<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>ITensor Support Q&amp;A - Recent questions</title>
<link>http://itensor.org/support/questions</link>
<description>Powered by Question2Answer</description>
<item>
<title>Best way to create equal amplitude states</title>
<link>http://itensor.org/support/3931/best-way-to-create-equal-amplitude-states</link>
<description>&lt;p&gt;I need to create equal amplitude superposition (RK type) superpositions to use as initial states in dynamics.&lt;/p&gt;

&lt;p&gt;I checked and the required bond-dimension is not onerous, so it should be possible to represent these using MPS&lt;/p&gt;

&lt;p&gt;Claude suggested two methods that I knew of (brute force construction and imaginary time evolution approximation to the projector) and the third which seemed more elegant using &lt;/p&gt;

&lt;p&gt;MPO(sites, &quot;MaxEntangler&quot;)&lt;/p&gt;

&lt;p&gt;seems like a neat trick but I never heard of MaxEntangler .. any quick thoughts?&lt;/p&gt;

&lt;p&gt;thanks,vadim&lt;/p&gt;
</description>
<guid isPermaLink="true">http://itensor.org/support/3931/best-way-to-create-equal-amplitude-states</guid>
<pubDate>Tue, 08 Apr 2025 01:42:19 +0000</pubDate>
</item>
<item>
<title>Exponential of MPO</title>
<link>http://itensor.org/support/3928/exponential-of-mpo</link>
<description>&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;So I've been trying to use this function: expHermitian(ITensor H, Cplx tau = 1)&lt;br&gt;
but the operator that I want to exponentiate is the total Sz. Here is the code that I have so far:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;auto ampo2  = AutoMPO(sites);
            for(auto k : range1(Nspins))
                {
                ampo2 += &quot;Sz&quot;,k;
                }        
         auto proj = toMPO(ampo2);
        auto exp2H = expHermitian(proj,2);&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;but I get an error that the function expects an ITensor object as the first argument (as expected). Is it possible to somehow do what I am trying to do?&lt;/p&gt;

&lt;p&gt;Thank you.&lt;/p&gt;
</description>
<guid isPermaLink="true">http://itensor.org/support/3928/exponential-of-mpo</guid>
<pubDate>Fri, 23 Sep 2022 16:22:44 +0000</pubDate>
</item>
<item>
<title>Adding a field to Hamiltonian to form gates</title>
<link>http://itensor.org/support/3926/adding-a-field-to-hamiltonian-to-form-gates</link>
<description>&lt;p&gt;I would like to perform TEBD with the Hamiltonian,&lt;br&gt;
$$&lt;br&gt;
H=\sum^{N-1}&lt;em&gt;{i} (XX + YY) + \sum&lt;/em&gt;{i=1}^{N} V(i)Z&lt;br&gt;
$$&lt;br&gt;
Where V(i) is just some function that depends on the site. I want this written as a gate but when I compare numerics to small system size ED they do not match. Here is the code for creating my gates. Help is much appreciated&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;function Gates(N::Int, dt::Float64, J, λ, q, phi, sindex)
gates = ITensor[]
for j=1:N-1
    s1 = sindex[j]
    s2 = sindex[j+1]
    if j != (N-1)
        Wj = 2*λ*cos(2*pi*q*j + phi)
        hj = J[j]*0.5*(op(&quot;S+&quot;, s1)*op(&quot;S-&quot;, s2) + op(&quot;S-&quot;, s1)*op(&quot;S+&quot;, s2)) + Wj*op(&quot;Sz&quot;, s1)*op(&quot;Id&quot;, s2)
        Gj = exp(-1.0im*0.5*dt*hj)
    elseif j==(N-1)
        WjN = 2*λ*cos(2*pi*q*N + phi)
        Wj = 2*λ*cos(2*pi*q*j + phi)
        hj = J[j]*0.5*(op(&quot;S+&quot;, s1)*op(&quot;S-&quot;, s2) + op(&quot;S-&quot;, s1)*op(&quot;S+&quot;, s2)) + WjN*op(&quot;Id&quot;, s1)*op(&quot;Sz&quot;, s2) + Wj*op(&quot;Sz&quot;, s1)*op(&quot;Id&quot;, s2)
        Gj = exp(-1.0im*0.5*dt*hj)
    end
    push!(gates, Gj)
end
append!(gates, reverse(gates))
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;end&lt;/p&gt;
</description>
<guid isPermaLink="true">http://itensor.org/support/3926/adding-a-field-to-hamiltonian-to-form-gates</guid>
<pubDate>Wed, 24 Aug 2022 19:36:54 +0000</pubDate>
</item>
<item>
<title>&quot;No space left on device&quot; error when using write_to_disk feature in Itensor Julia</title>
<link>http://itensor.org/support/3923/space-device-error-using-write_to_disk-feature-itensor-julia</link>
<description>&lt;p&gt;Hi there,&lt;/p&gt;

&lt;p&gt;I'm using write&lt;em&gt;when&lt;/em&gt;maxdim_exceeds keyword in dmrg to implement writing to disk, but I met the error message shown below. It says that there is not space left on the disk, but I checked that there is enough space in the directory (there is 2TB available space and the tensors are expected to occupy around 400GB). Can anyone help?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;DMRG Command:&lt;/strong&gt;&lt;br&gt;
  energy,psi = dmrg(H,psi,sweeps; write&lt;em&gt;when&lt;/em&gt;maxdim_exceeds=10000)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Space of the Directory&lt;/strong&gt;&lt;br&gt;
