pygsti.models.modelnoise.ComposedOpModelNoise#

class ComposedOpModelNoise(opmodelnoises)#

Bases: OpModelNoise

Op-model noise that is specified simply as the composition of other op-model noise specifications.

Parameters:

opmodelnoises (iterable) – The sub- OpModelNoise objects.

Methods

__init__(opmodelnoises)

apply_errorgen_stencil(stencil, evotype, ...)

See OpModelNoise.apply_errorgen_stencil().

apply_errormap_stencil(stencil, evotype, ...)

See OpModelNoise.apply_errormap_stencil().

cast(obj)

Convert an object to an OpModelNoise object if it isn't already.

compute_stencil_absolute_sslbls(stencil, ...)

Computes the set of state space labels that would be utilized when applying a stencil.

create_errorgen(opkey, evotype, state_space)

Create an error generator object to implement the noise on a given model operation.

create_errorgen_stencil(opkey, evotype, ...)

See OpModelNoise.create_errorgen_stencil().

create_errormap(opkey, evotype, state_space)

Create an error map object to implement the noise on a given model operation.

create_errormap_stencil(opkey, evotype, ...)

See OpModelNoise.create_errormap_stencil().

ensure_no_duplicates()

Raise an AssertionError if there are any duplicates among the composed noise specifications.

keys()

The operation labels for which this object specifies noise.

reset_access_counters()

Resets the internal key-access counters to zero.

warn_about_zero_counters()

Issue a warning if any of the internal key-access counters are zero

apply_errorgen_stencil(stencil, evotype, state_space, target_labels=None, qudit_graph=None, copy=False)#

See OpModelNoise.apply_errorgen_stencil().

apply_errormap_stencil(stencil, evotype, state_space, target_labels=None, qudit_graph=None, copy=False)#

See OpModelNoise.apply_errormap_stencil().

classmethod cast(obj)#

Convert an object to an OpModelNoise object if it isn’t already.

If a dictionary is given, it is assumed to contain per-operation error specifications. If a list/tuple is given, it is assumed to contain multiple sub-specifications that should be composed together (by constructing a ComposedOpModelNoise object).

Parameters:

obj (object) – The object to convert.

Return type:

OpModelNoise

compute_stencil_absolute_sslbls(stencil, state_space, target_labels=None, qudit_graph=None)#

Computes the set of state space labels that would be utilized when applying a stencil.

This function computes which state space labels are non-trivially acted upon by the operation that results from applying stencil to target_labels.

Parameters:
  • stencil (OrderedDict) – The stencil. A dictionary with keys that are target state space labels (perhaps stencil labels) and values that are operations. This function only cares about the keys of this dictionary.

  • state_space (StateSpace) – The state space that would be given if/when applying stencil. This should be the total state space of the model that the applied stencil would be inserted into.

  • target_labels (tuple or None, optional) – The target labels that determine where on the qudit graph stencil will be placed. None indicates that the entire space is the “target” space of the stencil.

  • qudit_graph (QubitGraph, optional) – The relevant qudit graph that contains adjacency and direction information used to resolve stencil state space labels into absolute labels within state_space. If None, then an error will be raised if any direction or connectivity information is needed to resolve the state space labels.

Returns:

A set (i.e. without any duplicates) of the state space labels that would be acted upon.

Return type:

set

create_errorgen(opkey, evotype, state_space, target_labels=None, qudit_graph=None)#

Create an error generator object to implement the noise on a given model operation.

Parameters:
  • opkey (Label or StencilLabel) – The operation label to create the error generator for.

  • evotype (str or Evotype) – The evolution type to use when creating the error generator.

  • state_space (StateSpace) – The state space to use when creating the error generator.

  • target_labels (tuple or None, optional) – The target state space labels for this operation. Sometimes this is also contained in opkey, but not always, so it must be supplied as a separate argument.

  • qudit_graph (QubitGraph, optional) – The relevant qudit graph, usually from a processor specification, that contains adjacency and direction information used to create more complex types of errors. If None, then an error will be raised if graph information is needed.

Return type:

LinearOperator

create_errorgen_stencil(opkey, evotype, state_space, num_target_labels=None)#

See OpModelNoise.create_errorgen_stencil().

create_errormap(opkey, evotype, state_space, target_labels=None, qudit_graph=None, copy=False)#

Create an error map object to implement the noise on a given model operation.

Parameters:
  • opkey (Label or StencilLabel) – The operation label to create the error map for.

  • evotype (str or Evotype) – The evolution type to use when creating the error map.

  • state_space (StateSpace) – The state space to use when creating the error map.

  • target_labels (tuple or None, optional) – The target state space labels for this operation. Sometimes this is also contained in opkey, but not always, so it must be supplied as a separate argument.

  • qudit_graph (QubitGraph, optional) – The relevant qudit graph, usually from a processor specification, that contains adjacency and direction information used to create more complex types of errors. If None, then an error will be raised if graph information is needed.

  • copy (bool, optional) – Whether the operations arising from the same stencil should be copied before embedding and composing them to apply the stencil. True can be used to make different applications of the stencil independent operations.

Return type:

LinearOperator

create_errormap_stencil(opkey, evotype, state_space, num_target_labels=None)#

See OpModelNoise.create_errormap_stencil().

ensure_no_duplicates()#

Raise an AssertionError if there are any duplicates among the composed noise specifications.

Return type:

None

keys()#

The operation labels for which this object specifies noise.

reset_access_counters()#

Resets the internal key-access counters to zero.

These counters tally the number of times each operation key is accessed, and are used to identify model noise specification that are supplied by the user but never used. See warn_about_zero_counters().

Return type:

None

warn_about_zero_counters()#

Issue a warning if any of the internal key-access counters are zero

Used to catch noise specifications that are never utilized and that the caller/user should be warned about.

Return type:

None