Site Tools


two-qubits

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
two-qubits [June 13, 2026 at 02:57] – external edit 127.0.0.1two-qubits [June 13, 2026 at 03:23] (current) Ivan Janevski
Line 6: Line 6:
 A general two-qubit state is a superposition over the four computational basis states, with the normalization condition saying the total probability must be 1: A general two-qubit state is a superposition over the four computational basis states, with the normalization condition saying the total probability must be 1:
  
-$$\lvert\psi\rangle = c_{00}\lvert 00\rangle + c_{01}\lvert 01\rangle + c_{10}\lvert 10\rangle + c_{11}\lvert 11\rangle, \qquad |c_{00}|^2 + |c_{01}|^2 + |c_{10}|^2 + |c_{11}|^2 = 1$$+$$\lvert\psi\rangle = \begin{pmatrix}c_{00}\\c_{01}\\c_{10}\\c_{11}\end{pmatrix}, \qquad \lvert\psi\rangle = c_{00}\underbrace{\begin{pmatrix}1\\0\\0\\0\end{pmatrix}}_{\lvert 00\rangle+ c_{01}\underbrace{\begin{pmatrix}0\\1\\0\\0\end{pmatrix}}_{\lvert 01\rangle+ c_{10}\underbrace{\begin{pmatrix}0\\0\\1\\0\end{pmatrix}}_{\lvert 10\rangle+ c_{11}\underbrace{\begin{pmatrix}0\\0\\0\\1\end{pmatrix}}_{\lvert 11\rangle}, \qquad |c_{00}|^2 + |c_{01}|^2 + |c_{10}|^2 + |c_{11}|^2 = 1$$
  
 ## Product states ## Product states
Line 32: Line 32:
 | [[ket-11|$\lvert 11\rangle$]] | Both qubits are $\lvert 1\rangle$. | | [[ket-11|$\lvert 11\rangle$]] | Both qubits are $\lvert 1\rangle$. |
  
-### X-basis+### X-basis (Hadamard basis)
  
 Pick [[ket-plus|$\lvert +\rangle$]] and [[ket-minus|$\lvert -\rangle$]] for each qubit instead. These states look "spread out" in the computational basis, because [[ket-plus|$\lvert +\rangle$]] $= (\lvert 0\rangle + \lvert 1\rangle)/\sqrt{2}$ mixes both. But in the X basis they are perfectly sharp, just like $\lvert 00\rangle$ is sharp in the Z basis. You get from the computational basis to this one by applying a Hadamard to every qubit. Pick [[ket-plus|$\lvert +\rangle$]] and [[ket-minus|$\lvert -\rangle$]] for each qubit instead. These states look "spread out" in the computational basis, because [[ket-plus|$\lvert +\rangle$]] $= (\lvert 0\rangle + \lvert 1\rangle)/\sqrt{2}$ mixes both. But in the X basis they are perfectly sharp, just like $\lvert 00\rangle$ is sharp in the Z basis. You get from the computational basis to this one by applying a Hadamard to every qubit.
Line 48: Line 48:
 | $\lvert --\rangle$ | $\tfrac{1}{2}(\lvert 00\rangle - \lvert 01\rangle - \lvert 10\rangle + \lvert 11\rangle)$ | Both qubits in [[ket-minus|$\lvert -\rangle$]]. | | $\lvert --\rangle$ | $\tfrac{1}{2}(\lvert 00\rangle - \lvert 01\rangle - \lvert 10\rangle + \lvert 11\rangle)$ | Both qubits in [[ket-minus|$\lvert -\rangle$]]. |
  
-### Y-basis+### Y-basis (Phase basis)
  
 Pick [[ket-plus-i|$\lvert +i\rangle$]] and [[ket-minus-i|$\lvert -i\rangle$]] for each qubit. These are the eigenstates of the Y gate. The coefficients are complex, so the Y-basis states are the first ones on this page with imaginary entries. You get from the computational basis to the Y basis by applying $SH$ to every qubit ($H$ first, then $S$). Pick [[ket-plus-i|$\lvert +i\rangle$]] and [[ket-minus-i|$\lvert -i\rangle$]] for each qubit. These are the eigenstates of the Y gate. The coefficients are complex, so the Y-basis states are the first ones on this page with imaginary entries. You get from the computational basis to the Y basis by applying $SH$ to every qubit ($H$ first, then $S$).
Line 81: Line 81:
  
 ^ State ^ Definition ^ Correlations ^ ^ State ^ Definition ^ Correlations ^
-| [[ket-phi-plus|$\lvert\Phi^+\rangle$]] | $\tfrac{1}{\sqrt{2}}(\lvert 00\rangle + \lvert 11\rangle)$ | Same-value in Z and X; anti-correlated in Y. Prepared from $\lvert 00\rangle$ by $H\otimes I$ then CNOT. |+| [[ket-phi-plus|$\lvert\Phi^+\rangle$]] | $\tfrac{1}{\sqrt{2}}(\lvert 00\rangle + \lvert 11\rangle)$ | Same-value in Z and X; anti-correlated in Y. Prepared from $\lvert 00\rangle$ by $H\otimes I$ then CX. |
 | [[ket-phi-minus|$\lvert\Phi^-\rangle$]] | $\tfrac{1}{\sqrt{2}}(\lvert 00\rangle - \lvert 11\rangle)$ | Same-value in Z; anti-correlated in X. The minus sign is invisible in Z-basis measurements. | | [[ket-phi-minus|$\lvert\Phi^-\rangle$]] | $\tfrac{1}{\sqrt{2}}(\lvert 00\rangle - \lvert 11\rangle)$ | Same-value in Z; anti-correlated in X. The minus sign is invisible in Z-basis measurements. |
-| [[ket-psi-plus|$\lvert\Psi^+\rangle$]] | $\tfrac{1}{\sqrt{2}}(\lvert 01\rangle + \lvert 10\rangle)$ | Anti-correlated in Z; same-value in X. Prepared from $\lvert 01\rangle$ by $H\otimes I$ then CNOT. |+| [[ket-psi-plus|$\lvert\Psi^+\rangle$]] | $\tfrac{1}{\sqrt{2}}(\lvert 01\rangle + \lvert 10\rangle)$ | Anti-correlated in Z; same-value in X. Prepared from $\lvert 01\rangle$ by $H\otimes I$ then CX. |
 | [[ket-psi-minus|$\lvert\Psi^-\rangle$]] | $\tfrac{1}{\sqrt{2}}(\lvert 01\rangle - \lvert 10\rangle)$ | Anti-correlated in every basis. The only antisymmetric Bell state; also called the singlet. | | [[ket-psi-minus|$\lvert\Psi^-\rangle$]] | $\tfrac{1}{\sqrt{2}}(\lvert 01\rangle - \lvert 10\rangle)$ | Anti-correlated in every basis. The only antisymmetric Bell state; also called the singlet. |
  
Line 99: Line 99:
 ## Gates ## Gates
  
-Two-qubit gates are $4\times 4$ unitary matrices acting on $\mathbb{C}^4$. The three most common ones are CX (CNOT), CZ, and SWAP. Row and column ordering follows the computational basis: $\lvert 00\rangle, \lvert 01\rangle, \lvert 10\rangle, \lvert 11\rangle$.+Two-qubit gates are $4\times 4$ unitary matrices acting on $\mathbb{C}^4$. The three most common ones are CX (CX), CZ, and SWAP. Row and column ordering follows the computational basis: $\lvert 00\rangle, \lvert 01\rangle, \lvert 10\rangle, \lvert 11\rangle$.
  
 $$CX = \begin{pmatrix}1&0&0&0\\0&1&0&0\\0&0&0&1\\0&0&1&0\end{pmatrix} $$CX = \begin{pmatrix}1&0&0&0\\0&1&0&0\\0&0&0&1\\0&0&1&0\end{pmatrix}
Line 118: Line 118:
 qc = QuantumCircuit(2, 2) qc = QuantumCircuit(2, 2)
 qc.h(0)       # Hadamard on qubit 0 → superposition qc.h(0)       # Hadamard on qubit 0 → superposition
-qc.cx(0, 1)   # CNOT: control=qubit 0, target=qubit 1 → entanglement+qc.cx(0, 1)   # CX: control=qubit 0, target=qubit 1 → entanglement
 qc.measure([0, 1], [0, 1]) qc.measure([0, 1], [0, 1])
  
two-qubits.1781319461.txt.gz · Last modified: by 127.0.0.1