pygsti.models.stencillabel.StencilLabelTuple#

class StencilLabelTuple(stencil_sslbls)#

Bases: StencilLabel

A stencil label that is a single state space label tuple.

This is the simplest type of stencil labels, and almost the same as just a tuple of state space labels. It may contain, however, special stencil directives like ‘@<num>’ and direction labels.

Parameters:

stencil_sslbls (tuple) – A tuple of state space labels. May contain special stencil directives.

Methods

__init__(stencil_sslbls)

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