cirq.google.Calibration

A convenience wrapper for calibrations that acts like a dictionary.

Calibrations act as dictionaries whose keys are the names of the metric, and whose values are the metric values. The metric values themselves are represented as a dictionary. These metric value dictionaries have keys that are tuples of cirq.GridQubits and values that are lists of the metric values for those qubits. If a metric acts globally and is attached to no specified number of qubits, the map will be from the empty tuple to the metrics values.

Calibrations act just like a python dictionary. For example you can get a list of all of the metric names using

`calibration.keys()`

and query a single value by looking up the name by index:

`calibration['t1']`

timestamp The time that this calibration was run, in milliseconds since the epoch.

Methods

get

D.get(k[,d]) -> D[k] if k in D, else d. d defaults to None.

heatmap

View source

Return a heatmap for metrics that target single qubits.

Args
key The metric key to return a heatmap for.

Returns
A cirq.Heatmap for the metric.

Raises
AssertionError if the heatmap is not for single qubits or the metric values are not single floats.

items

D.items() -> a set-like object providing a view on D's items

keys

D.keys() -> a set-like object providing a view on D's keys

timestamp_str

View source

Return a string for the calibration timestamp.

Args
tz The timezone for the string. If None, the method uses the platform's local date and time.
timespec See datetime.isoformat for valid values.

Returns
The string in ISO 8601 format YYYY-MM-DDTHH:MM:SS.ffffff.

values

D.values() -> an object providing a view on D's values

__contains__

__eq__

Return self==value.

__getitem__

View source

Supports getting calibrations by index.

Calibration may be accessed by key:

`calibration['t1']`.

This returns a map from tuples of cirq.GridQubits to a list of the values of the metric. If there are no targets, the only key will only be an empty tuple.

__iter__

View source

__len__

View source