+1 vote
asked by (150 points)

Is there any way to construct the initial state so that it will be a product state of singlets??
For example if I have 2N sites I want N singlets to initialize the state.

1 Answer

0 votes
answered by (70.1k points)

Hi Dhiman,
Good question as this is an important thing to be able to do sometimes. And of course you can do this, yes, as one can set the elements of an ITensor or IQTensor individually so you can make any MPS this way.

Here is a sample code that makes an MPS which is a product state of singlets. To do the IQMPS version all you should need to do is change MPS to IQMPS and ITensor to IQTensor.

auto psi = MPS(sites);
for(int n = 1; n <= 2*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.Aref(n) = ITensor(s1);
    psi.Aref(n+1) = ITensor(s2);
    psi.Aref(n) *= D;
commented by (150 points)
Thanks miles.
commented by (630 points)
edited by
Hi Miles,
           This is very helpful, thank you. Could you please let me know how I can edit this code to get a product state of singlets with free spins at the edges, i.e., |up> x |singlet> x ..... x |singlet> x |down>, where x is the symbol for the tensor product? Thanks in advance.

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.