propaq.noise¶
Noise models.
See the noise guide.
noise
¶
propaq noise models.
Classes:
| Name | Description |
|---|---|
UniformNoiseModel |
Exponential damping noise: each term of weight w is scaled by \(\exp(-\gamma w)\), |
GateNoiseModel |
A custom Python noise model. |
NativeNoiseModel |
Rust/C/AOT-compiled Julia noise model class. |
UniformNoiseModel
¶
Bases: UniformNoiseModel
Exponential damping noise: each term of weight w is scaled by \(\exp(-\gamma w)\), where \(w\) is the term's Pauli weight.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
damping
|
Per-weight damping rate \(\gamma\). Each term is multiplied by \(\exp(-\gamma w)\). |
required |
Methods:
| Name | Description |
|---|---|
apply_noise |
Apply uniform damping to all terms in term_sum in-place. |
damping_factor |
Return \(\exp(-\gamma w)\): the multiplicative factor applied to a term's coefficient. |
Attributes:
| Name | Type | Description |
|---|---|---|
damping |
float
|
|
apply_noise
method descriptor
¶
Apply uniform damping to all terms in term_sum in-place.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
term_sum
|
Any
|
A MajoranaTermSum or PauliTermSum to damp in-place. |
required |
damping_factor
method descriptor
¶
Return \(\exp(-\gamma w)\): the multiplicative factor applied to a term's coefficient.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
term_weight
|
int
|
Pauli weight of the term. |
required |
active_modes
|
int
|
Unused for uniform noise; present for API compatibility. |
required |
GateNoiseModel
¶
Bases: GateNoiseModel
A custom Python noise model.
Subclass this and define damping_factor or damping_factor_term
directly. See
NoiseModel for the two hook methods and
the noise guide for worked
examples of both.
NativeNoiseModel
¶
Bases: NativeNoiseModel
Rust/C/AOT-compiled Julia noise model class.
A plugin declares what it reads through propaq_noise_depends.
- 0 is a function of term weight alone, so it is collapsed to one table indexed by weight before propagation starts and never called again.
- 2 (
PROPAQ_DEPENDS_LAYER) also reads the circuit position. It keeps the tabulated fast path, but the table is rebuilt at each layer boundary. - 1 (
PROPAQ_DEPENDS_KEY) reads each term's raw basis-string words, necessary for structure-aware noise models.
The bits combine. See examples/plugins/README.md for the ABI and the
example plugins.
Methods:
| Name | Description |
|---|---|
factor_term |
Delegate to the plugin's |
Attributes:
| Name | Type | Description |
|---|---|---|
abi_version |
int
|
The ABI version the loaded plugin declared. |
depends |
int
|
The dependency bitmask the plugin declared: 1 = reads the term's key, |
depends
property
¶
The dependency bitmask the plugin declared: 1 = reads the term's key, 2 = reads the layer index. 0 means a function of weight alone.
factor_term
method descriptor
¶
factor_term(basis_kind: int, words: Sequence[int], n_units: int, weight: int, layer_index: int = 0, n_layers: int = 0) -> float
Delegate to the plugin's propaq_noise_factor.
Exposed so a plugin can be exercised from Python without running a circuit; propagation calls the same entry point directly from the pool.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
basis_kind
|
int
|
0 for Pauli, 1 for Majorana. |
required |
words
|
Sequence[int]
|
The term's raw basis-string words, two bits per unit. Ignored (and passed as NULL) unless the plugin declared it reads keys. |
required |
n_units
|
int
|
Qubits (Pauli) or modes (Majorana) of the register. |
required |
weight
|
int
|
The term's weight. |
required |
layer_index
|
int
|
Zero-based circuit layer. |
0
|
n_layers
|
int
|
Layers in the circuit. |
0
|
Base class¶
NoiseModel
¶
Bases: ABC
Interface reference for a custom Python noise model.