# How can I construct a 2-qubit state using single qubit gates and CNOT gate?

How can I construct the below 2-qubit state using suitable single qubit gates (maximum 3) and one CNOT gate starting with state $$|00\rangle$$?

$$|\omega\rangle=\frac{1}{3}(2|00\rangle+|01\rangle+2|11\rangle)$$

• Would 2 CNOTs do? Nov 7, 2020 at 17:03

Using only one CNOT gate and 3 single qubit gates:

Where: $$\mathrm{U3}(\theta,\phi,\lambda)= \begin{pmatrix} \cos(\theta/2) & -\mathrm{e}^{i\lambda}\sin(\theta/2) \\ \mathrm{e}^{i\phi}\sin(\theta/2) & \mathrm{e}^{i(\phi+\lambda)}\cos(\theta/2) \end{pmatrix}$$

To prepare a state, you can use Qiskit's QuantumCircuit.initialize. But when I used this method, the constructed circuit contains 2 CNOTs even with maximum optimization_level. Qiskit provides another method, QuantumCircuit.iso, which yields the circuit shown above.

Code:

# Using QuantumCircuit.initialize
qc = QuantumCircuit(2)
qc.initialize([2/3, 1/3, 0, 2/3], [0, 1])

qc_by_initialize = transpile(qc, basis_gates=['u3','cx'], optimization_level = 3)
qc_by_initialize.draw('mpl')

# Using QuantumCircuit.iso
qc = QuantumCircuit(2)
qc.iso([2/3, 1/3, 0, 2/3], [0, 1], [])

qc_by_isometry = transpile(qc, basis_gates=['u3','cx'], optimization_level = 3)
qc_by_isometry.draw('mpl')


Below is a circuit that can generate the state $$|w\rangle$$ that you wanted. However, It is NOT what you are looking for as it is using 2 CNOTs gate.

and if you look at the state vector output, you can see that it is indeed the correct state:

Hopefully someone will be able give you an answer that you are looking for :)

• would you also please explain how did you come up with this circuit/ gate combination? Nov 7, 2020 at 18:24
• I used Qiskit state preparation called Custom... qiskit.org/documentation/stubs/… ... But it seems like another person from the other answer found a better method. Nov 7, 2020 at 23:53
• I see! Thanks for the link. Nov 8, 2020 at 12:21

If you want to understand how to do this, think of the Schmidt decomposition. This shows you that, up to unitaries on the two qubits, the state can be written in the form $$\alpha|00\rangle+\beta|11\rangle$$. Now, can you answer your own question for this state?

• Nice hint! This method will give this circuit Nov 8, 2020 at 19:24