pygsti.models.stencillabel.StencilLabelSet#

class StencilLabelSet(stencil_sslbls_set)#

Bases: StencilLabel

A stencil label that is explicitly a set of multiple state space label tuples.

A StencilLabelSet stencil label simply expands into the list/set of state space label tuples used to construct it. It may contain special stencil directives, and is essentially just a list or tuple of StencilLabelTuple objects.

Parameters:

stencil_sslbls_set (list or tuple or set) – A collection of the individual state space label tuples that this stencil label expands into. May contain special stencil directives.

Methods

__init__(stencil_sslbls_set)

cast(obj)

Convert an object into a stencil label if it isn't already.

compute_absolute_sslbls(qubit_graph, ...)

Creates a list of all the state space label tuples this stencil label expands into.

create_local_state_space(entire_state_space)

Creates a "local" state space for an operator indexed using this stencil label.

classmethod cast(obj)#

Convert an object into a stencil label if it isn’t already.

Parameters:

obj (object) – The object to convert.

Return type:

StencilLabel

compute_absolute_sslbls(qubit_graph, state_space, target_lbls)#

Creates a list of all the state space label tuples this stencil label expands into.

See StencilLabel.compute_absolute_sslbls()

create_local_state_space(entire_state_space)#

Creates a “local” state space for an operator indexed using this stencil label.

When creating operator objects, a stencil label specifies where to place (embed) operators on some subset of the entire space. When these to-be-embedded operations are constructed, they need to be supplied with a state space that just corresponds to the sub-space where they act – a “local” state space. A stencil label expands into one or more state space label tuples, and this function constructs a single local state space that is appropriate for any and all of these tuples (i.e. what is returned by compute_absolute_sslbls()), and that is therefore appropriate for constructing the to-be-embedded operation. Importantly, this function can be called without knowing where this stencil label will be placed, that is, it doesn’t require a “target labels” argument.

Parameters:

entire_state_space (StateSpace) – The entire state space of the relevant processor, specifying the state space labels and information about them.

Return type:

StateSpace