MeasurementGate(key: str = '', invert_mask: Tuple[bool, ...] = ())¶
A gate that measures qubits in the computational basis.The measurement gate contains a key that is used to identify resultsof measurements.
__init__(key: str = '', invert_mask: Tuple[bool, ...] = ()) → None¶
- 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 shorter. Qubits with indices past the end of the mask are not flipped.
Returns an application of this gate to the given qubits.
Checks if this gate can be applied to the given qubits.
Toggles whether or not the measurement inverts various outputs.