pygsti.models.layerrules

Defines the LayerLizard class and supporting functionality.

Module Contents

Classes

LayerRules

Rules for composing a layer operation from the elements stored within a model.

class pygsti.models.layerrules.LayerRules

Bases: pygsti.baseobjs.nicelyserializable.NicelySerializable

Rules for composing a layer operation from the elements stored within a model.

A LayerRules object serves as an intermediary between a ImplicitModel object and a ForwardSimulator. It contains the logic for creating layer operations based on the partial/fundamental operation “blocks” stored within the model. Since different models hold different operation blocks, layer rules are usually tailored to a specific models.

_create_op_for_circuitlabel(self, model, circuitlbl)

A helper method for derived classes used for processing CircuitLabel labels.

(CircuitLabel labels encapsulate sub-circuits repeated some integer number of times).

This method build an operator for circuitlbl by creating a composed-op (using ComposedOp) of the sub-circuit that is exponentiated (using RepeatedOp) to the power circuitlbl.reps.

Parameters

circuitlbl (CircuitLabel) – The (sub-circuit)^power to create an operator for.

Returns

LinearOperator

prep_layer_operator(self, model, layerlbl, cache)

Create the operator corresponding to layerlbl.

Parameters

layerlbl (Label) – A circuit layer label.

Returns

State

povm_layer_operator(self, model, layerlbl, cache)

Create the operator corresponding to layerlbl.

Parameters

layerlbl (Label) – A circuit layer label.

Returns

POVM or POVMEffect

operation_layer_operator(self, model, layerlbl, cache)

Create the operator corresponding to layerlbl.

Parameters

layerlbl (Label) – A circuit layer label.

Returns

LinearOperator