1 Introduction

Quantum communication is the process of transferring quantum states from one place to another. It plays an important role in the field of quantum information processing [1]. Communication networks are the indispensable technology to transmit quantum information over long distances among the parties connected in a network. Although classical laws of physics are used for classical communication, it has been predicted that applying the principles of quantum physics and quantum information can enhance the efficiency of communication devices [2,3,4] significantly even if using the similar resources and network architecture [5, 6]. Quantum internet has been proposed by Kimble [7], which shows a significant improvement in the area of quantum communication from both the theoretical and experimental aspects. The most notable result has been observed in quantum cryptography [8, 9], which can be used for unconditional secure transmission of information. Quantum effects such as entanglement [10] and the probabilistic nature of measurement are the key mechanisms in achieving a secure quantum communication network.

Correct routing of signal from its source to the destination is necessary in a complex network architecture for both classical and quantum communications [11, 12]. Classical routers allow transmission of signal information, which is directed by control information in a classical network [13]. It is known from classical networks that the impossibility of perfect cloning prevents multi-directional broadcast in a quantum network. Hence, quantum routing needs more elaborate protocols as, in contrast to classical routing, any arbitrary quantum information cannot be perfectly cloned [14]. However, theoretically and experimentally approximate cloning has been studied extensively [15, 16], resulting in establishing and implementing optimal cloning protocols for a wide class of qubit distributions [17, 18].

Quantum network has a wide range of applications [19]. A router being the key element in a network uses a control bit to decide the path of transmission for the signal bit. In a quantum router, both the signal and control bits are represented as the quantum bits which is in general stored in a superposition state, and the control qubit has the potential to control the path of the signal qubit in a coherent superposition of multiple paths, which provides remarkable opportunity as compared to its classical counterpart [18, 20]. The quantum routing process enables to realize key applications such as quantum random access memory [21] and quantum machine learning [22, 23] that uses a large set of data.

A genuine quantum router satisfies the following six requirements [18, 24].

  1. (1)

    Both the control and signal information are stored in quantum bits.

  2. (2)

    The signal information remains unchanged under the routing process.

  3. (3)

    The router has to be able to route the signal in a coherent superposition of both the output modes.

  4. (4)

    The router has to work without any need for post-selection of signal qubits.

  5. (5)

    To optimize the resources of quantum network, only one control qubit is required to direct the signals.

  6. (6)

    To demonstrate the quantum nature of the quantum router, entanglement has to be generated between control and signal qubits.

Quantum network mainly uses single-photon pulses as they represent practical realization of flying qubits, which can be used for long-distance communication purposes. Several schemes for quantum router have been proposed; however, most of them do not satisfy all of the above six criteria. In some of the experiments, control bit only takes classical states [25, 26], hence resulting in a semi-quantum router. Many of the experiments deal with light-matter interaction [27,28,29], which is challenging for experimental realization. Chang et al. [30] have come up with the idea of entanglement-based quantum router, which does not satisfy the condition (2), as, in this case, the control information is quantum; however, the signal information collapses after the routing process. Lemr et al. have proposed methods for realizing quantum router without fulfilling conditions (5) [31] and (6) [18]. For the first time, a scheme of a genuine quantum router has been proposed by Yuan et al. [24], which satisfies all of the above conditions. Recently, researchers have shown various routing processes using different architectures [32,33,34,35,36,37,38,39]. IBM quantum experience now plays a significant role in quantum computing community for giving access to two five-qubit and one sixteen-qubit quantum processors named as ibmqx2, ibmqx4 and ibmqx5, respectively. A number of quantum tasks such as quantum algorithms [40,41,42,43,44], quantum error correction code [45,46,47], quantum state and gate teleportation [48, 49], quantum information theory [50,51,52,53,54,55,56], quantum simulation [57, 58], quantum machine learning [59], quantum artificial intelligence [60], quantum communication devices [61,62,63], have been realized using both five-qubit and sixteen-qubit quantum processors. Here, we consider three qubits, among which one is control and the other two act as the signal qubits. Control qubit stores the control information while controlling the routing of signal information stored in the signal qubits. After the routing process, the entanglement is generated between the control qubit and the other signal qubits, and the signal information is found to be well preserved. The routing process satisfies all the necessary conditions to be called as quantum routing, and the quantum circuit represents as a quantum router for the superconducting qubits.

2 The scheme of quantum routing

