+1 vote
asked by (1.2k points)

Hi,

For the following code, the answer should be "4.0", but it gives "2.0". Maybe it is a bug. Thanks.

s = Index([QN(("N",i,1))=>1 for i = 1:2];dir = ITensors.Arrow(1))
l = dag(addtags(s,"left"))
r = addtags(s,"right")
u = addtags(s,"up")
d = dag(addtags(s,"down"))
A = emptyITensor(l,r,u,d)
A[1,1,1,1] = 1.0
A[1,1,2,2] = 1.0
A[2,2,1,1] = 1.0
A[2,2,2,2] = 1.0
println(A*delta(dag(l),dag(r))*delta(dag(u),dag(d)))

Jin

commented by (14.1k points)
Thanks for the report, I am seeing the same thing. I'll take a look.

1 Answer

+1 vote
answered by (14.1k points)

This was indeed a bug in the low level contraction code for contracting block sparse tensors. I've fixed it here: https://github.com/ITensor/NDTensors.jl/pull/64 . The fix will be available in the next ITensors release (v0.1.38), it should be available later today.

commented by (1.2k points)
Thanks, Matt.
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

...