September 8, 2024
Search
Search
Close this search box.

Quantum – Circuits – Part 2 – Bellagio Mirror

The Bellagio Mirror follows part 1 of the quantum circuit. It has already tagged the solution by changing the phase of q6 in parts  3, 4, 8, 9, 12-16 of the mega qubit. In order to be able to measure the qubits, it is necessary to reverse the quantum circuits. Do this by running the gates of part 1 in reverse. This part 2 of the circuit is the quantum mirror. It includes a cancelling circuit at the end.

Changes to Mega Qubit from Bellagio Circuit Mirror

C/F|^v^vv^^>+|^v^^v^^>+|^vv^vv-v>+|^vvvvv-v>+|^^^vv^^>+|^^^^^^^>+ |^^v^^v^>+|^^vvvv-v> +
|v^^vvv-v>+|v^^^^v^>+|v^v^^v^>+|v^vvvv-v>+ |vv^vvv-v>+ |vv^^vv-v>+|vvv^vv-v>+|vvvvvv-v>
ccnot 4,5,6|^v^vv^^>+|^v^^v^^>+|^vv^vv-^>+|^vvvvv-^>+|^^^vv^^>+ |^^^^^^^>+ |^^v^^v^>+ |^^vvvv-^>+
|v^^vvv-^>+|v^^^^v^>+|v^v^^v^>+|v^vvvv-^>+ |vv^vvv-^>+|vv^^vv-^> +|vvv^vv-^>+|vvvvvv-^>
Firstly, taking the output from the part 1 of the circuit, undo the ccnot. Note that this
was the last gate used to find the solution.
X 0,2|vvvvv^^>+|vvv^v^^>+|vv^^vv-^>+|vv^vvv-^>+|v^vvv^^>+ |v^v^^^^>+ |v^^^^v^>+ |v^^vvv-^>+
|^^vvvv-^>+|^^v^^v^>+|^^^^^v^>+|^^^vvv-^>+ |^vvvvv-^>+|^vv^vv-^> +|^v^^vv-^>+|^v^vvv-^>
ccnot 0,2,5|vvvvvv^>+|vvv^vv^>+|vv^^vv-^>+|vv^vvv-^>+|v^vvvv^>+ |v^v^^v^>+ |v^^^^v^>+ |v^^vvv-^>+
|^^vvvv-^>+|^^v^^v^>+|^^^^^v^>+|^^^vvv-^>+ |^vvvvv-^>+ |^vv^vv-^> +|^v^^vv-^>+|^v^vvv-^>
X 0,2,5|^v^vv^^>+|^v^^v^^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vv^v^^^>+|vvv^^^^>+|vvvv^^^>
X 1|^^^^^^^>+|^^^v^^^>+|^^v^^^^>+|^^vv^^^>+|^v^^^^^>+ |^v^v^^^>+ |^vv^^^^>+|^vvv^^^>+
|vv^^^^^>+|vv^v^^^>+|vvv^^^^>+|vvvv^^^>+ |v^^^^^^> |v^^v^^^>+|v^v^^^^>+|v^vv^^^>
cnot 0,1|^^^^^^^>+|^^^v^^^>+|^^v^^^^>+|^^vv^^^>+|^v^^^^^>+ |^v^v^^^>+ |^vv^^^^>+|^vvv^^^>
|v^^^^^^>+|v^^v^^^>+|v^v^^^^>+|v^vv^^^>+ |vv^^^^^>+ |vv^v^^^>+|vvv^^^^>+|vvvv^^^>
Finally, undo the entanglement gates. The qubits q0 to q6 are now back to the state they were in after the Haadmard circuits in part 1. However, the solutions are now flagged by the phase setting of Q6.

Cancelling Circuit

After tagging the solutions and running the quantum mirror, it is necessary to run a cancelling circuit. Due to the analogue nature of quantum computers, errors do occur. The cancelling quantum circuit reverses these errors. Firstly, it starts by putting q0 to q3 through Haadamard followed by X gates. Then, it runs part 1 and 2 of the Bellagio circuit without the initial Haadamard gates. Finally it puts q0 to q3 through an X gate followed by Haadamard gates.

Grover’s algorithm indicates the need to run the Bellagio and cancelling circuits twice before measuring the qubits. This is √4 times, the square root of the number of primary qubits.

Next: Running the Bellagio Circuit

Previous: Bellagio Circuit Part 1

Share to:

Leave a Reply

Your email address will not be published. Required fields are marked *