<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Dear Mateusz,<div class=""><br class=""></div><div class="">Which version of the code are you using?</div><div class="">We recently rewrote how measurements are parsed (specially for measurement expressions).</div><div class=""><br class=""></div><div class="">Could you please try with a version newer than r7807?</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Best,</div><div class="">Michele</div><div class=""><br class=""><div class="">
<div style="color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant-ligatures: normal; font-variant-position: normal; font-variant-caps: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">--</div><div class="">ETH Zurich</div><div class=""><span style="text-align: -webkit-auto;" class="">Dr.</span><span style="text-align: -webkit-auto;" class=""> </span>Michele Dolfi</div><div class="">Institute for Theoretical Physics</div><div class="">HIT G 32.4</div><div class="">Wolfgang-Pauli-Str. 27</div><div class="">8093 Zurich</div><div class="">Switzerland</div><div class=""><br class=""></div><div class=""><a href="mailto:dolfim@phys.ethz.ch" class="">dolfim@phys.ethz.ch</a></div><div class=""><a href="http://www.itp.phys.ethz.ch" class="">www.itp.phys.ethz.ch</a></div><div class=""><br class=""></div><div class="">+41 44 633 78 56 phone</div><div class="">+41 44 633 11 15 fax </div></div>
</div>
<br class=""><div><blockquote type="cite" class=""><div class="">On 14 Jan 2017, at 18:17, Mateusz Łącki <<a href="mailto:mateusz.lacki@gmail.com" class="">mateusz.lacki@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">Dear All.<br class="">I would like to report a likely bug.<br class=""><br class="">I play with a simple transverse ising model for S=1/2. I  take a short chain of length say 8, compute magnetization in x and z direction. When I compute the same input with mps_optim and sparsediag i obtain different results. Both codes give me different magnetizatios in mps_optim measurement seems to be wrong by a factor.<br class=""><br class="">I changed the definition of a default model  “spin” (see below), the coupling is along x axis and field is along z. I consider the following input:<br class=""><br class="">LATTICE="inhomogeneous chain lattice"<br class="">MODEL_LIBRARY="models.xml"<br class=""><br class="">MODEL="spin"<br class="">J=1<br class="">SWEEPS=8<br class="">chkp_each=8<br class=""><br class="">MEASURE_LOCAL[Local magnetization Xa]=Splus<br class="">MEASURE_LOCAL[Local magnetization Xb]=Sminus<br class="">MEASURE_LOCAL[Local magnetization X1]=Sx<br class="">MEASURE_LOCAL[Local magnetization X2]=Sxx<br class="">MEASURE_LOCAL[Local magnetization Z]=Sz<br class="">MAXSTATES=40;<br class="">NUMBER_EIGENVALUES=1;<br class=""><br class="">{h=0;Gamma=0;L=8} <br class=""><br class="">*******************<br class="">In the above the Sxx operator is defined exactly the same as Sx:<br class=""><SITEOPERATOR name="Sx" site="x"><br class="">  1/2*(Splus(x)+Sminus(x))<br class=""></SITEOPERATOR><br class=""><br class="">but with 1/4 factor, not 1/2:<br class=""><SITEOPERATOR name="Sxx" site="x"><br class="">  1/4*(Splus(x)+Sminus(x))<br class=""></SITEOPERATOR><br class=""><br class=""><br class="">There are 2 runs that are important for my message:<br class=""><br class="">RUN A):<br class="">running the above input with sparsediag gives (at any site):<br class="">Local magnetization Xa=0.5<br class="">Local magnetization Xb=0.5<br class="">Local magnetization X1=0.5<br class="">Local magnetization X2=0.25<br class=""><br class="">Which makes sense, as Sx=0.5*(Jplus + Jminus)<br class=""><br class="">RUN B):<br class="">running the above input with mps_optim gives (at any site):<br class="">Local magnetization Xa=0.5<br class="">Local magnetization Xb=0.5<br class="">Local magnetization X1=1.0<br class="">Local magnetization X2=1.0<br class=""><br class=""><br class="">My conclusion:<br class="">It seems that measurement ignores the factor 1/4 in the definition of Sxx and 1/2 in the definition of Sx. If it is indeed the case (not stupid mistake on my side), would it be possible to issue a patch?<br class=""><br class="">If I change <br class="">  <BONDTERM source="i" target="j"><br class="">    <PARAMETER name="J#" default="J"/><br class="">    -J#*Sx(i)*Sx(j)*4<br class="">  </BONDTERM><br class=""><br class="">into <br class="">  <BONDTERM source="i" target="j"><br class="">    <PARAMETER name="J#" default="J"/><br class="">    -J#*Sxx(i)*Sxx(j)*4<br class="">  </BONDTERM><br class=""><br class="">then I get a correct factor 4 reduction in energy. So it seems only the mesurement ignores the numerical factor.<br class=""><br class="">If I exchange x-z direction in the Hamiltonian everything seems fine.<br class=""><br class="">Best,<br class="">Mateusz Łącki<br class=""><br class=""><br class=""><br class="">----<br class="">Comp-phys-alps-users Mailing List for the ALPS Project<br class=""><a href="http://alps.comp-phys.org/" class="">http://alps.comp-phys.org/</a><br class=""><br class="">List info: https://lists.phys.ethz.ch//listinfo/comp-phys-alps-users<br class="">Archive: https://lists.phys.ethz.ch//pipermail/comp-phys-alps-users<br class=""><br class="">Unsubscribe by writing a mail to comp-phys-alps-users-leave@lists.phys.ethz.ch.</div></div></blockquote></div><br class=""></div></body></html>