For the purposes of this demonstration, the qubits will be measured and the results assembled to form a message. Bob decodes his using the Shor decoding circuit. The channel may apply an arbitrary unitary operation to a single physical qubit in each group of 9. Alice and DumbAlice send their qubits through the quantum channel to Bob and DumbBob, respectively.DumbAlice wants to do the same, but doesn’t encode her state.She encodes her state as \(|\psi \rangle \rightarrow \alpha_0 \frac(|000\rangle - |111\rangle) \otimes (|000\rangle - |111\rangle) \otimes (|000\rangle - |111\rangle)\) using the circuit diagram above. Alice has some state \(|\psi\rangle=\alpha_0|0\rangle+\alpha_1|1\rangle\), which she wants to send to Bob through a noisy quantum channel.draw(output = 'mpl' ,filename = 'shorcode.png' ) #Draws an image of the circuit job = execute(circuit, backend, shots = 1000 ) job_monitor(job) counts = job. get_counts() print ( " \n Uncorrected bit flip and phase error" ) print ( "-" ) print (counts) #Shor code starts here # q = QuantumRegister( 9, 'q' ) c = ClassicalRegister( 1, 'c' ) circuit = QuantumCircuit(q,c) circuit. measure(q,c) job = execute(circuit, backend, shots = 1000 ) job_monitor(job) counts = job. get_backend( 'ibmq_qasm_simulator' ) q = QuantumRegister( 1, 'q' ) c = ClassicalRegister( 1, 'c' ) circuit = QuantumCircuit(q,c) circuit. get_provider(hub = 'ibm-q' ) backend = provider. enable_account( ‘ ENTER API KEY HERE ') provider = IBMQ. Print ( ' \n Shor Code' ) print ( '-' ) from qiskit import QuantumRegister from qiskit import ClassicalRegister from qiskit import QuantumCircuit, execute,IBMQ from import job_monitor IBMQ. Finally a toffoli gate is applied to the main qubit which is controlled by the 3rd and 6th qubit. Then CNOT gates are applied to the 3rd and 6th qubit where the control qubit is the main qubit. Toffoli gates are then applied to the main qubit as well as the 3rd and 6th qubit where the control qubits are the auxiliary qubits responsible for phase correction.Īfter this Hadamard gates are applied to the main qubit as well as the 3rd and 6th qubit to bring them out of superposition. in the diagram above this is denoted as E. The 6th transfer its state to the 7th and 8th qubit.Īfter this a bit flip or phase flip may occur on the main qubit. The 3rd transfers it state to the 4th and 5th. More specifically the main qubit transfers its state to the 1st and 2nd ancillary qubit. Next the states of the main qubit as well as the 3rd, and 6th qubits use CNOT gates to transfer their states to ancillary qubits responsible for correcting bit flips. After this these qubits are put in to superposition using a Hadamard gate. These qubits are used for correcting phase errors. The Shor code works by first taking the computational state of the main qubit and transferring it to the 3rd and 6th qubit. If you have seen our tutorials on the bit flip and phase flip circuit then the Shor code will look very familiar as it uses the same gates and ordering. For simplification we will call the 1st qubit that we want to correct the main qubit and the ancillary qubits 1 to 8. The Shor code is a 9 qubit circuit that requires 8 ancillary qubits to correct 1 qubit. In this tutorial we will explore what the Shor code is and how to implement it in Qiskit. However there is a specific error correction circuit known as the Shor code which can correct both phase flips as well as bit flip errors. Quantum Error Correction: Phase Flip Code in Qiskit: Quantum Error Correction: Bit Flip Code in Qiskit: For example the bit flip code cannot correct phase errors and phase flip code cannot correct bit flip errors.įor more information on these error correction circuits take a look at our tutorials on them below: Each of these errors has a circuit that can be used to correct that particular error but not the other type. In our last quantum error correction tutorials we looked at how to correct phase errors and bit flip errors. Interested in learning how to program quantum computers? Then check out our Qiskit textbook Introduction to Quantum Computing with Qiskit.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |