pygsti.baseobjs.protectedarray

Defines the ProtectedArray class

Module Contents

Classes

ProtectedArray

A numpy ndarray-like class that allows certain elements to be treated as read-only.

class pygsti.baseobjs.protectedarray.ProtectedArray(input_array, indices_to_protect=None)

Bases: object

A numpy ndarray-like class that allows certain elements to be treated as read-only.

Parameters
  • input_array (numpy.ndarray) – The base array.

  • indices_to_protect (tuple or list, optional) – A list or tuple of length input_array.shape, specifying the indices to protect along each axis. Values may be integers, slices, or lists of integers, e.g. (0, slice(None, None, None)).

__pos__(self)
__neg__(self)
__abs__(self)
__add__(self, x)
__radd__(self, x)
__sub__(self, x)
__rsub__(self, x)
__mul__(self, x)
__rmul__(self, x)
__truediv__(self, x)
__rtruediv__(self, x)
__floordiv__(self, x)
__rfloordiv__(self, x)
__pow__(self, x)
__eq__(self, x)

Return self==value.

__len__(self)
__int__(self)
__long__(self)
__float__(self)
__complex__(self)
__reduce__(self)

Helper for pickle.

__deepcopy__(self, memo)
__setstate__(self, state)
__getattr__(self, attr)
__getslice__(self, i, j)
__getitem__(self, key)
__setitem__(self, key, val)