m physical modeling / IICSM

PHYSICS / ENGINEERING / COMPUTING

Quantum computing models

Work from state vectors and gates to entanglement, simple algorithms, measurement statistics, and noise through twenty explicit examples.

Subject library · 51 guides · derivations & worked examples

Matter pathway: atom → solid → liquid → gas → plasma. Quantum mechanics and quantum field theory provide foundations across the pathway; they are not additional phases. This is a connected modeling route, not a universal heating curve. Actual phases depend on pressure, composition, and kinetics.

1. Qubits, gates, and measurement

Definitions & inputs. |ψ⟩=α|0⟩+β|1⟩; α,β complex amplitudes. Basis ordering for two qubits is |q0 q1⟩.

  1. The Born rule maps amplitudes to measurement probabilities.

    ∣α∣2+∣β∣2=1,P(1)=∣β∣2|\alpha|^2+|\beta|^2=1,\quad P(1)=|\beta|^2
  2. Unitary gates preserve normalization.

    ∣ψ′⟩=U∣ψ⟩,U†U=I|\psi^\prime\rangle=U|\psi\rangle,\quad U^\dagger U=I
  3. Matrix multiplication gives a tunable measurement probability.

    Ry(θ)∣0⟩=cos⁡(θ/2)∣0⟩+sin⁡(θ/2)∣1⟩R_y(\theta)|0\rangle=\cos(\theta/2)|0\rangle+\sin(\theta/2)|1\rangle

Interpretation. Global phase is unobservable; relative phase can affect later measurements.

↑ Return to definitions and contents

2. Bell states and density matrices

Definitions & inputs. ρ is a density operator; Tr traces over a basis; ZA,ZB are Pauli-Z observables on the two qubits.

  1. A Hadamard and controlled-NOT prepare a Bell state.

    ∣00⟩→H⊗I(∣00⟩+∣10⟩)/2→CNOT(∣00⟩+∣11⟩)/2|00\rangle\xrightarrow{H\otimes I}(|00\rangle+|10\rangle)/\sqrt2\xrightarrow{\rm CNOT}(|00\rangle+|11\rangle)/\sqrt2
  2. Each subsystem is maximally mixed although the joint state is pure.

    ρA=Tr⁡B∣Φ+⟩⟨Φ+∣=I/2\rho_A=\operatorname{Tr}_B|\Phi^+\rangle\langle\Phi^+|=I/2
  3. Local randomness coexists with perfect joint correlation.

    ⟨ZAZB⟩=1,Tr⁡ρA2=1/2\langle Z_AZ_B\rangle=1,\quad\operatorname{Tr}\rho_A^2=1/2

Interpretation. Entanglement correlations do not permit faster-than-light signaling.

↑ Return to definitions and contents

3. Interference in small algorithms

Definitions & inputs. N search items, one marked item; θ=arcsin(1/√N); r Grover iterations; m phase-estimation bits.

  1. Two reflections rotate amplitude in the marked/unmarked subspace.

    PGrover(r)=sin⁡2[(2r+1)θ]P_{\rm Grover}(r)=\sin^2[(2r+1)\theta]
  2. Controlled powers and inverse Fourier transform recover an exactly representable eigenphase on an exact eigenstate.

    U∣u⟩=e2πiϕ∣u⟩,k=2mϕwhen integerU|u\rangle=e^{2\pi i\phi}|u\rangle,\quad k=2^m\phi\quad\text{when integer}
  3. The Fourier transform changes phases; a basis input yields uniform computational-basis outcome probabilities.

    QFTN∣j⟩=N−1/2∑k=0N−1e2πijk/N∣k⟩\mathrm{QFT}_N|j\rangle=N^{-1/2}\sum_{k=0}^{N-1}e^{2\pi ijk/N}|k\rangle

Interpretation. Algorithmic advantage depends on data access, oracle cost, errors, and classical alternatives.

↑ Return to definitions and contents

4. Noise and finite-shot inference

