Checked circuit (qiskit_paulice.checked_circuit)¶
A class for specifying a circuit containing coherent spacetime Pauli checks.
- class CheckedCircuit(circuit, target_qubits=(), check_qubits=(), check_support=(), cost=None, cost_metric=None)[source]¶
Bases:
objectA quantum circuit and information about spacetime Pauli checks it contains.
- Parameters:
- circuit¶
A quantum circuit containing
0or more spacetime Pauli checks.
- target_qubits¶
Qubit indices of
circuitwhich were used to entangle the check qubits to the payload.Noneifcircuitcontains no checks.
- check_qubits¶
Qubit indices of the ancilla qubits in
circuit. Thei``th check uses ``check_qubits[i]to detect errors ontarget_qubits[i]and other qubits incheck_support[i].
- check_support¶
For each check, the qubit indices whose measurement outcomes XOR together to give that check’s syndrome bit.
- get_postselection_method()[source]¶
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.
- property uncovered_paulis: tuple[UncoveredPauli, ...]¶
Locations where a single qubit Pauli error is undetectable by some checks.
Each entry is an
UncoveredPauli(qubit, after_instruction, pauli)triple, wherequbitis the qubit of the single-qubit error,after_instructionis thecircuit.dataindex of the instruction which immediately precedes the error, andpauliis 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.
- class UncoveredPauli(qubit, after_instruction, pauli)[source]¶
Bases:
NamedTupleA spacetime location at which a single qubit Pauli error is undetectable by a set of checks.
- after_instruction¶
Index (into
circuit.data) of the instruction the error occurs after;Nonemeans 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(value, /)¶
Return number of occurrences of value.
- index(value, start=0, stop=9223372036854775807, /)¶
Return first index of value.
Raises ValueError if the value is not present.