-
Notifications
You must be signed in to change notification settings - Fork 14
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
Infinite range gives InexactError: trunc(Int64, Inf) #27
Comments
Hi, My apologies for this inconvenience. The macro is supposed to handle these kinds of syntactic sugar features (in this case just replacing the range with In this case, you can just simply replace the iterator with some type of lattice, which should then work. As a side note, do you feel like this kind of syntax adds a lot of value? If so, I will definitely try and fix it and support this again. |
Thanks for the quick response. I think I managed to construct the Hamiltonian by copying parts of the source code for some of the predefined models. The syntax there is however somewhat cumbersome.
An example would help:) |
I think you need to add an explicit iteration over the vertices for it to know what to do. This should work I think: H = @mpoham sum(σᶻᶻ(){i, i+1} + h * σˣ(){i} for i in vertices(InfiniteChain(1))) |
Hi,
Trying out one of the examples to create a Hamiltonian on an infinite chain:
yields
ERROR: InexactError: trunc(Int64, Inf)
. Tried replacing Inf with ∞ but it is not recognized.Am I missing a certain package or something?
I have Julia 1.10
The text was updated successfully, but these errors were encountered: