erado.models¶
Provides the underlying erasure simulation models.
Attributes¶
Per-shot callback function type. |
|
Circuit instructions recognised as supported state snapshots. |
|
Circuit instructions which are never involved in erasure events. |
Classes¶
Data structure representing the observed state of a quantum circuit. |
|
Protocol representing an erasure circuit simulation model. |
|
Data structure of per-shot information provided to callbacks. |
|
Transpiler pass implementing erasable qubits. |
|
Utility class to run |
|
Custom simulation wrapper implementing erasure noise on arbitrary circuits. |
Functions¶
|
Filter a state counter to only non-erased states. |
|
Return the index of the sole/first qubit in a qreg of a given name. |
|
Add an erasure noise model to an |
Package Contents¶
- erado.models.postselect_counts(counts: collections.Counter[CircuitState]) collections.Counter[str]¶
Filter a state counter to only non-erased states.
- Parameters:
counts (collections.Counter[CircuitState]) –
CircuitStatecounter.- Returns:
Counter of non-erased measurement states.
- Return type:
- erado.models.SNAPSHOT_GATES = ['save_statevector', 'save_density_matrix']¶
Circuit instructions recognised as supported state snapshots.
- erado.models.EXEMPT_GATES = ['barrier', 'measure', 'save_statevector', 'save_density_matrix']¶
Circuit instructions which are never involved in erasure events.
- erado.models.get_qubit_by_name(qc: qiskit.circuit.QuantumCircuit, name: str) int¶
Return the index of the sole/first qubit in a qreg of a given name.
- Parameters:
qc (qiskit.circuit.QuantumCircuit) – Qiskit circuit.
name (str) – Quantum register name.
- Raises:
ValueError – If no qreg could be found with the given name.
- Returns:
Qubit index.
- Return type:
- erado.models.add_erasure_noise(noise_model: qiskit_aer.noise.NoiseModel, qc: qiskit.circuit.QuantumCircuit, erasure_rate: float) None¶
Add an erasure noise model to an
ErasurePasscircuit.This model populates erasure events via Pauli noise on the
ErasurePass.ERASER_QREG_NAMEancilla.One should avoid using
add_all_qubit_quantum_error()in other error modes in the model, so as not to introduce additional noise on this ancilla. Instead, prefer to use meth:add_quantum_error on explicit qubits, via a loop or otherwise.See
example_ErasurePassfor example usage.- Parameters:
noise_model (qiskit_aer.noise.NoiseModel) – Preexisting Qiskit Aer noise model.
qc (qiskit.circuit.QuantumCircuit) – Qiskit circuit (must have had
ErasurePassapplied).erasure_rate (float) – Uniform erasure rate.
- Return type:
None