A schematic diagram for quantum router is depicted in Fig. 1. The control qubit encodes the quantum information, \(|\Psi _{c}\rangle =a|0\rangle +b|1\rangle \), with arbitrary coefficients a and b, where \(|a|^2+|b|^2=1\). Two signal qubits are taken to store signal information, whereas control qubit stores control information that will direct the path of the signal. The two signal qubits represent two possible paths for sending or storing signal information. Initially, signal qubit-1 stores quantum data encoded as, \(|\Psi _{s}\rangle _{1}=c|0\rangle +d|1\rangle \), with arbitrary coefficients c and d such that \(|c|^2+|d|^2=1\). Here, the path-1 stores the signal information, and we encode \(|+\rangle \) state in the signal qubit-2 to define ‘Null’ state, that means there is no information on the signal qubit-2. We are considering the case where signal information is stored in the path-1 and path-2 not containing any information about the signal. For a classical router, the control qubit is either in state \(|0\rangle \) or in state \(|1\rangle \); hence, the signal information is found either in signal qubit-1 (path-1) or in signal qubit-2 (path-2) according to the state of control. However, in quantum router, as the control qubit is in superposition of both \(|0\rangle \) and \(|1\rangle \), it is natural to find the signal information in a coherent superposition of both the paths after the routing process.

Fig. 1
figure 1

A schematic diagram illustrating the principle of a quantum router. The first qubit represents the control qubit which stores the control information (\(|\Psi ^{c}\rangle \)), that directs the path of the signal information (\(|\Psi ^{s}\rangle \)) initially stored in the second qubit. Here, path-2 contains no information, called as ‘Null’ state. After the routing process, the information is found in a coherent superposition of two paths (the two signal qubits), i.e., path-1 and path-2. The final state, \(|\Psi ^{f}\rangle \), shows the generation of entanglement between the control qubit and the two paths

Fig. 2
figure 2

The first qubit represents the control qubit which is in a superposition state, \(\frac{|0\rangle -e^{i\pi /4}|1\rangle }{\sqrt{2}}\). The signal information, \(|\Psi _{s}\rangle =\cos (\pi /8)|0\rangle +sin(\pi /8)|1\rangle \), is stored in the second qubit. The third qubit is in \(|+\rangle \) state, which is conventionally taken to be a ‘Null’ state. After the controlled-swap operation, the final state, \(|\Psi _\mathrm{f}\rangle =\frac{1}{\sqrt{2}}(|0\rangle |\Psi _\mathrm{s}\rangle |+\rangle -e^{i\pi /4}|1\rangle |+\rangle |\Psi _\mathrm{s}\rangle )\), is found in a three-qubit entangled state generating entanglement between the control and the two signal paths. It can be easily seen that the signal information, \(\Psi _\mathrm{s}\), is preserved after the routing process

2.1 Derivation of quantum routing process

In Fig. 2, we depict the process of quantum routing. After applying Hadamard (H) and phase gates (S & T) on the state \(|0\rangle \), the control information becomes \(|\Psi _\mathrm{c}\rangle =\frac{|0\rangle -e^{i\pi /4}|1\rangle }{\sqrt{2}}\). Similarly, the signal information can be calculated as, \(|\Psi _\mathrm{s}\rangle =\cos (\pi /8)|0\rangle +\sin (\pi /8)|1\rangle \). The initial state of the whole system can be written as, \(|\Psi \rangle =|\Psi _\mathrm{c}\rangle |\Psi _\mathrm{s}\rangle |+\rangle \). After applying controlled-swap operation, the final state becomes \(|\Psi _\mathrm{f}\rangle =\frac{1}{\sqrt{2}}(|0\rangle |\Psi _\mathrm{s}\rangle |+\rangle -e^{i\pi /4}|1\rangle |+\rangle |\Psi _\mathrm{s}\rangle )\). It is clearly seen that the signal information is in path-1 when the control information is in state \(|0\rangle \), and the signal information is in path-2, when the control information is in the state \(|1\rangle \). It is also observed that the control qubit is entangled with the signal paths, i.e., it controls the path of the signal information. Such entanglement between control information and signal paths is the key mechanism to realize quantum transistor and quantum random access memory [21]. As in a classical router, the carried signal information remains preserved; hence, a quantum router should follow this process, i.e., after the routing process, the signal information should be preserved. The preservation of the signal information has been shown by considering the following two cases (see Figs. 3, 4), where the initial control information has been taken separately as both in \(|0\rangle \) and \(|1\rangle \) states. It is observed that, for case-1, i.e., the control information is in \(|0\rangle \) state, the signal information is routed through the path-2, and in the case-2, i.e., the control information is in \(|1\rangle \) state, the signal information is found in the path-2. It can be concluded from the above observation that the control information decides the route of the signal information. Hence, the whole scheme describes the working of a quantum router.

