Site Tools


quantum-gate-two-qubit

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
quantum-gate-two-qubit [August 26, 2026 at 17:21] – created - external edit 127.0.0.1quantum-gate-two-qubit [August 26, 2026 at 18:03] (current) – Ivan Janevski
Line 1: Line 1:
 # Two-qubit gates # Two-qubit gates
  
-**Two-qubit gates** are unitary operations that act on pairs of qubits. They are represented by $4 \times 4$ unitary matrices and form the Lie group $\mathrm{SU}(4)$. While single-qubit gates alone can only create superposition, two-qubit gates enable [[quantum-entanglement|entanglement]] — the core resource that makes quantum computing powerful. Any quantum computation can be decomposed into single-qubit rotations and two-qubit gates, making two-qubit gates the critical entangling layer in quantum circuits.+**Two-qubit gates** are unitary operations that act on a pair of qubits. They are represented by $4 \times 4$ unitary matrices and form the Lie group $\mathrm{SU}(4)$. Unlike single-qubit gates, which only rotate individual qubits on their own Bloch spheres, two-qubit gates can create entanglement between qubits, which is what makes a quantum computer more than a collection of independent classical bits.
  
-A two-qubit gate acts on a state $|\psi\rangle$ of two qubits to produce $U|\psi\rangle$. Unlike single-qubit gates, which correspond to rotations on the Bloch sphere, two-qubit gates operate in a much higher-dimensional space. Some two-qubit gates are native to specific physical platforms (e.g., CX on superconducting qubits, iSWAP on trapped ions), while others require decomposition into native gates plus single-qubit rotations. The cost of two-qubit gates — both in time and error rate — dominates quantum circuit cost.+A two-qubit gate is applied to a joint state $|\psi\rangle \in \mathbb{C}^4$ to produce $U|\psi\rangle$. Two-qubit gates compose like any other gate (matrix product), and combined with arbitrary [[quantum-gate-single-qubit|single-qubit gates]] they form a universal gate set: any $n$-qubit unitary can be built from single-qubit rotations plus one entangling two-qubit gate, typically [[quantum-gate-cx|CNOT]] or [[quantum-gate-cz|CZ]]. 
 + 
 +Not every two-qubit gate entangles. A gate that factors as $A \otimes B$ for single-qubit unitaries $A, B$ acts independently on each qubit and creates no correlation. The gates of interest here, CX, CZ, SWAP, and the parametric $\text{XX}$/$\text{YY}$/$\text{ZZ}$ family, are exactly the ones that don't factor this way.
  
 ## List of gates ## List of gates
Line 12: Line 14:
   - [[quantum-gate-swap|SWAP]]   - [[quantum-gate-swap|SWAP]]
   - [[quantum-gate-iswap|iSWAP]]   - [[quantum-gate-iswap|iSWAP]]
-  - [[quantum-gate-cphase|Controlled-Phase (CPhase)]] +  - [[quantum-gate-cp|Controlled-Phase]] 
-  - [[quantum-gate-xx|XX (Ising XX)]] +  - [[quantum-gate-xx|XX (Ising coupling)]] 
-  - [[quantum-gate-yy|YY (Ising YY)]] +  - [[quantum-gate-yy|YY (Ising coupling)]] 
-  - [[quantum-gate-zz|ZZ (Ising ZZ)]]+  - [[quantum-gate-zz|ZZ (Ising coupling)]]
  
