-
Notifications
You must be signed in to change notification settings - Fork 118
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
Add compatible
function checking sites against MPS, MPO
#743
Comments
The main corner case with defining it as Also I would prefer something a bit more descriptive, like |
These are good considerations. I agree about the function name. For the MPO case, my vote would be that if either set of MPO inds are an exact match (including prime level) then it returns true, otherwise false. So the meaning would be “an MPS with these inds can be multiplied by this MPO without any index adjustments”. |
There's already a function like that used for checking index compatibility at the beginning of DMRG: https://github.com/ITensor/ITensors.jl/blob/v0.2.6/src/mps/dmrg.jl#L41 |
There is a lot of similar functionality floating around as internal functions so I think it is a matter of choosing a good interface and exposing it externally. I've been trying to go for a consistency between the ITensor level index functions and the MPS/MPO index functions, so something like |
Define a function
compatible(sites::Vector{<:Index},psi::MPS)
which checks thatsites
andpsi
are the same length and thatsites==siteinds(psi)
essentially. (Perhaps that could be the whole definition.)The text was updated successfully, but these errors were encountered: