Search⌘ K

The Bloch Spheres of the State | +->

Explore the behavior of qubits on Bloch spheres by examining the effects of CNOT, Hadamard, and RZ gates on two-qubit states. Understand phase shifts and quantum gate interactions, building intuition for quantum state manipulation essential for quantum machine learning.

Javascript (babel-node)
# Create a quantum circuit with one qubit
qc = QuantumCircuit(2)
# put qubit 0 into |+>
qc.h(0)
# put qubit 1 into |->
qc.x(1)
qc.h(1)
out = execute(qc,Aer.get_backend('statevector_simulator')).result().get_statevector()
plot_bloch_multivector(out)

Next, we apply the CNOT-gate on this state with the qubit at position 0 is the control qubit, and the qubit at position 1 is the target.

Showing the effect of the CNOT‐gate on state |+‐>

Javascript (babel-node)
# Create a quantum circuit with one qubit
qc = QuantumCircuit(2)
# put qubit 0 into |+>
qc.h(0)
# put qubit 1 into |->
qc.x(1)
qc.h(1)
# apply CNOT gate with qubit 0 as control qubit
qc.cx(0,1)
out = execute(qc,Aer.get_backend('statevector_simulator')).result().get_statevector()
plot_bloch_multivector(out)

The math is not the target qubit but the control qubit at position 0 that switches its phase. Let’s look at another situation.

The following circuit applies the Hadamard gate on both qubits and a phase shift on qubit 1 using the RZR_Z-gate. Similar to the RYR_Y-gate that rotates the qubit state vector around the Y-axis, the RZ ...