cirq_ionq.results.QPUResult

The results of running on an IonQ QPU.

Methods

counts

View source

Returns the raw counts of the measurement results.

If a key parameter is supplied, these are the counts for the measurement results for the qubits measured by the measurement gate with that key. If no key is given, these are the measurement results from measuring all qubits in the circuit.

The key in the returned dictionary is the computational basis state measured for the qubits that have been measured. This is expressed in big-endian form. For example, if no measurement key is supplied and all qubits are measured, the key in this returned dict has a bit string where the cirq.LineQubits are expressed in the order: (cirq.LineQubit(0), cirq.LineQubit(1), ..., cirq.LineQubit(n-1)) In the case where only r qubits are measured corresponding to targets t_0, t1,...t{r-1}, the bit string corresponds to the order (cirq.LineQubit(t_0), cirq.LineQubit(t1), ... cirq.LineQubit(t{r-1}))

The value is the number of times that corresponding bit string occurred.

See to_cirq_result to convert to a cirq.Result.

measurement_dict

View source

Returns a map from measurement keys to target qubit indices for this measurement.

num_qubits

View source

Returns the number of qubits the circuit was run on.

repetitions

View source

Returns the number of times the circuit was run.

to_cirq_result

View source

Returns a cirq.Result for these results.

cirq.Result contains a less dense representation of results than that returned by the IonQ API. Typically these results are also ordered by when they were run, though that contract is implicit. Because the IonQ API does not retain that ordering information, the order of these cirq.Result objects should not be interpetted as representing the order in which the circuit was repeated.

Args
params The cirq.ParamResolver used to generate these results.

Returns
The cirq.Result for these results.

Raises
ValueError If the circuit used to produce this result had no measurement gates (and hence no measurement keys).

__eq__

View source

Return self==value.