Definitions & inputs. T1 is energy relaxation time, T2 phase-coherence time, nshots independent measurements, and p a measured-event probability.

  1. Separate population loss from off-diagonal coherence.

    P1(t)=P1(0)e−t/T1,∣ρ01(t)∣=∣ρ01(0)∣e−t/T2P_1(t)=P_1(0)e^{-t/T_1},\quad|\rho_{01}(t)|=|\rho_{01}(0)|e^{-t/T_2}
  2. Pure dephasing adds to the coherence decay rate in this simple model.

    1/T2=1/(2T1)+1/Tϕ1/T_2=1/(2T_1)+1/T_\phi
  3. A binomial model gives sampling uncertainty, distinct from device bias.

    σp^=p(1−p)/nshots\sigma_{\hat p}=\sqrt{p(1-p)/n_{\rm shots}}

Interpretation. A simulator result is not a hardware validation; real error budgets include preparation, gates, readout, and correlations.

↑ Return to definitions and contents

5. Algorithm foundations: reversible queries and phase kickback

Definitions & inputs. x is an n-bit candidate, f(x) is a Boolean predicate, ⊕ is addition modulo two, |−⟩=(|0⟩−|1⟩)/√2. An oracle is a reversible circuit computing the predicate, not a source that reveals the answer for free.

  1. Store the predicate in a target qubit while preserving the candidate, which makes the map reversible.

    Uf∣x⟩∣b⟩=∣x⟩∣b⊕f(x)⟩U_f|x\rangle|b\rangle=|x\rangle|b\oplus f(x)\rangle
  2. The minus state is an eigenstate of the bit-flip gate with eigenvalue −1.

    X∣−⟩=−∣−⟩X|{-}\rangle=-|{-}\rangle
  3. A controlled bit flip therefore becomes a phase on the candidate. The ancilla separates from the data.

    Uf∣x⟩∣−⟩=(−1)f(x)∣x⟩∣−⟩U_f|x\rangle|{-}\rangle=(-1)^{f(x)}|x\rangle|{-}\rangle
  4. Hadamard gates prepare equal amplitudes. An immediate measurement still returns a uniformly random candidate.

    ∣s⟩=H⊗n∣0n⟩=1N∑x=0N−1∣x⟩,N=2n|s\rangle=H^{\otimes n}|0^n\rangle=\frac1{\sqrt N}\sum_{x=0}^{N-1}|x\rangle,\quad N=2^n

Interpretation. Algorithms create useful interference before measurement. They do not provide simultaneous classical access to all amplitudes. Oracle synthesis and data loading contribute real cost.

↑ Return to definitions and contents

6. Grover: derive the two-reflection rotation

Definitions & inputs. N candidates contain M marked answers, 0<M<N. |G⟩ and |B⟩ are normalized uniform superpositions of good and bad candidates. θ=arcsin√(M/N). Basis ordering below is (|G⟩, |B⟩).

  1. Group equal candidate amplitudes into a two-dimensional subspace.

    ∣s⟩=M/N∣G⟩+1−M/N∣B⟩=sin⁡θ∣G⟩+cos⁡θ∣B⟩|s\rangle=\sqrt{M/N}|G\rangle+\sqrt{1-M/N}|B\rangle=\sin\theta|G\rangle+\cos\theta|B\rangle
  2. Within this subspace the oracle reflects the good component. On the full space its projector includes every marked basis state.

    O=I−2∣G⟩⟨G∣=(−1001)O=I-2|G\rangle\langle G|=\begin{pmatrix}-1&0\\0&1\end{pmatrix}
  3. Expand the outer product. The diffuser reflects about the initial state.

    D=2∣s⟩⟨s∣−I=(−cos⁡2θsin⁡2θsin⁡2θcos⁡2θ)D=2|s\rangle\langle s|-I=\begin{pmatrix}-\cos2\theta&\sin2\theta\\\sin2\theta&\cos2\theta\end{pmatrix}
  4. Apply the oracle first, then the diffuser: two reflections give a rotation toward the good axis.

    G=DO=(cos⁡2θsin⁡2θ−sin⁡2θcos⁡2θ)G=DO=\begin{pmatrix}\cos2\theta&\sin2\theta\\-\sin2\theta&\cos2\theta\end{pmatrix}
  5. Multiply once and use the angle-addition identities; induction proves the expression for k iterations.

    Gk∣s⟩=sin⁡[(2k+1)θ]∣G⟩+cos⁡[(2k+1)θ]∣B⟩G^k|s\rangle=\sin[(2k+1)\theta]|G\rangle+\cos[(2k+1)\theta]|B\rangle
  6. Square the good amplitude. Compare neighboring nonnegative integers around k* to choose the first peak.

    Pk=sin⁡2[(2k+1)θ],k∗≈π4θ−12P_k=\sin^2[(2k+1)\theta],\quad k_*\approx\frac{\pi}{4\theta}-\frac12
  7. For sparse solutions this is a quadratic query improvement over classical unstructured search.

    θ≃M/N ⇒ k=O(N/M)\theta\simeq\sqrt{M/N}\ \Rightarrow\ k=O(\sqrt{N/M})