Fig. 3
figure 3

The first qubit, i.e., the control qubit is initially stored in \(|0\rangle \) state. The signal information, \(|\Psi _\mathrm{s}\rangle =cos(\pi /8)|0\rangle +sin(\pi /8)|1\rangle \), is stored in the second qubit, called signal path-1 qubit. The third qubit is in \(|+\rangle \) state (called signal’s path-2 qubit), which is conventionally taken to be a Null state. After the controlled-swap operation, the final state becomes \(|\Psi _\mathrm{f}\rangle =|0\rangle |\Psi _\mathrm{s}\rangle |+\rangle \), which implies the signal information is stored in the second qubit, preserving the signal information

Fig. 4
figure 4

The first qubit, i.e., the control qubit is initially stored in \(|1\rangle \) state. The signal information, \(|\Psi _\mathrm{s}\rangle =cos(\pi /8)|0\rangle +sin(\pi /8)|1\rangle \), is stored in the second qubit, called signal path-1 qubit. The third qubit is in \(|+\rangle \) state (called signal path-2 qubit), which is conventionally taken to be a Null state. After the controlled-swap operation, the final state becomes \(|\Psi _\mathrm{f}\rangle =|1\rangle |+\rangle \Psi _\mathrm{s}\rangle \), which implies the signal information is stored in the third qubit, preserving the signal information after being controlled by the control qubit

3 Results

All the above quantum circuits are designed in IBM Quantum Experience interface using single-qubit gates (Hadamard gate (H), phase gates (S, T and \(T^{\dagger }\)), NOT gate (X)) and two-qubit quantum gate (CNOT gate). It can be mentioned that CNOT gate acts on two qubits, where one qubit is the control qubit and the other one is the target qubit. Control qubit controls the target qubit whether NOT gate will be applied on the target qubit or not. When the control qubit is in \(|1\rangle \) state, NOT operation is applied on the target qubit otherwise not. To verify the quantum nature of the quantum router, we confirm the coherence between the two signal paths and the generation of entanglement between the control qubit and signal paths, provided they were initially in product states. We prepare the control qubit in \(|\Psi _\mathrm{c}\rangle \) state in a superposition state, by sequentially operating H, S, T and S gates on \(|0\rangle \) state. Similarly, the signal information \(|\Psi _\mathrm{s}\rangle \) is prepared by sequentially operating H, T, H and S gates on \(|0\rangle \) state. Then, it is stored in the signal path-1 qubit. A Hadamard gate is applied on the signal path-2 qubit showing the ‘Null’ state, i.e., having no information about the signal. The output for the control qubit should be in an entangled state with the signal path for the ideal case. We verify the entanglement by performing measurement-based three-qubit state tomography process. We measure the state with 63 different measurement bases by taking 8192 number of shots. The theoretical density matrix for the quantum state, \(|\Psi \rangle \), can be written as, \(\rho =|\Psi \rangle \langle \Psi |\). Here, \(|\Psi \rangle \) is obtained after the controlled-swap operation in Fig. 2. For implementation of the controlled swap, it is decomposed into many single-qubit and two-qubit quantum gates. The decomposition can be found in Ref. [63], where Protocol-I and Protocol-II are applied to design the quantum circuits on the ‘ibmqx4’ quantum chip. The experimental density matrix for a three-qubit system can be given as,

$$\begin{aligned} \rho ^{E}=\frac{1}{8}\sum _{i_{1},i_{2},i_{3}=0}^{3}T_{i_{1}i_{2}i_{3}}(\sigma _{i_{1}} \otimes \sigma _{i_{2}}\otimes \sigma _{i_{3}}) \end{aligned}$$
(1)

