pygsti.algorithms.core.iterative_gst_generator

pygsti.algorithms.core.iterative_gst_generator#

iterative_gst_generator(dataset, start_model, circuit_lists, optimizer, iteration_objfn_builders, final_objfn_builders, resource_alloc, starting_index=0, verbosity=0)#

Performs Iterative Gate Set Tomography on the dataset. Same as run_iterative_gst, except this function produces a generator for producing the output for each iteration instead of returning the lists of outputs all at once.

Parameters:
  • dataset (DataSet) – The data used to generate MLGST gate estimates

  • start_model (Model) – The Model used as a starting point for the least-squares optimization.

  • circuit_lists (list of lists of (tuples or Circuits)) – The i-th element is a list of the circuits to be used in the i-th iteration of the optimization. Each element of these lists is a circuit, specified as either a Circuit object or as a tuple of operation labels (but all must be specified using the same type). e.g. [ [ (), (‘Gx’,) ], [ (), (‘Gx’,), (‘Gy’,) ], [ (), (‘Gx’,), (‘Gy’,), (‘Gx’,’Gy’) ] ]

  • optimizer (Optimizer, or dict, or list of Optimizer, or list of dict (default None)) – The optimizer to use, or a dictionary of optimizer parameters from which a default optimizer can be built. If a list, the length of the list should either be 1 or equal to the number of iterations. If 1, then this optimizer is used for every iteration, otherwise each optimizer is used for its corresponding iteration.

  • iteration_objfn_builders (list) – List of ObjectiveFunctionBuilder objects defining which objective functions should be optimizized (successively) on each iteration.

  • final_objfn_builders (list) – List of ObjectiveFunctionBuilder objects defining which objective functions should be optimizized (successively) on the final iteration.

  • resource_alloc (ResourceAllocation) – A resource allocation object containing information about how to divide computation amongst multiple processors and any memory limits that should be imposed.

starting_indexint, optional (default 0)

Index of the iteration to start the optimization at. Primarily used when warmstarting the iterative optimization from a checkpoint.

verbosityint, optional

How much detail to send to stdout.

Returns:

Returns a generator which when queried the i-th time returns a tuple containing:

  • model: the model corresponding to the results of the i-th iteration.

  • optimums : the final OptimizerResults from the i-th iteration.

  • final_objfn : If the final iteration the MDSObjectiveFunction function / store, which encapsulated the final objective function evaluated at the best-fit point (an “evaluated” model-dataset-circuits store).

Return type:

generator

Parameters:

optimizer (Optimizer | dict | list[Optimizer] | list[dict])