Quantum Computing Asked on August 29, 2021
I don’t know how to prepare using Qiskit the following state in order to implement a Steane’s 7-qubit code circuit (I omit the normalization factor):
begin{align*} |0_Lrangle =&|0000000rangle+|1010101rangle+|0110011rangle+|1100110rangle+
+&|0001111rangle+|1011010rangle+|0111100rangle+|1101001rangle
end{align*}
Furthermore, I was wondering if it exists a general procedure in order to prepare an arbitrary multipartite state like $|0_Lrangle$.
Here is a circuit that can create the desired state (similar ideas were discussed in this answer), if all mentioned measurements yield $|0rangle$ state:
or in a more compact form (the circuits are constructed via quirk). The first three qubits are ancillary qubits and the rest are the qubits where $|0_Lrangle$ will be created if after the measurements all ancillary qubits are in the $|000rangle$ state, otherwise one should repeat the procedure until the desired measurement result will be archived.
Let's go step by step. The circuit has three parts and in each step, we assume that the measured state of the ancillary is $|0rangle$. The normalization factors are omitted.
$$|000rangle big( |0000000rangle + |1010101rangle big)$$
$$|000rangle big( |0000000rangle + |1010101rangle + |0110011rangle + |1100110ranglebig)$$
$$|000rangle |0_Lrangle = |000rangle big( |0000000rangle + |1010101rangle + |0110011rangle + |1100110rangle |0001111rangle + |1011010rangle +|0111100rangle + |1101001rangle big)$$
After disregarding the ancillary qubits that are in the $|000rangle$ state we will have the desired $|0_Lrangle$ state. The probability that each measurement outcome will be $|0rangle$ is $0.5$, thus the probability of creating the $|0_Lrangle$ state with this circuit is $0.125$. For Qiskit, one can implement the circuit mentioned above, then apply any algorithm or gate that is needed on the $|0_Lrangle$ state, and after the computation disregard all the results where ancillary qubits are not in the $|000rangle$ state.
Correct answer by Davit Khachatryan on August 29, 2021
Qubits are initialized at 0 so would you be wanting to flip certain qubits to 1?
I’m tempted to just apply x gates to obtain the necessary bits.
For example: |ψ⟩=...+|1010101⟩+...
from qiskit import QuantumCircuit qc = QuantumCircuit(7) qc.x([0, 2, 4, 6])
I hope I understood your question :)
Answered by splch on August 29, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP