I need to build a Quantum circuit in Qiskit as shown below. Does anyone know the formal steps to approach the design?
1 Answer
You can make use of the Schmidt-decomposition-based method discussed generally in Section VII of this paper. For the particular case of the preparation of a three-qubit state, such as the one considered in this question, you may refer to Appendix F of the same paper, which is what I shall follow below.
First, we cast the $8$-dimensional vector corresponding to the three-qubit state,
$|\psi \rangle = (0, 0, \frac{1}{2}, 0, 0, \frac{\sqrt{3}}{2}, 0, 0)^{T}$,
into a $4 \times 2$ matrix
$M' = \begin{pmatrix} 0 & 0 \\ \frac{1}{2} & 0 \\ 0 & \frac{\sqrt{3}}{2} \\ 0 & 0 \end{pmatrix}$,
which effectively defines an asymmetric bipartition with two qubits on one side and one qubit on the other. Now we can perform the singular value decomposition of matrix $M' = U' S' V'^{\dagger}$, with
$U' = \begin{pmatrix} 0 & 0 & -1 & 0 \\ 0 & 1 & 0 & 0 \\ 1 & 0 & 0 & 0 \\ 0 & 0 & 0 & -1 \end{pmatrix}, \quad S' = \begin{pmatrix} \frac{\sqrt{3}}{2} & 0 \\ 0 & \frac{1}{2} \\ 0 & 0 \\ 0 & 0 \end{pmatrix} \equiv \begin{pmatrix} s'_0 & 0 \\ 0 & s'_1 \\ 0 & 0 \\ 0 & 0 \end{pmatrix}, \quad V'^{\dagger} = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}.$
Finally, we just have to implement the quantum circuit shown in Fig. 10 of Appendix F of the reference paper, which requires expressing $U'$ and $V'$ as two-qubit and single-qubit subcircuits, as well as finding a single-qubit subcircuit $B'$ that prepares the state $s_0 |0\rangle + s_1 |1\rangle \equiv \frac{\sqrt{3}}{2} |0\rangle + \frac{1}{2} |1\rangle$ starting from the fiducial state $|0\rangle$.
- $B' = R_y(\frac{\pi}{3})$.
- $V' = X$.
- $U' = C_{0}NOT_{\textrm{least}, \textrm{most}} (Z \otimes \mathbf{1})$.
The notation $C_{0}NOT_{\textrm{least}, \textrm{most}}$ should be clarified: It is a CNOT gate with the least significant qubit as the control-qubit, the most significant qubit as the target-qubit, and the NOT gate only being applied to the target-qubit when the control-qubit is in state $|0 \rangle$. The $Z$ gate prior to this CNOT is applied to the most significant qubit of the pair.
Putting all the pieces together, the quantum circuit that prepares state $|\psi \rangle$ is shown below. The qubits are ordered from least to most significant from top to bottom.
More generally, this method allows to prepare any three-qubit state with at most $4$ CNOTs, since any two-qubit operation $U'$ can be implemented by a quantum circuit with at most $3$ CNOTs.
-
$\begingroup$ You are just awesome. Thank you! $\endgroup$ Commented Sep 16, 2022 at 23:21
-
$\begingroup$ Why do we need a Z gate to the third Qubit? Without it, i get the same output. The Z rotation doesn't do anything because the Qubits are in the north pole. $\endgroup$ Commented Sep 17, 2022 at 0:06
-
$\begingroup$ Yes, well spotted, @JoydeepBhattacharjee. The Z gate is completely redundant. It would be necessary for the correct basis gate decomposition of U' (i.e., to account for the minus signs in the third and fourth columns), but for the preparation of this three-qubit state only the first two columns of U' act nontrivially, so the Z gate can be removed. $\endgroup$– bm442Commented Sep 17, 2022 at 15:23