tqec.circuit.operations.operation.MeasurementsRecord

class MeasurementsRecord(measurement_data: Sequence[Measurement])[source]
__init__(measurement_data: Sequence[Measurement]) None[source]

A group of measurements.

This class simply stores a list of Measurement instances. Its purpose is to be used as a base to build operations that require a list of measurements.

Parameters:

measurement_data – a sequence of Measurement that form a group. The exact meaning of this group (e.g., a detector or an observable) is not explicit and have to be provided by subclasses. There should be no duplicate in the provided sequence.

Raises:

TQECException – if there is any duplicate entry in the provided measurement_data.

Methods

__init__(measurement_data)

A group of measurements.

controlled_by(*control_qubits[, control_values])

Returns a controlled version of this operation. If no control_qubits

transform_qubits(qubit_map)

Returns the same operation, but with different qubits.

validate_args(qubits)

Raises an exception if the qubits don't match this operation's qid shape.

with_classical_controls(*conditions)

Returns a classically controlled version of this operation.

with_probability(probability)

Creates a probabilistic channel with this operation.

with_qubits(*new_qubits)

Returns the same operation, but applied to different qubits.

with_tags(*new_tags)

Creates a new TaggedOperation, with this op and the specified tags.

without_classical_controls()

Removes all classical controls from the operation.

Attributes

classical_controls

The classical controls gating this operation.

gate

measurement_data

The recorded relative measurement data.

qubits

tags

Returns a tuple of the operation's tags.

untagged

Returns the underlying operation without any tags.