-## Entanglement and entangling power 
- 
-Two-qubit gates enable entanglement by creating correlations between qubits that cannot be expressed as a product of independent single-qubit states. A state $|\psi\rangle$ is separable if it can be written as $|\psi\rangle = |\phi_0\rangle \otimes |\phi_1\rangle$; otherwise it is entangled. The four **Bell states** form a maximally entangled basis: 
- 
-$$|\Phi^+\rangle = \frac{1}{\sqrt{2}}(|00\rangle + |11\rangle), \quad |\Phi^-\rangle = \frac{1}{\sqrt{2}}(|00\rangle - |11\rangle)$$ 
-$$|\Psi^+\rangle = \frac{1}{\sqrt{2}}(|01\rangle + |10\rangle), \quad |\Psi^-\rangle = \frac{1}{\sqrt{2}}(|01\rangle - |10\rangle)$$ 
- 
-A gate's **entangling power** measures how much it can increase entanglement when applied to a separable state. A gate with zero entangling power (like single-qubit gates acting independently) cannot create entanglement from separable input. Most two-qubit gates have nonzero entangling power and can transform any separable two-qubit state to an entangled one (given the right single-qubit pre-rotations). Measuring entanglement uses metrics like **concurrence** (ranges 0 for separable to 1 for maximally entangled) and **entanglement entropy** of one qubit after tracing out the other. 
- 
-The **entanglement landscape** geometrically describes how two-qubit gates move around the space of possible two-qubit states. Unlike the Bloch sphere for single qubits (a 2D surface), the two-qubit state space is $2^4 - 1 = 15$ real dimensions. Two-qubit gates that leave separable states invariant (like tensor products of single-qubit gates) do not change entanglement; controlled gates and interaction-based gates actively create or manipulate entanglement. 
  
 ## Matrix representations ## Matrix representations
  
-**Controlled-NOT (CX):**+**Controlled gates** (control on qubit 1, target on qubit 2):
  
-$$\text{CX} = \begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 \\ 0 & 0 & 1 & 0 \end{pmatrix}$$+$$\mathrm{CX} = \begin{pmatrix} 1&0&0&0 \\ 0&1&0&0 \\ 0&0&0&1 \\ 0&0&1&0 \end{pmatrix} \quad \mathrm{CY} = \begin{pmatrix} 1&0&0&0 \\ 0&1&0&0 \\ 0&0&0&-i \\ 0&0&i&0 \end{pmatrix} \quad \mathrm{CZ} = \begin{pmatrix} 1&0&0&0 \\ 0&1&0&0 \\ 0&0&1&0 \\ 0&0&0&-1 \end{pmatrix}$$
  
-Applies X to target qubit if control qubit is $|1\rangle$. Also called CNOT.+**SWAP family:**
  
-**SWAP:**+$$\mathrm{SWAP} = \begin{pmatrix} 1&0&0&0 \\ 0&0&1&0 \\ 0&1&0&0 \\ 0&0&0&1 \end{pmatrix} \quad \mathrm{iSWAP} = \begin{pmatrix} 1&0&0&0 \\ 0&0&i&0 \\ 0&i&0&0 \\ 0&0&0&1 \end{pmatrix}$$
  
-$$\text{SWAP} = \begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 \end{pmatrix}$$+**Parametric Ising-coupling gates (angle $\theta$):**
  
-Exchanges the state of two qubits. Its own inverse: $\text{SWAP}^2 = I$. Useful for moving qubit states across a chip when qubits can only interact with neighbors.+$$\text{XX}(\theta) = \exp\left(-i\frac{\theta}{2} X \otimes X\right), \quad \text{YY}(\theta) = \exp\left(-i\frac{\theta}{2} Y \otimes Y\right), \quad \text{ZZ}(\theta) = \exp\left(-i\frac{\theta}{2} Z \otimes Z\right)$$
  
-**iSWAP:**+Note: $\mathrm{SWAP} = \mathrm{CX}_{12} \, \mathrm{CX}_{21} \, \mathrm{CX}_{12}$, and $\mathrm{iSWAP} = \text{XX}(\pi/2)\,\text{YY}(\pi/2)$ up to single-qubit phases.
  
-$$\text{iSWAP} = \begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 & 0 & i & 0 \\ 0 & i & 0 & 0 \\ 0 & 0 & 0 & 1 \end{pmatrix}$$ 
  
-Swaps qubits and applies an imaginary unit phase to the swapped components. Native to trapped-ion and superconducting platforms with parametric coupling. The iSWAP is self-inverse when applied twice: $(iSWAP)^4 = I$ (accounting for global phase).+## Group structure
  
-**Controlled-Z (CZ):**+Two-qubit gates form $\mathrm{SU}(4)$ (dimension 15); the local subgroup $\mathrm{SU}(2) \otimes \mathrm{SU}(2)$ has dimension 6. The entangling content of a gate, the part that can't be absorbed into surrounding single-qubit gates, lives in the remaining 9-dimensional quotient $\mathrm{SU}(4) / (\mathrm{SU}(2) \otimes \mathrm{SU}(2))$.
  
