Skip to content
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

Subtle error message for symmetry broken unitcell #82

Open
ryanlevy opened this issue Apr 26, 2024 · 2 comments
Open

Subtle error message for symmetry broken unitcell #82

ryanlevy opened this issue Apr 26, 2024 · 2 comments

Comments

@ryanlevy
Copy link
Contributor

[From the forum here ]
The following OpSum appears to break the code due to a single Op not being wrapped into a sum

function ITensorInfiniteMPS.unit_cell_terms(::Model"bad")
    opsum = OpSum()
    opsum += 0.5, "Z",1
    opsum += 0.4, "Z",2 # the problem
    opsum += -1, "X",1,"X",2
    return opsum
end

initstate(n) = isodd(n) ? "Up" : "Dn"
s = infsiteinds("S=1/2", N;  conserve_qns = false, initstate)
model = Model("bad")
# Form the Hamiltonian
H = InfiniteSum{MPO}(model, s;)

with the error MethodError: no method matching translatecell(::ITensorInfiniteMPS.var”#_shift_cell#176"{Int64}, ::Scaled{ComplexF64, Prod{Op}}, ::Int64) "

What's happening is that there's only one term in the second "translate" term

 julia> _infinite_terms = ITensorInfiniteMPS.infinite_terms(model)
 sum(
  0.5 Z(1,)
  -1.0 X(1,) X(2,)
)
 0.4 Z(2,)

For this to be a legal unit cell, I'd expect the user to include"X",2,"X",3 (otherwise its a trivial uniform product state I suppose).
Not sure if its possible to catch this and write a more helpful message, etc

@LHerviou
Copy link
Contributor

Sorry for the absurdly long delay of response.
This package is in a bit of hiatus as I am (and others also) waiting for the rewriting of the core of ITensors before putting back more work into it.

You are correct, of course, the error message should be improved.

@mtfishman
Copy link
Member

@LHerviou regarding how any rewrites going on in core ITensor packages may affect this package, see my comment: #87 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants