pygsti.modelmembers.povms.computationalpovm

Defines the ComputationalBasisPOVM class

Module Contents

Classes

ComputationalBasisPOVM

A POVM that "measures" states in the computational "Z" basis.

class pygsti.modelmembers.povms.computationalpovm.ComputationalBasisPOVM(nqubits, evotype='default', qubit_filter=None, state_space=None)

Bases: pygsti.modelmembers.povms.povm.POVM

A POVM that “measures” states in the computational “Z” basis.

Parameters
  • nqubits (int) – The number of qubits

  • evotype (Evotype or str, optional) – The evolution type. The special value “default” is equivalent to specifying the value of pygsti.evotypes.Evotype.default_evotype.

  • qubit_filter (list, optional) – An optional list of integers specifying a subset of the qubits to be measured.

  • state_space (StateSpace, optional) – The state space for this POVM. If None a default state space with the appropriate number of qubits is used.

classmethod from_pure_vectors(cls, pure_vectors, evotype, state_space)
__contains__(self, key)

For lazy creation of effect vectors

__iter__(self)

Implement iter(self).

__len__(self)

Return len(self).

keys(self)

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

values(self)

An iterator over the effect vectors of this POVM.

items(self)

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

__getitem__(self, key)

For lazy creation of effect vectors

__reduce__(self)

Needed for OrderedDict-derived classes (to set dict items)

simplify_effects(self, 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

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

Returns

OrderedDict of POVMEffects

to_memoized_dict(self, mmg_memo)

Create a serializable dict with references to other objects in the memo.

Parameters

mmg_memo (dict) – Memo dict from a ModelMemberGraph, i.e. keys are object ids and values are ModelMemberGraphNodes (which contain the serialize_id). This is NOT the same as other memos in ModelMember (e.g. copy, allocate_gpindices, etc.).

Returns

mm_dict (dict) – A dict representation of this ModelMember ready for serialization This must have at least the following fields:

module, class, submembers, params, state_space, evotype

Additional fields may be added by derived classes.

classmethod _from_memoized_dict(cls, mm_dict, serial_memo)

For subclasses to implement. Submember-existence checks are performed, and the gpindices of the return value is set, by the non-underscored :method:`from_memoized_dict` implemented in this class.

_is_similar(self, other, rtol, atol)

Returns True if other model member (which it guaranteed to be the same type as self) has the same local structure, i.e., not considering parameter values or submembers

__str__(self)

Return str(self).