Skip to content

Commit

Permalink
Have meaningful comments for classes in evotypes/densitymx_slow/
Browse files Browse the repository at this point in the history
  • Loading branch information
rileyjmurray committed Feb 3, 2024
1 parent 6c2e5f3 commit eb79162
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 17 deletions.
12 changes: 6 additions & 6 deletions pygsti/evotypes/densitymx_slow/effectreps.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,9 @@
from ...tools import matrixtools as _mt


"""
Riley note:
These classes are actually used for representing linear operators that
act on superkets, not linear operators that act on density matrices.
"""

class EffectRep:
"""Any representation of an "effect" in the sense of a POVM."""

def __init__(self, state_space):
self.state_space = _StateSpace.cast(state_space)

Expand All @@ -32,6 +28,10 @@ def probability(self, state):


class EffectRepConjugatedState(EffectRep):
"""
A real superket representation of an "effect" in the sense of a POVM.
Internally uses a StateRepDense object to hold the real superket.
"""

def __init__(self, state_rep):
self.state_rep = state_rep
Expand Down
13 changes: 8 additions & 5 deletions pygsti/evotypes/densitymx_slow/opreps.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,10 @@
from ...tools import matrixtools as _mt
from ...tools import optools as _ot

"""
Riley note:
These classes are actually used for representing linear operators that
act on superkets, not linear operators that act on density matrices.
"""

class OpRep:
"""Any representation of a linear operator on a defined vector space."""

def __init__(self, state_space):
self.state_space = state_space

Expand Down Expand Up @@ -58,6 +55,12 @@ def rmv(v):


class OpRepDenseSuperop(OpRep):
"""
A real superoperator representation of a quantum channel.
The operator's action (and adjoint action) work with Hermitian matrices
stored as *vectors* in their real superket representations.
"""

def __init__(self, mx, basis, state_space):
state_space = _StateSpace.cast(state_space)
if mx is None:
Expand Down
12 changes: 6 additions & 6 deletions pygsti/evotypes/densitymx_slow/statereps.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,9 @@
_fastcalc = None


"""
Riley note:
These classes are actually used for representing superkets,
not density matrices.
"""

class StateRep:
"""A real superket representation of a Hermitian matrix of given order."""

def __init__(self, data, state_space):
#vec = _np.asarray(vec, dtype='d')
assert(data.dtype == _np.dtype('d'))
Expand Down Expand Up @@ -67,6 +63,10 @@ def __str__(self):


class StateRepDense(StateRep):
"""
An almost-trivial wrapper around StateRep.
Implements the "base" property and defines a trivial "base_has_changed" function.
"""

def __init__(self, data, state_space, basis):
#ignore basis for now (self.basis = basis in future?)
Expand Down

0 comments on commit eb79162

Please sign in to comment.