Checked circuit
qiskit_paulice.checked_circuit
A class for specifying a circuit containing coherent spacetime Pauli checks.
CheckedCircuit
class CheckedCircuit(circuit, target_qubits=(), check_qubits=(), check_support=(), cost=None, cost_metric=None)
Bases: object
A quantum circuit and information about spacetime Pauli checks it contains.
Parameters
- circuit (QuantumCircuit)
- target_qubits (tuple[int, ...])
- check_qubits (tuple[int, ...])
- check_support (tuple[tuple[int, ...], ...])
- cost (float | None)
- cost_metric (str | None)
circuit
A quantum circuit containing 0 or more spacetime Pauli checks.
Type
target_qubits
Qubit indices of circuit which were used to entangle the check qubits to the payload. None if circuit contains no checks.
Type
check_qubits
Qubit indices of the ancilla qubits in circuit. The i``th check uses ``check_qubits[i] to detect errors on target_qubits[i] and other qubits in check_support[i].
Type
check_support
For each check, the qubit indices whose measurement outcomes XOR together to give that check’s syndrome bit.
Type
cost
cost_metric
get_postselection_method
get_postselection_method()
Return a function that maps a single shot’s outcome to a syndrome vector.
No errors were detected iff every entry of the returned vector is zero. The returned function accepts either bitstrings or bit arrays.
Return type
uncovered_paulis
Type: tuple[UncoveredPauli, ...]
Locations where a single qubit Pauli error is undetectable by some checks.
Each entry is an UncoveredPauli(qubit, after_instruction, pauli) triple, where qubit is the qubit of the single-qubit error, after_instruction is the circuit.data index of the instruction which immediately precedes the error, and pauli is the type of error ("X", "Y", or "Z").
Only locations on input wires and immediately after 2-qubit gates are enumerated; errors after single qubit gates are folded into the next 2-qubit-gate wire.
UncoveredPauli
class UncoveredPauli(qubit, after_instruction, pauli)
Bases: NamedTuple
A spacetime location at which a single qubit Pauli error is undetectable by a set of checks.
Parameters
qubit
after_instruction
Index (into circuit.data) of the instruction the error occurs after; None means the error sits on the qubit’s input wire.
Type
int | None
pauli
The undetected Pauli error ("X", "Y", or "Z")
Type
Literal[‘X’, ‘Y’, ‘Z’]
Create new instance of UncoveredPauli(qubit, after_instruction, pauli)
count
count(value, /)
Return number of occurrences of value.
index
index(value, start=0, stop=9223372036854775807, /)
Return first index of value.
Raises ValueError if the value is not present.