cirq.MeasurementGate

class cirq.MeasurementGate(key: str = '', invert_mask: Tuple[bool, ...] = ())[source]

Indicates that qubits should be measured plus a key to identify results.

key

The string key of the measurement.

invert_mask

A list of values indicating whether the corresponding qubits should be flipped. The list’s length must not be longer than the number of qubits, but it is permitted to be shorted. Qubits with indices past the end of the mask are not flipped.

__init__(key: str = '', invert_mask: Tuple[bool, ...] = ()) → None[source]

Initialize self. See help(type(self)) for accurate signature.

Methods

is_measurement(op, cirq.ops.raw_types.Operation])
known_qasm_output(qubits, …], args) Returns lines of QASM output representing the gate on the given qubits or None if a simple conversion is not possible.
on(*qubits) Returns an application of this gate to the given qubits.
text_diagram_info(args) Describes how to draw something in a text diagram.
validate_args(qubits) Checks if this gate can be applied to the given qubits.
with_bits_flipped(*bit_positions) Toggles whether or not the measurement inverts various outputs.