-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rewrite MPS types to use C
instead of CR
(and CL
) and add ψ.center
functionality.
#216
Conversation
… in unmutable `FiniteMPS` struct
…or center tensor
In my opinion renaming CR to C might also be confusing since it's then unclear if C[site] corresponds to the C matrix left or right of that site. In hindsight it's probably most logical to allow indixation of the Cs with half integers. This way we get things like : |
Nothing that good documentation (that is planned) can't fix. Its also in the docstring of |
It surely was confusing. Essentially I looked into the code to see what it returned whenever relevant... For the front end user half indexing might be very handy and user friendly though. If you and @lkdvos are open to this I can make a PR. Imo both can just coexist :) |
@Gertian indexing with |
This PR changes the name of MPS bondtensors. The bond tensor for all MPS types is now called
C
and is equivalent to what was previously calledCR
.A new property "center" of
FiniteMPS
is introduced. It can be accessed throughψ.center
.It will return a
HalfInteger
i
:isinteger(i)
→i
is a whole number and indicates the location of the firstAC
tensor present inψ.ACs
ishalfodd(i)
→i
is a half-odd-integer (e.g. 3/2), meaning that there are noAC
tensors, and indicating between which sites the bond tensor lives.For example:
i
= 3/2 (= 1.5) means that there lives aC
between theAL
on site 1 and theAR
on site 2The goal is to use this new
center
property to avoid unnecessary gaugefixing in methods likenorm(::FiniteMPS)
where before, the center gauge was brought to the first site, after which the norm was calculated. After this PR the norm is calculated using the (bond) tensor atψ.center
, without gaugefixing.An important note is that
ψ.C[center(ψ)]
does not work,ψ.C
should be indexed using integers andψ.C[i]
returns the bond tensor between sites i and i+1