WIP: simplify hilbert space code
Rewrite hilbert_space.py, while keeping its basic structure unchanged:
-
Remove
Site
, only keepSiteArray
-
Reogranize Hilbert spaces into the ABC
HilbertSpace
, and the concrete classesSimple
andProduct
. -
Introduce a global (weakref) registry of names of simple Hilbert spaces. This way, the uniqueness of Hilbert spaces is enforced.
Some bits of "porcelain" that were removed (like infinite_part
or __call__
) can be added back easily in one form or other when needed.
Here are some idea that I haven't pursued so far:
-
Hilbert spaces could support numpy-like indexing to create site arrays. For example, when
space
is indexed by(x, y, spin)
it would be natural to writespace[2, 3]
to designate the two DOFs(2, 3, 0)
and(2, 3, 1)
. Other possibilities would bespace[ [(1, 1), (1, 2), (2, 3)] ]
or evenspace[0:10, 0:10, 0]
. -
SiteArrays could be interpreted as Hilbert spaces and generalized to also contain infinite dimensions. This could be used as a way to describe translational symmetries, but I'm not sure whether it would be a good way.