0 votes
asked by (680 points)
edited by

This may be a basic question, but I am trying to implement a thermal state calculation, and I am definitely doing something incorrectly. I think my problem lies in using AutoMPO.

At one point, I am calculating the operator S^zk (the Fourier transform of S^zi), and I build S^z_k using AutoMPO as

        auto ampo = AutoMPO(sites);
        for(auto s : lattice->getSites())
        {
            if(s.t == Lattice::physical)
            {
               ampo += sin(0.5*(s.s+1)*q),"Sz",s.s;
            }
        }

sites is of type SpinHalf with 2N sites, s.t is a tag as either "physical" or "environment", and s.s is the site number. all physical sites are odd, and ancilla sites are even.

I also need to calculate the Louivillian defined by L = HxI - IxH, with H the Heisenberg Hamiltonian. My code for this is

    auto ampo = AutoMPO(sites);
    for(auto b : lattice->getBonds())
    {
        if(b.t == Lattice::physical)
        {
            ampo += 0.5,"S+",b.s1,"S-",b.s2;
            ampo += 0.5,"S-",b.s1,"S+",b.s2;
            ampo +=     "Sz",b.s1,"Sz",b.s2;
        }
        if(b.t == Lattice::environment)
        {
            ampo += -0.5,"S+",b.s1,"S-",b.s2;
            ampo += -0.5,"S-",b.s1,"S+",b.s2;
            ampo += -1.0,"Sz",b.s1,"Sz",b.s2;
        }
    }
    L = toMPO(ampo);

My main question is, can I recycle AutoMPO for use with a thermal state or do I need to modify something else to do this? And how do I correctly implement tensoring with the identity on the ancilla degrees of freedom?

Thank you for your time,
Nick

1 Answer

0 votes
answered by (680 points)

So I figured it out, it was somewhere else in my code that the issue was arising. For anyone else having the same issue, AutoMPO automatically puts the identity on operators that are not specified.

commented by (14.1k points)
Thanks for the update!
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

...