Читать книгу Quantum Computing - Hafiz Md. Hasan Babu - Страница 25
3.3.1 Example
ОглавлениеTo construct a two-qubit quantum comparator circuit, one MQC circuit and one RQC circuit are needed to perform the greater than, less than, and equality operations. In figure 3.6, the detailed quantum circuit for a two-qubit comparator has been shown. The midpoint is the qubits in position 1. At first, the midpoint qubits ∣A1〉 and ∣B1〉 are applied in the MQC circuit to generate the following outputs as
∣E1〉=∣A1〉⊙∣B1〉∣G1〉=∣A1B1¯〉3∣L1=∣A1¯B1〉.(3.3)
Then the outputs of the MQC circuit (∣E1〉, ∣G1〉, ∣L1〉) and the rest of the qubits (∣A0〉, ∣B0〉) are used as inputs to the next circuit which is the RQC circuit. This circuit produces the final outputs
∣AGB0〉=∣G1〉+∣E1〉.∣A0(B0)〉∣ALB0〉=∣L1〉+∣E1〉.∣(A0)B0〉∣AEB0〉=∣AGB0〉⊙∣ALB0〉.(3.4)
Figure 3.6. The two-qubit quantum comparator circuit. Reproduced with permission from [2]. Copyright 2017 IEEE.
Similarly, an n-qubit quantum comparator circuit can be constructed using one MQC circuit and maximum (n − 1) RQC circuits or minimum ((n/2) − 1) RQC to perform the greater than, less than, and equality operations. In figure 3.7, the detailed quantum circuit for an n-qubit quantum comparator is shown.
Figure 3.7. The n-qubit quantum comparator circuit. Reproduced with permission from [2]. Copyright 2017 IEEE.