Filesystem       1K-blocks        Used  Available Use% Mounted on&lt;br&gt;
/dev/md2       15625699328 13595822844 2029876484  88% /scratch&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Error Message:&lt;/strong&gt;&lt;br&gt;
ERROR: LoadError: SystemError: close: No space left on device&lt;br&gt;
Stacktrace:&lt;br&gt;
  [1] systemerror(p::String, errno::Int32; extrainfo::Nothing)&lt;br&gt;
    @ Base ./error.jl:174&lt;br&gt;
  [2] #systemerror#68&lt;br&gt;
    @ ./error.jl:173 [inlined]&lt;br&gt;
  [3] systemerror&lt;br&gt;
    @ ./error.jl:173 [inlined]&lt;br&gt;
  [4] close&lt;br&gt;
    @ ./iostream.jl:63 [inlined]&lt;br&gt;
  [5] open(::Serialization.var&quot;#1#2&quot;{ITensor}, ::String, ::Vararg{String}; kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})&lt;br&gt;
    @ Base ./io.jl:332&lt;br&gt;
  [6] open&lt;br&gt;
    @ ./io.jl:328 [inlined]&lt;br&gt;
  [7] serialize&lt;br&gt;
    @ ~/julia-1.7.2/share/julia/stdlib/v1.7/Serialization/src/Serialization.jl:775 [inlined]&lt;br&gt;
  [8] setindex!&lt;br&gt;
    @ ~/.julia/packages/SerializedElementArrays/cdFxy/src/SerializedElementArrays.jl:78 [inlined]&lt;br&gt;
  [9] &lt;em&gt;makeL!(P::ITensors.DiskProjMPO, psi::MPS, k::Int64)&lt;br&gt;
    @ ITensors ~/.julia/dev/ITensors/src/mps/abstractprojmpo.jl:164&lt;br&gt;
 [10] makeL!&lt;br&gt;
    @ ~/.julia/dev/ITensors/src/mps/diskprojmpo.jl:103 [inlined]&lt;br&gt;
 [11] position!&lt;br&gt;
    @ ~/.julia/dev/ITensors/src/mps/abstractprojmpo.jl:219 [inlined]&lt;br&gt;
 [12] macro expansion&lt;br&gt;
    @ ~/.julia/dev/ITensors/src/mps/dmrg.jl:206 [inlined]&lt;br&gt;
 [13] macro expansion&lt;br&gt;
    @ ~/.julia/packages/TimerOutputs/LDL7n/src/TimerOutput.jl:252 [inlined]&lt;br&gt;
 [14] macro expansion&lt;br&gt;
    @ ~/.julia/dev/ITensors/src/mps/dmrg.jl:205 [inlined]&lt;br&gt;
 [15] macro expansion&lt;br&gt;
    @ ./timing.jl:299 [inlined]&lt;br&gt;
 [16] dmrg(PH::ProjMPO, psi0::MPS, sweeps::Sweeps; kwargs::Base.Pairs{Symbol, Int64, Tuple{Symbol}, NamedTuple{(:write&lt;/em&gt;when&lt;em&gt;maxdim&lt;/em&gt;exceeds,), Tuple{Int64}}})&lt;br&gt;
    @ ITensors ~/.julia/dev/ITensors/src/mps/dmrg.jl:186&lt;br&gt;
 [17] #dmrg#958&lt;br&gt;
    @ ~/.julia/dev/ITensors/src/mps/dmrg.jl:47 [inlined]&lt;/p&gt;
</description>
<guid isPermaLink="true">http://itensor.org/support/3923/space-device-error-using-write_to_disk-feature-itensor-julia</guid>
<pubDate>Thu, 28 Jul 2022 06:37:29 +0000</pubDate>
</item>
<item>
<title>about MixedSiteSet for electron and spin</title>
<link>http://itensor.org/support/3922/about-mixedsiteset-for-electron-and-spin</link>
<description>&lt;p&gt;Dear there,&lt;br&gt;
I want to use dmrg to solve a Hamiltonian which has couplied spin 1/2 operator and electron operator on same site. &lt;br&gt;
For example:  H= a \sum{n}  {Sx(n)C^dag&lt;em&gt;up(n)C&lt;/em&gt;up(n)}  +  b\sum{n}   {Sz(n)}.&lt;/p&gt;

&lt;p&gt;After some searching, I found I need use MixedSiteSet. But so far, I only find a previous example for a Holstein-type new site set , which is: &lt;br&gt;
using Holstein = MixedSiteSet(ElectronSite,BosonSite);&lt;/p&gt;

&lt;p&gt;And I saw in that answer, it mentions &quot;the odd numbered sites will be electron sites and the even numbered sites will be boson sites&quot;. But in my case, I need electron and spin on same site. I'm not sure if this kind of MixedSiteSet already exits in Itensor or how could I construct this?&lt;/p&gt;

&lt;p&gt;Thank you so much!!&lt;/p&gt;
</description>
<guid isPermaLink="true">http://itensor.org/support/3922/about-mixedsiteset-for-electron-and-spin</guid>
<pubDate>Wed, 27 Jul 2022 23:59:53 +0000</pubDate>
</item>
<item>
<title>Coupling a spin to heat bath</title>
<link>http://itensor.org/support/3920/coupling-a-spin-to-heat-bath</link>
<description>&lt;p&gt;Hey, can someone help me in how to write an initial state of heat but coupled to a spin ? can I just treat this as a spin chain and couple in the N+1 site a spin ? or should I do otherwise ?&lt;/p&gt;
</description>
<guid isPermaLink="true">http://itensor.org/support/3920/coupling-a-spin-to-heat-bath</guid>
<pubDate>Tue, 24 May 2022 06:35:58 +0000</pubDate>
</item>
<item>
<title>New Forum Launched!</title>
<link>http://itensor.org/support/3913/new-forum-launched</link>
<description>&lt;p&gt;We are happy to announce a brand new ITensor Support Forum based on the Discourse software. Please post all new questions there. The new address is:&lt;/p&gt;

&lt;p&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://itensor.discourse.group&quot;&gt;https://itensor.discourse.group&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;You should be able to register a new account there yourself, but if you have any difficulties feel free to email support@itensor.org for help. &lt;/p&gt;

&lt;p&gt;We will definitely leave this page up so that you can search through previous questions, but we request that you please post any future questions at the new forum.&lt;/p&gt;
</description>
<guid isPermaLink="true">http://itensor.org/support/3913/new-forum-launched</guid>
<pubDate>Thu, 14 Apr 2022 21:48:08 +0000</pubDate>
</item>
<item>
<title>how to measure correlator of two point with 4 operators in two component bose-hubbard model(c++)</title>
<link>http://itensor.org/support/3898/measure-correlator-point-operators-component-hubbard-model</link>
<description>&lt;p&gt;Dear ITensor users&lt;/p&gt;

&lt;p&gt;I have tried to obtain two correlation functions in a two component bose-hubbard model. But I got nothing about correlation function in my output files and the output file reported errors  as the following:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;Mismatched QN Index from set 1 (dim=6|id=345|&quot;n=32,Site,Boson&quot;)' &amp;lt;Out&amp;gt;
  1: 1 QN({&quot;Nb&quot;,0})
  2: 1 QN({&quot;Nb&quot;,1})
  3: 1 QN({&quot;Nb&quot;,2})
  4: 1 QN({&quot;Nb&quot;,3})
  5: 1 QN({&quot;Nb&quot;,4})
  6: 1 QN({&quot;Nb&quot;,5})
Mismatched QN Index from set 2 (dim=6|id=345|&quot;n=32,Site,Boson&quot;)' &amp;lt;Out&amp;gt;
  1: 1 QN({&quot;Nb&quot;,0})
  2: 1 QN({&quot;Nb&quot;,1})
  3: 1 QN({&quot;Nb&quot;,2})
  4: 1 QN({&quot;Nb&quot;,3})
  5: 1 QN({&quot;Nb&quot;,4})
  6: 1 QN({&quot;Nb&quot;,5})

Mismatched QN Index arrows
From line 912, file itensor.cc
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;You can obtain the Hamiltonian of two component bose-hubbard model from equation (1) in this paper: &lt;a rel=&quot;nofollow&quot; href=&quot;https://doi.org/10.1103/PhysRevA.80.023619&quot;&gt;https://doi.org/10.1103/PhysRevA.80.023619&lt;/a&gt;&lt;br&gt;
Or you can see it in the question posted before in the community：&lt;a rel=&quot;nofollow&quot; href=&quot;http://itensor.org/support/2973/two-component-bose-hubbard-model?show=2973#q2973&quot;&gt;http://itensor.org/support/2973/two-component-bose-hubbard-model?show=2973#q2973&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I want to measure two different correlation functions of two point  with 4 operators as the followings.&lt;br&gt;
 1. $$\braket{\hat{a}^{\dagger }&lt;em&gt;i\hat{b}^{\dagger}&lt;/em&gt;i\hat{a}&lt;em&gt;j\hat{b}&lt;/em&gt;j }$$&lt;br&gt;
 2. $$\braket{\hat{a}^{\dagger }&lt;em&gt;i\hat{b}&lt;/em&gt;i\hat{a}&lt;em&gt;j\hat{b}^{\dagger }&lt;/em&gt;j }$$&lt;br&gt;
They were also presented in the paper I mentioned above.(equation (13) (14)) &lt;/p&gt;

&lt;p&gt;In my codes, I made a copy of boson.h and called it a&lt;em&gt;boson.h, and I renamed all operators in a&lt;/em&gt;boson.h as &quot;Aa&quot;, &quot;Aadag&quot;, &quot;Na&quot;. Also, I rename its class as &quot;ABosonSite&quot;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Here is my codes for groundstate&lt;/strong&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;float t=atof(argv[1]);
float U_12=atof(argv[2]);
int L = atof(argv[3]);
int max = atof(argv[4]);
using twocom=MixedSiteSet&amp;lt;ABosonSite,BosonSite&amp;gt;;
autosites=twocom(L,{&quot;ConserveQNs&quot;,true,&quot;ConserveQNs&quot;,true,
&quot;ConserveNb&quot;,true,&quot;ConserveNb&quot;,true,&quot;MaxOcc=&quot;,max});
auto sweeps = Sweeps(8);
sweeps.maxdim() = 100,200,400,400,800,800,1000,1000;
sweeps.cutoff() = 1E-12;
float U = 1;
float t_1=t;
float t_2=t;
auto ampo = AutoMPO(sites);
for (int i = 1;i &amp;lt;= L-3; i += 2)
{
ampo += -U/2, &quot;Na&quot;, i;
ampo += U/2, &quot;Na&quot;, i,&quot;Na&quot;,i;
ampo += -t_1, &quot;Aa&quot;, i, &quot;Aadag&quot;, i + 2;
ampo += -t_1, &quot;Aadag&quot;, i, &quot;Aa&quot;, i + 2;
}
ampo += -U/2, &quot;Na&quot;, L-1;
ampo += U/2, &quot;Na&quot;, L-1,&quot;Na&quot;,L-1;
for (int i = 2;i &amp;lt;= L-2; i += 2)
{
ampo += -U/2, &quot;N&quot;, i;
ampo += U/2, &quot;N&quot;, i,&quot;N&quot;,i;
ampo += -t_2, &quot;A&quot;, i, &quot;Adag&quot;, i + 2;
ampo += -t_2, &quot;Adag&quot;, i, &quot;A&quot;, i + 2;
}
ampo += -U/2, &quot;N&quot;, L;
ampo += U/2, &quot;N&quot;, L,&quot;N&quot;,L;
for (int i = 1;i &amp;lt; L; i += 2)
{
ampo +=U_12, &quot;Na&quot;, i,'N',i+1;
ampo += V, &quot;N&quot;, i, &quot;N&quot;, i + 1;
}
auto H = toMPO(ampo);
auto state = InitState(sites);
for (int i = 1; i &amp;lt;= L; i += 4)
{
state.set(i,&quot;1&quot;);
}
for (int i = 4; i &amp;lt;= L; i += 4)
{
state.set(i,&quot;1&quot;);
}
PrintData(sweeps);
auto psi0 = randomMPS(state);
auto [energy, psi] = dmrg(H, psi0, sweeps, {&quot;Quiet=&quot;,true})
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;And here is my codes for one of two correlation functions&lt;/strong&gt;.(sorry for my long codes)&lt;br&gt;
To minimize the effect of boundary condition, I place i and j symmetrically around the center.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;int j_p;
j_p=L/2-1;
int i_p;
i_p=L/2-1;
for (auto r : range1(1,L))
{
    auto corf_op1=op(sites,&quot;Aadag&quot;,i_p);
    auto corf_op2=op(sites,&quot;Adag&quot;,i_p+1);
    auto corf_op3=op(sites,&quot;Aa&quot;,j_p);
    auto corf_op4=op(sites,&quot;A&quot;,j_p+1);
  if (r%2==1)
  {
    j_p=j_p+2;
    psi.position(j_p+1);
    ITensor C=psi(j_p+1);
    C *= corf_op4;
    double corf=0;
    if (r==1)
    {
      auto il = commonIndex(psi(j_p+1),psi(j_p),&quot;Link&quot;);
      C *=dag(prime(prime(psi(j_p+1),&quot;Site&quot;),il));
      C *=psi(j_p);
      C *=corf_op3;
      auto ill = commonIndex(psi(j_p),psi(i_p+1),&quot;Link&quot;);
      C *=dag(prime(prime(psi(j_p),&quot;Site&quot;),ill));
      C *=psi(i_p+1);
      C *=corf_op2;
      auto illl = commonIndex(psi(i_p+1),psi(i_p),&quot;Link&quot;);
      C *=dag(prime(prime(psi(i_p+1),&quot;Site&quot;),illl));
      C *=psi(i_p);
      C *=corf_op1;
      auto ir =commonIndex(psi(i_p),psi(i_p+1),&quot;Link&quot;);
      C *=dag(prime(prime(psi(i_p),&quot;Site&quot;),ir));
      corf=elt(C);
    }
    if (r&amp;gt;=2)
    {
      auto il = commonIndex(psi(j_p+1),psi(j_p),&quot;Link&quot;);
      C *=dag(prime(prime(psi(j_p+1),&quot;Site&quot;),il));
      C *=psi(j_p);
      C *=corf_op3;
      auto ill = commonIndex(psi(j_p),psi(j_p-1),&quot;Link&quot;);
      C *=dag(prime(prime(psi(j_p),&quot;Site&quot;),ill));
      for(int k=1;k&amp;lt;(j_p-i_p-1);k++)
      {
      C *= psi(j_p-k);
      C *= dag(prime(psi(j_p-k),&quot;Link&quot;));
      }
      C *=psi(i_p+1);
      C *=corf_op2;
      auto illl = commonIndex(psi(i_p+1),psi(i_p),&quot;Link&quot;);
      C *=dag(prime(prime(psi(i_p+1),&quot;Site&quot;),illl));
      C *=psi(i_p);
      C *=corf_op1;
      auto ir =commonIndex(psi(i_p),psi(i_p+1),&quot;Link&quot;);
      C *=dag(prime(prime(psi(i_p),&quot;Site&quot;),ir));
      corf=elt(C);
    }
    fprintf(fp2,&quot;%i,%i,%i,%f\n&quot;,r,i_p,j_p,corf);
  }
  else
  {
    i_p=i_p-2;
    psi.position(j_p+1);
    ITensor C=psi(j_p+1);
    C *= corf_op4;
    double corf=0;
    auto il = commonIndex(psi(j_p+1),psi(j_p),&quot;Link&quot;);
    C *=dag(prime(prime(psi(j_p+1),&quot;Site&quot;),il));
    C *=psi(j_p);
    C *=corf_op3;
    auto ill = commonIndex(psi(j_p),psi(j_p-1),&quot;Link&quot;);
    C *=dag(prime(prime(psi(j_p),&quot;Site&quot;),ill));
    for(int k=1;k&amp;lt;(j_p-i_p-1);k++)
    {
    C *= psi(j_p-k);
    C *= dag(prime(psi(j_p-k),&quot;Link&quot;));
    }
    C *=psi(i_p+1);
    C *=corf_op2;
    auto illl = commonIndex(psi(i_p+1),psi(i_p),&quot;Link&quot;);
    C *=dag(prime(prime(psi(i_p+1),&quot;Site&quot;),illl));
    C *=psi(i_p);
    C *=corf_op1;
    auto ir =commonIndex(psi(i_p),psi(i_p+1),&quot;Link&quot;);
    C *=dag(prime(prime(psi(i_p),&quot;Site&quot;),ir));
    corf=elt(C);
    fprintf(fp2,&quot;%i,%i,%i,%f\n&quot;,r,i_p,j_p,corf);
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Another correlation function is the same thing but with different operators.&lt;br&gt;
After calculation, I got energies and density distributions but without correlation functions.&lt;br&gt;
Are there some mistakes I make in my codes? &lt;/p&gt;

&lt;p&gt;Looking forward to your response and suggestions.&lt;br&gt;
Thank you very much!&lt;/p&gt;
</description>
<guid isPermaLink="true">http://itensor.org/support/3898/measure-correlator-point-operators-component-hubbard-model</guid>
<pubDate>Tue, 12 Apr 2022 08:42:27 +0000</pubDate>
</item>
<item>
<title>Julia related error in purification.jl code</title>
<link>http://itensor.org/support/3897/julia-related-error-in-purification-jl-code</link>
<description>&lt;p&gt;Hello,&lt;br&gt;
  I am getting the following error while running  &lt;code&gt;purification.jl&lt;/code&gt;, strangely, it is working in REPL &quot;&lt;a rel=&quot;nofollow&quot; href=&quot;https://replit.com/@scin/EnragedJadedNasm#main.jl&quot;&gt;https://replit.com/@scin/EnragedJadedNasm#main.jl&lt;/a&gt;&quot;.  Could you please help me out in this ?&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;β = 0.00 energy = 0.00000000
 ************
 ERROR:
 LoadError: MethodError: no method matching /(::MPO, ::Float64)
 Closest candidates are:
/(::StridedArray{P, N} where N, ::Real) where P&amp;lt;:Dates.Period at /buildworker    
/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Dates  
/src/deprecated.jl:44
/(::Union{SparseArrays.SparseVector{Tv, Ti}, SubArray{Tv, 1, var&quot;#s814&quot;,    
Tuple{Base.Slice{Base.OneTo{Int64}}, Int64}, false} where var&quot;#s814&quot;   
&amp;lt;:SparseArrays.AbstractSparseMatrixCSC{Tv, Ti}, SubArray{Tv, 1, var&quot;#s814&quot;,    
Tuple{Base.Slice{Base.OneTo{Int64}}}, false} where var&quot;#s814&quot; 
&amp;lt;:SparseArrays.AbstractSparseVector{Tv, Ti}} where {Tv, Ti}, ::Number) at   
/buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/SparseArrays  
/src/sparsevector.jl:1450
/(::Complex, ::Real) at complex.jl:333
...
Stacktrace:
[ 1] main(; N::Int64, cutoff::Float64, δτ::Float64, beta_max::Float64)
 @ Main /media/test.jl:26
[2] main()
 @ Main /media/test.jl:11
 [3] top-level scope
 @ /media/test.jl:30
 in expression starting at /media/test.jl:30
&lt;/code&gt;&lt;/pre&gt;
</description>
<guid isPermaLink="true">http://itensor.org/support/3897/julia-related-error-in-purification-jl-code</guid>
<pubDate>Tue, 12 Apr 2022 06:56:14 +0000</pubDate>
</item>
<item>
<title>[JULIA] Strange Error concerning my external file of S=2 spin system</title>
<link>http://itensor.org/support/3896/julia-strange-error-concerning-my-external-file-spin-system</link>
<description>&lt;p&gt;Hello iTensor team,  &lt;/p&gt;

&lt;p&gt;First i have to thank all iTensor team for keep this incredible package alive and growing.&lt;/p&gt;

&lt;p&gt;Secondly, I'm trying to use an external file to study a ferrimagnetic system with Spin S=2. I follow the correct structure of external file, which give the following simple code&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;using ITensors
function ITensors.space(::SiteType&quot;S=2&quot;;  conserve_qns=false)
if conserve_qns
    return [QN(&quot;Sz&quot;,4)=&amp;gt;1,QN(&quot;Sz&quot;,2)=&amp;gt;1,
    QN(&quot;Sz&quot;,0)=&amp;gt;1,QN(&quot;Sz&quot;,-2)=&amp;gt;1,QN(&quot;Sz&quot;,-4)=&amp;gt;1]
  end
  return 5
end

function ITensors.op!(Op::ITensor, ::OpName&quot;Sz&quot;, 
::SiteType&quot;S=2&quot;, s::Index)
Op[s'=&amp;gt;1,s=&amp;gt;1] = +2
Op[s'=&amp;gt;2,s=&amp;gt;2] = +1
Op[s'=&amp;gt;3,s=&amp;gt;3] = +0
Op[s'=&amp;gt;4,s=&amp;gt;4] = -1
Op[s'=&amp;gt;5,s=&amp;gt;5] = -2
end

function ITensors.op!(Op::ITensor, ::OpName&quot;S+&quot;,
::SiteType&quot;S=2&quot;, s::Index)
Op[s'=&amp;gt;1,s=&amp;gt;2] = 2
Op[s'=&amp;gt;2,s=&amp;gt;3] = sqrt(6)
Op[s'=&amp;gt;3,s=&amp;gt;4] = sqrt(6)
Op[s'=&amp;gt;4,s=&amp;gt;5] = 2
end

function ITensors.op!(Op::ITensor, ::OpName&quot;S-&quot;,
::SiteType&quot;S=2&quot;, s::Index)
Op[s'=&amp;gt;2,s=&amp;gt;1] = 2
Op[s'=&amp;gt;3,s=&amp;gt;2] = sqrt(6)
Op[s'=&amp;gt;4,s=&amp;gt;3] = sqrt(6)
Op[s'=&amp;gt;5,s=&amp;gt;4] = 2
end

ITensors.state(::StateName&quot;Up+&quot;, ::SiteType&quot;S=2&quot;) = [1.0, 0.0, 0.0, 0.0, 0.0]
ITensors.state(::StateName&quot;Up&quot;, ::SiteType&quot;S=2&quot;) = [0.0, 1.0, 0.0, 0.0, 0.0]
ITensors.state(::StateName&quot;Z0&quot;, ::SiteType&quot;S=2&quot;) = [0.0, 0.0, 1.0, 0.0, 0.0]
ITensors.state(::StateName&quot;Dn&quot;, ::SiteType&quot;S=2&quot;) = [0.0, 0.0, 0.0, 1.0, 0.0]
ITensors.state(::StateName&quot;Dn-&quot;, ::SiteType&quot;S=2&quot;) = [0.0, 0.0, 0.0, 0.0, 1.0]
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The interesting part is, I'm receiving an error message &quot;InexactError&quot; from the line concerning the value of Sqrt(6). The funny part is when I tried using the same structure to construct the same external file for different spins (S=3/2, 5/2) everyting works fine. I'm not using the convert Julia function to convert any float number to an integer, so I don't know exactly what i had to change to make my code work.&lt;br&gt;
Here follow the error message :&lt;/p&gt;

&lt;p&gt;ERROR: LoadError: InexactError: Int64(2.449489742783178)&lt;br&gt;
Stacktrace:&lt;br&gt;
  [1] Int64&lt;br&gt;
    @ ./float.jl:723 [inlined]&lt;br&gt;
  [2] convert&lt;br&gt;
    @ ./number.jl:7 [inlined]&lt;br&gt;
  [3] setindex!&lt;br&gt;
    @ ./array.jl:839 [inlined]&lt;br&gt;
  [4] setindex!&lt;br&gt;
    @ /scratch/lmverissimo/.julia/packages/ITensors/XnM47/src/NDTensors/tensorstorage.jl:25 [inlined]&lt;br&gt;
  [5] setindex!&lt;br&gt;
    @ /scratch/lmverissimo/.julia/packages/ITensors/XnM47/src/NDTensors/blocksparse/blocksparsetensor.jl:266 [inlined]&lt;br&gt;
  [6] setindex!!&lt;br&gt;
    @ /scratch/lmverissimo/.julia/packages/ITensors/XnM47/src/NDTensors/tensor.jl:325 [inlined]&lt;br&gt;
  [7] &lt;em&gt;setindex!!&lt;br&gt;
    @ /scratch/lmverissimo/.julia/packages/ITensors/XnM47/src/qn/qnitensor.jl:11 [inlined]&lt;br&gt;
  [8] _setindex!!&lt;br&gt;
    @ /scratch/lmverissimo/.julia/packages/ITensors/XnM47/src/itensor.jl:855 [inlined]&lt;br&gt;
  [9] _setindex!!(::ITensors.NDTensors.BlockSparseTensor{Int64, 2, Tuple{Index{Vector{Pair{QN, Int64}}}, Index{Vector{Pair{QN, Int64}}}}, ITensors.NDTensors.BlockSparse{Int64, Vector{Int64},&lt;br&gt;
    @ ITensors /scratch/lmverissimo/.julia/packages/ITensors/XnM47/src/itensor.jl:911&lt;br&gt;
 [10] setindex!&lt;br&gt;
    @ /scratch/lmverissimo/.julia/packages/ITensors/XnM47/src/itensor.jl:919 [inlined]&lt;br&gt;
 [11] op!(Op::ITensor, #unused#::OpName{Symbol(&quot;S+&quot;)}, #unused#::SiteType{S=2}, s::Index{Vector{Pair{QN, Int64}}})&lt;br&gt;
    @ Main /scratch/lmverissimo/Top2/2/N=128/S=2.jl:29&lt;br&gt;
 [12] op(name::String, s::Index{Vector{Pair{QN, Int64}}}; kwargs::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})&lt;br&gt;
    @ ITensors /scratch/lmverissimo/.julia/packages/ITensors/XnM47/src/physics/sitetype.jl:256&lt;br&gt;
 [13] op&lt;br&gt;
    @ /scratch/lmverissimo/.julia/packages/ITensors/XnM47/src/physics/sitetype.jl:221 [inlined]&lt;br&gt;
 [14] #op#902&lt;br&gt;
    @ /scratch/lmverissimo/.julia/packages/ITensors/XnM47/src/physics/sitetype.jl:332 [inlined]&lt;br&gt;
 [15] op&lt;br&gt;
    @ /scratch/lmverissimo/.julia/packages/ITensors/XnM47/src/physics/sitetype.jl:332 [inlined]&lt;br&gt;
 [16] (::ITensors.var&quot;#calcQN#1004&quot;{Vector{Index{Vector{Pair{QN, Int64}}}}, Dict{Pair{String, Int64}, ITensor}})(term::Vector{ITensors.SiteOp})&lt;br&gt;
    @ ITensors /scratch/lmverissimo/.julia/packages/ITensors/XnM47/src/physics/autompo.jl:668&lt;br&gt;
 [17] qn&lt;/em&gt;svdMPO(ampo::OpSum, sites::Vector{Index{Vector{Pair{QN, Int64}}}}; kwargs::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})&lt;br&gt;
    @ ITensors /scratch/lmverissimo/.julia/packages/ITensors/XnM47/src/physics/autompo.jl:676&lt;br&gt;
 [18] qn_svdMPO&lt;br&gt;
    @ /scratch/lmverissimo/.julia/packages/ITensors/XnM47/src/physics/autompo.jl:632 [inlined]&lt;br&gt;
 [19] #MPO#1007&lt;br&gt;
    @ /scratch/lmverissimo/.julia/packages/ITensors/XnM47/src/physics/autompo.jl:973 [inlined]&lt;br&gt;
 [20] MPO(ampo::OpSum, sites::Vector{Index{Vector{Pair{QN, Int64}}}})&lt;br&gt;
    @ ITensors /scratch/lmverissimo/.julia/packages/ITensors/XnM47/src/physics/autompo.jl:966&lt;/p&gt;

&lt;p&gt;Any help will be appreciated, Thank you ! &lt;/p&gt;
</description>
<guid isPermaLink="true">http://itensor.org/support/3896/julia-strange-error-concerning-my-external-file-spin-system</guid>
<pubDate>Tue, 12 Apr 2022 00:22:36 +0000</pubDate>
</item>
<item>
<title>von Neumann entanglement entropy of 1D hubbard model (Julia)</title>
<link>http://itensor.org/support/3895/von-neumann-entanglement-entropy-of-1d-hubbard-model-julia</link>
<description>&lt;p&gt;Hi all,&lt;br&gt;
I got a question when calculating von Neumann entanglement entropy of a simple 1D hubbard model... I use the sample code (&lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/ITensor/ITensors.jl/blob/main/examples/dmrg/1d_hubbard_extended.jl),&quot;&gt;https://github.com/ITensor/ITensors.jl/blob/main/examples/dmrg/1d_hubbard_extended.jl),&lt;/a&gt; keep only t1 and U and change sweep setting a little bit (attached below in code) because I have a longer chain (100sites). And I combined it with another sample code for the entropy calculation which I find here (&lt;a rel=&quot;nofollow&quot; href=&quot;http://itensor.org/support/2423/entanglement-entropy-julia).&quot;&gt;http://itensor.org/support/2423/entanglement-entropy-julia).&lt;/a&gt;  &lt;/p&gt;

&lt;p&gt;I use a loop for that index b which labels a cut at bond b, so that I can plot this entropy as a function of the site number. I expect the order of magnitude of S(b) to be O(1), but the results I got are all very samll numbers ~10^(-6)... I'm confused...Did I do anything wrong in my code?&lt;/p&gt;

&lt;p&gt;Thank you so much! ! &lt;br&gt;
(I attched my complete code and printed entropy at each b below.)&lt;/p&gt;

&lt;p&gt;Code:&lt;br&gt;
using ITensors&lt;/p&gt;

&lt;p&gt;let&lt;br&gt;
  N = 100&lt;br&gt;
  Npart = 100&lt;br&gt;
  t1 = 1.0&lt;br&gt;
  t2 = 0.0&lt;br&gt;
  U = -5.0&lt;br&gt;
  V1 = 0.0&lt;/p&gt;

&lt;p&gt;s = siteinds(&quot;Electron&quot;, N; conserve_qns=true)&lt;/p&gt;

&lt;p&gt;ampo = OpSum()&lt;br&gt;
  for b in 1:(N - 1)&lt;br&gt;
    ampo += -t1, &quot;Cdagup&quot;, b, &quot;Cup&quot;, b + 1&lt;br&gt;
    ampo += -t1, &quot;Cdagup&quot;, b + 1, &quot;Cup&quot;, b&lt;br&gt;
    ampo += -t1, &quot;Cdagdn&quot;, b, &quot;Cdn&quot;, b + 1&lt;br&gt;
    ampo += -t1, &quot;Cdagdn&quot;, b + 1, &quot;Cdn&quot;, b&lt;br&gt;
    ampo += V1, &quot;Ntot&quot;, b, &quot;Ntot&quot;, b + 1&lt;br&gt;
  end&lt;br&gt;
  for b in 1:(N - 2)&lt;br&gt;
    ampo += -t2, &quot;Cdagup&quot;, b, &quot;Cup&quot;, b + 2&lt;br&gt;
    ampo += -t2, &quot;Cdagup&quot;, b + 2, &quot;Cup&quot;, b&lt;br&gt;
    ampo += -t2, &quot;Cdagdn&quot;, b, &quot;Cdn&quot;, b + 2&lt;br&gt;
    ampo += -t2, &quot;Cdagdn&quot;, b + 2, &quot;Cdn&quot;, b&lt;br&gt;
  end&lt;br&gt;
  for i in 1:N&lt;br&gt;
    ampo += U, &quot;Nupdn&quot;, i&lt;br&gt;
  end&lt;br&gt;
  H = MPO(ampo, s)&lt;/p&gt;

&lt;p&gt;sweeps = Sweeps(30)&lt;br&gt;
  setmaxdim!(sweeps, 500)&lt;br&gt;
  setcutoff!(sweeps, 1E-7)&lt;br&gt;
  @show sweeps&lt;/p&gt;

&lt;p&gt;state = [&quot;Emp&quot; for n in 1:N]&lt;br&gt;
  p = Npart&lt;br&gt;
  for i in N:-1:1&lt;br&gt;
    if p &amp;gt; i&lt;br&gt;
      println(&quot;Doubly occupying site $i&quot;)&lt;br&gt;
      state[i] = &quot;UpDn&quot;&lt;br&gt;
      p -= 2&lt;br&gt;
    elseif p &amp;gt; 0&lt;br&gt;
      println(&quot;Singly occupying site $i&quot;)&lt;br&gt;
      state[i] = (isodd(i) ? &quot;Up&quot; : &quot;Dn&quot;)&lt;br&gt;
      p -= 1&lt;br&gt;
    end&lt;br&gt;
  end&lt;br&gt;
  # Initialize wavefunction to be bond &lt;br&gt;
  # dimension 10 random MPS with number&lt;br&gt;
  # of particles the same as &lt;code&gt;state&lt;/code&gt;&lt;br&gt;
  psi0 = randomMPS(s, state, 10)&lt;/p&gt;

&lt;p&gt;# Check total number of particles:&lt;br&gt;
  @show flux(psi0)&lt;/p&gt;

&lt;p&gt;# Start DMRG calculation:&lt;br&gt;
  energy, psi = dmrg(H, psi0, sweeps)&lt;/p&gt;

&lt;p&gt;upd = fill(0.0, N)&lt;br&gt;
  dnd = fill(0.0, N)&lt;br&gt;
  for j in 1:N&lt;br&gt;
    orthogonalize!(psi, j)&lt;br&gt;
    psidag&lt;em&gt;j = dag(prime(psi[j], &quot;Site&quot;))&lt;br&gt;
    upd[j] = scalar(psidag&lt;/em&gt;j * op(s, &quot;Nup&quot;, j) * psi[j])&lt;br&gt;
    dnd[j] = scalar(psidag_j * op(s, &quot;Ndn&quot;, j) * psi[j])&lt;br&gt;
  end&lt;/p&gt;

&lt;p&gt;println(&quot;Up Density:&quot;)&lt;br&gt;
  for j in 1:N&lt;br&gt;
    println(&quot;$j $(upd[j])&quot;)&lt;br&gt;
  end&lt;br&gt;
  println()&lt;/p&gt;

&lt;p&gt;println(&quot;Dn Density:&quot;)&lt;br&gt;
  for j in 1:N&lt;br&gt;
    println(&quot;$j $(dnd[j])&quot;)&lt;br&gt;
  end&lt;br&gt;
  println()&lt;/p&gt;

&lt;p&gt;println(&quot;Total Density:&quot;)&lt;br&gt;
  for j in 1:N&lt;br&gt;
    println(&quot;$j $(upd[j]+dnd[j])&quot;)&lt;br&gt;
  end&lt;br&gt;
  println()&lt;/p&gt;

&lt;p&gt;println(&quot;\nGround State Energy = $energy&quot;)&lt;/p&gt;

&lt;p&gt;function entropy&lt;em&gt;von&lt;/em&gt;neumann(psi::MPS, N::Int)&lt;br&gt;
    SvN = fill(0.0, N)&lt;br&gt;
    for b in 2:N-1&lt;br&gt;
        orthogonalize!(psi, b)&lt;br&gt;
        _,S = svd(psi[b], (linkind(psi, b-1), s[b]))&lt;br&gt;
        for n in dim(S, 1)&lt;br&gt;
            p = S[n,n]^2&lt;br&gt;
            SvN[b] -= p * log(p)&lt;br&gt;
        end&lt;br&gt;
        println(&quot;$(SvN[b])&quot;)&lt;br&gt;
    end&lt;br&gt;
    return SvN&lt;br&gt;
  end&lt;/p&gt;

&lt;p&gt;SvN = entropy&lt;em&gt;von&lt;/em&gt;neumann(psi, N)&lt;/p&gt;

&lt;p&gt;end&lt;/p&gt;

&lt;hr&gt;

&lt;p&gt;The  entropy S(b):&lt;br&gt;
0.09070691669706957&lt;br&gt;
0.001332649961200171&lt;br&gt;
1.3686167960001409e-6&lt;br&gt;
4.359976386344567e-6&lt;br&gt;
6.733373654214966e-6&lt;br&gt;
1.3372604646791153e-7&lt;br&gt;
1.5001040623576317e-5&lt;br&gt;
5.058686612647704e-7&lt;br&gt;
2.5543410516658077e-5&lt;br&gt;
1.0639655773856194e-6&lt;br&gt;
3.829868192360102e-5&lt;br&gt;
1.4027735830778272e-7&lt;br&gt;
2.0115153047422772e-7&lt;br&gt;
2.2972119655530066e-7&lt;br&gt;
3.4283980977130424e-7&lt;br&gt;
3.115574369307899e-7&lt;br&gt;
4.871244534235853e-7&lt;br&gt;
3.9846497809687774e-7&lt;br&gt;
6.440428978804487e-7&lt;br&gt;
4.885839791828351e-7&lt;br&gt;
8.217896181088025e-7&lt;br&gt;
5.822938107843419e-7&lt;br&gt;
1.060520215982716e-6&lt;br&gt;
6.831068268753088e-7&lt;br&gt;
1.3465796889154753e-6&lt;br&gt;
1.4128831887793594e-7&lt;br&gt;
1.6578331240586298e-6&lt;br&gt;
1.6817179418251726e-7&lt;br&gt;
1.9086191014162828e-6&lt;br&gt;
1.9218002525787778e-7&lt;br&gt;
2.1334820606118912e-6&lt;br&gt;
2.1459105376943014e-7&lt;br&gt;
2.3313186179033887e-6&lt;br&gt;
2.3442546255436683e-7&lt;br&gt;
2.5091554302506395e-6&lt;br&gt;
2.5148073806805365e-7&lt;br&gt;
2.6629455105823636e-6&lt;br&gt;
2.675461252705469e-7&lt;br&gt;
2.7969288395425305e-6&lt;br&gt;
2.820721836141702e-7&lt;br&gt;
2.908469131486962e-6&lt;br&gt;
2.940051897395952e-7&lt;br&gt;
2.9878629561903115e-6&lt;br&gt;
3.0171249585454165e-7&lt;br&gt;
3.0612731469971742e-6&lt;br&gt;
3.083795037091508e-7&lt;br&gt;
3.100147849310539e-6&lt;br&gt;
3.123873318518695e-7&lt;br&gt;
3.1099061931736388e-6&lt;br&gt;
3.123841279545293e-7&lt;br&gt;
3.0987763981597106e-6&lt;br&gt;
3.0976940496368236e-7&lt;br&gt;
3.063501520406781e-6&lt;br&gt;
3.0449799942869857e-7&lt;br&gt;
3.001787667600418e-6&lt;br&gt;
2.957587377413038e-7&lt;br&gt;
2.918827460496549e-6&lt;br&gt;
2.847481294234705e-7&lt;br&gt;
2.808596119674664e-6&lt;br&gt;
2.7068863487085386e-7&lt;br&gt;
2.6786544449685913e-6&lt;br&gt;
2.5486386260203346e-7&lt;br&gt;
2.524835813245228e-6&lt;br&gt;
2.3709999310016173e-7&lt;br&gt;
2.3417164843292646e-6&lt;br&gt;
2.154108041515205e-7&lt;br&gt;
2.1471156146958798e-6&lt;br&gt;
1.9392643033737067e-7&lt;br&gt;
1.9277674229420978e-6&lt;br&gt;
1.6959635573688854e-7&lt;br&gt;
1.6764798541578795e-6&lt;br&gt;
1.4214995738633714e-7&lt;br&gt;
1.3460961878017196e-6&lt;br&gt;
6.8199231820002e-7&lt;br&gt;
1.0490130295538297e-6&lt;br&gt;
5.814456742233713e-7&lt;br&gt;
8.18106307245907e-7&lt;br&gt;
4.878329051121316e-7&lt;br&gt;
6.425305910731801e-7&lt;br&gt;
3.9783346478151117e-7&lt;br&gt;
4.842645529017947e-7&lt;br&gt;
3.105588577603732e-7&lt;br&gt;
3.2992276174983606e-7&lt;br&gt;
2.099190336426272e-7&lt;br&gt;
1.9297394199410213e-7&lt;br&gt;
1.3973463812131638e-7&lt;br&gt;
3.825571380443112e-5&lt;br&gt;
1.059329165404299e-6&lt;br&gt;
2.554198355682492e-5&lt;br&gt;
4.920291374342437e-7&lt;br&gt;
1.4994953866517857e-5&lt;br&gt;
1.3062726493860295e-7&lt;br&gt;
6.736631969987577e-6&lt;br&gt;
4.323008567401327e-6&lt;br&gt;
1.3668060657135116e-6&lt;br&gt;
0.0013324848707008954&lt;br&gt;
0.09070625418213862&lt;br&gt;
0.3597747329567827&lt;/p&gt;
</description>
<guid isPermaLink="true">http://itensor.org/support/3895/von-neumann-entanglement-entropy-of-1d-hubbard-model-julia</guid>
<pubDate>Mon, 11 Apr 2022 09:23:09 +0000</pubDate>
</item>
<item>
<title>Finite Temperature Properties of  the Spin Systems</title>
<link>http://itensor.org/support/3893/finite-temperature-properties-of-the-spin-systems</link>
<description>&lt;p&gt;Hello, &lt;/p&gt;

&lt;p&gt;Zero Temperature magnetization can be found by &lt;code&gt;mgn=(inner(psi,Mz,psi))&lt;/code&gt; &lt;br&gt;
Where Mz is uniform magnetization operator. Now my question is how can I find the finite temperature magnetization or other T dependent properties.&lt;/p&gt;

&lt;p&gt;Thanks&lt;/p&gt;
</description>
<guid isPermaLink="true">http://itensor.org/support/3893/finite-temperature-properties-of-the-spin-systems</guid>
<pubDate>Wed, 06 Apr 2022 07:45:07 +0000</pubDate>
</item>
<item>
<title>Unsuccesful TEBD for Time Independent Fermi-Hubbard Model</title>
<link>http://itensor.org/support/3883/unsuccesful-tebd-for-time-independent-fermi-hubbard-model</link>
<description>&lt;p&gt;I have been trying to recreate the dynamics of a driven Fermi-Hubbard Hamiltonian in Julia:&lt;/p&gt;

&lt;p&gt;$$&lt;br&gt;
\hat{H}=-t&amp;#95;0 \sum&amp;#95;{j,\sigma}\left( e^{-i\Phi(t)}\hat{c}^{\dag}&amp;#95;{j,\sigma}\hat{c}&lt;em&gt;{j+1,\sigma} + h.c. \right)+\sum&amp;#95;{j} \hat{n}&amp;#95;{j,\uparrow}\hat{n}&lt;/em&gt;{j,\downarrow}&lt;br&gt;
$$&lt;br&gt;
(don't know why this isn't formatting this is the Hamiltonian given by equation 12 in &lt;a rel=&quot;nofollow&quot; href=&quot;https://journals.aps.org/pra/abstract/10.1103/PhysRevA.101.053408&quot;&gt;https://journals.aps.org/pra/abstract/10.1103/PhysRevA.101.053408&lt;/a&gt; )&lt;/p&gt;

&lt;p&gt;where @@ \sigma @@ is spin, but my first step is attempting this with @@\Phi(t)@@ set to 0, which results in an undriven, time independent model. I have successfully performed DMRG to obtain the ground state (which I know because I have compared energies to exact calculations in the QuSpin package), but I have been unsuccessful in using TEBD (and RK2 and RK4) to evolve the ground state using the time independent Hamiltonian. I know applying the time evolution operator as an exponential of the TI Hamiltonian to the ground state should preserve the ground state, but instead the energy of the state resulting from the application of the time evolution operator increases throughout the evolution. Though I have not tested dependence rigorously, the energy increase seems to be mostly independent of the time step even though it should be @@\mathcal{O}(\delta t)@@ according to &lt;a rel=&quot;nofollow&quot; href=&quot;https://www.sciencedirect.com/science/article/pii/S0003491619302532.&quot;&gt;https://www.sciencedirect.com/science/article/pii/S0003491619302532.&lt;/a&gt; I have implemented a dynamic time step as well, and tested a couple different maximum bond dimensions in DMRG, as well as decreasing the cutoff for both DMRG and the apply function. Any help is greatly appreciated, thanks in advance! My code is below:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&quot;&quot;&quot;
Use second order TEBD to evolve psi(t) to psi (t + dt)
&quot;&quot;&quot;
function TEBD(psi, dt, time, params, independent, cutoff)

    phi = phi_tl(time + dt / 2, params, independent)

    # odd gates (1,2),(3,4),(5,6),...
    ogates = ITensor[]
    # even gates (2,3),(4,5),(6,7),...
    egates = ITensor[]
    for j=1:params.nsites
        s1 = params.space[j]
        #periodic BC
        if j == params.nsites
            s2 = params.space[1]
        else
            s2 = params.space[j+1]
        end
        # we have to define the two site operator so contributions
        # of each site will be counted twice
        ul = ur = params.U / 2
        # exp(i phi(t)) and exp(-i phi(t))
        eiphi = exp(1.0im * phi)
        eiphiconj = conj(eiphi)
        # create operator (only scaled parameters are passed in so t is always 1)
        hj = -eiphiconj * op(&quot;Cdagup&quot;,s1) * op(&quot;Cup&quot;,s2) +
             -eiphiconj * op(&quot;Cdagdn&quot;,s1) * op(&quot;Cdn&quot;,s2) +
             -eiphi * op(&quot;Cdagup&quot;,s2) * op(&quot;Cup&quot;,s1) +
             -eiphi * op(&quot;Cdagdn&quot;,s2) * op(&quot;Cdn&quot;,s1) +
             ul * op(&quot;Nupdn&quot;, s1) * op(&quot;Id&quot;,s2) +
             ur * op(&quot;Id&quot;,s1) * op(&quot;Nupdn&quot;, s2)
        # odd gate
        if j % 2 == 1
            Gj = exp(-1.0im * dt * hj)
            push!(ogates, Gj)
        # even gate
        else
            Gj = exp(-1.0im * dt / 2 * hj)
            push!(egates, Gj)
        end
    end

    gates = ITensor[]
    append!(gates, egates)
    append!(gates, ogates)
    append!(gates, egates)

    return apply(gates, psi; cutoff=cutoff)

end

&quot;&quot;&quot;
Propogates ground from 0 to tf using method to propogate by an adaptive timestep
Parameters:
    ground - ground state (MPS)
    tf - final time
    method - the function used to propogate a wavefunction over single dt
    dti - initial guess for timestep
    epsilon - total change allowed in a single time step
    independent - boolean that is True if we are evolving with a time independent
              Hamiltonian, and False otherwise
&quot;&quot;&quot;
function propogation(ground::MPS, params, tf, method, dti, epsilon, independent, cutoff)
    # error measures (en is for current step, en1 is for previous step)
    en = en1 = 0.0
    time = 0.0
    # copy states
    psi = deepcopy(ground)
    # set dt and previous dt
    dt = pdt = dti

    # initialize vectors for saving times and expectation values
    times = [0]
    energies = [inner(ground, get_ham(0, params, independent), ground)]
    currents = [inner(ground, get_current(0, params, independent), ground)]

    # run for the entire time interval
    while time &amp;lt; tf

        # get the MPS at time + dt
        next_psi = method(psi, dt, time, params, independent, cutoff)

        # calculate difference between current and next psi
        en = difference(psi, next_psi)

        # run propogation while the difference is greater than acceptable error
        while en &amp;gt; epsilon
            # adjust time step
            dt *= epsilon / en
            # get the next MPS and calculate difference
            next_psi = method(psi, dt, time, params, independent, cutoff)
            en = difference(psi, next_psi)
        end

        # incremement time and add it to the array
        time += dt
        times = vcat(times, [time])

        # accept wavefunction
        psi = deepcopy(next_psi)

        # calculate expectations
        energies = vcat(energies, [inner(psi, get_ham(time, params, independent), psi)])
        currents = vcat(currents, [inner(psi, get_current(time, params, independent), psi)])

        en1 = (en1 &amp;gt; 0) ? en1 : en

        # adjust for next time step
        # https://www.sciencedirect.com/science/article/pii/S0377042705001123
        ndt = dt * ((epsilon^2 * dt)/ (en * en1 * pdt))^(1/12)

        # update values for next iteration e_{n-1} -&amp;gt; e_n, dt_{n-1} = dt_n,
        # dt_n -&amp;gt; dt_{n+1}
        en1 = en
        pdt = dt
        dt = ndt
    end
    return times, energies, currents
end
&lt;/code&gt;&lt;/pre&gt;
</description>
<guid isPermaLink="true">http://itensor.org/support/3883/unsuccesful-tebd-for-time-independent-fermi-hubbard-model</guid>
<pubDate>Tue, 29 Mar 2022 23:17:57 +0000</pubDate>
</item>
<item>
<title>AutoMPO using operators with more arguments</title>
<link>http://itensor.org/support/3879/autompo-using-operators-with-more-arguments</link>
<description>&lt;p&gt;[Using Julia]&lt;/p&gt;

&lt;p&gt;Hi! I am hoping to construct an ampo using operators that contain extra arguments. For example, &lt;/p&gt;

&lt;pre&gt;&lt;code&gt;function ITensors.op(::OpName&quot;Nup&quot;, st::SiteType&quot;HubHolst&quot;; max_phonons::Int=1)
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Initially I just had a global MAX&amp;#95;PHONONS variable defined in the HubHolst site type file, but for the sake of making the code more hygienic I was hoping to explicitly pass in max_phonons as an argument to specify the dimension of the phonon Hilbert space whenever I construct the operators. Alternatively (and preferably), the st variable could also carry this information. However, I am not sure whether it is possible (that is to say, internally compatible) to modify the SiteType struct to contain more fields, such as the dimension of the phonon hilbert space on each site. &lt;/p&gt;

&lt;p&gt;Thanks so much for the help! I really appreciate it&lt;/p&gt;
</description>
<guid isPermaLink="true">http://itensor.org/support/3879/autompo-using-operators-with-more-arguments</guid>
<pubDate>Tue, 29 Mar 2022 16:15:46 +0000</pubDate>
</item>
<item>
<title>Infinite MPS TEBD in Julia</title>
<link>http://itensor.org/support/3871/infinite-mps-tebd-in-julia</link>
<description>&lt;p&gt;Hi! Previously I asked about apply function in Julia. I have succesfully implemented a finite MPS TEBD time evolution. Now I am moving to the infinite case. I just found that there is a package currently under developed called ITensorInfiniteMPS.jl by ITensor developers. I am trying to understand how it works, and how to perform Trotter-like gate evolution using it. May I ask what c means in the MPS index?&lt;/p&gt;

&lt;p&gt;InfiniteMPS&lt;br&gt;
[1] IndexSet{3} (dim=1|id=317|&quot;Link,c=0,l=3&quot;) (dim=2|id=652|&quot;S=1/2,Site,c=1,n=1&quot;) (dim=1|id=77|&quot;Link,c=1,l=1&quot;)&lt;br&gt;
[2] IndexSet{3} (dim=1|id=77|&quot;Link,c=1,l=1&quot;) (dim=2|id=984|&quot;S=1/2,Site,c=1,n=2&quot;) (dim=1|id=868|&quot;Link,c=1,l=2&quot;)&lt;br&gt;
[3] IndexSet{3} (dim=1|id=868|&quot;Link,c=1,l=2&quot;) (dim=2|id=569|&quot;S=1/2,Site,c=1,n=3&quot;) (dim=1|id=317|&quot;Link,c=1,l=3&quot;)&lt;/p&gt;

&lt;p&gt;Also, I understand that to perform time evolution with infinite MPS, one essentially evolves the unit cell. We are using an OBC MPS which contains one unit cell to do such a task. One needs to deal with the sites at the boundary, i.e. site=n, and site=n+1 which goes back to site=1, assuming the unit cell contains n sites. To write such a function 'apply', we just include an additional term h[n,1] into the gates, is that correct?&lt;/p&gt;

&lt;p&gt;Thank you!&lt;/p&gt;

&lt;p&gt;Best regards,&lt;br&gt;
Tianqi&lt;/p&gt;
</description>
<guid isPermaLink="true">http://itensor.org/support/3871/infinite-mps-tebd-in-julia</guid>
<pubDate>Fri, 25 Mar 2022 06:18:33 +0000</pubDate>
</item>
<item>
<title>How to add a constant term in Hamiltonian(julia)</title>
<link>http://itensor.org/support/3864/how-to-add-a-constant-term-in-hamiltonian-julia</link>
<description>&lt;p&gt;I have  a dumb question... When constructing ampo, how to add a constant term? For example,  in a 1D spin model, that 1/4 in terms like 0.5(Sz&lt;em&gt;i Sz&lt;/em&gt;i+1 -1/4)? &lt;/p&gt;

&lt;p&gt;I tried:&lt;br&gt;
      ampo = OpSum()&lt;br&gt;
      for i in 1:(N - 1)&lt;br&gt;
        ampo += 0.5, &quot;Sz&quot;, i, &quot;Sz&quot;, i + 1&lt;br&gt;
       ampo += -0.5/4&lt;br&gt;
      end&lt;/p&gt;

&lt;p&gt;But doesn't work... I know the overall constant is trivial, but just want to know...&lt;br&gt;
Thank you!&lt;/p&gt;
</description>
<guid isPermaLink="true">http://itensor.org/support/3864/how-to-add-a-constant-term-in-hamiltonian-julia</guid>
<pubDate>Thu, 24 Mar 2022 10:22:46 +0000</pubDate>
</item>
<item>
<title>[Julia]3-sites MPS Time Evolution</title>
<link>http://itensor.org/support/3862/julia-3-sites-mps-time-evolution</link>
<description>&lt;p&gt;Hi Miles&lt;/p&gt;

&lt;p&gt;If my Hamiltonian is a 3-sites interaction, Is it useful to only add a&lt;br&gt;
 &lt;code&gt;s3 = s[j+2]&lt;/code&gt;&lt;br&gt;
and use&lt;br&gt;
 &lt;code&gt;hj= op(&quot;xx&quot;,s1) * op(&quot;xx&quot;,s2)*op(&quot;xx&quot;,s3)&lt;/code&gt;&lt;br&gt;
compared with example from document?&lt;br&gt;
I have tried it and the code evaluating time is much longer than 2-sites. &lt;/p&gt;
</description>
<guid isPermaLink="true">http://itensor.org/support/3862/julia-3-sites-mps-time-evolution</guid>
<pubDate>Thu, 24 Mar 2022 08:51:00 +0000</pubDate>
</item>
<item>
<title>Where can I find the proper syntax required to perform SVD in dmrg tutorial ?</title>
<link>http://itensor.org/support/3859/where-find-proper-syntax-required-perform-svd-dmrg-tutorial</link>
<description>&lt;p&gt;I am trying to finish the tutorial 06 on dmrg. However, I am not able to find the help section on the website. I am facing issues in implementing SVD. Where can I find the proper syntax required to perform SVD in dmrg tutorial?&lt;br&gt;
Note: that I am the c++ version of the ITensor package.&lt;/p&gt;
</description>
<guid isPermaLink="true">http://itensor.org/support/3859/where-find-proper-syntax-required-perform-svd-dmrg-tutorial</guid>
<pubDate>Wed, 23 Mar 2022 10:06:05 +0000</pubDate>
</item>
<item>
<title>[C++] OMP vs. MKL parallelization</title>
<link>http://itensor.org/support/3852/c-omp-vs-mkl-parallelization</link>
<description>&lt;p&gt;In the &lt;a rel=&quot;nofollow&quot; href=&quot;http://itensor.org/docs.cgi?vers=cppv3&amp;amp;page=install/install_with_openmp&quot;&gt;documentation&lt;/a&gt;, the parallelization is controlled by two environment variables, &lt;code&gt;MKL_NUM_THREADS&lt;/code&gt; and &lt;code&gt;OMP_NUM_THREADS&lt;/code&gt;. However in my benchmark, changing &lt;code&gt;MKL_NUM_THREADS&lt;/code&gt; has no effect, and the number of CPU is fully controlled by &lt;code&gt;OMP_NUM_THREADS&lt;/code&gt;. With this observation I have the following questions.&lt;/p&gt;

&lt;p&gt;Is it correct that, &lt;code&gt;MKL_NUM_THREADS&lt;/code&gt; controls the number of CPU used in a matrix-matrix multiplication, and &lt;code&gt;OMP_NUM_THREADS&lt;/code&gt; controls the parallelization among different quantum number blocks? If this is true, does the current version of ITensor only support the parallelization among quantum number blocks?&lt;/p&gt;
</description>
<guid isPermaLink="true">http://itensor.org/support/3852/c-omp-vs-mkl-parallelization</guid>
<pubDate>Tue, 22 Mar 2022 02:17:32 +0000</pubDate>
</item>
<item>
<title>fail to reproduce results of 1D Bose-Hubbard model</title>
<link>http://itensor.org/support/3851/fail-to-reproduce-results-of-1d-bose-hubbard-model</link>
<description>&lt;p&gt;Dear Itensor users&lt;/p&gt;

&lt;p&gt;I have tried to reproduce the density of the 1D Bose-Hubbard model using dmrg without success. Following are the Hamiltonian and the measurements I used for the simulations (I skip some not relevant parts).&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;auto sites = Boson(L, {&quot;MaxOcc=&quot;, 5, &quot;ConserveQNs&quot;, true, &quot;ConserveNb&quot;, false});
auto ampo = AutoMPO(sites);

for (int i = 1; i &amp;lt; L; i += 1)
{
    ampo += - U / 2, &quot;N&quot;, i;
    ampo += -mu, &quot;N&quot;, i;
    ampo += U / 2, &quot;N&quot;, i, &quot;N&quot;, i;
    ampo += -t, &quot;Adag&quot;, i + 1, &quot;A&quot;, i;
    ampo += -t, &quot;Adag&quot;, i, &quot;A&quot;, i + 1;
}

ampo += U/2, &quot;N&quot;, L, &quot;N&quot;, L;
ampo += - U/2, &quot;N&quot;, L;
ampo += -mu, &quot;N&quot;, L;

auto H = toMPO(ampo);

auto state = InitState(sites);
for (int i : range1(L))
{
   state.set(i, &quot;1&quot;);
}
auto psi0 = randomMPS(state);

auto [energy, psi] = dmrg(H, psi0, sweeps, &quot;Quiet&quot;);

fptr = fopen(argv[6],&quot;a&quot;);

auto ampo_a = AutoMPO(sites);
auto ampo_1 = AutoMPO(sites);
for (int i = 1; i &amp;lt;= L; i++)
{
  ampo_a += 1, &quot;N&quot;, i;
  ampo_1 += 1, &quot;A&quot;, i;
}
auto ope = toMPO(ampo_a);
auto ope1 = toMPO(ampo_1);

fprintf(fptr,&quot;%.12f %.12f\n&quot;,inner(psi,ope,psi),inner(psi,ope1,psi));
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Any help will be greatly appreciated.&lt;/p&gt;

&lt;p&gt;Sincerely,&lt;br&gt;
FJ&lt;/p&gt;
</description>
<guid isPermaLink="true">http://itensor.org/support/3851/fail-to-reproduce-results-of-1d-bose-hubbard-model</guid>
<pubDate>Tue, 22 Mar 2022 01:52:03 +0000</pubDate>
</item>
<item>
<title>Measure multi-point correlation in 2D lattice</title>
<link>http://itensor.org/support/3825/measure-multi-point-correlation-in-2d-lattice</link>
<description>&lt;p&gt;Hi everyone&lt;/p&gt;

&lt;p&gt;Recently I've been trying to calculate some observable in Kitaev honeycomb model (Kitaev 2006) using ITensor DMRG. One important result to check out is the flux operator Wp whose ground state expectation should be Wp = +1 as calculated analytically by Kitaev himself. &lt;/p&gt;

&lt;p&gt;However, I found that sometimes I cannot retrieve this number in dmrg. For example, in a 24-site system shown below:&lt;br&gt;
&lt;img src=&quot;https://github.com/fengshi96/KSL_ML/blob/30ec802bf0b5737f78b505f4f1bbb0bd83e88efe/Plots/24input_a.png?raw=true&quot; alt=&quot;Wp consists of the 6 sites on the boundary of the shaded region&quot;&gt;&lt;br&gt;
following the &lt;a rel=&quot;nofollow&quot; href=&quot;http://itensor.org/docs.cgi?page=tutorials/correlations&quot;&gt;tutorial&lt;/a&gt; and &lt;a rel=&quot;nofollow&quot; href=&quot;http://itensor.org/support/1228/measure-multi-site-more-than-2-correlation&quot;&gt;other advices&lt;/a&gt;, the multi-point correlation for [s2 s3 s4 s7 s8 s9] is calculated using the following code:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;    ITensor Sz_2 = op(sites, &quot;Sx&quot;, 2);
    ITensor Sz_3 = op(sites, &quot;Sy&quot;, 3);
    ITensor Sz_4 = op(sites, &quot;Sz&quot;, 4);
    ITensor Sz_7 = op(sites, &quot;Sz&quot;, 7);
    ITensor Sz_8 = op(sites, &quot;Sy&quot;, 8);
    ITensor Sz_9 = op(sites, &quot;Sx&quot;, 9);

    psi.position(2);

    ITensor C = psi(2);
    C *= Sz_2;  // with primed physical index
    auto ir = commonIndex(psi(2),psi(3),&quot;Link&quot;);
    C *= dag(prime(prime(psi(2), &quot;Site&quot;), ir));

    C *= psi(3);
    C *= Sz_3;
    C *= dag(prime(prime(psi(3), &quot;Site&quot;), &quot;Link&quot;));

    C *= psi(4);
    C *= Sz_4;
    C *= dag(prime(prime(psi(4), &quot;Site&quot;), &quot;Link&quot;));

    C *= psi(5);
    C *= dag(prime(psi(5), &quot;Link&quot;));

    C *= psi(6);
    C *= dag(prime(psi(6), &quot;Link&quot;));

    C *= psi(7);
    C *= Sz_7;
    C *= dag(prime(prime(psi(7), &quot;Site&quot;), &quot;Link&quot;));

    C *= psi(8);
    C *= Sz_8;
    C *= dag(prime(prime(psi(8), &quot;Site&quot;), &quot;Link&quot;));

    C *= psi(9);
    C *= Sz_9;
    auto il = commonIndex(psi(8),psi(9),&quot;Link&quot;);
    C *= dag(prime(prime(psi(9), &quot;Site&quot;), il));

    auto results = eltC(C * 64);  // spin-1/2 to pauli matrix by 2^6
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;where I have contracted site 5,6 directly since there's no operator acting on them. But this gives a wrong number Wp = -0.18 instead of +1; even though all 2-site operator are correct. &lt;/p&gt;

&lt;p&gt;On the other hand, if I reorder the site indices so that the first 6 continuous sites in MPS correspond to the Wp operator, as shown below:&lt;br&gt;
&lt;img src=&quot;https://raw.githubusercontent.com/fengshi96/KSL_ML/30ec802bf0b5737f78b505f4f1bbb0bd83e88efe/Plots/24input_b.png&quot; alt=&quot;enter image description here&quot;&gt; &lt;br&gt;
where Wp = [s1 s2 s3 s4 s5 s6], then I got the correct expectation Wp = +1 by the same token. &lt;/p&gt;

&lt;p&gt;It is curious to me that the order of sites makes such a huge difference, though both ordering gave the same ground state energy. I would like to understand the crux of this problem (maybe I missed some trivial stuff) before I implement more nested correlators in dmrg. &lt;/p&gt;

&lt;p&gt;Could someone give any suggestions? Thank you. &lt;/p&gt;
</description>
<guid isPermaLink="true">http://itensor.org/support/3825/measure-multi-point-correlation-in-2d-lattice</guid>
<pubDate>Tue, 15 Mar 2022 21:48:09 +0000</pubDate>
</item>
<item>
<title>Entanglement Entropy near phase transition in 1D</title>
<link>http://itensor.org/support/3823/entanglement-entropy-near-phase-transition-in-1d</link>
<description>&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;I am trying to evaluate entanglement entropy for 1D system with OBC  by keeping fix J and variable t2. There is a phase transition from 2-Majorana phase to 4-Majorana phase.  For J=0, entanglement entropy is non-vanishing and there is a peak in entanglement entropy at phase transition but as soon as I turn on J, entanglement entropy turns out to be zero (near 10^(-7)). I used DMRG (ITensor Julia) to calculate ground state wavefunction and it seems like it is choosing a state with least entanglement for non-zero J interaction. Is there any way to force dmrg in ITensor Julia to get correct entangled ground state? I would really appreciate any help or suggestions.&lt;/p&gt;

&lt;p&gt;Thank you so much!&lt;/p&gt;

&lt;p&gt;I am using following Hamiltonian:  &lt;/p&gt;

&lt;p&gt;sites = siteinds(&quot;S=1/2&quot;,N1)&lt;/p&gt;

&lt;p&gt;for j=1:N1-1&lt;br&gt;
    ampo += -1/2,&quot;Sx&quot;,j,&quot;Sx&quot;,j+1&lt;br&gt;
  ampo += J/4,&quot;Sz&quot;,j,&quot;Sz&quot;,j+1&lt;br&gt;
    end&lt;br&gt;
    for j=1:N1-2&lt;br&gt;
    ampo += t2,&quot;Sx&quot;,j,&quot;Sz&quot;,j+1,&quot;Sx&quot;,j+2&lt;br&gt;
     end&lt;/p&gt;
</description>
<guid isPermaLink="true">http://itensor.org/support/3823/entanglement-entropy-near-phase-transition-in-1d</guid>
<pubDate>Tue, 15 Mar 2022 07:52:17 +0000</pubDate>
</item>
<item>
<title>SPIN-SPIN CORREALTION FOR A TWO LEG LADDER MODEL</title>
<link>http://itensor.org/support/3821/spin-spin-correaltion-for-a-two-leg-ladder-model</link>
<description>&lt;p&gt;Hii,&lt;/p&gt;

&lt;p&gt;I am doing DMRG  of a two leg ladder model  in ITensor  julia.&lt;/p&gt;

&lt;p&gt;I have calculated the ground sate energy and spin-spin correlation in 1D Heisenberg model and 1D Hubbard model and it gives correct ground state energy  and spin-spin(Total spin on each site) .&lt;/p&gt;

&lt;p&gt;However, when i calculated DMRG for a two leg ladder model (for 48*2 sites) , it appears the ground state energy is correct, but the spin-spin correlation is antiferromagnetic while the actual correlation should be ferromagnetic.&lt;/p&gt;

&lt;p&gt;Here is the Hamiltonian of the code with parameters&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;Nx=48

N= 2*Nx

sites=siteinds(&quot;Electron&quot;,N,conserve_qns=true,conserve_nf = true,conserve_sz=true,conserve_nfparity=false)



ampo =AutoMPO()

#intra-leg hopping
for j=1:2:(N-3)

    ampo += -t,&quot;Cdagup&quot;,j,&quot;Cup&quot;,j+2
    ampo += -t,&quot;Cdagup&quot;,j+2,&quot;Cup&quot;,j
    ampo += -t,&quot;Cdagdn&quot;,j,&quot;Cdn&quot;,j+2
    ampo += -t,&quot;Cdagdn&quot;,j+2,&quot;Cdn&quot;,j


    ampo += -t,&quot;Cdagup&quot;,j+1,&quot;Cup&quot;,j+3
    ampo += -t,&quot;Cdagup&quot;,j+3,&quot;Cup&quot;,j+1
    ampo += -t,&quot;Cdagdn&quot;,j+1,&quot;Cdn&quot;,j+3
    ampo += -t,&quot;Cdagdn&quot;,j+3,&quot;Cdn&quot;,j+1

end

#inter-leg hopping

p=1

for j =1:2:(N-1)

    ampo += Q(p),&quot;Cdagup&quot;,j,&quot;Cup&quot;,j+1
    ampo += conj(Q(p)),&quot;Cdagup&quot;,j+1,&quot;Cup&quot;,j
    ampo += Q(p),&quot;Cdagdn&quot;,j,&quot;Cdn&quot;,j+1
    ampo += conj(Q(p)),&quot;Cdagdn&quot;,j+1,&quot;Cdn&quot;,j
    p=p+1

end   





# On-site interaction       

for j=1:N

    ampo += U,&quot;Nupdn&quot;,j


end
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;I kept the particle number fixed as i want to calculate ground sate energy  at some particular electron density.&lt;/p&gt;

&lt;p&gt;After performing the DMRG with the above Hamiltonian i calculate the spin-spin correlation in the following way&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;xxcorr = correlation_matrix(psi,&quot;S+&quot;,&quot;S-&quot;)
yycorr = correlation_matrix(psi,&quot;S-&quot;,&quot;S+&quot;)
zzcorr = correlation_matrix(psi,&quot;Sz&quot;,&quot;Sz&quot;)
zz =  0.5* xxcorr + 0.5 * yycorr +  zzcorr
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;I calculate the spin-spin correlation for a reference site  away from the boundary.&lt;/p&gt;

&lt;p&gt;But as i mentioned i am not getting the correct spin-spin correlations(which is ferromagnetic for some given parameters).&lt;/p&gt;

&lt;p&gt;So ,is there   anything wrong in  writing the Hamiltonian or in the correlation matrix ?&lt;/p&gt;

&lt;p&gt;Thanks&lt;/p&gt;
</description>
<guid isPermaLink="true">http://itensor.org/support/3821/spin-spin-correaltion-for-a-two-leg-ladder-model</guid>
<pubDate>Mon, 14 Mar 2022 19:02:11 +0000</pubDate>
</item>
<item>
<title>Computing the transfer matrix for iDMRG</title>
<link>http://itensor.org/support/3820/computing-the-transfer-matrix-for-idmrg</link>
<description>&lt;p&gt;I would like to extract the correlation length from the transfer matrix using iDMRG with a given unit cell, preferably using the C++ version. Is there any simple way to compute it from the MPS ?&lt;br&gt;
Thanks in advance for any advice,&lt;/p&gt;
</description>
<guid isPermaLink="true">http://itensor.org/support/3820/computing-the-transfer-matrix-for-idmrg</guid>
<pubDate>Mon, 14 Mar 2022 18:32:37 +0000</pubDate>
</item>
<item>
<title>[C++] Convert an MPS with quantum number to an MPS without quantum number</title>
<link>http://itensor.org/support/3818/convert-mps-with-quantum-number-mps-without-quantum-number</link>
<description>&lt;p&gt;Suppose I have an MPS with conserved particle number. Is there an easy way to convert this MPS to one with no particle-number (but replaced by parity) quantum number?&lt;/p&gt;
</description>
<guid isPermaLink="true">http://itensor.org/support/3818/convert-mps-with-quantum-number-mps-without-quantum-number</guid>
<pubDate>Mon, 14 Mar 2022 16:43:39 +0000</pubDate>
</item>
<item>
<title>[Julia]using a periodic boundary condition</title>
<link>http://itensor.org/support/3811/julia-using-a-periodic-boundary-condition</link>
<description>&lt;p&gt;Hi Miles&lt;/p&gt;

&lt;p&gt;I want do time evolution in PBC with two sites Hamiltonian . For example, a chain made of 12 sites whose first site is related to the 12. I can only find code example in &quot;Make a 2D Hamiltonian for DMRG&quot;  that uses&lt;br&gt;
 &lt;code&gt;lattice = square_lattice(Nx, Ny; yperiodic = false)&lt;/code&gt;&lt;br&gt;
If I imitate the code from &quot;MPS Time Evolution&quot; in document with my own Hamiltonian, how can I add PBC?&lt;/p&gt;
</description>
<guid isPermaLink="true">http://itensor.org/support/3811/julia-using-a-periodic-boundary-condition</guid>
<pubDate>Sun, 13 Mar 2022 09:16:18 +0000</pubDate>
</item>
<item>
<title>C++ version, complex matrix-vector multiplication</title>
<link>http://itensor.org/support/3809/c-version-complex-matrix-vector-multiplication</link>
<description>&lt;p&gt;I found that in C++ version, the function operator* for matrix-vector multiplication seems not implemented for complex matrix CMatrix and complex vector CVector. The sample code is as follows.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;CMatrix a (2,2);
CVector v (2);
auto b = a * v;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The error message is&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;error: no match for ‘operator*’ (operand types are ‘itensor::CMatrix’ {aka ‘itensor::Ten&amp;lt;itensor::MatRangeT&amp;lt;0&amp;gt;, std::complex &amp;gt;’} and ‘itensor::CVector’ {aka ‘itensor::Ten&amp;lt;itensor::VecRangeT&amp;lt;0&amp;gt;, std::complex &amp;gt;’})&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Is there a chance that it will be implemented?&lt;/p&gt;
</description>
<guid isPermaLink="true">http://itensor.org/support/3809/c-version-complex-matrix-vector-multiplication</guid>
<pubDate>Sun, 13 Mar 2022 06:18:50 +0000</pubDate>
</item>
<item>
<title>[Julia]define the state in different Hilbert space</title>
<link>http://itensor.org/support/3799/julia-define-the-state-in-different-hilbert-space</link>
<description>&lt;p&gt;Hi Miles&lt;/p&gt;

&lt;p&gt;I want to use operators which is not included in &quot;electron&quot; or &quot;boson&quot; and so on. The document has used the example &quot;S=3/2&quot; to tell me how to define operators I need. I also need a initial state I set to do time evolution.  For example, the &quot;Up&quot; and &quot;Dn&quot; are MPS in &quot;S=1/2&quot; and we can use it to set initial state. How can I define something like &quot;Dn&quot; or &quot;Up&quot; I need?  &lt;/p&gt;
</description>
<guid isPermaLink="true">http://itensor.org/support/3799/julia-define-the-state-in-different-hilbert-space</guid>
<pubDate>Thu, 10 Mar 2022 07:55:53 +0000</pubDate>
</item>
<item>
<title>Time dependent correlations</title>
<link>http://itensor.org/support/3798/time-dependent-correlations</link>
<description>&lt;p&gt;Hi miles,&lt;br&gt;
I am using Itensor C++ code.&lt;br&gt;
I am interested to find  correlation between Sz&lt;em&gt;1(t) and Sz&lt;/em&gt;4  for L=10 sites Heisenberg spin(1/2) chain.&lt;br&gt;
So  first I calculated psi0 then by using trotter gate psi0&lt;em&gt;t. Next I obtained new1&lt;/em&gt;psi0&lt;em&gt;t=Sz&lt;/em&gt;1*psi0_t(1) (operating Sz_1  at psi0_t(1)). Similarly by operating other operator Sz_4 at psi0(4), new state new4_psi0 calculated. Then I did time evolution of new4_psi0 to get new4_psi0_t and finally  innerC(new1_psi0_t,new4_psi0_t). Is it right?  &lt;/p&gt;
</description>
<guid isPermaLink="true">http://itensor.org/support/3798/time-dependent-correlations</guid>
<pubDate>Wed, 09 Mar 2022 08:01:52 +0000</pubDate>
</item>
<item>
<title>Time evolution under periodic Hamiltoian</title>
<link>http://itensor.org/support/3796/time-evolution-under-periodic-hamiltoian</link>
<description>&lt;p&gt;Hi Miles&lt;/p&gt;

&lt;p&gt;I was trying to implement the time evolution of a direct product initial state under periodic Hamiltonian. Using the autoMPO method, I constructed the Hamiltonian, but when I compared the result with the exact diagonalization, I saw inconsistency between MPS and ED results. &lt;/p&gt;

&lt;p&gt;My initial state was with an open boundary condition. I think I will not face any issues using MPS with closed boundary conditions. Can we construct MPS with closed boundary conditions in iTensor? I went through the documentation, but  I could not find any details regarding MPS with closed boundary.&lt;/p&gt;

&lt;p&gt;I appreciate any help you can provide.&lt;/p&gt;
</description>
<guid isPermaLink="true">http://itensor.org/support/3796/time-evolution-under-periodic-hamiltoian</guid>
<pubDate>Tue, 08 Mar 2022 08:28:49 +0000</pubDate>
</item>
<item>
<title>Computing correlation function</title>
<link>http://itensor.org/support/3795/computing-correlation-function</link>
<description>&lt;p&gt;Hi there! I am using Julia to compute the one-particle spectral function for the Hubbard Holstein system. While I have some degree of confidence in my DMRG calculation (I get the same results as ED) and time evolution (the entropy of the unmodified ground state function, evolved in time, remains very flat), I am getting correlation results that are exactly sign flipped relative to the ED calculation. I've attached a plot of the results for the case where @@N=8, t=1, U=8, \Delta t=0.01, T=1@@. The correlation function I (believe I am) plotting is @@\langle c&amp;#95;j^\dagger (t) c&amp;#95;i(0)\rangle@@ for @@i=j=4@@, the midpoint. &lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://ibb.co/xM0K11V&quot; alt=&quot;Calculating the one-particle correlation function for the midsite, comparing my results to ED&quot;&gt;&lt;/p&gt;

&lt;p&gt;As you can see, there is an exact sign flip between the ED analysis and the results I've obtained by running the algorithm described &lt;a rel=&quot;nofollow&quot; href=&quot;https://journals.aps.org/prl/abstract/10.1103/PhysRevLett.93.076401&quot;&gt;here&lt;/a&gt; on my DMRG ground state. Here is a plot showing the corresponding entropy of both wavefunctions: &lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://ibb.co/ZYyk1s4&quot; alt=&quot;Entropy for time evolution&quot;&gt;&lt;/p&gt;

&lt;p&gt;Because I think the issue might be localized to how I am computing the correlation function, I tried a few different ways of doing so, but ultimately was unable to fix the problem. Here is a snippet of the code I am using to time-evolve the wavefunction and compute the correlation function:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;function apply_onesite_operator(ϕ::MPS, opname::String, sites, siteidx::Int)
    ϕ = copy(ϕ) 

    ## Account for fermion sign using Jordan-Wigner strings ##
    if opname == &quot;Cup&quot; || opname == &quot;Cdn&quot;
        ϕ = apply_op(ϕ, opname, sites, siteidx)
        for i in reverse(1:(siteidx-1)) # Don't act with string on-site
            ϕ = apply_op(ϕ, &quot;F&quot;, sites, i)
        end
        return ϕ
    elseif opname == &quot;Cdagup&quot; || opname == &quot;Cdagdn&quot;
        for i in 1:(siteidx-1) # Don't act with string on-site
            ϕ = apply_op(ϕ, &quot;F&quot;, sites, i)
        end
        ϕ = apply_op(ϕ, opname, sites, siteidx)
        return ϕ
    end

    # Otherwise, just apply the operator as usual
    return apply_op(ϕ, opname, sites, siteidx)
end

function apply_op(ϕ::MPS, opname::String, sites, siteidx::Int)
    ϕ = copy(ϕ) # Make a copy of the original state

    orthogonalize!(ϕ, siteidx)
    new_ϕj = op(opname,sites[siteidx]) * ϕ[siteidx] # Apply the local operator
    noprime!(new_ϕj) 
    ϕ[siteidx] = new_ϕj
    return ϕ
end
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;And now for the compute_correlation functions itself:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;function compute_correlations(dmrg_results::DMRGResults, A_t0::String, A_t::String, HH::HubbardHolsteinModel, p::Parameters)
    # Results 
    corrs = []

    # The wavefunction being acted upon at t=0, |ψ⟩ = A_t0|ϕ⟩
    ϕ = copy(dmrg_results.ground_state)
    ψ = copy(ϕ)

    # Apply A_t0 to middle site
    ψ = apply_onesite_operator(ψ, A_t0, HH.sites, p.mid)

    nsteps = floor(p.T/p.τ) # Number of time steps for time evolution
    t = 0.0
    for step in 1:nsteps
        ϕ = apply(HH.gates, ϕ; maxdim=p.TEBD_maxdim, cutoff=p.TEBD_cutoff)
        ψ = apply(HH.gates, ψ; maxdim=p.TEBD_maxdim, cutoff=p.TEBD_cutoff) # evolve forward

        t += p.τ 

        function measure_corr(j::Int)
            A_tψ = apply_onesite_operator(ψ, A_t, HH.sites, j)
            return inner(ϕ,A_tψ)
        end

        # Measure the correlation fcn 
        push!(corrs,measure_corr.(collect(1:p.N)))
    end
    hcat(corrs...)
end
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Due to how I've set up the code, I pass in Cdagup for A&lt;em&gt;t and Cup for A&lt;/em&gt;t0. Here is the Hamiltonian AMPO, which I use during DMRG:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;ampo = OpSum()
for j=1:N-1
    ampo += -t,&quot;Cdagup&quot;,j,&quot;Cup&quot;,j+1
    ampo += -t,&quot;Cdagup&quot;,j+1,&quot;Cup&quot;,j
    ampo += -t,&quot;Cdagdn&quot;,j,&quot;Cdn&quot;,j+1
    ampo += -t,&quot;Cdagdn&quot;,j+1,&quot;Cdn&quot;,j

    ampo += U,&quot;Nupdn&quot;,j,&quot;I&quot;,j

    ampo += ω,&quot;Nb&quot;,j

    ampo += g0,&quot;Ntot(Bd+B)&quot;,j

    ampo += g1,&quot;Ntot&quot;,j,&quot;Bdag+B&quot;,j+1 
    ampo += g1,&quot;Ntot&quot;,j+1,&quot;Bdag+B&quot;,j
end
# Edge site
ampo += U,&quot;Nupdn&quot;,N
ampo += ω,&quot;Nb&quot;,N
ampo += g0,&quot;Ntot(Bd+B)&quot;,N
H = MPO(ampo,sites)
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;And the trotter gates for time evolution: &lt;/p&gt;

&lt;pre&gt;&lt;code&gt;gates = ITensor[]
for j=1:N-1
    s1 = sites[j] # site j
    s2 = sites[j+1] # site j+1

    hj_twosite = -t*(op(&quot;Cdagup*F&quot;,s1) * op(&quot;Cup&quot;,s2)  # t * (c^†_jσ c_{j+1}σ + h.c.)
             -op(&quot;Cup*F&quot;,s1) * op(&quot;Cdagup&quot;,s2) 
             +op(&quot;Cdagdn*F&quot;,s1) * op(&quot;Cdn&quot;,s2) 
             -op(&quot;Cdn*F&quot;,s1) * op(&quot;Cdagdn&quot;,s2)) 
            + g1*(op(&quot;Ntot&quot;,s1) * op(&quot;Bdag+B&quot;,s2))
            + g1*(op(&quot;Bdag+B&quot;,s1) * op(&quot;Ntot&quot;,s2))

    hj_onesite = U*(op(&quot;Nupdn&quot;,s1) * op(&quot;I&quot;,s2))    
                + ω*(op(&quot;Nb&quot;,s1) * op(&quot;I&quot;,s2))   
                + g0*(op(&quot;Ntot(Bd+B)&quot;,s1) * op(&quot;I&quot;,s2))

    Gj_twosite = exp(-1.0im * τ/2 * hj_twosite)
    Gj_onesite = exp(-1.0im * τ/2 * hj_onesite)
    push!(gates,Gj_twosite)
    push!(gates,Gj_onesite)
end
# End site 
hn = U*op(&quot;Nupdn&quot;,sites[N]) 
    + ω*op(&quot;Nb&quot;,sites[N]) 
    + g0*op(&quot;Ntot(Bd+B)&quot;,sites[N])
Gn = exp(-1.0im * τ/2 * hn)
push!(gates,Gn)
append!(gates,reverse(gates))
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Thanks so much for the help!&lt;/p&gt;
</description>
<guid isPermaLink="true">http://itensor.org/support/3795/computing-correlation-function</guid>
<pubDate>Thu, 03 Mar 2022 18:23:09 +0000</pubDate>
</item>
<item>
<title>DMRG for 2D lattices with rotational symmetry</title>
<link>http://itensor.org/support/3794/dmrg-for-2d-lattices-with-rotational-symmetry</link>
<description>&lt;p&gt;Dear community,&lt;/p&gt;

&lt;p&gt;I am trying to simulate a 2D Hamiltonian on a rectangular lattice geometry using DMRG in Julia, and I expect the ground state of my system to be invariant under a pi rotation of the lattice.&lt;/p&gt;

&lt;p&gt;I was wondering if just performing the DMRG sweeps on half of the MPS and copying the resulting ITensors on the other side of the system could help enforce this symmetry.&lt;/p&gt;

&lt;p&gt;Would it be useful (and efficient) compared to performing the whole sweep?&lt;/p&gt;

&lt;p&gt;Looking at the &lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/ITensor/ITensors.jl/blob/10d870155ef78ee6c1257ea07f9c1571a651c3bc/src/mps/dmrg.jl#L20-L39&quot;&gt;dmrg.jl&lt;/a&gt; file it looks like I would just have to change the for loop in line 201 to  &lt;code&gt;for (b, ha) in sweepnext(Int(N/2))&lt;/code&gt; and then do something like &lt;code&gt;psi[end] = psi[1]&lt;/code&gt;, &lt;code&gt;psi[end-1] = psi[2]&lt;/code&gt; and so on.&lt;/p&gt;

&lt;p&gt;For this last point, is there a way to efficiently replace the values of one ITensor with the ones of another without changing the indices? I tried using &lt;code&gt;replacebond!&lt;/code&gt; without success as there is a mismatch in the indices of the two tensors.&lt;/p&gt;

&lt;p&gt;Best, &lt;br&gt;
Niccolò&lt;/p&gt;
</description>
<guid isPermaLink="true">http://itensor.org/support/3794/dmrg-for-2d-lattices-with-rotational-symmetry</guid>
<pubDate>Wed, 02 Mar 2022 15:24:22 +0000</pubDate>
</item>
<item>
<title>The principle of calculating excited states using DMRG</title>
<link>http://itensor.org/support/3784/the-principle-of-calculating-excited-states-using-dmrg</link>
<description>&lt;p&gt;In ITensor we can use 'DMRG' to target excited states using ground state and Hamiltonian. &lt;br&gt;
I am curious about the principle of it.&lt;br&gt;
Would you please share the papers to calculate excited state that ITensor referred to?&lt;br&gt;
Thank you so much for your sharing and this wonderful ITensor library. &lt;/p&gt;
</description>
<guid isPermaLink="true">http://itensor.org/support/3784/the-principle-of-calculating-excited-states-using-dmrg</guid>
<pubDate>Sun, 20 Feb 2022 13:41:49 +0000</pubDate>
</item>
<item>
<title>Spontaneous symmetry breaking and ground state</title>
<link>http://itensor.org/support/3783/spontaneous-symmetry-breaking-and-ground-state</link>
<description>&lt;p&gt;Hi, &lt;/p&gt;

&lt;p&gt;I am using dmrg in the ITensor Julia version to calculate various excited states in the 1D spin system. There is a Z2 spontaneous symmetry breaking which should lead to two ground states. I was wondering whether dmrg output for ground state energy in ITensor provides both of these ground states ( one as ground state and the second ground state as an excited state) or a linear combination of them leads to ground state. I would like to know if there is any way to get both ground states rather than a linear combination. &lt;/p&gt;

&lt;p&gt;Also, while calculating excited state energy using dmrg, how does the choice of &quot;Weight&quot; will impact the answer? What would be a good guess ( or approach) for choosing the value of &quot;Weight&quot; if a gap is closing between the excited state and ground state or the gap is very small?&lt;/p&gt;

&lt;p&gt;Thank you so much,&lt;/p&gt;

&lt;p&gt;Best,&lt;br&gt;
Ajit&lt;/p&gt;
</description>
<guid isPermaLink="true">http://itensor.org/support/3783/spontaneous-symmetry-breaking-and-ground-state</guid>
<pubDate>Sun, 20 Feb 2022 02:52:36 +0000</pubDate>
</item>
<item>
<title>DMRG FOR TWO LEG LADDER MODEL</title>
<link>http://itensor.org/support/3780/dmrg-for-two-leg-ladder-model</link>
<description>&lt;p&gt;i am trying to calculate the ground state energy of a two leg ladder model by DMRG method using ITensor(Julia), but i have some doubts regarding this. the questions are as follows.&lt;/p&gt;

&lt;p&gt;a)How to introduce the electron density parameter in the code ? For  example : At Half filling of 1D Hubbard model(Spin-1/2 electrons) the electron density is 1/2. ( I know one can calculate total no. of electrons from electron density ,put it in the initial state of the code and keep the filling quantum number fixed, but i am asking can i put the electron density parameter directly in the code?)&lt;/p&gt;

&lt;p&gt;b) Is there anyway to calculate the expectation values(&quot;Sz&quot; or &quot;Ntot&quot; or anyother ) after each sweep rather then after all sweeps?&lt;/p&gt;

&lt;p&gt;Sorry if i have asked very basic questions.&lt;/p&gt;

&lt;p&gt;Thanks&lt;/p&gt;

&lt;p&gt;Paban&lt;/p&gt;
</description>
<guid isPermaLink="true">http://itensor.org/support/3780/dmrg-for-two-leg-ladder-model</guid>
<pubDate>Mon, 14 Feb 2022 19:44:54 +0000</pubDate>
</item>
<item>
<title>Customising the 'Custom SiteSet' in the Site set class ?</title>
<link>http://itensor.org/support/3762/customising-the-custom-siteset-in-the-site-set-class</link>
<description>&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;I was wondering If it is possible to create a single site set that describes 2 ( or possibly three) particles ( spin one-half, electrons, bosons etc.) in the current version of ITensor (C++). An example to this would be trying to create a ladder system of particles, but instead of the Zigzag method, could I create a single site set that supports 2 particles?&lt;/p&gt;

&lt;p&gt;Cheers&lt;/p&gt;
</description>
<guid isPermaLink="true">http://itensor.org/support/3762/customising-the-custom-siteset-in-the-site-set-class</guid>
<pubDate>Wed, 09 Feb 2022 09:37:40 +0000</pubDate>
</item>
<item>
<title>Stopping a DMRG Run &quot;Gracefully&quot;</title>
<link>http://itensor.org/support/3745/stopping-a-dmrg-run-gracefully</link>
<description>&lt;p&gt;Dear all,&lt;/p&gt;

&lt;p&gt;I read this &lt;a rel=&quot;nofollow&quot; href=&quot;https://itensor.org/docs.cgi?vers=cppv3&amp;amp;page=formulas/stopping_dmrg&quot;&gt;post&lt;/a&gt; (C++ implementation)  on how to stop dmrg sweeps without killing the entire program. Can this be implemented in Julia?&lt;/p&gt;

&lt;p&gt;Cheers!&lt;/p&gt;
</description>
<guid isPermaLink="true">http://itensor.org/support/3745/stopping-a-dmrg-run-gracefully</guid>
<pubDate>Fri, 04 Feb 2022 22:18:41 +0000</pubDate>
</item>
<item>
<title>[julia] TEBD gates involving fermions</title>
<link>http://itensor.org/support/3743/julia-tebd-gates-involving-fermions</link>
<description>&lt;p&gt;Dear all,&lt;/p&gt;

&lt;p&gt;I am trying to generalize the TEBD method mentioned &lt;a rel=&quot;nofollow&quot; href=&quot;https://itensor.github.io/ITensors.jl/stable/tutorials/MPSTimeEvolution.html&quot;&gt;here&lt;/a&gt; to a case involving fermions. When changing the following part&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;gates = ITensor[]
for j=1:N-1
  s1 = s[j]
  s2 = s[j+1]
  hj =       op(&quot;Sz&quot;,s1) * op(&quot;Sz&quot;,s2) +
     1/2 * op(&quot;S+&quot;,s1) * op(&quot;S-&quot;,s2) +
     1/2 * op(&quot;S-&quot;,s1) * op(&quot;S+&quot;,s2)
  Gj = exp(-1.0im * tau/2 * hj)
  push!(gates,Gj)
end
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;to include some fermion operators, do we need to manually add JW strings? I am not sure whether these &lt;code&gt;gates&lt;/code&gt; already implement JW string like &lt;code&gt;OpSum&lt;/code&gt; or not.&lt;/p&gt;

&lt;p&gt;Best,&lt;br&gt;
Junsen&lt;/p&gt;
</description>
<guid isPermaLink="true">http://itensor.org/support/3743/julia-tebd-gates-involving-fermions</guid>
<pubDate>Fri, 04 Feb 2022 18:19:13 +0000</pubDate>
</item>
<item>
<title>[julia] how to create local identity operator</title>
<link>http://itensor.org/support/3738/julia-how-to-create-local-identity-operator</link>
<description>&lt;p&gt;Dear all&lt;/p&gt;

&lt;p&gt;How to create local identity operator at site j? Indirectly, one can use the identity &quot;S^z&lt;em&gt;jS^z&lt;/em&gt;j&quot; or &quot;projUp+projDn&quot;, which have built-in functions like &lt;code&gt;op(&quot;Z&quot;,sites,j)&lt;/code&gt; and &lt;code&gt;op(&quot;projDn&quot;,sites,j)&lt;/code&gt;. Is there a more standard way?&lt;/p&gt;

&lt;p&gt;Moreover, how about high-spin sites, fermion/electron sites?&lt;/p&gt;

&lt;p&gt;Best,&lt;br&gt;
Junsen&lt;/p&gt;
</description>
<guid isPermaLink="true">http://itensor.org/support/3738/julia-how-to-create-local-identity-operator</guid>
<pubDate>Thu, 03 Feb 2022 14:41:40 +0000</pubDate>
</item>
<item>
<title>DMRG for phase transitions</title>
<link>http://itensor.org/support/3730/dmrg-for-phase-transitions</link>
<description>&lt;p&gt;Hello,&lt;/p&gt;

&lt;p&gt;My understanding is that DMRG can be successfully used to study phase transitions and calculating critical exponents, etc. Yet, I am having trouble getting sufficient convergence for a range of parameters, in order to properly find the critical point and extract critical exponents. This happens  or several different models, so I suspect that I am simply not using it properly. So let me describe some specific issues I encounter.&lt;br&gt;
I am running DMRG (on the c++ version) for different parameters @@\lambda@@ and systems sizes @@L@@, recording the expectation value of the Z2 order parameter @@\phi@@.&lt;br&gt;
Here are 3 runs, relatively close to the phase transition:&lt;br&gt;
$$ &lt;br&gt;
\lambda  =0.259592, \phi = 0.698822, E_GS =-7.39535 &lt;/p&gt;

&lt;p&gt;\lambda  =0.26, \phi = 0.0681269, E_GS =-7.39147 &lt;/p&gt;

&lt;p&gt;\lambda =0.260816, \phi = 0.633245, E_GS = -7.37986 &lt;br&gt;
$$&lt;br&gt;
The second run @@\lambda=0.26@@, despite being very close in parameter space to the other two, ends up being stuck in the wrong phase (at least, I suspect that the outer two are correct and the middle one is wrong).&lt;/p&gt;

&lt;p&gt;I am doing at least 40 sweeps, with the schedule below:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;sweeps
{
maxm minm cutoff niter  noise
  10    1  1E-5     3  1e-05
  10    1  1E-5     3  1e-05
  10    1  1E-6     3  1e-05
  10    1  1E-7     3  1e-05
  10    1  1E-7     3  1e-07
  10    1  1E-7     3  1e-07
  10    1  1E-7     3  1e-07
  10    1  1E-7     3  1e-07
  15    1  1E-7     3  1e-07
  15    1  1E-7     3  1e-09
  15    1  1E-7     3  1e-09
  20    1  1E-7     2  1e-09
  20    1  1E-8     2  1e-09
  20    1  1E-8     2  1e-12
  20    1  1E-8     2  1e-12
  20    1  1E-8     2  1e-12
  30    1  1E-9     2  1e-12
  50    1  1E-9     2  1e-12
 100    1  1e-9     2  1e-07
 100    1  1E-9     2      0
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;I did vary all the seep parameters, without much success. &lt;br&gt;
The two outer runs seem to converge with a much smaller bond dimension. The largest m during the last 40th sweep was 37, 51, 34, respectively (which I think simply reflects the higher entanglement in the symmetric phase). In all cases, it is quite much smaller than the maxm I allow.&lt;br&gt;
For concreteness, this is a bosonic phi^4 model. The above is for @@L=100@@ and @@maxOcc=16@@. The starting state is a product state of coherent states on each site with finite @@\phi@@. This is an attempt starting close to one of the symmetry broken states. I think this generally works better than a randomMPS.&lt;/p&gt;

&lt;p&gt;I suspect that for some system sizes I get an entire curve of @@\phi@@ vs @@\lambda@@ which are incorrect, whereas for other @@L@@, it seems to converge properly.&lt;br&gt;
Any tips are greatly appreciated!&lt;/p&gt;
</description>
<guid isPermaLink="true">http://itensor.org/support/3730/dmrg-for-phase-transitions</guid>
<pubDate>Sun, 30 Jan 2022 08:19:12 +0000</pubDate>
</item>
<item>
<title>Symmetry breaking in the transverse field Ising model/ Kitaev chain</title>
<link>http://itensor.org/support/3729/symmetry-breaking-transverse-field-ising-model-kitaev-chain</link>
<description>&lt;p&gt;I have been doing some simple experiments with the transverse field Ising model and its Jordan Wigner transformed version, the Kitaev chain, in the Julia version of ITensor. I am trying to understand how DMRG deals with ground state degeneracies/ topological degeneracies. I have a few questions about this:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;When the transverse field is zero or small, DMRG ends up picking one of the two ferromagnetically ordered states at random. Why does it not pick linear combinations? My guess would be: Linear combinations of the ordered states have long range entanglement. This cannot be captured by DMRG because it arrives at the ground state by optimizing local bonds. Is that correct?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Also, the MPS representation of these linear combinations would have a tiny bond dimension of 2. So what is the signature of long range entanglement in the MPS representation if it is not a large bond dimension?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Is there any way though to force the DMRG to pick up one of the cat states? &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;One possibility is to Jordan Wigner transform the Ising model to a Kitaev chain. When I compute ground states for the Kitaev chain with open boundary conditions in the topological phase, DMRG always picks up a uniform superposition of the even and odd parity states. This would correspond to the ordered states in the spin language. Again, why does DMRG do this? Does the long range entanglement argument translate into the fermion language as well?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A side comment/ question about this: Even though DMRG picks up the &quot;ordered&quot; state, when I compute the expectation value of the Jordan Wigner spin sz, I get zero instead of +1 or -1 which is expected of the ordered state.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Upon adding periodic or anti-periodic boundary terms, DMRG ends up picking the even or odd parity state (and this would correspond to picking up a cat state in the spin language). My question about this is the following: For the DMRG to successfully pick a definite parity state, I need a large enough bond dimension for the initial state psi0 (the number of sweeps does not matter so much). Why is this the case when the final bond dimension of the cat state is just 2? And how should the bond dimension of the initial state scale with system size to enable the DMRG to converge to a definite parity ground state?&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Thank you! &lt;/p&gt;
</description>
<guid isPermaLink="true">http://itensor.org/support/3729/symmetry-breaking-transverse-field-ising-model-kitaev-chain</guid>
<pubDate>Fri, 28 Jan 2022 17:36:38 +0000</pubDate>
</item>
<item>
<title>Time evolution of local green function using two applyMPO for spinless-fermions.</title>
<link>http://itensor.org/support/3725/evolution-local-green-function-applympo-spinless-fermions</link>
<description>&lt;p&gt;Hi,&lt;br&gt;
    I am trying to calculate the local green function G&lt;em&gt;ii(t)= &amp;lt;\psi&lt;/em&gt;0|Cdag&lt;em&gt;i(t)C&lt;/em&gt;i|\psi&lt;em&gt;0&amp;gt; at site i=N, using two applyMPO for one-dimensional Kitaev model [equation 1 of PRB 88, 161103(R) (2013)]. For this I am doing following steps:&lt;br&gt;
(i)  I am calculating  |\phi&amp;gt;=C&lt;/em&gt;i |\psi&lt;em&gt;0&amp;gt; by applying local operator C&lt;/em&gt;i to the ground state |psi&lt;em&gt;0&amp;gt;. &lt;br&gt;
(ii) Time evolution of |\phi&amp;gt; using applyMPO: |phi(t)&amp;gt;=exp(-iHt)|\phi&amp;gt;.&lt;br&gt;
(iii) Application of local operator Cdag&lt;/em&gt;i to |\phi(t): Cdag&lt;em&gt;i|phi(t)&amp;gt;.   &lt;br&gt;
(iv)Time evolution of |psi&lt;/em&gt;0&amp;gt; using applyMPO: |psi(t)&amp;gt;=exp(-iHt)|\psi_0&amp;gt;.&lt;br&gt;
(v) Overlap of &amp;lt;psi(t)|phi(t)&amp;gt; using innerC. &lt;/p&gt;

&lt;p&gt;After running the code, I am getting non-zero values for the odd time steps and zero for even number of time steps:&lt;br&gt;
0.001 -0.000605309 -0.671164&lt;br&gt;
0.002 0 -0&lt;br&gt;
0.003 0.00300302 0.671158&lt;br&gt;
0.004 0 -0&lt;br&gt;
0.005 -0.00540069 -0.671143&lt;/p&gt;

&lt;p&gt;Here is the code: &lt;/p&gt;

&lt;p&gt;`//-------------Creating |phi&amp;gt; = C_i1|Psig&amp;gt;--------&lt;/p&gt;

&lt;pre&gt;&lt;code&gt; auto i1=N;  // for site i1=N. 
 psig.position(i1);
 auto newpsi = noPrime(psig(i1)*op(sites,&quot;A&quot;,i1));
 psig.set(N, newpsi);
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;//--------------Jordan-Wigner string----------------------&lt;/p&gt;

&lt;pre&gt;&lt;code&gt; for(int k = i1-1; k &amp;gt;=1; k--)
{
 psig.position(k);
auto newpsi1 = noPrime(psig(k)*op(sites,&quot;F&quot;,k)); 
   psig.set(k, newpsi1);
}
  psig.noPrime().normalize();
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;auto tau=0.001;&lt;br&gt;
auto ii = Complex&lt;em&gt;i;&lt;br&gt;
auto args = Args(&quot;Method=&quot;,&quot;DensityMatrix&quot;,&quot;Cutoff=&quot;,1E-14,&quot;MaxDim=&quot;,7000);&lt;br&gt;
auto expH = toExpH(ampo,tstep*Cplx&lt;/em&gt;i);&lt;br&gt;
//-------------Time Evolution-------------------------- &lt;/p&gt;

&lt;pre&gt;&lt;code&gt;auto nt = int(ttotal/tau+(1e-9*(ttotal/tau)));
for(int n = 1; n &amp;lt;= nt;++n)
{
           psig = applyMPO(expH,psig,args);     
           psig.noPrime().normalize();
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;//--Jordan-Wigner string&lt;/p&gt;

&lt;pre&gt;&lt;code&gt; for(int k = 1; k &amp;lt;i1; ++k)
  {  
       psig.position(k);
       auto newpsi2 = noPrime(psig(k)*op(sites,&quot;F&quot;,k)); 
       psig.set(k, newpsi2);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;// ----------------- Cdag|phi(t)&amp;gt;--------------------&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;    psig.position(i1);
    auto newpsi3 = noPrime(psig(i1)*op(sites,&quot;Adag&quot;,i1));
    psig.set(i1, newpsi3);
    psig.noPrime().normalize();
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;//------------------psi(t)&amp;gt;=exp(-iHt)|psig&amp;gt;-----------------------    &lt;/p&gt;

&lt;pre&gt;&lt;code&gt;      psi = applyMPO(expH,psi,args);
      psi.noPrime().normalize();
      auto result2 = -ii*innerC(psi,psig);
      file2&amp;lt;&amp;lt;float(n*tstep)&amp;lt;&amp;lt;' '&amp;lt;&amp;lt; result2.real()&amp;lt;&amp;lt;' ' &amp;lt;&amp;lt;result2.imag() &amp;lt;&amp;lt;std::endl;
&lt;/code&gt;&lt;/pre&gt;
</description>
<guid isPermaLink="true">http://itensor.org/support/3725/evolution-local-green-function-applympo-spinless-fermions</guid>
<pubDate>Tue, 25 Jan 2022 14:29:18 +0000</pubDate>
</item>
<item>
<title>Spatial parity inversion of MPS using SWAP gates</title>
<link>http://itensor.org/support/3719/spatial-parity-inversion-of-mps-using-swap-gates</link>
<description>&lt;p&gt;I have a model of two sets of energy levels coupled to an impurity (like a two channel Kondo model). The MPO is implemented such that the MPS has a L(eft channel) - imp(urity) - R(ight channel) geometry. I am using the c++ version of ITensor. &lt;/p&gt;

&lt;p&gt;When the physical parameters are symmetric, this system has spatial inversion symmetry. To measure it, I want to implement a parity operator that swaps the L and R channels in the MPS. For 7 sites the action of this operator would transform the mps (1, 2, 3) - 4 - (5, 6, 7) into (5, 6, 7) - 4 - (1, 2, 3).  Measuring the overlap of the new state with the original should give me parity. &lt;/p&gt;

&lt;p&gt;I implemented the permutation of channels by using SWAP gates to permute neighbouring sites so that the channels get swapped. I tried using the BongGate class and also the svd trick mentioned in Miles' comment from Sep 13, 2019 &lt;a rel=&quot;nofollow&quot; href=&quot;http://itensor.org/support/760/swap-gates-for-non-identical-sites&quot;&gt;here&lt;/a&gt;. I check that the permutation is correct by comparing occupation numbers (or even local density matrices) of sites in the old and new state. Then, I compute parity as inner(psi, newpsi). &lt;/p&gt;

&lt;p&gt;There are two problems:&lt;/p&gt;

&lt;p&gt;a) The approach does not seem to be correct. For symmetrical parameters, the parity should be 1 or -1, but the result is typically at least a few percent off (depends on physical parameters and symmetry sector chosen - I have observed that taking half-filling gives results closer to 1 (but still on the order of 0.98), but am not sure whether this is relevant). I also tried permuting the siteIndeces of the MPS using the delta tensor as indicated &lt;a rel=&quot;nofollow&quot; href=&quot;http://itensor.org/support/375/reflecting-an-mps&quot;&gt;here&lt;/a&gt;, but it does not seem to do anything - the overlap always gives 1, even with asymmetric physical parameters. &lt;/p&gt;

&lt;p&gt;b) The approach will not work for large system sizes, as permuting the levels with SWAP gates blows up the MPS in memory. &lt;/p&gt;

&lt;p&gt;My question is two-fold.&lt;br&gt;
What is wrong with my approach? &lt;br&gt;
And what would be a better way to obtain parity? &lt;/p&gt;
</description>
<guid isPermaLink="true">http://itensor.org/support/3719/spatial-parity-inversion-of-mps-using-swap-gates</guid>
<pubDate>Mon, 24 Jan 2022 09:02:18 +0000</pubDate>
</item>
<item>
<title>toExpH in Julia</title>
<link>http://itensor.org/support/3718/toexph-in-julia</link>
<description>&lt;p&gt;Hi, &lt;/p&gt;

&lt;p&gt;does there exist a toExpH analog in the Julia version?&lt;/p&gt;

&lt;p&gt;Best,&lt;br&gt;
Andreas&lt;/p&gt;
</description>
<guid isPermaLink="true">http://itensor.org/support/3718/toexph-in-julia</guid>
<pubDate>Mon, 24 Jan 2022 05:18:52 +0000</pubDate>
</item>
<item>
<title>Possible bug in on-site terms - AutoMPO (C++)</title>
<link>http://itensor.org/support/3716/possible-bug-in-on-site-terms-autompo-c</link>
<description>&lt;p&gt;I am noticing a bug when I use AutoMPO for building the following bosonic Hamiltonian&lt;br&gt;
$$ &lt;br&gt;
H = \sum&amp;#95;j n&amp;#95;j n&amp;#95;j &lt;br&gt;
$$ &lt;br&gt;
Essentially, it looks like it does not do the square correctly. For example, if I run the following code (I don't impose conservation of particles, since in the actual model I have been investigating it is not conserved)&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;int size = 2;
int cutoff = 3;
SiteSet sites = Boson(size,{&quot;ConserveQNs&quot;,false,&quot;MaxOcc=&quot;,cutoff}); 
auto ampo = AutoMPO(sites); 
for(int j = 1 ; j &amp;lt;= size ; j++) ampo += 1 , &quot;N&quot;, j , &quot;N&quot;, j ;
MPO H = toMPO(ampo,{&quot;Exact=&quot;,true});
PrintData(H(1));
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The output does not appear to be n^2:&lt;/p&gt;

&lt;p&gt;H(1) = &lt;br&gt;
ITensor ord=3: (dim=4|id=952|&quot;n=1,Site,Boson&quot;) (dim=4|id=952|&quot;n=1,Site,Boson&quot;)' (dim=3|id=827|&quot;l=1,Link&quot;) &lt;br&gt;
{norm=8.60 (Dense Real)}&lt;br&gt;
(1,1,1) 1.0000000&lt;br&gt;
(2,2,1) 1.0000000&lt;br&gt;
(3,3,1) 1.0000000&lt;br&gt;
(4,4,1) 1.0000000&lt;br&gt;
(2,2,2) 2.0000000&lt;br&gt;
(3,3,2) 4.0000000&lt;br&gt;
(4,4,2) 6.0000000&lt;br&gt;
(2,2,3) 1.0000000&lt;br&gt;
(3,3,3) 2.0000000&lt;br&gt;
(4,4,3) 3.0000000&lt;/p&gt;

&lt;p&gt;Am I missing something?&lt;/p&gt;

&lt;p&gt;Thank you in advance!&lt;/p&gt;
</description>
<guid isPermaLink="true">http://itensor.org/support/3716/possible-bug-in-on-site-terms-autompo-c</guid>
<pubDate>Fri, 21 Jan 2022 19:13:50 +0000</pubDate>
</item>
<item>
<title>How to calculate string operator in ITensor-3 C version</title>
<link>http://itensor.org/support/3715/how-to-calculate-string-operator-in-itensor-3-c-version</link>
<description>&lt;p&gt;Dear ITensor team,&lt;br&gt;
    Thanks for the reply. Recently, I want to calculate string operator in Haldane phase., e.g. &amp;lt;s^{z}&lt;em&gt;{I}exp(I\pi\sum&lt;/em&gt;{k}&lt;em&gt;{i=&amp;lt;k&amp;lt;j}s^{z}&lt;/em&gt;{k})s^{z}_{j}&amp;gt;, but in ITensor doc, I just find time evolution exponential operation (for t must be small) but not find exponential the ordinary autoMPO. So I want to ask how do we calculate the string operator in the simple way ? Many thanks ! &lt;br&gt;
Best regards,&lt;br&gt;
sugar&lt;/p&gt;
</description>
<guid isPermaLink="true">http://itensor.org/support/3715/how-to-calculate-string-operator-in-itensor-3-c-version</guid>
<pubDate>Thu, 20 Jan 2022 03:51:56 +0000</pubDate>
</item>
<item>
<title>[julia] Out of memory problem</title>
<link>http://itensor.org/support/3700/julia-out-of-memory-problem</link>
<description>&lt;p&gt;Dear all,&lt;/p&gt;

&lt;p&gt;I have obtained the ground state MPS wavefunction, Now the problem is: when calculating the correlators, I encounter the &quot;out of memory error&quot; and the program get killed.&lt;/p&gt;

&lt;p&gt;Note this problem is similar to &lt;a rel=&quot;nofollow&quot; href=&quot;http://itensor.org/support/3528/out-of-memory-error-when-using-correlation_matrix?show=3528#q3528&quot;&gt;this one&lt;/a&gt;, but in my case the correct code for calculating the correlator has been implemented, but the problem remains...&lt;/p&gt;

&lt;p&gt;I guess there may be some way to save the intermediate data into disk? Can someone give me more details on how to do it, or give me some links about this method.&lt;/p&gt;
</description>
<guid isPermaLink="true">http://itensor.org/support/3700/julia-out-of-memory-problem</guid>
<pubDate>Tue, 18 Jan 2022 16:47:34 +0000</pubDate>
</item>
<item>
<title>Working in different subspace</title>
<link>http://itensor.org/support/3699/working-in-different-subspace</link>
<description>&lt;p&gt;Dear ITensor comminuty &lt;/p&gt;

&lt;p&gt;I am interested to probe the minimum energy of a general many-body Hamiltonian, let's say spin models, in different subspaces.  For example,  plotting the E&lt;em&gt;{min} versos S^z&lt;/em&gt;{total} }.&lt;/p&gt;

&lt;p&gt;any comments and help would be appreciated&lt;/p&gt;

&lt;p&gt;Regards&lt;br&gt;
Javad &lt;/p&gt;
</description>
<guid isPermaLink="true">http://itensor.org/support/3699/working-in-different-subspace</guid>
<pubDate>Tue, 18 Jan 2022 13:50:00 +0000</pubDate>
</item>
<item>
<title>[julia] unexpected fermion density configuration in CDW phase</title>
<link>http://itensor.org/support/3692/julia-unexpected-fermion-density-configuration-cdw-phase</link>
<description>&lt;p&gt;Dear all,&lt;/p&gt;

&lt;p&gt;As a simple exercise, I examine the CDW phase of the spinless fermion chian (with nearest neighbor interaction) at half filling.&lt;/p&gt;

&lt;p&gt;For @@U@@ small, the fermion density configuration is almost flat, with something like Friedel oscillation at two ends.&lt;/p&gt;

&lt;p&gt;However, for @@U@@ large, the fermion density configuration is not a standard CDW, but forming a symmetric crossing at the center site, like this:&lt;br&gt;
&lt;img src=&quot;https://i.ibb.co/k3xqC1p/1642406625-1.png&quot; alt=&quot;large U&quot;&gt;&lt;/p&gt;

&lt;p&gt;This configuration is somehow expected, since it is more symmetric than the usual 101010,&lt;br&gt;
but how can i recover this standard result?&lt;/p&gt;

&lt;p&gt;In case needed, the code I use is given below:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;using LinearAlgebra
using MKL
using ITensors
using HDF5

let
        N = 20
        t1 = 1.0
        U = 50

        sites = siteinds(&quot;Fermion&quot;, N; conserve_qns=true)

        ampo = OpSum()
        for j in 1:(N-1)
            ampo += -t1, &quot;Cdag&quot;, j+1, &quot;C&quot;, j
            ampo += -t1, &quot;Cdag&quot;, j, &quot;C&quot;, j+1
        end
        for j in 1:(N-1)
            ampo += U, &quot;N&quot;, j, &quot;N&quot;,j+1
        end
        H = MPO(ampo, sites)

        nthreads = 8
        BLAS.set_num_threads(nthreads)
        sweeps = Sweeps(300)
        etol = 1E-9
        obs1 = DMRGObserver(;energy_tol=etol,minsweeps=20)
        obs2 = DMRGObserver(;energy_tol=etol,minsweeps=10)
        obs3 = DMRGObserver(;energy_tol=etol,minsweeps=10)
        setmaxdim!(sweeps, 20, 30, 50, 100, 200, 300, 500, 1000, 2000)
        setcutoff!(sweeps, 1E-10)
        vnoi = [1E-5 for i in 1:10]
        setnoise!(sweeps, 1E-3, 1E-4, vnoi...,
                  1E-6, 1E-7, 1E-8, 1E-9, 1E-10,
                  1E-11, 1E-12, 0.0)

        state = [isodd(n) ? &quot;Emp&quot; : &quot;Occ&quot; for n in 1:N]
           psii = randomMPS(sites, state, 10)
        energy0, psi0 = dmrg(H, psii, sweeps;observer=obs1)
            n = expect(psi0,&quot;N&quot;)
end
&lt;/code&gt;&lt;/pre&gt;
</description>
<guid isPermaLink="true">http://itensor.org/support/3692/julia-unexpected-fermion-density-configuration-cdw-phase</guid>
<pubDate>Mon, 17 Jan 2022 08:00:07 +0000</pubDate>
</item>
<item>
<title>[C++ ITensor 3] MPO time evolution does not work for large interactions</title>
<link>http://itensor.org/support/3691/itensor-time-evolution-does-not-work-for-large-interactions</link>
<description>&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;It seems the MPO time evolution gives wrong results for large interactions. The sample code is below.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;#include &quot;itensor/all.h&quot;
using namespace std;
using namespace itensor;

int
main(int argc, char* argv[])
{
int N = 10;
auto sites = Boson(N,{&quot;MaxOcc=&quot;,1,&quot;ConserveQNs=&quot;,false});
auto state = InitState(sites);
for(int i = 1; i &amp;lt;= N; ++i)
    {
    state.set(i,&quot;0&quot;);
    }
auto psi0 = MPS(state);
auto psi = MPS(state);

auto ampo = AutoMPO(sites);
//Make the Hamiltonian
for(int b = 1; b &amp;lt; N; ++b)
    {
    ampo += 10.0,&quot;N&quot;,b,&quot;N&quot;,b+1;
    }
for(int b = 1; b &amp;lt;= N; ++b)
    {
    ampo += 0.5,&quot;Adag&quot;,b;
    ampo += 0.5,&quot;A&quot;,b;
    ampo += -2.0,&quot;N&quot;,b;
    }
auto H = toMPO(ampo);
auto tau = 0.1;
//auto expH = toExpH(ampo,tau);
auto expH = toExpH(ampo,tau*Cplx_i);

auto args = Args(&quot;Method=&quot;,&quot;DensityMatrix&quot;,&quot;Cutoff=&quot;,1E-9,&quot;MaxDim=&quot;,3000);
auto ttotal = 3.0;
auto nt = int(ttotal/tau+(1e-9*(ttotal/tau)));

for(int n = 1; n &amp;lt;= nt; ++n)
    {
    psi = applyMPO(expH,psi,args);
    psi.noPrime().normalize();
    auto ovlp = norm(innerC(psi,psi0));
    auto bb = n*tau;
    printfln(&quot;\nOverlap at time %.4f %.20f&quot;,bb,ovlp);
    }
return 0;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;When the NN interaction is large, like 10.0, the overlap between the time-evolved psi and the initial psi will quickly become &quot;0.00000000000000000000&quot; and then keeps zero forever. This makes no sense. Is this due to the algorithm itself or some bug in the code? Thanks.&lt;/p&gt;

&lt;p&gt;Jin&lt;/p&gt;
</description>
<guid isPermaLink="true">http://itensor.org/support/3691/itensor-time-evolution-does-not-work-for-large-interactions</guid>
<pubDate>Mon, 17 Jan 2022 05:42:44 +0000</pubDate>
</item>
</channel>
</rss>