qat.generators.TomographyGenerator

class qat.generators.TomographyGenerator(method, target_gates_spec=None, enforce_CP=False, enforce_TP=False, verbose=False)

Generator class to perform tomography of a QPU. It provides a generate function that can be called with the gates needed for state preparation and measurement, along with a list of gates to perform tomography on.

Three tomography methods are supplied:

  • Linear inversion Quantum Process Tomography (‘lqpt’),

  • Maximum Likelihood Quantum Process Tomography (‘mlqpt’), and

  • Linear inversion Gateset Tomography (‘lgst’).

Parameters
  • method (string) – type of tomography (lqpt|mlqpt|lgst)

  • target_gates_spec (GatesSpecification, optional) – ideal/target gates specification. Required for QPT methods.

  • enforce_CP (bool) – whether to enforce complete-positive character. Included in ‘mlqpt’ (not yet implemented for GST methods)

  • enforce_TP (bool) – whether to enforce trace-preserving character (implemented by fixing some PTM elements in ‘mlqpt’, and by gauge-fixing in ‘lgst’)

  • verbose (bool) – verbose output

generate(specs, prep_gates, meas_gates, gate_list, qbits, nbshots=1024)

Generates the batches to perform data collection phase of the tomography (for a set of gates specified in argument). The tomography batches are yielded to be submitted to the QPU, and the collected tomography results are stored in an attribute tomo_data of the generator instance to be processed in the post-process function. This function does not return any result at the end of the data collection, since the processed data is not processed yet.

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

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

  • gate_list (list<string>) – list of gates to be tomographed.

  • qbits (tuple<int>, optional) – qbits to be tomographed. Defaults to None (implying qbit #0).

  • nbshots (int, optional) – number of shots in experiment (repetitions of each circuit). Defaults to 1024.

post_process(result)

Post process the result of the sampling into more interpretable information

Parameters

result (Result) –

Returns

Gate specification

Return type

GatesSpecification