+1 vote
asked by (310 points)

Hi All,

I read all the official docs about the construction of new site types with the julia version of ITensor but there is nothing on how to overload the state() function. I just followed standard overload procedure as with the op! functions but the system cannot find my definition of state().

Could you please point me to the source of the erro in the code below? (the code returns an error)

using ITensors
ITensors.space(::SiteType"Xev") = 8 
ITensors.state(::StateName"0", ::SiteType"Xev") = [1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
N = 10
sites = siteinds("Xev",N)
ψ = MPS(sites,"0")

Thanks,
lello

commented by (70.1k points)
Thanks for the question - it is a bug in ITensors.jl! So I am working on fixing it tonight and will let you know when the fix is ready.

Thanks,
Miles

1 Answer

0 votes
answered by (70.1k points)

Hi, thanks for pointing out this issue! We have fixed it, and it will be fixed in the new version 0.2.5 which will be available in the next few hours or so (after the Julia registration system updates).

Miles

commented by (310 points)
Thanks for the fix, now the code works.
Welcome to ITensor Support Q&A, where you can ask questions and receive answers from other members of the community.

Formatting Tips:
  • To format code, indent by four spaces
  • To format inline LaTeX, surround it by @@ on both sides
  • To format LaTeX on its own line, surround it by $$ above and below
  • For LaTeX, it may be necessary to backslash-escape underscore characters to obtain proper formatting. So for example writing \sum\_i to represent a sum over i.
If you cannot register due to firewall issues (e.g. you cannot see the capcha box) please email Miles Stoudenmire to ask for an account.

To report ITensor bugs, please use the issue tracker.

Categories

...