Interpretation. More iterations can reduce success: the state rotates past the good direction. Verify a measured candidate classically. Unknown M calls for an adaptive search or counting method; the quadratic oracle count does not remove the cost of implementing each oracle.

↑ Return to definitions and contents

7. Grover worked examples: four and eight candidates

Definitions & inputs. First mark |11⟩ among four two-qubit strings. Amplitude vectors use order 00,01,10,11. Second use one marked answer among eight candidates.

  1. For the two-qubit example a controlled-Z gate marks |11⟩.

    ∣s⟩=12(1,1,1,1)T →O 12(1,1,1,−1)T|s\rangle=\tfrac12(1,1,1,1)^{\mathsf T}\ \xrightarrow{O}\ \tfrac12(1,1,1,-1)^{\mathsf T}
  2. The diffuser maps each amplitude to its reflection about the mean amplitude, not the mean probability.

    aˉ=14(12+12+12−12)=14,ax→D2aˉ−ax\bar a=\tfrac14(\tfrac12+\tfrac12+\tfrac12-\tfrac12)=\tfrac14,\quad a_x\xrightarrow{D}2\bar a-a_x
  3. All unmarked amplitudes cancel and the target amplitude becomes one.

    DO∣s⟩=(0,0,0,1)T,P1=1DO|s\rangle=(0,0,0,1)^{\mathsf T},\quad P_1=1
  4. The same derivation works beyond the special exact two-qubit case.

    N=8, M=1:θ=arcsin⁡(1/8),P0=1/8N=8,\ M=1:\quad \theta=\arcsin(1/\sqrt8),\quad P_0=1/8
  5. Two oracle queries give 94.53125% success in the eight-candidate example.

    P1=sin⁡2(3θ)=25/32,P2=sin⁡2(5θ)=121/128P_1=\sin^2(3\theta)=25/32,\quad P_2=\sin^2(5\theta)=121/128
  6. A third iteration overshoots and drops success to about 33.0%.

    P3=sin⁡2(7θ)=169/512P_3=\sin^2(7\theta)=169/512

Interpretation. The diffuser circuit is H⊗n(2|0…0⟩⟨0…0|−I)H⊗n. A circuit implementing the negative of this operator differs only by a global phase for ordinary Grover search. Relative and global phase must not be confused.

↑ Return to definitions and contents

8. Quantum Fourier transform and phase estimation

Definitions & inputs. U|u⟩=exp(2πiφ)|u⟩ with 0≤φ<1. A t-qubit control register has Q=2ᵗ states. y is the measured integer. This derivation uses the inverse QFT sign convention shown.

  1. Initialize a uniform control superposition and the target eigenstate.

    ∣0t⟩∣u⟩→H⊗t1Q∑x=0Q−1∣x⟩∣u⟩|0^t\rangle|u\rangle\xrightarrow{H^{\otimes t}}\frac1{\sqrt Q}\sum_{x=0}^{Q-1}|x\rangle|u\rangle
  2. Controlled U, U², U⁴, … combine according to the binary digits of x. Eigenphase is kicked back to the control register.

    1Q∑x∣x⟩Ux∣u⟩=1Q∑xe2πixϕ∣x⟩∣u⟩\frac1{\sqrt Q}\sum_x|x\rangle U^x|u\rangle=\frac1{\sqrt Q}\sum_x e^{2\pi i x\phi}|x\rangle|u\rangle
  3. The inverse transform converts a phase gradient into an integer peak.

    FQ−1∣x⟩=1Q∑y=0Q−1e−2πixy/Q∣y⟩F_Q^{-1}|x\rangle=\frac1{\sqrt Q}\sum_{y=0}^{Q-1}e^{-2\pi ixy/Q}|y\rangle
  4. Collect the amplitude of output y.

    A(y)=1Q∑x=0Q−1e2πix(ϕ−y/Q)A(y)=\frac1Q\sum_{x=0}^{Q-1}e^{2\pi ix(\phi-y/Q)}
  5. Sum the geometric series and take its squared magnitude, using the limiting value at removable singularities.

    P(y)=sin⁡2[πQ(ϕ−y/Q)]Q2sin⁡2[π(ϕ−y/Q)]P(y)=\frac{\sin^2[\pi Q(\phi-y/Q)]}{Q^2\sin^2[\pi(\phi-y/Q)]}
  6. A worked exact phase produces the bit string 011 under the stated integer ordering; other grid outputs vanish.

    ϕ=3/8, Q=8 ⇒ P(y=3)=1\phi=3/8,\ Q=8\ \Rightarrow\ P(y=3)=1

