Noise Models - Noro-Official/OQS GitHub Wiki
Noise Models in OpenQStack
Quantum information is fragile—errors arise from interaction with the environment, imperfect gates, measurement collapse, and more.
OpenQStack provides a modular framework to simulate these effects with realistic, customizable quantum noise channels.
Built-In Error Channels
Bit-Flip Channel
Simulates a random Pauli-X error on a single qubit.
from openqstack.qec import BitFlipChannel
channel = BitFlipChannel(p=0.1, n_qubits=3, target_qubit=1)
noisy_state = channel(state)
Phase-Flip Channel
Simulates a Z error with probability p
.
from openqstack.qec import PhaseFlipChannel
Depolarizing Channel
Applies X, Y, or Z randomly with equal probability (total probability p
):
from openqstack.qec import DepolarizingChannel
Channel API
All noise channels are subclasses of ErrorChannel
and support:
apply(state, mode="stochastic")
— default: single-shot Kraus samplingapply(state, mode="average")
— applies the full density matrix evolution
You can also pass channels as callable functions:
state = channel(state, mode="average")
Custom Channels
You can define your own noise model by subclassing ErrorChannel
:
class MyCustomNoise(ErrorChannel):
def kraus_operators(self):
# Return list of (K_i, p_i) pairs
return [...]
Examples include:
- Amplitude damping
- Correlated noise
- Crosstalk
- Leakage or dephasing
Testing Noise Effects
Try modifying openq_blink.py
to inject different noise models and compare logical error rates after recovery.
You can also visualize impact with:
from openqstack.visualize import plot_bloch
plot_bloch(decoded)
Coming Soon
- Multi-qubit entangled noise
- Circuit-level error insertion
- Benchmarking with QECBench
- Visualization of noise map evolution