Returns a single MeasurementGate applied to all the given qubits.
cirq.M(
*target,
key: Optional[Union[str, 'cirq.MeasurementKey']] = None,
invert_mask: Tuple[bool, ...] = (),
confusion_map: Optional[Dict[Tuple[int, ...], np.ndarray]] = None
) -> cirq.Operation
Used in the notebooks
Used in the guide |
Used in the tutorials |
|
|
The qubits are measured in the computational basis. This can also be
used with the alias cirq.M
.
Args |
*target
|
The qubits that the measurement gate should measure.
These can be specified as separate function arguments or
with a single argument for an iterable of qubits.
|
key
|
Optional str or cirq.MeasurementKey that gate should use.
If none provided, it defaults to a comma-separated list of
str(qubit) for each of the target qubits.
|
invert_mask
|
A list of Truthy or Falsey values indicating whether
the corresponding qubits should be flipped. None indicates no
inverting should be done.
|
confusion_map
|
A map of qubit index sets (using indices in
target ) to the 2D confusion matrix for those qubits. Indices
not included use the identity. Applied before invert_mask if both
are provided.
|
Returns |
An operation targeting the given qubits with a measurement.
|
Raises |
ValueError
|
If the qubits are not instances of Qid.
|