Interpretation. When Qφ is not an integer, nearby outcomes have nonzero probability. A standard exact t-qubit QFT uses Hadamards, controlled phase rotations of angles π/2, π/4, …, and final swaps; its inverse reverses gate order and phase signs. The gate count is O(t²), excluding controlled-U synthesis.

↑ Return to definitions and contents

9. Shor: reduce factoring to order finding

Definitions & inputs. N is an odd composite integer after classical checks for even numbers and perfect powers. Choose 1<a<N coprime to N. The order r is the least positive integer satisfying aʳ≡1 mod N.

  1. Run Euclid’s classical algorithm first; only a coprime base needs quantum order finding.

    d=gcd⁡(a,N)>1 ⇒ d is already a nontrivial factord=\gcd(a,N)>1\ \Rightarrow\ d\text{ is already a nontrivial factor}
  2. Factor a difference of squares after obtaining an even order.

    ar≡1(modN),r even ⇒ (ar/2−1)(ar/2+1)≡0(modN)a^r\equiv1\pmod N,\quad r\text{ even}\ \Rightarrow\ (a^{r/2}-1)(a^{r/2}+1)\equiv0\pmod N
  3. A nontrivial square root of one can separate factors of N.

    x=ar/2 mod N,x≢±1(modN)x=a^{r/2}\bmod N,\quad x\not\equiv\pm1\pmod N
  4. The gcd extracts divisors without requiring a quantum measurement to return the factors directly.

    d−=gcd⁡(x−1,N),d+=gcd⁡(x+1,N)d_- =\gcd(x-1,N),\quad d_+=\gcd(x+1,N)
  5. Verify each proposed divisor. Repeat the base selection if the order is odd or the square root is trivial.

    1<d±<N,N mod d±=01<d_{\pm}<N,\quad N\bmod d_{\pm}=0

Interpretation. Shor’s speedup concerns a structured arithmetic problem. The quantum component estimates a period; modular arithmetic and continued fractions do the classical postprocessing. Factoring arbitrary large cryptographic integers also requires sufficiently accurate, fault-tolerant hardware.

↑ Return to definitions and contents

10. Shor: derive the order-finding eigenstates and period readout

