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: object

A quantum circuit and information about spacetime Pauli checks it contains.

Parameters:
circuit

A quantum circuit containing 0 or more spacetime Pauli checks.

Type:

qiskit.circuit.quantumcircuit.QuantumCircuit

target_qubits

Qubit indices of circuit which were used to entangle the check qubits to the payload. None if circuit contains no checks.

Type:

tuple[int, …]

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:

tuple[int, …]

check_support

For each check, the qubit indices whose measurement outcomes XOR together to give that check’s syndrome bit.

Type:

tuple[tuple[int, …], …]

cost

The value of the cost function with respect to the checks in circuit

Type:

float | None

cost_metric

The metric used to evaluate check quality (gamma or LER)

Type:

str | None

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.

Return type:

Callable[[str | ndarray], ndarray]

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, 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.

class UncoveredPauli(qubit, after_instruction, pauli)[source]

Bases: NamedTuple

A spacetime location at which a single qubit Pauli error is undetectable by a set of checks.

Parameters:
  • qubit (int)

  • after_instruction (int | None)

  • pauli (Literal['X', 'Y', 'Z'])

qubit

Index of the qubit where the undetected error sits

Type:

int

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(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.