Noise models (qiskit_paulice.noise_models)¶
Noise model specification for evaluating spacetime Pauli checks.
- class NoiseModel(gate_noise=None, readout_noise=None, idling_noise=None)[source]¶
Bases:
objectNoise model used to find optimal circuit locations for spacetime Pauli checks.
- classmethod from_backend(backend, layout, uniform_gate_noise=False, pauli_bases=None)[source]¶
Instantiate a
NoiseModelfrom backend calibration data.Edge keys in the resulting
GateWiseNoisedict use virtual qubit indices (positions inlayout). If the input circuit has a layout that maps virtual to physical consistently withlayout, the keys also serve as physical indices.idling_noiseis alwaysNonefrom this method; ifbackendlacks readout calibration,readout_noisewill also beNone.- Parameters:
backend (BackendV2) – A backend containing two-qubit gate error probabilities for each coupling map edge as well as readout error information for each qubit in the layout.
layout (Sequence[int]) – Physical qubit indices on the backend to include in the noise model. The order defines the virtual qubit indexing (virtual qubit 0 maps to
layout[0], etc.).uniform_gate_noise (bool) – If
True, thegate_noisefield in the outputNoiseModelwill be aUniformGateNoiseand the error probability is assumed to be distributed uniformly among the15non-identity Pauli bases to form a uniform depolarizing channel which will affect all entangling gates equally. IfFalse,gate_noisewill be aGateWiseNoiseinstance where each edge is associated with a custom noise channel based on backend calibration data.pauli_bases (Sequence[str] | None) – For
GateWiseNoisemodels,pauli_basesare the bases over which the error probability reported from the backend will be distributed. Each basis is a 2-character Pauli string paired left-to-right with the edge tuple, so"XZ"on edge(a, b)placesXonaandZonb. The default behavior is to use the full 2Q Pauli basis excluding"II". ForUniformNoise, the full basis is assumed, and this argument is ignored.
- Returns:
A
NoiseModelinstance containing gate and readout noise derived from backend calibration data.- Raises:
ValueError – Backend is missing calibration data or layout contains invalid qubit indices.
- Return type:
- classmethod from_pauli_lindblad_maps(layer_noise, readout_noise=None)[source]¶
Create a NoiseModel from Pauli-Lindblad maps.
This method constructs a
NoiseModelfromPauliLindbladMapinstances that represent noise channels affecting gates and, optionally, measurements. Gate noise is specified with thelayer_noiseargument. EachPauliLindbladMapinstance is assumed to act on a unique layer of entangling gates. Readout noise is specified by a singlePauliLindbladMapcontaining single-qubit Pauli-X generators and their associated rates.- Parameters:
layer_noise (Sequence[PauliLindbladMap]) – A sequence of
PauliLindbladMapobjects, where each map represents the noise channel for one unique entangling layer in the circuit.readout_noise (PauliLindbladMap | None) – Optional
PauliLindbladMapcontaining Pauli X generators on each qubit for readout errors.
- Returns:
A
NoiseModelinstance reflecting the noise model(s) defined in the inputPauliLindbladMap``s. ``idling_noisewill always beNonefor this method.- Raises:
ValueError – Weight of error generator greater than
2.ValueError – Readout error generator is not Pauli-X.
- Return type:
- gate_noise: GateNoise | None = None¶
Errors that occur during 2-qubit gate operations. Can be:
UniformNoise: Same error probability for all gates. The error probability is equally distributed to each Pauli basis represented in the channel.LayeredNoise: Pauli-Lindblad noise channel per unique entangling layerGateWiseNoise: Pauli-Lindblad noise channel per unique entangling edge
- UniformGateNoise = <class 'float'>¶
A depolarizing probability applied uniformly to all 2-qubit gates.
This probability will be equally distributed among the
15non-identity Paulis in the 2-qubit Pauli basis to form the depolarizing channel. This noise channel will be applied after each entangling gate.
- LayeredGateNoise¶
Layered noise model mapping unique entangling layers to Pauli error generators.
Note
The Pauli-Lindblad error associated with each entangling layer is assumed to be defined before the gates in the layer.
Keys are tuples of qubit index pairs (edges) defining a layer. Values are lists of
(pauli, rate)tuples wherepauliis a Pauli or Pauli string defined over all qubits andrateis the associated error rate.alias of
dict[tuple[tuple[int,int], …],list[tuple[Pauli|str,float]]]
- GateWiseNoise¶
Gate-wise noise model mapping qubit pairs to a Pauli noise channel.
Keys are tuples of qubit index pairs representing edges. Values are lists of (pauli, rate) tuples where
pauliis a 2-character Pauli string andrateis the associated error rate. The string is paired left-to-right with the edge tuple — matchingPauliLindbladMap’s sparse form(pauli_str, indices): for edge(a, b),"XZ"placesXonaandZonb.
- GateNoise = float | dict[tuple[tuple[int, int], ...], list[tuple[qiskit.quantum_info.operators.symplectic.pauli.Pauli | str, float]]] | dict[tuple[int, int], list[tuple[str, float]]]¶
Gate noise can be uniform (float), layered (dict), or gate-wise (dict).