Definitions & inputs. Ua maps |y⟩ to |ay mod N⟩ for 0≤y<N and acts as identity on unused computational basis states. Since gcd(a,N)=1 this is a permutation. |us⟩ labels eigenphases s/r for s=0,…,r−1.

  1. Superpose the cyclic orbit of one with Fourier phases.

    ∣us⟩=1r∑k=0r−1e−2πisk/r∣ak mod N⟩|u_s\rangle=\frac1{\sqrt r}\sum_{k=0}^{r-1}e^{-2\pi isk/r}|a^k\bmod N\rangle
  2. Shift k to k+1, relabel the cyclic sum, and factor out exp(2πis/r).

    Ua∣us⟩=e2πis/r∣us⟩U_a|u_s\rangle=e^{2\pi is/r}|u_s\rangle
  3. Fourier orthogonality cancels every orbit basis state except k=0. A simple target initialization therefore supplies a uniform eigenphase mixture for measurement.

    ∣1⟩=1r∑s=0r−1∣us⟩|1\rangle=\frac1{\sqrt r}\sum_{s=0}^{r-1}|u_s\rangle
  4. Controlled modular powers a^(2ʲ) implement the phase-estimation interaction without enumerating every x classically.

    1Q∑x∣x⟩∣1⟩ →modular exponentiation 1Q∑x∣x⟩∣ax mod N⟩\frac1{\sqrt Q}\sum_x|x\rangle|1\rangle\ \xrightarrow{\mathrm{modular\ exponentiation}}\ \frac1{\sqrt Q}\sum_x|x\rangle|a^x\bmod N\rangle
  5. Use the preceding phase-estimation derivation. An ideal experiment samples different s values; it does not always return 1/r.

    FQ−1 on controls⇒y/Q≈s/rF_Q^{-1}\text{ on controls}\quad\Rightarrow\quad y/Q\approx s/r
  6. A sufficiently close sample permits rational reconstruction. The nearest-grid outcome with Q≥N² satisfies this error bound, but not every measurement is nearest-grid.

    ∣yQ−sr∣<12r2⇒the reduced s/r is a continued-fraction convergent\left|\frac yQ-\frac sr\right|<\frac1{2r^2}\quad\Rightarrow\quad\text{the reduced }s/r\text{ is a continued-fraction convergent}
  7. Test candidate denominators, appropriate multiples, or combine samples and rerun. A shared factor gcd(s,r)>1 can produce only a divisor of the true order.

    r^ candidate:ar^ mod N=?1\hat r\text{ candidate}:\quad a^{\hat r}\bmod N\stackrel{?}=1

Interpretation. The order must be validated before taking gcds. A sample y=0 is uninformative. Efficient reversible modular exponentiation and the QFT give polynomial scaling in log N; this is not a claim that a tiny demonstration circuit scales directly to useful factoring.

↑ Return to definitions and contents

11. Shor worked example: factor 15, including failed samples

Definitions & inputs. N=15, a=2, Q=256 (eight control qubits); four target qubits encode residues. In the ideal arithmetic circuit the order is r=4.

  1. List this small orbit to check the result independently: the first return occurs after four steps.

    20,21,22,23,24(mod15)=1,2,4,8,12^0,2^1,2^2,2^3,2^4\pmod{15}=1,2,4,8,1
  2. All four phases lie exactly on the Q=256 grid, so each listed output has probability 1/4.

    ϕ∈{0,1/4,1/2,3/4} ⇒ y∈{0,64,128,192}\phi\in\{0,1/4,1/2,3/4\}\ \Rightarrow\ y\in\{0,64,128,192\}
  3. The continued fraction immediately supplies denominator four, which passes the order test.

    y=64:64/256=1/4=[0;4] ⇒ r^=4,24 mod 15=1y=64:\quad 64/256=1/4=[0;4]\ \Rightarrow\ \hat r=4,\quad 2^4\bmod15=1
  4. The two gcds recover 15=3×5.

    x=24/2=4,gcd⁡(4−1,15)=3,gcd⁡(4+1,15)=5x=2^{4/2}=4,\quad\gcd(4-1,15)=3,\quad\gcd(4+1,15)=5
  5. The reduced fraction loses a factor of two in the denominator. Test a multiple or gather another sample; do not call two the order.

    y=128:128/256=1/2,22 mod 15=4≠1y=128:\quad 128/256=1/2,\quad 2^2\bmod15=4\ne1
  6. Even a correct order can fail the factor-extraction condition for a poor base. For a=14 both gcd outputs are trivial.

    y=0 is uninformative;a=14: r=2, ar/2≡−1(mod15)y=0\text{ is uninformative};\quad a=14:\ r=2,\ a^{r/2}\equiv-1\pmod{15}

Interpretation. For this example, the two coprime phase numerators 1 and 3 directly yield the full order, together with probability 1/2. Verification and repeated sampling are part of the algorithm, not optional repairs.

↑ Return to definitions and contents

Graphical worked example

Apply Ry(θ) to |0〉; ideal measurement gives sin²(θ/2), without noise. X axis: Rotation angle θ (radians). Y axis: Probability of measuring 1 (dimensionless).
Apply Ry(θ) to |0〉; ideal measurement gives sin²(θ/2), without noise. Related worked calculation · Download SVG · Plot data

Twenty worked examples

Open a problem to see its defined inputs, assumptions, equation, numerical substitution, result, and interpretation. Values are illustrative analytical exercises.