where \(T_{i_{1}i_{2}i_{3}}\) is expressed as \(T_{i_{1}i_{2}i_{3}}\)=\((P_{|0i_{1}\rangle }-P_{|1i_{1}\rangle })(P_{|0i_{2}\rangle }-P_{|1i_{2}\rangle })(P_{|0i_{3}\rangle }-P_{|1i_{3}\rangle })\)=\(P_{|0i_{1}0i_{2}0i_{3}\rangle }-P_{|0i_{1}0i_{2}1i_{3}\rangle }- \cdots +P_{|1i_{1}1i_{2}1i_{3}\rangle }\), where \(P_{|0_{j}\rangle }\) and \(P_{|1_{j}\rangle }\) are the probabilities of getting 0 and 1, respectively, when the qubit is measured in jth basis. Here \(i_{1}\), \(i_2\), \(i_3\) can take the values 1, 2 and 3 corresponding to X, Y and Z basis measurements, respectively. It is to be noted that \(\sigma _{0}\), \(\sigma _{1}\), \(\sigma _{2}\) and \(\sigma _{3}\) are I, X, Y and Z operations, respectively. The density matrices for both the theoretical and run results are plotted for comparison. Both the real and imaginary parts of reconstructed density matrices are shown in Fig. 5. In Fig. 5, (a) and (b) represent the real and imaginary parts of the theoretical density matrices, whereas (c) and (d) represent the real and imaginary parts of the experimental density matrices, respectively. It is observed that the fidelity for the experimental density matrices is calculated to be 0.9799.

Another important quantum nature of quantum router is that it should preserve the signal information carried by the signal qubit path-1. For verifying the preservation of quantum data or signal information, we have performed single-qubit quantum state tomography for both the cases when the control qubit does not carry any superposition state; it carries only \(|0\rangle \) or \(|1\rangle \) state, the case of a classical router. Hence, the measurement is taken on the second and third qubits according to the state of the control qubit. The experimental density matrix for the single-qubit state is given as follows,

$$\begin{aligned} \rho ^\mathrm{E}= \frac{1}{2} (I + \langle X\rangle X + \langle Y \rangle Y + \langle Z \rangle Z) \end{aligned}$$
(2)

here \(\langle A \rangle = tr(|\Psi \rangle \langle \Psi |A)\), where A = X, Y and Z operations, respectively. \(\langle A \rangle \) can be calculated as, \(\langle A \rangle \)=\(P_{|0A\rangle }-P_{|1A\rangle }\), where \(P_{|0A\rangle }\) and \(P_{|1A\rangle }\) are the probabilities of outcome 0 and 1, respectively, in \(A^{th}\) basis. Here, \(|\Psi \rangle \) is the quantum state obtained on the second and third qubits in Figs. 3 and 4. The comparison of density matrices for the theoretical and run results is shown in Fig. 6. In Fig. 6, a–f represent real and imaginary parts of the theoretical and experimental (2nd qubit in Fig. 3 and 3rd qubit in Fig. 4) density matrices, respectively. The fidelities for the above cases are found to be 0.9840 and 0.9777, respectively. Both the above experiments are repeated for different superposition states of control qubit and for storing arbitrary information in the signal paths. In all the cases, we confirm the generation of entanglement between the control qubit and the signal paths, and the preservation of signal information, which are the two main operations of a quantum router to illustrate the quantum nature of it.

Fig. 5
figure 5

The density matrices representing entanglement generation between the control qubit and the two signal paths. a, b represent the real and imaginary parts of the theoretical density matrices, while c, d represent the real and imaginary parts of reconstructed density matrices obtained from run results. The fidelity of the experimental results is found to be 0.9799

Fig. 6
figure 6

The density matrices represent the signal information. The theoretical and experimental results are compared. a, b, respectively, represent the real and imaginary parts of the theoretical density matrices, while c, d represent the real and imaginary parts of reconstructed density matrices obtained from run results, for the case when the control information is in \(|0\rangle \) state. e, f represent the real and imaginary parts of the reconstructed density matrices for the case when the control qubit is in state \(|1\rangle \)

4 Discussion

