pygsti.tools.edesigntools.calculate_fisher_information_per_circuit#
- calculate_fisher_information_per_circuit(model, circuits, approx=False, regularization=1e-08, verbosity=1, comm=None, mem_limit=None)#
Helper function to calculate all Fisher information terms for each circuit.
This function can be used to pre-generate a cache for the calculate_fisher_information_matrix() function, and this should be done for computational efficiency when computing many Fisher information matrices.
- Parameters:
model (OpModel) – The model used to calculate the terms of the Fisher information matrix.
circuits (list) – List of circuits to compute Fisher information for.
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.
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.
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_info_terms – Dictionary where keys are circuits and values are (num_params, num_params) Fisher information matrices for a single circuit.
- Return type:
dict