qsengine docs · Quantum physics
Entanglement
Two qubits are entangled when their joint state cannot be split into a state for each one. Measuring one then tells you about the other.
A Hadamard on qubit 0 and a CNOT from 0 to 1 give (|00⟩ + |11⟩)/√2, a Bell state. In qsengine it is two lines.
Each qubit on its own looks like a fair coin. Only the pair is special, because the two results always agree.
Running it 1000 times gives 513 of 00 and 487 of 11, and never 01 or 10.