Example 01. Born probability

Definitions & inputs. State 0.8|0⟩+0.6|1⟩.

  1. Choose the governing model and isolate the requested quantity.

    P(1)=∣β∣2P(1)=|\beta|^2
  2. Insert the stated inputs in consistent units or the explicitly defined normalized units.

    P(1)=0.62P(1)=0.6^2
  3. Evaluate the expression; the result uses the units shown.

    Result=0.36 \mathrm{Result}=0.36\

Interpretation. The two probabilities sum to one.

↑ Return to definitions and contents
Example 02. Hadamard outcome

Definitions & inputs. Input |0⟩, apply H, measure Z.

  1. Choose the governing model and isolate the requested quantity.

    H∣0⟩=(∣0⟩+∣1⟩)/2; P(1)=1/2H|0\rangle=(|0\rangle+|1\rangle)/\sqrt2;\ P(1)=1/2
  2. Insert the stated inputs in consistent units or the explicitly defined normalized units.

    P(1)=∣1/2∣2P(1)=|1/\sqrt2|^2
  3. Evaluate the expression; the result uses the units shown.

    Result=0.5 \mathrm{Result}=0.5\

Interpretation. Equal amplitudes give equal probabilities.

↑ Return to definitions and contents
Example 03. Y rotation

Definitions & inputs. Apply Ry(π/3) to |0⟩.

  1. Choose the governing model and isolate the requested quantity.

    P(1)=sin⁡2(θ/2)P(1)=\sin^2(\theta/2)
  2. Insert the stated inputs in consistent units or the explicitly defined normalized units.

    P(1)=sin⁡2(π/6)P(1)=\sin^2(\pi/6)
  3. Evaluate the expression; the result uses the units shown.

    Result=0.25 \mathrm{Result}=0.25\

Interpretation. Rotation angle is twice the amplitude angle.

↑ Return to definitions and contents
Example 04. Relative phase becomes probability

Definitions & inputs. State (|0⟩+exp(iπ/3)|1⟩)/√2, then H.

  1. Choose the governing model and isolate the requested quantity.

    P(0)=(1+cos⁡ϕ)/2P(0)=(1+\cos\phi)/2
  2. Insert the stated inputs in consistent units or the explicitly defined normalized units.

    P(0)=(1+cos⁡(π/3))/2P(0)=(1+\cos(\pi/3))/2
  3. Evaluate the expression; the result uses the units shown.

    Result=0.75 \mathrm{Result}=0.75\

Interpretation. The second Hadamard converts relative phase into a population difference.

↑ Return to definitions and contents
Example 05. Bell-state joint outcome

Definitions & inputs. State (|00⟩+|11⟩)/√2.

  1. Choose the governing model and isolate the requested quantity.

    P(11)=∣1/2∣2P(11)=|1/\sqrt2|^2
  2. Insert the stated inputs in consistent units or the explicitly defined normalized units.

    P(11)=1/2P(11)=1/2
  3. Evaluate the expression; the result uses the units shown.

    Result=0.5 \mathrm{Result}=0.5\

Interpretation. Outcomes 01 and 10 have zero probability.

↑ Return to definitions and contents
Example 06. Bell correlation

Definitions & inputs. Same Bell state; eigenvalues Z are ±1.

  1. Choose the governing model and isolate the requested quantity.

    ⟨Z⊗Z⟩=P00+P11−P01−P10\langle Z\otimes Z\rangle=P_{00}+P_{11}-P_{01}-P_{10}
  2. Insert the stated inputs in consistent units or the explicitly defined normalized units.

    1/2+1/2−0−01/2+1/2-0-0
  3. Evaluate the expression; the result uses the units shown.

    Result=1 \mathrm{Result}=1\

Interpretation. Individual results are random but the product is always +1.

↑ Return to definitions and contents
Example 07. Mixed-state purity

Definitions & inputs. ρ=diag(0.7,0.3).

  1. Choose the governing model and isolate the requested quantity.

    Tr⁡(ρ2)=0.72+0.32\operatorname{Tr}(\rho^2)=0.7^2+0.3^2
  2. Insert the stated inputs in consistent units or the explicitly defined normalized units.

    0.49+0.090.49+0.09
  3. Evaluate the expression; the result uses the units shown.

    Result=0.58 \mathrm{Result}=0.58\

