pygsti.modelmembers.povms.tensorprodpovm

Defines the TensorProductPOVM class

Module Contents

Classes

TensorProductPOVM

A POVM that is effectively the tensor product of several other POVMs (which can be TP).

class pygsti.modelmembers.povms.tensorprodpovm.TensorProductPOVM(factor_povms, evotype='auto', state_space=None)

Bases: pygsti.modelmembers.povms.povm.POVM

A POVM that is effectively the tensor product of several other POVMs (which can be TP).

Parameters

factor_povmslist of POVMs

POVMs that will be tensor-producted together.

evotypeEvotype or str, optional

The evolution type. The special value “default” is equivalent to specifying the value of pygsti.evotypes.Evotype.default_evotype. The special value “auto” uses the evolution type of the first factor if there are more than zero factors.

state_spaceStateSpace, optional

The state space for this POVM. This should be a space description compatible with the product of all the factors’ state spaces. If None a default compatible space will be chosen.

Initialize a new ModelMember

property parameter_labels

An array of labels (usually strings) describing this model member’s parameters.

property num_params

Get the number of independent parameters which specify this POVM.

Returns
int

the number of independent parameters.

submembers()

Get the ModelMember-derived objects contained in this one.

Returns

list

keys()

An iterator over the effect (outcome) labels of this POVM.

values()

An iterator over the effect SPAM vectors of this POVM.

items()

An iterator over the (effect_label, effect_vector) items in this POVM.

simplify_effects(prefix='')

Creates a dictionary of simplified effect vectors.

Returns a dictionary of effect POVMEffects that belong to the POVM’s parent Model - that is, whose gpindices are set to all or a subset of this POVM’s gpindices. Such effect vectors are used internally within computations involving the parent Model.

Parameters
prefixstr

A string, usually identitying this POVM, which may be used to prefix the simplified gate keys.

Returns

OrderedDict of POVMEffects

to_vector()

Extract a vector of the underlying gate parameters from this POVM.

Returns
numpy array

a 1D numpy array with length == num_params().

from_vector(v, close=False, dirty_value=True)

Initialize this POVM using a vector of its parameters.

Parameters
vnumpy array

The 1D vector of POVM parameters. Length must == num_params().

closebool, optional

Whether v is close to this POVM’s current set of parameters. Under some circumstances, when this is true this call can be completed more quickly.

dirty_valuebool, optional

The value to set this object’s “dirty flag” to before exiting this call. This is passed as an argument so it can be updated recursively. Leave this set to True unless you know what you’re doing.

Returns

None

depolarize(amount)

Depolarize this POVM by the given amount.

Parameters
amountfloat or tuple

The amount to depolarize by. If a tuple, it must have length equal to one less than the dimension of the gate. All but the first element of each spam vector (often corresponding to the identity element) are multiplied by amount (if a float) or the corresponding amount[i] (if a tuple).

Returns

None