-$$\text{CZ} = \begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & -1 \end{pmatrix}$$ +$\mathrm{SU}(4)$ has no Bloch-sphere-like picture. Instead its entangling content is captured by a small set of **local invariants**, unchanged under pre/post-composition with local gates, and reduces to just three numbers.
- +
-Applies Z to both qubits if both are $|1\rangle$. Symmetric: CZ has no control/target distinction. +
- +
-**Ising interactions (XX, YY, ZZ):** +
- +
-$$R_{XX}(\theta) = \begin{pmatrix} \cos(\theta/2) & 0 & 0 & -i\sin(\theta/2) \\ 0 & \cos(\theta/2) & -i\sin(\theta/2) & 0 \\ 0 & -i\sin(\theta/2) & \cos(\theta/2) & 0 \\ -i\sin(\theta/2) & 0 & 0 & \cos(\theta/2) \end{pmatrix}$$ +
- +
-Similarly for $R_{YY}(\theta)$ and $R_{ZZ}(\theta)$. These parameterized gates implement Ising-type interactions common in natural Hamiltonians. +
- +
-## Clifford vs non-Clifford +
- +
-Two-qubit gates partition into Clifford and non-Clifford classes, extending the single-qubit definitions. +
- +
-**Clifford gates** (like CX, CZ, SWAP) preserve the property that conjugating a Pauli tensor product by the gate yields another Pauli tensor product (up to phase). The two-qubit Clifford group has $5 \times 2^7 = 11{,}520$ elements. Examples: +
- +
-- CX conjugates $X_1 \rightarrow X_1$ and $X_2 \rightarrow X_1 X_2$ (where subscripts denote qubit indices) +
-- CZ is symmetric and conjugates $Z_1 Z_2 \rightarrow Z_1 Z_2$ +
-- SWAP conjugates Paulis on qubit 1 to the same Paulis on qubit 2 and vice versa +
- +
-Clifford circuits remain efficiently simulatable classically via stabilizer tableaux; two-qubit Cliffords alone cannot provide quantum advantage. +
- +
-**Non-Clifford gates** (like parameterized Ising gates with irrational angles, or some phase-controlled gates) break Pauli closure when acting on stabilizers. The resulting operators are superpositions of Paulis. In fault-tolerant quantum computing, non-Clifford two-qubit gates require additional resources (magic state distillation) to implement reliably, making their count a cost metric similar to T gates in single-qubit circuits.+
  
 ## KAK decomposition ## KAK decomposition
  
-The **Cartan decomposition** (or Khanna-Abernathy-Klappenecker decomposition) is the two-qubit analog of Euler angle decomposition for single-qubit gates. Any two-qubit unitary $U \in \mathrm{SU}(4)$ can be written as:+The intuition: any two-qubit gate can be sorted into "local dressing", single-qubit rotations that don't cost an entangling operation on hardware, wrapped around one irreducible entangling core. KAK decomposition makes this split explicit. Any $U \in \mathrm{SU}(4)$ factors as local gates sandwiching one canonical entangling gate $A \in \mathrm{SU}(4)$, where $K_1, K_2, K_3, K_4 \in \mathrm{SU}(2)$ are single-qubit unitaries, local by construction:
  
-$$U = (A_1 \otimes A_2) \, \text{CX}_{12} \, (B_1 \otimes B_2) \, \text{CX}_{12} \, (C_1 \otimes C_2)$$+$$U = (K_1 \otimes K_2) \; A \; (K_3 \otimes K_4), \quad A = \exp\left(i \left( a\, X{\otimes}X + b\, Y{\otimes}Y + c\, Z{\otimes}Z \right)\right)$$
  
-where $A_i, B_i, C_i$ are arbitrary single-qubit unitaries and $\text{CX}_{12}$ denotes a CX gate from qubit 0 to qubit 1. In the worst case, this requires three CX gates (the maximum two-qubit gate depth for universal gates). Some gates can be implemented with fewer CNOTs: for example, a single-qubit gate requires zero CNOTs, CZ requires one CX, and iSWAP requires one CX (up to phase).+This is the **Cartan KAK decomposition** of $\mathfrak{su}(4)$: all entangling content is isolated in $(a, b, c)$, since the $K_k$ entangle nothing.
  
