localuf.noise.main¶
Classes for noise models.
Classes
|
Circuit-level depolarizing noise model. |
|
Code capacity noise model. |
|
Abstract base class for noise models. |
|
Phenomenological noise model. |
- class localuf.noise.main.Noise[source]¶
Bases:
ABCAbstract base class for noise models.
- abstract property ALL_WEIGHTS: Iterable[int] | tuple[tuple[int, ...], ...]¶
All possible
force_errorinputs.
- abstract property ALL_WEIGHTS_INDEX: Index¶
ALL_WEIGHTSas pandas Index.
- abstractmethod make_error(noise_level)[source]¶
See
Code.make_error.- Parameters:
noise_level (float)
- Return type:
set[tuple[tuple[int, …], tuple[int, …]]]
- abstractmethod force_error(weight)[source]¶
Make error of weight
weight.- Parameters:
weight (int | tuple[int, ...])
- Return type:
set[tuple[tuple[int, …], tuple[int, …]]]
- abstractmethod subset_probability(weights, noise_level)[source]¶
Return probability of any error of weight
weight, forweightinweights.- Parameters:
weights (Iterable[int] | tuple[tuple[int, ...], ...])
noise_level (float)
- Return type:
Iterable[float]
- subset_probabilities(noise_level, survival=True)[source]¶
Return DataFrame containing probabilities of each subset.
- Parameters:
noise_level (float) – noise level.
survival (bool) – whether to compute survival probability column.
- Returns:
DataFrame indexed by subset weight, with columns
['subset prob', 'survival prob'].
- abstractmethod get_edge_weights(noise_level)[source]¶
Return map from edge to its flip probability and weight.
- Parameters:
noise_level (None | float) – a probability that represents the noise strength. This defines the nonuniform edge weights of the decoding graph in the circuit-level noise model. If not specified, all edges have flip probability 0 and weight 1.
- Return edge_weights:
A map from each edge in the decoding window to the pair (flip probability, weight).
- Return type:
dict[tuple[tuple[int, …], tuple[int, …]], tuple[float, float]]
- class localuf.noise.main.CodeCapacity(fresh_edges, all_edges=None)[source]¶
Bases:
_UniformCode capacity noise model.
Extends
_Uniform.- Parameters:
fresh_edges (tuple[tuple[tuple[int, ...], tuple[int, ...]], ...])
all_edges (None | tuple[tuple[tuple[int, ...], tuple[int, ...]], ...])
- class localuf.noise.main.Phenomenological(fresh_edges, all_edges=None)[source]¶
Bases:
_UniformPhenomenological noise model.
Extends
_Uniform.- Parameters:
fresh_edges (tuple[tuple[tuple[int, ...], tuple[int, ...]], ...])
all_edges (None | tuple[tuple[tuple[int, ...], tuple[int, ...]], ...])
- class localuf.noise.main.CircuitLevel(fresh_edge_dict, parametrization, demolition, monolingual, fresh_merges=None, force_by='pair', all_edge_dict=None, all_merges=None)[source]¶
Bases:
NoiseCircuit-level depolarizing noise model.
- Parameters:
fresh_edge_dict (dict[Literal['S', 'E westmost', 'E bulk', 'E eastmost', 'U 3', 'U 4', 'SD', 'EU west corners', 'EU east corners', 'EU edge', 'EU centre', 'SEU'], tuple[tuple[tuple[int, ...], tuple[int, ...]], ...]])
parametrization (Literal['standard', 'balanced', 'ion trap'])
demolition (bool)
monolingual (bool)
fresh_merges (dict[tuple[tuple[int, ...], tuple[int, ...]], tuple[tuple[int, ...], tuple[int, ...]]] | None)
force_by (Literal['pair', 'edge'])
all_edge_dict (None | dict[Literal['S', 'E westmost', 'E bulk', 'E eastmost', 'U 3', 'U 4', 'SD', 'EU west corners', 'EU east corners', 'EU edge', 'EU centre', 'SEU'], tuple[tuple[tuple[int, ...], tuple[int, ...]], ...]])
all_merges (None | dict[tuple[tuple[int, ...], tuple[int, ...]], tuple[tuple[int, ...], tuple[int, ...]]])
- property ALL_WEIGHTS¶
All possible
force_errorinputs.
- property ALL_WEIGHTS_INDEX¶
ALL_WEIGHTSas pandas Index.
- subset_probability(weights, noise_level)[source]¶
Return probability of any error of weight
weight, forweightinweights.- Parameters:
weights (tuple[tuple[int, ...], ...])
noise_level (float)
- get_edge_weights(noise_level)[source]¶
Return map from edge to its flip probability and weight.
- Parameters:
noise_level (None | float) – a probability that represents the noise strength. This defines the nonuniform edge weights of the decoding graph in the circuit-level noise model. If not specified, all edges have flip probability 0 and weight 1.
- Return edge_weights:
A map from each edge in the decoding window to the pair (flip probability, weight).