qat.tomo.collect_tomography_data

qat.tomo.collect_tomography_data(prep_gates, meas_gates, gate_list, qbits, qpu=None, n_shots=1024, add_gst_measurements=False, verbose=False)

Collect measurements

\[\tilde{G}^{(k)}_{i,j} = d\ll E|F_{i}'G_{k}F_{j}|\rho\gg\]

(where \(|\rho\gg\) and \(\ll E |\) are the initial state and final measurement operators, respectively, and \(d=2^{n_\mathrm{qbits}}\)

and, optionally, if add_gst_measurements is True,

\[ \begin{align}\begin{aligned}g_{ij} = d\ll E|F_{i}'F_{j}|\rho\gg\\\tilde{\rho}_{i}=d\ll E|F_{i}|\rho\gg\\\tilde{E}_{j}=d\ll E|F_{j}'|\rho\gg\end{aligned}\end{align} \]

and the corresponding error bars (standard error on the mean).

For instance, for \(\tilde{G}^{(k)}_{i,j}\): for each gate \(G_k\) in gate_list,

  • for each gate sequence \(F_j\) in prep_gates and each gate sequence \(F^{'}_i\) in meas_gates, construct circuit \(C_{ijk} = \{F_j + G_k + F^{'}_i\}\)

  • if n_shots = 0 (infinite number):

    • for n in 1 .. n_shots, get measurement outcomes \(O_n\);

    • then, get average \(\tilde{G}^{(k)}_{i,j}\) and standard error on the mean \(\Delta\tilde{G}^{(k)}_{i,j}\)

  • otherwise: directly get \(\tilde{G}^{(k)}_{i,j}\) (\(\Delta\tilde{G}^{(k)}_{i,j}=0\))

Parameters
  • prep_gates (list<list<pair<string, int>>>) – list of gate sequences for state preparation (\(>= d^2\)), with \(d = 2^{n_\mathrm{qbits}}\)

  • meas_gates (list<list<pair<string, int>>>) – list of gate sequences for measurement (\(>= d^2\))

  • gate_list (list<string>) – list of gates to be make the tomography of. all gates in target_hw_model

  • qbits (tuple<int>) – qbits to be tomographed.

  • qpu (QPUHandler, optional) – qpu to be tomographed. Default to None. If None, the function only dumps the circuits to file.

  • n_shots (int, optional) – number of shots in experiment (repetitions of each circuit). Defaults to 1024. (0 for an infinite number)

  • add_gst_measurements (bool, optional) – whether to perform additional measurements required for GST. Defaults to False

  • verbose (bool) – for verbose output

Returns

\(\{\tilde{G}^{(k)}\}_k\),

\(\{(\Delta\tilde{G}^{(k)})^2\}_k\), \(g\), \(\Delta g^2\), \(\tilde{E}\), \(\Delta \tilde{E}\), \(\tilde{\rho}\), \(\Delta\tilde{\rho}^2\)

Return type

list<array>, list<array>, array, array, array, array, array

Note

This method is available as an application in Qaptiva Access.