cirq.M
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.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-06-27 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-06-27 UTC."],[],[]]