1# IonQ API Calibrations
2
3Calibrations are snapshots of the performance of the IonQ platform
4at a given moment of time.  The IonQ quantum computers are continuously
5calibrated, and measurements are taken of the performance of the machine
6periodically.
7
8In this section, we assume a `cirq.ionq.Service` object has been instantiated and is
9called `service` and `cirq` and `cirq.ionq` have been imported:
10```python
11import cirq
12import cirq.ionq as ionq
13service = ionq.Service()
14```
15See [IonQ API Service](service.md) for how to set up the service.
16
17## Fetching information about the device
18
19To get the latest calibration, you simply query the service for the calibration
20object
21```python
22calibration = service.get_current_calibration()
23```
24The returned object then has data about the target (currently only on QPU)
25as well as the current performance of the target.
26
27```python
28print(calibration.fidelities())
29# prints something like
30{'1q': {'mean': 0.99717}, '2q': {'mean': 0.9696}, 'spam': {'mean': 0.9961}}
31```
32Here
33* `1q` and `2q` refer to one and two qubit average gate fidelities measured using
34randomized benchmarking.  Technically these refer to the native gates on the
35device, which are the `cirq.XX**(0.5)` gate and the `cirq.X**(0.5)` gate (and also their
36inverses).  Like many architectures `cirq.Z**x` gates are "free", these gates are
37compiled out of the circuit.  Thus these gates are not included in
38this gate fidelities.
39* `spam` here refers to state preparation and measurement
40error, and can mostly be thought of as the probability of the measurement
41being correct.
42
43Another useful bit of information are the timings of the gates:
44```python
45print(calibration.timings())
46# prints something like
47{'t1': 10000, 't2': 0.2, '1q': 1.1e-05, '2q': 0.00021, 'readout': 0.000175, 'reset': 3.5e-05}
48```
49These measurements are all returned in seconds
50* `t1`: the energy relaxation time.
51* `t2`: the dephasing time.
52* `1q`: the time it takes to execute a single qubit gate.
53* `2q`: the time it takes to execute a two qubit gate.
54* `readout`: the time it takes to measure the qubit.
55* `reset`: the time it takes to reset the ion between shots.
56
57A few other properties of the `ionq.Calibration` object are
58* `num_qubits`: the number of qubits on the QPU.
59* `connectivity`: a set of all the possible qubits that can interact in the set.
60* `target`: in the future when there are multiple QPUs this will list which target.
61