Lesson 9 of 15

Bell States

Quantum Entanglement

The Bell states are the simplest examples of quantum entanglement — two qubits whose fates are linked no matter how far apart they are.

The most famous Bell state is Phi+angle|Phi^+ angle (phi-plus):

angle = rac{|00 angle + |11 angle}{sqrt{2}}$$ To create it: 1. Start with $|00 angle$ 2. Apply H to the first qubit: $ rac{|0 angle + |1 angle}{sqrt{2}} otimes |0 angle = rac{|00 angle + |10 angle}{sqrt{2}}$ 3. Apply CNOT: $ rac{|00 angle + |11 angle}{sqrt{2}}$ Applying H to the first qubit of a 4-element state $[a, b, c, d]$: $$(H otimes I)[a, b, c, d] = left[ rac{a+c}{sqrt{2}}, rac{b+d}{sqrt{2}}, rac{a-c}{sqrt{2}}, rac{b-d}{sqrt{2}} ight]$$ ```python import math def h_on_first(state): s = 1 / math.sqrt(2) return [ s * (state[0] + state[2]), s * (state[1] + state[3]), s * (state[0] - state[2]), s * (state[1] - state[3]), ] def cnot(state): return [state[0], state[1], state[3], state[2]] ket_00 = [1.0, 0.0, 0.0, 0.0] phi_plus = cnot(h_on_first(ket_00)) # [1/√2, 0, 0, 1/√2] ≈ [0.7071, 0, 0, 0.7071] ``` ### Your Task Implement `h_on_first(state)` that applies H to the first qubit of a 2-qubit state. Then create the Bell state $|Phi^+ angle$.
Python runtime loading...
Loading...
Click "Run" to execute your code.