|q⟩ Bad Qubits

beginner · Programming · Two Qubits & Tensor Products

Independent Gates on Each Qubit

A quantum register holds multiple qubits. When no gate couples them, each qubit evolves independently — you can think of the register as two separate one-qubit systems that happen to share the same wire.

Tensor products and independent evolution

A two-qubit state that factorises is written as a tensor product:

∣ψ0⟩⊗∣ψ1⟩.|\psi_0\rangle \otimes |\psi_1\rangle.

Applying a gate UU to qubit 0 and a gate VV to qubit 1 simultaneously means the combined operation is U⊗VU \otimes V:

(U⊗V)(∣ψ0⟩⊗∣ψ1⟩)=U∣ψ0⟩⊗V∣ψ1⟩.(U \otimes V)\big(|\psi_0\rangle \otimes |\psi_1\rangle\big) = U|\psi_0\rangle \otimes V|\psi_1\rangle.

The qubits do not need to communicate; each gate acts on its own qubit and the results are combined through the tensor product. This works only when the state is separable — not entangled.

A concrete example

Start from ∣00⟩|00\rangle (both qubits initialised to ∣0⟩|0\rangle). Apply HH to qubit 0 and XX to qubit 1:

H∣0⟩⊗X∣0⟩=∣0⟩+∣1⟩2⊗∣1⟩=∣01⟩+∣11⟩2.H|0\rangle \otimes X|0\rangle = \frac{|0\rangle + |1\rangle}{\sqrt{2}} \otimes |1\rangle = \frac{|01\rangle + |11\rangle}{\sqrt{2}}.

Here qubit 0 is the most significant bit, so ∣01⟩|01\rangle means qubit 0 = 0, qubit 1 = 1. Both basis strings have amplitude 12\tfrac{1}{\sqrt{2}}, and no entanglement has been created.

Try it

Build the circuit that transforms ∣00⟩|00\rangle into 12(∣01⟩+∣11⟩)\tfrac{1}{\sqrt{2}}(|01\rangle + |11\rangle) by applying HH to qubit 0 and XX to qubit 1.

Run your code to see the quantum state.

Check the State Vector tab: qubits 0 and 1 are shown separately, and the amplitudes should each read ≈0.707\approx 0.707.

Sign in on the full site to ask questions and join the discussion.