Interpretation. Purity below one indicates a mixed state.

↑ Return to definitions and contents
Example 08. Maximally mixed entropy

Definitions & inputs. ρ=I/2; base-two logarithms.

  1. Choose the governing model and isolate the requested quantity.

    S=−Tr⁡(ρlog⁡2ρ)S=-\operatorname{Tr}(\rho\log_2\rho)
  2. Insert the stated inputs in consistent units or the explicitly defined normalized units.

    S=−2(1/2)log⁡2(1/2)S=-2(1/2)\log_2(1/2)
  3. Evaluate the expression; the result uses the units shown.

    Result=1 bit\mathrm{Result}=1\ {\rm bit}

Interpretation. A pure Bell pair has mixed one-qubit reductions.

↑ Return to definitions and contents
Example 09. Ideal CHSH value

Definitions & inputs. Maximally entangled pair and optimal measurement axes.

  1. Choose the governing model and isolate the requested quantity.

    SCHSH=22S_{\rm CHSH}=2\sqrt2
  2. Insert the stated inputs in consistent units or the explicitly defined normalized units.

    222\sqrt2
  3. Evaluate the expression; the result uses the units shown.

    Result=2.828427 \mathrm{Result}=2.828427\

Interpretation. This exceeds the local-hidden-variable bound two.

↑ Return to definitions and contents
Example 10. Grover with four items

Definitions & inputs. N=4, one marked item, r=1.

  1. Choose the governing model and isolate the requested quantity.

    P=sin⁡2[(2r+1)arcsin⁡(1/N)]P=\sin^2[(2r+1)\arcsin(1/\sqrt N)]
  2. Insert the stated inputs in consistent units or the explicitly defined normalized units.

    P=sin⁡2(3π/6)P=\sin^2(3\pi/6)
  3. Evaluate the expression; the result uses the units shown.

    Result=1 \mathrm{Result}=1\

Interpretation. One ideal iteration succeeds with certainty for this special size.

↑ Return to definitions and contents
Example 11. Four-point Fourier measurement

Definitions & inputs. Apply QFT4 to |1⟩ and measure in the computational basis.

  1. Choose the governing model and isolate the requested quantity.

    P(k)=∣e2πik/4/2∣2P(k)=|e^{2\pi ik/4}/2|^2
  2. Insert the stated inputs in consistent units or the explicitly defined normalized units.

    P(k)=1/4P(k)=1/4
  3. Evaluate the expression; the result uses the units shown.

    Result=0.25 \mathrm{Result}=0.25\

Interpretation. The output phases differ although all four outcome probabilities match.

↑ Return to definitions and contents
Example 12. Exact phase-estimation integer

Definitions & inputs. φ=3/8, m=3 phase qubits, eigenstate input.

  1. Choose the governing model and isolate the requested quantity.

    k=2mϕk=2^m\phi
  2. Insert the stated inputs in consistent units or the explicitly defined normalized units.

    k=8(3/8)k=8(3/8)
  3. Evaluate the expression; the result uses the units shown.

    Result=3 \mathrm{Result}=3\

Interpretation. The logical bit string is 011 in most-significant-bit-first notation.

↑ Return to definitions and contents
Example 13. Shot uncertainty

Definitions & inputs. p=0.5, nshots=1000.

  1. Choose the governing model and isolate the requested quantity.

    σp^=p(1−p)/n\sigma_{\hat p}=\sqrt{p(1-p)/n}
  2. Insert the stated inputs in consistent units or the explicitly defined normalized units.

    0.25/1000\sqrt{0.25/1000}
  3. Evaluate the expression; the result uses the units shown.

    Result=0.01581139 \mathrm{Result}=0.01581139\

Interpretation. About 0.0158 is a one-standard-deviation sampling uncertainty.

↑ Return to definitions and contents
Example 14. Required shots

Definitions & inputs. Worst-case p=0.5; target standard deviation 0.01.

  1. Choose the governing model and isolate the requested quantity.

    n≥p(1−p)/σ2n\geq p(1-p)/\sigma^2
  2. Insert the stated inputs in consistent units or the explicitly defined normalized units.

    n≥0.25/0.012n\geq0.25/0.01^2
  3. Evaluate the expression; the result uses the units shown.

    Result=2500 \mathrm{Result}=2500\

