pygsti.models.fogistore

Defines the FirstOrderGaugeInvariantStore class and supporting functionality.

Module Contents

Classes

FirstOrderGaugeInvariantStore

An object that computes and stores the first-order-gauge-invariant quantities of a model.

class pygsti.models.fogistore.FirstOrderGaugeInvariantStore(gauge_action_matrices_by_op, gauge_action_gauge_spaces_by_op, errorgen_coefficient_labels_by_op, op_label_abbrevs=None, reduce_to_model_space=True, dependent_fogi_action='drop', norm_order=None)

Bases: object

An object that computes and stores the first-order-gauge-invariant quantities of a model.

Currently, it is only compatible with ExplicitOpModel objects.

TODO: docstring

property errorgen_space_dim
property gauge_space_dim
property num_fogi_directions
property num_fogv_directions
find_nice_fogiv_directions()
fogi_errorgen_direction_labels(typ='normal')

typ can be ‘raw’ or ‘abbrev’ too

fogv_errorgen_direction_labels(typ='normal')
errorgen_vec_to_fogi_components_array(errorgen_vec)
errorgen_vec_to_fogv_components_array(errorgen_vec)
opcoeffs_to_fogi_components_array(op_coeffs)
opcoeffs_to_fogv_components_array(op_coeffs)
opcoeffs_to_fogiv_components_array(op_coeffs)
fogi_components_array_to_errorgen_vec(fogi_components)
fogv_components_array_to_errorgen_vec(fogv_components)
fogiv_components_array_to_errorgen_vec(fogi_components, fogv_components)
errorgen_vec_to_opcoeffs(errorgen_vec)
fogi_components_array_to_opcoeffs(fogi_components)
fogv_components_array_to_opcoeffs(fogv_components)
fogiv_components_array_to_opcoeffs(fogi_components, fogv_components)
create_binned_fogi_infos(tol=1e-05)

Creates an ‘info’ dictionary for each FOGI quantity and places it within a nested dictionary structure by the operators involved, the types of error generators, and the qubits acted upon (a.k.a. the “target” qubits). TODO: docstring

Returns

dict

create_elementary_errorgen_space(op_elem_errgen_labels)

Construct a matrix whose column space spans the given list of elementary error generators.

Parameters

op_elem_errgen_labelsiterable

A list of (operation_label, elementary_error_generator_label) tuples, where operation_label is one of the primitive operation labels in self.primitive_op_labels and elementary_error_generator_label is a GlobalElementaryErrorgenLabel object.

Returns

numpy.ndarray

A two-dimensional array of shape (self.errorgen_space_dim, len(op_elem_errgen_labels)). Columns correspond to elements of op_elem_errgen_labels and the rowspace is the full elementary error generator space of this FOGI analysis.

create_fogi_aggregate_space(op_set='all', errorgen_types='all', target='all')

Construct a matrix with columns equal to the FOGI directions within the specified categories.

Projecting a model’s error-generator vector onto such a space can be used to obtain the contribution of a desired subset of the model’s errors.

Parameters

op_settuple or “all”

Restrict to (intrinsic) FOGI quantities of a single operation, given as a 1-tuple, e.g. ((‘Gxpi2’,0),) or relational error between multiple operations, e.g., ((‘Gxpi2’,0), (‘Gypi2’,0)). The special “all” value includes quantities on all operations (no restriction).

errorgen_typestuple of {“H”, “S”} or “all”

Restrict to FOGI quantities containing elementary error generators of the given type(s). Note that a tuple with multiple types only selects FOGI quantities containing all the give types (e.g., (‘H’,’S’) will not match quantities composed of solely Hamiltonian-type generators). The special “all” value includes quantities of all types (no restriction).

targettuple or “all”

A tuple of state space (qubit) labels to restrict to, e.g., (‘Q0’,’Q1’). Note that includeing multiple labels selects only those quantities that target all the labels. The special “all” value includes quantities on all targets (no restriction).

Returns

numpy.ndarray

A two-dimensional array with self.errorgen_space_dim rows and a number of columns dependent on the number of FOGI quantities matching the argument criteria.

create_fogi_aggregate_single_op_space(op_label, errorgen_type='H', intrinsic_or_relational='intrinsic', target='all')

Construct a matrix with columns spanning a particular FOGI subspace for a single operation.

This is a subspace of the full error-generator space of this FOGI analysis, and projecting a model’s error-generator vector onto this space can be used to obtain the contribution of a desired subset of the op_label’s errors.

Parameters

op_labelLabel or str

The operation to construct a subspace for. This should be an element of self.primitive_op_labels.

errorgen_type{“H”, “S”, “all”}

Potentially restrict to the subspace containing just Hamiltonian (H) or Pauli stochastic (S) errors. “all” imposes no restriction.

intrinsic_or_relational{“intrinsic”, “relational”, “all”}

Restrict to intrinsic or relational errors (or not, using “all”).

targettuple or “all”

A tuple of state space (qubit) labels to restrict to, e.g., (‘Q0’,’Q1’). Note that including multiple labels selects only those quantities that target all the labels. The special “all” value includes quantities on all targets (no restriction).

Returns

numpy.ndarray

A two-dimensional array with self.errorgen_space_dim rows and a number of columns dependent on the dimension of the selected subspace.

classmethod merge_binned_fogi_infos(binned_fogi_infos, index_offsets)

Merge together multiple FOGI-info dictionaries created by create_binned_fogi_infos().

Parameters

binned_fogi_infoslist

A list of FOGI-info dictionaries.

index_offsetslist

A list of length len(binned_fogi_infos) that gives the offset into an assumed-to-exist corresponding vector of components for all the FOGI infos.

Returns

dict

The merged dictionary