+1 vote
asked by (190 points)

Dear All

I am trying to implement a product singlet state and measure the Sz of it. I tried tutorial/finiteT/ancilla.cc code as a start. My code is as follows:

#include "./itensor/all.h"
#include "./itensor/util/print_macro.h"

using namespace itensor;

int main()
{
int N = 2; //number of sites
auto sites = tJ(N,{"ConserveQNs=",true});
auto psi = MPS(sites);
for(int n = 1; n < N; n += 2)
    {
    auto s1 = sites(n);
    auto s2 = sites(n+1);
    auto wf = ITensor(s1,s2);
    wf.set(s1(1),s2(2), ISqrt2);
    wf.set(s1(2),s2(1), -ISqrt2);
    ITensor D;
    psi.ref(n) = ITensor(s1);
    psi.ref(n+1) = ITensor(s2);
    svd(wf,psi.ref(n),D,psi.ref(n+1));
    psi.ref(n) *= D;
    }
for (auto i : range1(N-1))
    {
    psi.position(i);

    auto bondket = psi(i)*psi(i+1);
    auto bondbra = dag(prime(bondket,"Site"));

    auto zzop = op(sites,"Sz",i)*op(sites,"Sz",i+1);
    auto zz = eltC(bondbra*zzop*bondket).real();
    printfln("%d Sz*Sz: %.12f",i,zz);
    }

for(auto j : range1(N))
        {
        psi.position(j);

        auto ket = psi(j);
        auto bra = dag(prime(ket,"Site"));
        auto Nupjop = op(sites,"Nup",j);
        auto Nupj = eltC(bra*Nupjop*ket).real();
        auto Ndnjop = op(sites,"Ndn",j);
        auto Ndnj = eltC(bra*Ndnjop*ket).real();
        auto szjop = op(sites,"Sz",j);
        auto szj = eltC(bra*szjop*ket).real();

        printfln("%d up:%.12f,dn:%.12f,tot:%.12f,sz:%.12f",j,Nupj,Ndnj,Nupj+Ndnj,szj);
        }
return 0;
}

So above I produced the product of singlet states (|up dn>-|dn up>)/sqrt2. I measured the Szi*Szj, Nupi, Ndni, Sz_i for this state. The result is :

1 S*S: 0.000000000000 Sz*Sz: 0.000000000000
1 up:0.500000000000,dn:0.000000000000,tot:0.500000000000,sz:0.250000000000
2 up:0.500000000000,dn:0.000000000000,tot:0.500000000000,sz:0.250000000000

This is wrong but I don't know why.

I changed the number of sites to 4 and the result is:

1 S*S: 0.000000000000 Sz*Sz: 0.000000000000
2 S*S: 0.062500000000 Sz*Sz: 0.062500000000
3 S*S: 0.000000000000 Sz*Sz: 0.000000000000

1 up:0.500000000000,dn:0.000000000000,tot:0.500000000000,sz:0.250000000000
2 up:0.500000000000,dn:0.000000000000,tot:0.500000000000,sz:0.250000000000
3 up:0.500000000000,dn:0.000000000000,tot:0.500000000000,sz:0.250000000000
4 up:0.500000000000,dn:0.000000000000,tot:0.500000000000,sz:0.250000000000

Can you pls tell me what is the problem of it? Thanks!

Eric

commented by (70.1k points)
Hi Eric,
Thanks for the question. I think the problem is in how you are making the state in the first place. For the tJ site set, the first state of each index is the empty state (no particle), so it has no spin. The second state is the “up”, single electron state. The third is the “down”, single electron state.

So for making singlets, you should be superposing s1(2),s2(3) and s1(3),s2(2). Can you please try that to see if it works?

Miles
commented by (190 points)
Hi Miles,

Thanks for your quick response. I changed it to s1(2),s2(3) and s1(3), s2(2). The measurement of Up Dn Up+Dn Sz for site i is correct. But the measurement of Sz_i*Sz_j is not. My result is:

    Sz*Sz: -0.250000000000

I think the result of <Sz_1 * Sz_2>=1/2*(1*(-1)+(-1)*1)=-1.

ps: in my question, I missed typing the codes of measuring the S_i*S_j.
commented by (70.1k points)
Glad it’s working better now. Have you accounted for the fact that the Sz operator is defined as 1/2 * \sigma_z, where \sigma_z is the z Pauli matrix? Then that would account for the factor of 0.25 because there are two Sz operators for a combined factor of 1/4.
commented by (190 points)
Hi Miles,

Thanks! It works. I thought Sz is defined as \sigma_z and the unit is 1 in the ITensor library to store quantum numbers as integers. Because I saw this somewhere in the Q&A. If 1/2 then it makes sense.

Eric
commented by (190 points)
Dear Miles,

Additionally, I found that the dimensions of each site are 3x2, 3x2,3x2,3x2,...(I produced product singlet state of N tJ sites using the above code). I thought they should be 3x3, 3x3x9, 9x3x27,...3^n x 3 x 3^(n+1),...according to MPS. Do I misunderstand something?

Thanks

Eric
commented by (70.1k points)
Hi when you say dimensions of each site, I think you mean each MPS tensor correct? Yes the sizes of 3x2, then 2x3, etc. are correct. The reason is that a product of singlets can be exactly represented by an MPS of bond dimension 2, because there are only two different states that have to be correlated with each other between neighboring sites.

The idea that the bond dimensions should grow exponentially as in the second part of your question would only be true, or necessary, for a state which is highly entangled such as a state which is drawn at random from the full many-body Hilbert space. But the key idea of MPS is that they are useful for representing states which are not random, but which have limited correlations such as ground states of local Hamiltonians. Then the hope is that one can keep the bond dimension below some maximum value of at most a few hundreds or perhaps thousands only (not exponentially growing) and still represent the state accurately.
commented by (70.1k points)
Regarding the QN conventions, I should note that we *do* store the quantum numbers as integers, in units of spin 1/2. This is because integer arithmetic is exact in C++ whereas floating point is not and would overcomplicate the code by a lot. The fact that we store the Sz values as integers is just a programming detail, though, and does not imply a certain definition of the Sz operator itself. We define the Sz operator the same way as in the standard physics literature. But I can see how the integer Sz values inside the quantum numbers could be confusing for sure.
commented by (190 points)
Thank you Miles! I get your points.
commented by (70.1k points)
Thanks for letting me know it helped clarify things. For the Julia version of ITensor, we are considering using Julia’s built-in support for exact rational number arithmetic to allow QN values to be rational numbers. This could help a lot with spin quantum numbers, since I think everyone, including me and the other developers, has a hard time mapping in our heads back and forth between actual spin values and the integers we use in ITensor QNs.

Best,
Miles
commented by (190 points)
Dear Miles,

Great! I am looking forwards to it.

Eric

1 Answer

0 votes
answered by (70.1k points)

(See answer in comments above.)

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

...