cirq.google.XmonStepResult.sample_measurement_ops¶
-
XmonStepResult.sample_measurement_ops(measurement_ops: List[cirq.ops.gate_operation.GateOperation], repetitions: int = 1) → Dict[str, List[List[bool]]]¶ Samples from the wave function at this point in the computation.
Note that this does not collapse the wave function.
In contrast tosamplewhich samples qubits, this takes a list ofcirq.GateOperationinstances whose gates arecirq.MeasurementGateinstances and then returns a mapping from the key in the measurementgate to the resulting bit strings. Different measurement operations mustnot act on the same qubits.Parameters: - measurement_ops – GateOperation instances whose gates are MeasurementGate instances to be sampled form.
- repetitions – The number of samples to take.
- Returns: A dictionary from the measurement gate keys to the measurement
- results. These results are lists of lists, with the outer list corresponding to repetitions and the inner list corresponding to the qubits acted upon by the measurement operation with the given key.
Raises: ValueError– If the operation’s gates are not MeasurementGate instances or a qubit is acted upon multiple times by different operations from measurement_ops.