issp-center-dev / HPhi

Quantum Lattice Model Simulator Package
https://www.pasums.issp.u-tokyo.ac.jp/hphi/en/
GNU General Public License v3.0
82 stars 25 forks source link

Fix interall interactions #127

Closed k-yoshimi closed 2 years ago

k-yoshimi commented 2 years ago

When i1 sigma1 i2 sigma2 i3 sigma3 i4 sigma4 val_re val_im is defined and i4 sigma4 i3 sigma3 i2 sigma2 i1 sigma1 val_re -val_im and i2 sigma2 i1 sigma1 i4 sigma4 i3 sigma3 val_re -val_im exists at the same time in InterAll.def, a branching error will occur.

  1. Add a check condition

Before

if (icntincorrect != 0) {
  return (-1);
}

After

if (icntincorrect != 0 || NInterAllOffDiagonal != 2*icntHermite) {
  return (-1);
}
  1. Remove a check condition for spin and spingc

Before

if (iCalcModel == Kondo || iCalcModel == KondoGC || iCalcModel == Spin || iCalcModel == SpinGC) {

After

if (iCalcModel == Kondo || iCalcModel == KondoGC) {
For the off-diagonal component, be sure to provide a pair of i1 sigma1 i2 sigma2 i3 sigma3 i4 sigma4 and i4 sigma4 i3 sigma3 i2 sigma2 i1 sigma1.
tmisawa commented 2 years ago

@k-yoshimi Since Hermite pair should be given in (I,J,K,L) and (L,K,J,I), the second criterion is redundant. It is better to delete the following part

else if (isite1 == itmpsite2 && isite2 == itmpsite1 && isite3 == itmpsite4 && isite4 == itmpsite3)

And, if pair (I,J,K,L) , (L,K,J,I) does not exist, it is better to exit with an error message

tmisawa commented 2 years ago

In the previous comment, I did not consider the standard notation used in the spin systems.

For example, In spin systems, exchange interactions are described as S^{+}_{A}S^{-}_{B}+S^{-}_{A}S^{+}_{B}. In this description, the Hermite pair is given by (I,J,K,L) and (J,I,L,K).

This kind of expression is frequently used in the study of the spin systems, it is better to regard the pair [(I,J,K,L), (J,I,L,K)] as the Hermiter pair.

k-yoshimi commented 2 years ago

@tmisawa Thank you for your comment. My latest commit fixes the problem. Please check it and if theres's no problem, merge it to the develop branch.

tmisawa commented 2 years ago

minimum.zip For a memo, I uploaded the minimum input files for this bug. Note that the true GS energy is -0.25 but it is -0.50 in the old version.