QVM v0.4.0
[GitHub]
Docs/Noise and Hardware Profiles

๐ŸŒก๏ธ Quantum Noise and Hardware Profiles

Physical quantum computers suffer from decoherence and gate errors. The QVM provides a noise simulation system in noise.py, modeling physical noise channels using Kraus operators and stochastic trajectories.


๐Ÿ“ Mathematical Model: Kraus Channels and Trajectories

Quantum noise is mathematically described using open quantum system dynamics. A noise channel mapping an density matrix ฯ\rho is defined by a set of Kraus operators {Ki}\{K_i\} satisfying the completeness relation: ฯโ†’โˆ‘iKiฯKiโ€ ,withโˆ‘iKiโ€ Ki=I\rho \to \sum_i K_i \rho K_i^\dagger, \quad \text{with} \quad \sum_i K_i^\dagger K_i = I

The Stochastic Trajectory Method (Monte Carlo)

To simulate noise efficiently on statevectors without converting to density matrices (which would scale as O(4N)O(4^N)), QVM uses the stochastic trajectory method:

  1. When a noisy gate is applied, the simulator computes the probability pip_i of each Kraus operator KiK_i occurring on the current state โˆฃฯˆโŸฉ|\psi\rangle: pi=โˆฅKiโˆฃฯˆโŸฉโˆฅ2=โŸจฯˆโˆฃKiโ€ KiโˆฃฯˆโŸฉp_i = \| K_i |\psi\rangle \|^2 = \langle\psi| K_i^\dagger K_i |\psi\rangle
  2. Samples a single Kraus operator KjK_j based on these probabilities {pi}\{p_i\}.
  3. Applies the sampled operator and re-normalizes the statevector: โˆฃฯˆnewโŸฉ=KjโˆฃฯˆโŸฉpj|\psi_{\text{new}}\rangle = \frac{K_j |\psi\rangle}{\sqrt{p_j}}

This reproduces the density matrix statistics when averaged over many shots, while keeping simulation scaling at O(2N)O(2^N).


๐Ÿงช Supported Noise Channels

1. Depolarizing Noise

Replaces the qubit state with a maximally mixed state with probability pp.

  • Single-Qubit Kraus Operators: K0=1โˆ’3p4I,K1=p4X,K2=p4Y,K3=p4ZK_0 = \sqrt{1 - \frac{3p}{4}} I, \quad K_1 = \sqrt{\frac{p}{4}} X, \quad K_2 = \sqrt{\frac{p}{4}} Y, \quad K_3 = \sqrt{\frac{p}{4}} Z
  • Two-Qubit Kraus Operators: Scales the 1616 two-qubit tensor product combinations of Pauli operators: K0=1โˆ’15p16II,Kk=p16PaโŠ—Pb(Pa,Pbโˆˆ{I,X,Y,Z})K_0 = \sqrt{1 - \frac{15p}{16}} II, \quad K_k = \sqrt{\frac{p}{16}} P_a \otimes P_b \quad (P_a, P_b \in \{I, X, Y, Z\})

2. Amplitude Damping (T1 Decay)

Models energy relaxation (spontaneous emission) where state โˆฃ1โŸฉ|1\rangle decays to state โˆฃ0โŸฉ|0\rangle with probability ฮณ\gamma: K0=(1001โˆ’ฮณ),K1=(0ฮณ00)K_0 = \begin{pmatrix} 1 & 0 \\ 0 & \sqrt{1 - \gamma} \end{pmatrix}, \quad K_1 = \begin{pmatrix} 0 & \sqrt{\gamma} \\ 0 & 0 \end{pmatrix}


3. Phase Damping (T2 Dephasing)

Models pure dephasing (loss of phase coherence without energy loss) with probability ฮณ\gamma: K0=(1001โˆ’ฮณ),K1=(000ฮณ)K_0 = \begin{pmatrix} 1 & 0 \\ 0 & \sqrt{1 - \gamma} \end{pmatrix}, \quad K_1 = \begin{pmatrix} 0 & 0 \\ 0 & \sqrt{\gamma} \end{pmatrix}


4. Thermal Relaxation

Combines T1T_1 relaxation and T2T_2 dephasing over a specific gate duration tgt_g.

  • Decay Probabilities: pamplitude=1โˆ’eโˆ’tg/T1,pphase=1โˆ’eโˆ’tg/T2p_{\text{amplitude}} = 1 - e^{-t_g / T_1}, \quad p_{\text{phase}} = 1 - e^{-t_g / T_2}
  • Residual Phase Calculation: To combine these channels, the simulator computes a residual phase damping probability to account for dephasing already caused by the amplitude damping: pphase_residual=maxโก(0,1โˆ’1โˆ’pphase1โˆ’pamplitude)p_{\text{phase\_residual}} = \max\left(0, 1 - \frac{1 - p_{\text{phase}}}{\sqrt{1 - p_{\text{amplitude}}}}\right)
  • Kraus Operators: Built by composing the amplitude damping and residual phase damping operators, resulting in 44 combined Kraus operators.

๐Ÿ“Š Readout Error Models (Confusion Matrix)

Readout error models the probability of classical measurement bits flipping. It is defined using a 2ร—22 \times 2 confusion matrix MM: Mij=P(measureย jโˆฃtrueย stateย isย i)M_{ij} = P(\text{measure } j \mid \text{true state is } i) M=(P(0โˆฃ0)P(1โˆฃ0)P(0โˆฃ1)P(1โˆฃ1))M = \begin{pmatrix} P(0|0) & P(1|0) \\ P(0|1) & P(1|1) \end{pmatrix}

During measurement sampling, the simulator evaluates the true state of each qubit and stochastically flips the output bit based on the confusion matrix:

python
true_bit = int(bits_list[i])
# Sample from confusion matrix row
flip_prob = cm[true_bit, 1 - true_bit]
if rng.random() < flip_prob:
    bits_list[i] = str(1 - true_bit)

๐Ÿ–ฅ๏ธ Predefined Device Profiles

The DeviceBackend class loads calibration data (T1, T2, gate times, single/two-qubit gate errors, and readout errors) to generate realistic noise models:

  • fake_5q_device() (IBM Manila):
    • 55 qubits in a linear chain: 0โˆ’1โˆ’2โˆ’3โˆ’40-1-2-3-4.
    • T1โ‰ˆ100โ€‰ฮผsT_1 \approx 100\,\mu\text{s}, T2โ‰ˆ80โ€‰ฮผsT_2 \approx 80\,\mu\text{s}.
    • Gate errors: 0.1%0.1\% for single-qubit gates, 1%1\% for CNOTs.
    • Readout errors: โ‰ˆ2%\approx 2\%.
  • fake_7q_device() (IBM Lagos):
    • 77 qubits in a T-shape.
    • T1โ‰ˆ100โ€‰ฮผsT_1 \approx 100\,\mu\text{s}, T2โ‰ˆ80โ€‰ฮผsT_2 \approx 80\,\mu\text{s}.
    • Gate errors: 0.08%0.08\% for single-qubit gates, 1.2%1.2\% for CNOTs.
  • ideal(): Zero-noise baseline for testing.