In the above scheme, it is observed that how with a simple quantum circuit, having single-qubit and two-qubit gates, a quantum router is designed. It is notable that for the case of having two paths, a controlled-swap operation can be used to act as a quantum router. Similarly, for more number of paths, a quantum router can be designed with a series of multi-controlled-swap operations. For example, suppose we have four paths where signal information can be transmitted, then we can use in total six number of qubits to design a 6-qubit quantum router. Here, the first two qubits contain the control information, and the third qubit contains the signal information initially. The paths 1 to 4 are represented by the qubits number 3 to 6, respectively. The initial quantum state of the system can be written as, \(|\Psi _\mathrm{in}\rangle = |\Psi _\mathrm{c}\rangle |\Psi _\mathrm{s}\rangle |+\rangle |+\rangle |+\rangle \), where \(|\Psi _\mathrm{c}\rangle =\alpha _1|00\rangle +\alpha _2|01\rangle +\alpha _3|10\rangle +\alpha _4|11\rangle \) and \(\sum _{i=1}^{4}|\alpha _i|^2=1\). Then, we can apply three two-controlled-swap operations such as anti-controlled-controlled-swap\(_{1234}\), controlled-anti-controlled-swap\(_{1235}\) and anti-controlled-anti-controlled-swap\(_{1236}\) operations to direct the signal information in any one of the paths. The final state after the routing process can be written as, \(|\Psi _\mathrm{final}\rangle = \alpha _1|00\rangle |\Psi _\mathrm{s}\rangle |+\rangle |+\rangle |+\rangle +\alpha _2|01\rangle |+\rangle |\Psi _\mathrm{s}\rangle |+\rangle |+\rangle +\alpha _3|10\rangle |+\rangle |+\rangle |\Psi _\mathrm{s}\rangle |+\rangle +\alpha _4|11\rangle |+\rangle |+\rangle |+\rangle |\Psi _\mathrm{s}\rangle \). Here, the generation of entanglement between the control information and signal paths along with the preservation of signal information in one of the paths is easily observed to demonstrate the quantum nature of a six-qubit quantum router. Similarly for N number of paths, n number of qubits can be taken for representing control information and N number qubits will be taken for representing the paths, where \(N\le 2^{n}\). Hence, in total \(N+n\) number of qubits are required to design a (\(N+n\))-qubit quantum router.

5 Conclusion

To conclude, we have demonstrated here the quantum nature of a quantum router by using a five-qubit quantum processor, ‘ibmqx4.’ We have shown the working of quantum router by designing quantum circuit consisting of single-qubit and multi-qubit gates. We have clearly shown that the control information directs the signal information either to one path or superposition of several paths. We show the two main operations of a quantum router, i.e., entanglement generation between the control qubit and the signal paths, and preservation of signal information after the routing process. We have verified our experimental results by performing three-qubit and single-qubit quantum state tomography. With fidelity 0.9799, the generation of entanglement between the control information and the signal paths, and with fidelities 0.9840 and 0.9777 the preservation of signal information are achieved. We hope quantum router will find its significant application in areas like quantum network and quantum data processing.

6 Methods

Experimental setup Some important experimental parameters of ibmqx4 chip are given in Table 1, where the readout resonator’s resonance frequency, qubit frequency, anharmonicity, qubit–cavity coupling strength, relaxation time and coherence time are, respectively, denoted by \(\omega ^{R}_{i}\), \(\omega _{i}\), \(\delta _{i}\), \(\chi \), \(T_1\) and \(T_2\). Figure 7b shows the connection and control of five superconducting qubits (q[0], q[1], q[2], q[3] and q[4]). The black and white lines represent the controls of the single-qubit and two-qubit controls provided by the coplanar waveguide (CPW) resonators. The qubits q[2], q[3], q[4] and q[0], q[1], q[2] are coupled via two superconducting CPWs, with 6.6 Hz and 7.0 Hz resonator frequencies, respectively. Each qubit is controlled and read out by individual CPWs. The chip, ‘ibmqx4,’ is stored in a dilution refrigerator at temperature around 0.021 K. The single-qubit gate error is of the order \(10^{-3}\), and the multi-qubit and readout error are of the order \(10^{-2}\). The gate errors are measured by using the process of randomized benchmarking. The experimental construction of CNOT gate is illustrated in Fig. 8.

Fig. 7
figure 7

a A schematic diagram of the chip layout of 5-qubit quantum processor ‘ibmqx4.’ The chip is generally cooled in a dilution refrigerator at temperature 0.021 K. The connection of all five transmon qubits with the two coplanar waveguide (CPW) resonators is shown. With the resonance frequencies 6.6 GHz and 7.0 GHz, q[2], q[3], q[4] and q[0], q[1], q[2] are coupled with the two CPWs, respectively. Individual qubits in the chip are controlled and read out by particular CPWs. b The CNOTs coupling map in the chip follows as, \(\{q1 \rightarrow (q[0]), q2 \rightarrow (q[0], q[1], q[4]), q[3] \rightarrow (q[2], q[4])\}\), where \(i \rightarrow (j)\) means i and j denote the control and the target qubit, respectively, for implementing CNOT gate. The errors in gates and readout are of the order \(10^{-2}\) to \(10^{-3}\)

Table 1 Parameters of the device ibmqx4 are presented
Fig. 8
figure 8

Experimental construction of CNOT gate. Different frame change (FC), Gaussian derivative (GD) and Gaussian flattop (GF) pulses are applied with proper amplitude and angle parameters for implementation of CNOT gate