Measure how closely two quantum states match. Handle pure states or density matrices with ease. Export results instantly for reports, labs, and project notes.
| Case | Input Type | State 1 | State 2 | Expected Fidelity |
|---|---|---|---|---|
| Orthogonal qubit states | Vectors | |0⟩ = (1, 0) | |1⟩ = (0, 1) | 0 |
| Identical states | Vectors | (0.70710678, 0.70710678) | (0.70710678, 0.70710678) | 1 |
| Pure vs mixed qubit (illustrative) | 2×2 Matrices | ρ = diag(0.7, 0.3) | σ = diag(0.6, 0.4) | ≈ 0.994987 |
The matrix example uses the qubit closed-form fidelity. Small rounding differences are normal.
For normalized vectors |ψ⟩ and |φ⟩, the fidelity is: F = |⟨ψ|φ⟩|².
If auto-normalization is enabled, the calculator scales each vector to unit norm before computing the overlap.
For 2×2 density matrices ρ and σ, the (squared) Uhlmann fidelity has a closed form: F = Tr(ρσ) + 2√(det(ρ) det(σ)).
Physical density matrices are Hermitian, positive semidefinite, and have trace 1.
Fidelity is a unitless similarity score between two quantum states, constrained to the range 0 to 1. Values near 1 indicate close agreement, while values near 0 suggest strong mismatch such as orthogonality. This calculator reports fidelity and supporting metrics so comparisons are consistent across runs.
In many laboratory benchmarks, fidelities above 0.90 often indicate a usable preparation or gate, while values above 0.99 are common in high-quality calibration data. Simulations may produce values extremely close to 1, limited mainly by rounding and truncation error.
For vectors, the key quantity is the overlap magnitude |⟨ψ|φ⟩|. Global phase does not change fidelity, but relative phases between amplitudes do. For example, (1, 1)/√2 and (1, −1)/√2 are orthogonal and yield fidelity 0 even though their magnitudes match.
Physical state vectors must be normalized to unit norm. If you paste raw amplitudes from experiments, enable auto-normalization to avoid inflating or deflating results. The tolerance setting controls sanity checks and helps flag inputs that are far from normalized.
Tomography and noisy channels often produce mixed states represented by density matrices. For qubits, fidelity can be computed efficiently using Tr(ρσ) and determinants. The calculator also reports √F and the Bures distance, which is frequently used as a geometric error measure.
Bures distance is 0 for identical states and increases as states separate. It connects to statistical distinguishability and is sensitive near high-fidelity regimes. When √F is close to 1, small changes in √F can produce visible differences in the reported distance.
Enter amplitudes as comma or space separated complex numbers using i for the imaginary unit. Scientific notation is accepted, such as 2.3e-4 or −1.1e3. For 2×2 matrices, provide entries in row-major order: a, b, c, d for the matrix [a b; c d].
Exporting results as CSV or PDF helps keep analysis reproducible. Include the chosen mode, tolerance, and whether auto-normalization was applied. For fair comparisons across devices or datasets, use the same normalization policy and report fidelity alongside √F or the Fubini–Study angle when relevant.
For valid inputs, identical states produce fidelity 1. For vectors, the overlap magnitude becomes 1. For qubit matrices, the trace-and-determinant expression also evaluates to 1 within numerical rounding.
Relative phase differences can cause destructive interference in the overlap. Two states may share the same magnitudes but differ by sign or complex phase, reducing |⟨ψ|φ⟩| and therefore fidelity.
Enable it when amplitudes come from raw measurements, unscaled vectors, or intermediate computations. If you already know your vectors or matrices are properly normalized, you can disable it to preserve exact input scaling.
Provide a 2×2 density matrix: Hermitian, positive semidefinite, and trace 1. The calculator can scale by trace if enabled, but it cannot enforce positivity, so unphysical matrices may trigger warnings.
F is the fidelity reported on a 0 to 1 scale. √F is sometimes called the Uhlmann fidelity and is used in definitions of distance measures, including the Bures distance shown by this calculator.
Small floating-point errors can push computed values slightly below 0 or above 1. Clamping keeps the reported value physically meaningful while preserving accuracy at typical precision levels.
Use i for the imaginary unit: 0.2+0.1i, 0.2−0.1i, or 0.5i. Spaces are ignored. You can also use scientific notation, like 1e-3 or −2.5e2i.
Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.