+1 vote
asked by (220 points)

I have been using AutoMPO to create MPO's with both onsite and nearest-neighbor terms, but after a recent update, this no longer seems to work as before:

const int N = 4;
SpinHalf hs(N);

AutoMPO ampo(hs),bmpo(hs);
for(int i = 1 ; i <= N ; ++i) {
    if(i != N) {
        ampo += -1.0,"Sz",i,"Sz",i+1;
        bmpo += -1.0,"Sz",i,"Sz",i+1;
        }
    bmpo += -1.0,"Sx",i;
    }
auto A = MPO(ampo);
println("checkpoint 1");
auto B = MPO(bmpo);
println("checkpoint 2");

For me, MPO A (with pair terms only) correctly generates, but the second call to the MPO constructor causes the program to crash with the following ITError:

doTask not defined for task CalcDiv and storage type QMixed<Real>

Which I suppose comes from the storage type changing between the two cases. I am up-to-date with the git branch master.

1 Answer

+1 vote
answered by (70.1k points)

Edit: fixed on Sep 28
https://github.com/ITensor/ITensor/commit/f426166

Hi Brendan,
Unfortunately this is just a straight up bug / missing feature in version 2 right now.

The longish explanation is that in order not to have to write the AutoMPO logic out twice, I wrote it for IQTensors/IQMPOs and then use this to handle the ITensor/MPO case as well. In version 1, IQTensors were a lot less "picky" about whether they were well-defined or not. But in version 2, they are a lot more strict which makes them much more efficient but also means you can't get away with some tricks I was using before.

So what I need to do is to rewrite AutoMPO to handle the case of operators which don't conserve quantum numbers such as Sx. This is on my short list of things to do, but will take a week at least.

Please email me in a week or two if you haven't heard back and I can let you know where I'm at with it.

Miles

commented by (220 points)
Hi Miles,

I see now, I originally guessed that QMixed was just some sort of compression format and this was a simple matter of implementing a method. Appreciate the commitment to a relatively major overhaul. (Also non-QN conserving operators seem to work fine in the v2.0.10 branch, so it's not like I have to roll it way back.)

Brenden
commented by (70.1k points)
Hi Brenden,
Turns out it wasn't such a big fix after all (as you noticed it still worked as recently as v2.0.10). So I was able to fix it much more quickly than expected.

Please try the latest tip of the master branch and let me know if it still doesn't work for you.

Miles
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

...