pygsti.models.stencillabel.StencilLabelRadiusCombos#
- class StencilLabelRadiusCombos(base_sslbls, radius, num_to_choose, connected=False)#
Bases:
StencilLabelA stencil label specifying all length-k combinations of the labels within a radius of some “base” label(s).
This stencil label depends heavily on the qubit graph. It expands to all length-num_to_choose combinations of the qubit graphy nodes (state space labels) that lie within radius edge traversals of any of the node labels in base_sslbls. If connected=True then the combinations are further filtered so that they must form connected subgraphs of the qubit graph.
- Parameters:
base_sslbls (tuple) – The state space labels that form the “center” of the possible labels
- radiusint
The maximum number of edge traversals (along the qubit graph) used to define the “radius” of labels about the base labels.
- num_to_chooseint
The number of possible state space labels in each combination of the labels within the radius of possible labels. This stencil label expands into potentially many state space label tuples all of this length.
- connectedbool, optional
If True, restrict combinations to those that form a connected subgraph of the qubit graph.
Methods
__init__(base_sslbls, radius, num_to_choose)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:
- compute_absolute_sslbls(qubit_graph, state_space, target_lbls)#
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.
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: