The Bloch Spheres of the State | +->
Learn about the Bloch spheres of the state | +->.
Press + to interact
# Create a quantum circuit with one qubitqc = 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 |+‐>
Press + to interact
# Create a quantum circuit with one qubitqc = 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 qubitqc.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 -gate. Similar to the -gate that rotates the qubit state vector around the Y-axis, ...