-The canonical form emphasizes the role of the **entangling coefficients** (or Cartan parameters) $c_1, c_2, c_3 \in [0, \pi/4]$, which characterize the entangling power. The generalized decomposition is: +The triples $(a,b,c)$ range over the **Weyl chamber**; gates related by local operations map to the same point. CX, CZ, and iSWAP sit at distinct points; SWAP sits at the corner of maximal entanglement. This also bounds circuit cost: any two-qubit unitary needs at most 3 CNOTs, an entangling one at least 1.
- +
-$$U = (A_1 \otimes A_2) \, \text{CX}_{12} \, R_Z(c_1) \, \text{CX}_{12} \, R_Z(c_2) \, \text{CX}_{12} \, R_Z(c_3) \, (C_1 \otimes C_2)$$ +
- +
-where the Cartan parameters encode how much entanglement the gate creates. When all three are zero, $U$ is separable. When they are nonzero and distinct, $U$ is fully entangling. This decomposition is the workhorse for compiling arbitrary two-qubit gates on real hardware. +
- +
-## Isospectral equivalence +
- +
-Two-qubit gates related by single-qubit rotations have the same eigenvalues (spectrum) but different eigenvectors. For instance, CX, CY, and CZ are isospectral: they differ only by single-qubit basis rotations applied before and after. Similarly, iSWAP is isospectral to other parametric interactions (e.g., $\exp(-i \theta X_1 X_2)$ for appropriate $\theta$). +
- +
-This equivalence is important for hardware mapping: if a physical platform natively implements iSWAP but a circuit calls for CX, the compiler uses single-qubit rotations to convert between them. Formally, $U$ and $V$ are isospectral if $U = (A_1 \otimes A_2) V (B_1 \otimes B_2)$ for single-qubit gates $A_i, B_i$. The conversion is efficient (one extra layer of single-qubit gates), so platform-specific native gates can interchangeably be used in circuit compilation.+
  
 ## Uses ## Uses
  
-- **Entanglement generation**: Create Bell states and multi-qubit entangled states for algorithms and error correction +- **Entanglement generation**: Bell pairs, GHZ states, correlated-qubit protocols 
-- **Controlled operations**: CX and CZ implement the control flow and conditional logic of quantum algorithms +- **Variational algorithms**: [[cuda-q-vqe|VQE]] and [[cuda-q-qaoa|QAOA]] alternate single-qubit rotations with entangling layers 
-- **Basis-dependent measurements**: Apply two-qubit gates (e.g., CX before measurement) to measure joint operators +- **Error correction**: CX/CZ entangle data qubits with ancillas to measure stabilizers 
-- **Quantum error correction**: Two-qubit Clifford gates (CX, CZ) are essential for measuring stabilizers in fault-tolerant codes +- **Circuit synthesis**: KAK decomposition is how compilers target native gates 
-- **Variational algorithms**: [[cuda-q-vqe|VQE]] and [[cuda-q-qaoa|QAOA]] use two-qubit entangling layers as parameterized ansatz blocks +- **State transfer**: SWAP moves information between non-adjacent qubits
-- **Qubit routing and relabeling**: SWAP gates move qubit states across linear or 2D qubit arrays when distant qubits must interact +
-- **Quantum simulation**: Ising interactions ($R_{XX}, R_{YY}, R_{ZZ}$) directly implement nearest-neighbor Hamiltonian terms +
-- **State swapping and permutations**: SWAP and iSWAP efficiently permute qubit indices without additional measurement or readout+
  
 ## Implementation ## Implementation
  
