pygsti.tools.edesigntools.calculate_fisher_information_matrices_by_L#
- calculate_fisher_information_matrices_by_L(model, circuit_lists, Ls, num_shots=1, term_cache=None, regularization=1e-08, cumulative=True, approx=False, mem_efficient_mode=False, circuit_chunk_size=100, verbosity=1, comm=None, mem_limit=None)#
Calculate a set of Fisher information matrices for a set of circuits grouped by iteration.
- Parameters:
model (OpModel) – The model used to calculate the terms of the Fisher information matrix.
circuit_lists (list of lists of circuits or CircuitLists) – Circuit lists for the experiment design for each L. Most likely from the value of the circuit_lists attribute of most experiment design objects.
Ls (list of ints) – A list of integer values corresponding to the circuit lengths associated with each circuit list as past in with circuit_lists.
num_shots (int or dict) – If int, specifies how many shots each circuit gets. If dict, keys must be circuits and values are per-circuit counts.
term_cache (dict or None) – If provided, should have circuits as keys and per-circuit Fisher information matrices as values, i.e. the output of calculate_fisher_information_per_circuit(). This cache will be updated with any additional circuits that need to be calculated in the given circuit list.
regularization (float, optional (default 1e-8)) – A regularization parameter used to set a minimum probability value for circuits. This is needed to avoid division by zero problems in the fisher information calculation.
cumulative (bool) – Whether to include Fisher information matrices for lower L (True) or not.
approx (bool, optional (default False)) – When set to true use the approximate fisher information where we drop the hessian term. Significantly faster to compute than when including the hessian.
mem_efficient_mode (bool, optional (default False)) – If true avoid constructing the intermediate term cache to save on memory.
circuit_chunk_size – Used in conjunction with mem_efficient_mode. This sets the maximum number of circuits to simultaneously construct the per-circuit contributions to the fisher information for at any one time.
int – Used in conjunction with mem_efficient_mode. This sets the maximum number of circuits to simultaneously construct the per-circuit contributions to the fisher information for at any one time.
100) (optional (default) – Used in conjunction with mem_efficient_mode. This sets the maximum number of circuits to simultaneously construct the per-circuit contributions to the fisher information for at any one time.
verbosity (int, optional (default 1)) – Used to control the level of output printed by a VerbosityPrinter object.
comm (mpi4py.MPI.Comm, optional) – When not None, an MPI communicator for distributing the computation across multiple processors.
mem_limit (int, optional) – A rough memory limit in bytes which is used to determine job allocation when there are multiple processors.
- Returns:
fisher_information_by_L – Dictionary with keys as circuit length L and value as Fisher information matrices
- Return type:
dict