Interpretation. This is a standard-deviation target, not a confidence interval guarantee.

↑ Return to definitions and contents
Example 15. Relaxation survival

Definitions & inputs. Start in |1⟩; t=20 µs, T1=100 µs.

  1. Choose the governing model and isolate the requested quantity.

    P1=e−t/T1P_1=e^{-t/T_1}
  2. Insert the stated inputs in consistent units or the explicitly defined normalized units.

    e−20/100e^{-20/100}
  3. Evaluate the expression; the result uses the units shown.

    Result=0.8187308 \mathrm{Result}=0.8187308\

Interpretation. Population decays toward the ground state.

↑ Return to definitions and contents
Example 16. Pure-dephasing time

Definitions & inputs. T1=100 µs, T2=80 µs.

  1. Choose the governing model and isolate the requested quantity.

    Tϕ=[1/T2−1/(2T1)]−1T_\phi=[1/T_2-1/(2T_1)]^{-1}
  2. Insert the stated inputs in consistent units or the explicitly defined normalized units.

    Tϕ=[1/80−1/200]−1T_\phi=[1/80-1/200]^{-1}
  3. Evaluate the expression; the result uses the units shown.

    Result=133.3333 μs\mathrm{Result}=133.3333\ {\rm \mu s}

Interpretation. This separates relaxation-limited coherence from pure dephasing.

↑ Return to definitions and contents
Example 17. Dephased plus-state readout

Definitions & inputs. Initial |+⟩; t/T2=1; measure in X basis.

  1. Choose the governing model and isolate the requested quantity.

    P(+)=12(1+e−t/T2)P(+)=\tfrac12(1+e^{-t/T_2})
  2. Insert the stated inputs in consistent units or the explicitly defined normalized units.

    P(+)=12(1+e−1)P(+)=\tfrac12(1+e^{-1})
  3. Evaluate the expression; the result uses the units shown.

    Result=0.6839397 \mathrm{Result}=0.6839397\

Interpretation. Loss of coherence moves X outcomes toward one half.

↑ Return to definitions and contents
Example 18. Independent gate-success estimate

Definitions & inputs. 100 gates, independent stochastic failure p=0.001 per gate.

  1. Choose the governing model and isolate the requested quantity.

    Pno error=(1−p)100P_{\rm no\ error}=(1-p)^{100}
  2. Insert the stated inputs in consistent units or the explicitly defined normalized units.

    0.9991000.999^{100}
  3. Evaluate the expression; the result uses the units shown.

    Result=0.9047921 \mathrm{Result}=0.9047921\

Interpretation. This is a no-error-event probability, not a general circuit fidelity.

↑ Return to definitions and contents
Example 19. Three-bit repetition failure

Definitions & inputs. Independent bit flips p=0.01; majority decoding.

  1. Choose the governing model and isolate the requested quantity.

    PL=3p2(1−p)+p3P_L=3p^2(1-p)+p^3
  2. Insert the stated inputs in consistent units or the explicitly defined normalized units.

    3(0.01)2(0.99)+(0.01)33(0.01)^2(0.99)+(0.01)^3
  3. Evaluate the expression; the result uses the units shown.

    Result=0.000298 \mathrm{Result}=0.000298\

Interpretation. Two or more flips defeat this decoder; phase errors are not corrected.

↑ Return to definitions and contents
Example 20. Statevector memory

Definitions & inputs. n=30 qubits; 16 bytes per complex amplitude.

  1. Choose the governing model and isolate the requested quantity.

    B=16 2nB=16\,2^n
  2. Insert the stated inputs in consistent units or the explicitly defined normalized units.

    B=16 230B=16\,2^{30}
  3. Evaluate the expression; the result uses the units shown.

    Result=1.717987×1010 bytes\mathrm{Result}=1.717987\times10^{10}\ {\rm bytes}

Interpretation. This is 16 GiB for amplitudes alone, before simulator overhead.

↑ Return to definitions and contents

Symbols and units

Each derivation and problem defines its own symbols and inputs. Symbols may be reused with different meanings in other subjects. Keep units consistent, retain sufficient precision during calculation, and apply the stated validity limits.