-Two-qubit gate performance is platform-dependent and often dominates circuit cost. +- **Superconducting**: CZ is usually native (~20–60 ns, tunable coupler); CX is synthesized from CZ + Hadamards; fidelity 99–99.9% 
- +- **Trapped ions**: native Mølmer-Sørensen gate is effectively $\text{XX}(\theta)$ (~10–200 μs); CX/CZ synthesized from it; fidelity 99.9%+ 
-**Superconducting qubits:** +- **Photonic**: deterministic gates need weak optical nonlinearity, so CZ is often probabilistic/measurement-induced; fidelity limited by photon loss
-- CX via AC-Stark shift or parametric drive: ~20–100 ns +
-- iSWAP via parametric coupling: ~50–200 ns +
-- fidelity: typically 98–99.5% (lower than single-qubit) +
-- CZ decomposed from CX + single-qubit gates when not natively available +
-- Gate depth and error are the main performance bottlenecks in longer circuits +
- +
-**Trapped ions:** +
-- iSWAP via Rabi oscillations on a simulated coupling: ~1–10 μs +
-- Native interactions often include Heisenberg XX and parametric Ising-type gates +
-- fidelity: 99%+ achievable; slower than superconducting but higher fidelity +
-- CX decomposed from iSWAP and single-qubit gates if not native +
- +
-**Photonic:** +
-- Beam splitters implement parameterized XX and YY interactions +
-- No direct CX available; must decompose via multiple beam splitters and phase shifters +
-- fidelity: ~95–99% (limited by optical component precision) +
- +
-**Spin qubits (solid-state):** +
-- Heisenberg XX coupling via exchange interaction or dipole coupling +
-- iSWAP and CX decomposed from native parametric interactions +
-- fidelity: varies; rapidly improving+
  
-The **Cartan/KAK decomposition** is the standard compilation strategy: given a target gate and the native gate set, the compiler expresses the gate as a product of native operations (typically one or two-qubit rotations). On platforms where CX is expensive, a compiler might prefer iSWAP-native decompositions or other isospectral forms to minimize depth and error accumulation.+CX is rarely the physically native gate; it's a compiler target synthesized from whatever the hardware actually implements (usually CZ or an $\text{XX}$-type coupling).
  
 ## Relations ## Relations
  
-- [[quantum-gate|Quantum gates]]: two-qubit gates are part of the broader gate taxonomy +- [[quantum-gate-cx|CX]], [[quantum-gate-cy|CY]], [[quantum-gate-cz|CZ]]: the controlled-Pauli family, interconvertible via single-qubit basis changes 
-- [[quantum-gate-single-qubit|Single-qubit gates]]: the building blocks of two-qubit decompositions +- [[quantum-gate-swap|SWAP]], [[quantum-gate-iswap|iSWAP]]: exchange-type gates, at extremal points of the Weyl chamber 
-- [[quantum-gate-three-qubit|Three-qubit gates]]: multi-qubit generalizations; many are built from two-qubit gates +- [[quantum-gate-xx|XX]], [[quantum-gate-yy|YY]], [[quantum-gate-zz|ZZ]]: parametric Ising-coupling gates, the native form on many platforms 
-- [[quantum-entanglement|Quantum entanglement]]: the resource created and manipulated by two-qubit gates +- [[quantum-gate-single-qubit|Single-qubit gates]]: plus one entangling two-qubit gate, form a universal gate set 
-- [[quantum-gate-parametric|Parametric gates]]: framework for angle-parameterized two-qubit gates +- [[quantum-gate-clifford|Clifford gates]]: CX, CY, CZ, SWAP, iSWAP are two-qubit Cliffords 
-- [[quantum-gate-clifford|Clifford gates]]: two-qubit Clifford gates form a large but classically simulatable subgroup +- [[quantum-gate-three-qubit|Three-qubit gates]]: built from two-qubit gates plus control logic
-- [[quantum-gate-non-clifford|Non-Clifford gates]]: non-Clifford two-qubit gates enable universality +
-- [[quantum-gate-universal|Universal gate sets]]: single-qubit rotations + two-qubit Clifford (e.g., CX) are universal+
 - $\mathrm{SU}(4)$: group structure of two-qubit unitaries - $\mathrm{SU}(4)$: group structure of two-qubit unitaries
-- Cartan decomposition: parametrization of two-qubit gates via KAK+- Weyl chamber: geometric classification of two-qubit gates up to local equivalence
  
quantum-gate-two-qubit.1787764866.md.gz · Last modified: by 127.0.0.1