# Creating an entangled state in Hadamard basis (Qiskit)

I am familiar with building a quantum circuit of an entangled pair providing that they are in the computational basis:

|ψ⟩ = 1/√2 (|00⟩ + |11⟩)

This circuit works great.

I am trying to build the same circuit but on the Hadamard basis (+, -): |ψ⟩ = 1/√2 (|++⟩ + |--⟩)

I have tried this circuit but it didn't work. Instead of finding (00, 11), I am getting (00, 10).

Please let me know how to build such circuit. Can I choose in which basis the measurement should be done , like the results be (++ , --)?

Best,

The $$H\otimes H$$ should come after the X and CNOT

$$H_1|00\rangle=|+0\rangle$$ $$CNOT|+0\rangle=|00\rangle+|11\rangle$$ $$HH(|00\rangle+|11\rangle)=|++\rangle+|--\rangle$$

The equivalence of X base and Z base up to Hadamard, tells us that you can take a circuit that works well and known in Z basis, operate with it in the Z basis, and than just change the base

What you tryed to do, is transform into X basis, and than to try to act with a circuit that works in a known manner on the Z basis, but you acted with it in the wrong basis (X).

• Thank you, this is so helpful. Mar 2, 2022 at 13:34

To get the result in $$|+>$$ , $$|->$$ basis you have to perform the measurement in X basis because $$|+>$$ and $$|->$$ are the eigenvectos of PauliX gate. One way to do that is to apply Hadamard gate on all the qubits of the QuantumCircuit and then perform measurement.
So applying $$H \otimes H$$ on $$1/\sqrt(2)(|++>+|-->)$$ will produce $$1/\sqrt(2)(|00>+|11>)$$. Now if you perform measurement you will get $$|00>$$ and $$|11>$$ with equal probability. Considering the application of Hadamard gate within the measurement process you can now say $$|00>$$ and $$|11>$$ corresponds to the state $$|++>$$ and $$|-->$$ respectively.
Here is the qiskit implementation of what I just said And the resulting histogram looks like
For more elaborate discussion you may look here.

• Thank you, this is so helpful. Mar 2, 2022 at 13:34