measurement_gate: MeasurementGate

Description Usage Arguments Details Value Note See Also

View source: R/Measure.R

Description

A gate that measures qubits in the computational basis.

Usage

1
measurement_gate(num_qubits = NULL, key = "str", invert_mask, qid_shape = NULL)

Arguments

num_qubits

The number of qubits to act upon.

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.

qid_shape

Specifies the dimension of each qid the measurement applies to. The default is 2 for every qubit.

Details

The measurement gate contains a key that is used to identify results of measurements.

Value

a list of operations individually measuring the given qubits.

Note

If the length of invert_mask is greater than num_qubits. Or if the length of qid_shape doesn’t equal num_qubits.

See Also

Other Measurement: measure_each(), measure()


henry090/Cirq documentation built on June 13, 2020, 1:28 a.m.