From fb711db67f3f5bd1299eed24e05187d4b5d76ac6 Mon Sep 17 00:00:00 2001 From: Mitsuaki Kawamura Date: Tue, 28 Sep 2021 11:56:06 +0900 Subject: [PATCH 01/26] OpenMP parallelism for sz before Hacker's delite. In this commit, implemented only for Hubbard-N-Conserved. --- src/sz.c | 83 +++++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 58 insertions(+), 25 deletions(-) diff --git a/src/sz.c b/src/sz.c index 811fc54e2..8374845e1 100644 --- a/src/sz.c +++ b/src/sz.c @@ -77,11 +77,13 @@ int sz long unsigned int div; long unsigned int num_up,num_down; long unsigned int irght,ilft,ihfbit; + long unsigned int *jbthread; //*[s] for omp parall + int mythread; unsigned int all_up,all_down,tmp_res,num_threads; long unsigned int tmp_1,tmp_2,tmp_3; - long int **comb; + long int **comb, **comb2; //*[e] for omp parall // [s] for Kondo @@ -407,39 +409,70 @@ int sz } else if(hacker==1){ // this part can not be parallelized - jb = 0; - iSpnup=0; iMinup=0; iAllup=X->Def.Ne; if(X->Def.Ne > X->Def.Nsite){ iMinup = X->Def.Ne-X->Def.Nsite; iAllup = X->Def.Nsite; } - for(ib=0;ibCheck.sdim;ib++){ - list_jb[ib]=jb; - i=ib*ihfbit; - num_up=0; - for(j=0;j<=N2-2;j+=2){ - div=i & X->Def.Tpow[j]; - div=div/X->Def.Tpow[j]; - num_up+=div; + jbthread = lui_1d_allocate(nthreads); + #pragma omp parallel default(none) \ + shared(X,iMinup,iAllup,list_jb,ihfbit,N2,nthreads,jbthread) \ + private(ib,i,j,num_up,num_down,div,tmp_res,tmp_1,tmp_2,iSpnup,jb,all_up,all_down,comb2,mythread) + { + jb = 0; + iSpnup=0; +#ifdef _OPENMP + mythread = omp_get_thread_num(); +#else + mythread = 0; +#endif + comb2 = li_2d_allocate(X->Def.Nsite+1,X->Def.Nsite+1); + #pragma omp for + for(ib=0;ibCheck.sdim;ib++){ + list_jb[ib]=jb; + i=ib*ihfbit; + num_up=0; + for(j=0;j<=N2-2;j+=2){ + div=i & X->Def.Tpow[j]; + div=div/X->Def.Tpow[j]; + num_up+=div; + } + num_down=0; + for(j=1;j<=N2-1;j+=2){ + div=i & X->Def.Tpow[j]; + div=div/X->Def.Tpow[j]; + num_down+=div; + } + tmp_res = X->Def.Nsite%2; // even Ns-> 0, odd Ns -> 1 + all_up = (X->Def.Nsite+tmp_res)/2; + all_down = (X->Def.Nsite-tmp_res)/2; + + for(iSpnup=iMinup; iSpnup<= iAllup; iSpnup++){ + tmp_1 = Binomial(all_up, iSpnup-num_up,comb2,all_up); + tmp_2 = Binomial(all_down, X->Def.Ne-iSpnup-num_down,comb2,all_down); + jb += tmp_1*tmp_2; + } } - num_down=0; - for(j=1;j<=N2-1;j+=2){ - div=i & X->Def.Tpow[j]; - div=div/X->Def.Tpow[j]; - num_down+=div; + free_li_2d_allocate(comb2); + if(mythread != nthreads-1) jbthread[mythread+1] = jb; + #pragma omp barrier + #pragma omp single + { + jbthread[0] = 0; + for(j=1;jDef.Nsite%2; // even Ns-> 0, odd Ns -> 1 - all_up = (X->Def.Nsite+tmp_res)/2; - all_down = (X->Def.Nsite-tmp_res)/2; - - for(iSpnup=iMinup; iSpnup<= iAllup; iSpnup++){ - tmp_1 = Binomial(all_up, iSpnup-num_up,comb,all_up); - tmp_2 = Binomial(all_down, X->Def.Ne-iSpnup-num_down,comb,all_down); - jb += tmp_1*tmp_2; + #pragma omp for + for(ib=0;ibCheck.sdim;ib++){ + list_jb[ib] += jbthread[mythread]; } - } + }//omp parallel + free_lui_1d_allocate(jbthread); +for(ib=0;ibCheck.sdim;ib++){ + printf("%ld %ld\n", ib, list_jb[ib]); +} //#pragma omp barrier TimeKeeper(X, cFileNameSzTimeKeep, cOMPSzMid, "a"); TimeKeeper(X, cFileNameTimeKeep, cOMPSzMid, "a"); From de7a1a640273029aa568184e5f10be87a4d19709 Mon Sep 17 00:00:00 2001 From: Mitsuaki Kawamura Date: Wed, 29 Sep 2021 20:47:27 +0900 Subject: [PATCH 02/26] Forgot to delete debug message --- src/sz.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/sz.c b/src/sz.c index 8374845e1..9f5e0a771 100644 --- a/src/sz.c +++ b/src/sz.c @@ -470,9 +470,6 @@ int sz } }//omp parallel free_lui_1d_allocate(jbthread); -for(ib=0;ibCheck.sdim;ib++){ - printf("%ld %ld\n", ib, list_jb[ib]); -} //#pragma omp barrier TimeKeeper(X, cFileNameSzTimeKeep, cOMPSzMid, "a"); TimeKeeper(X, cFileNameTimeKeep, cOMPSzMid, "a"); From 3e0667745e08d69a66b99cc7e4f2eb10be7423b8 Mon Sep 17 00:00:00 2001 From: Mitsuaki Kawamura Date: Thu, 30 Sep 2021 12:08:47 +0900 Subject: [PATCH 03/26] OpenMP parallelism of sz for Hubbard(Sz conserved) --- src/sz.c | 75 +++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 50 insertions(+), 25 deletions(-) diff --git a/src/sz.c b/src/sz.c index 9f5e0a771..15cdca0ee 100644 --- a/src/sz.c +++ b/src/sz.c @@ -314,34 +314,60 @@ int sz } break; }else if(hacker==1){ - // this part can not be parallelized - jb = 0; + jbthread = lui_1d_allocate(nthreads); + #pragma omp parallel default(none) \ + shared(X,list_jb,ihfbit,N2,nthreads,jbthread) \ + private(ib,i,j,num_up,num_down,div,tmp_res,tmp_1,tmp_2,jb,all_up,all_down,comb2,mythread) + { + jb = 0; +#ifdef _OPENMP + mythread = omp_get_thread_num(); +#else + mythread = 0; +#endif + comb2 = li_2d_allocate(X->Def.Nsite+1,X->Def.Nsite+1); + #pragma omp for + for(ib=0;ibCheck.sdim;ib++){ + list_jb[ib]=jb; - for(ib=0;ibCheck.sdim;ib++){ - list_jb[ib]=jb; + i=ib*ihfbit; + num_up=0; + for(j=0;j<=N2-2;j+=2){ + div=i & X->Def.Tpow[j]; + div=div/X->Def.Tpow[j]; + num_up+=div; + } + num_down=0; + for(j=1;j<=N2-1;j+=2){ + div=i & X->Def.Tpow[j]; + div=div/X->Def.Tpow[j]; + num_down+=div; + } - i=ib*ihfbit; - num_up=0; - for(j=0;j<=N2-2;j+=2){ - div=i & X->Def.Tpow[j]; - div=div/X->Def.Tpow[j]; - num_up+=div; + tmp_res = X->Def.Nsite%2; // even Ns-> 0, odd Ns -> 1 + all_up = (X->Def.Nsite+tmp_res)/2; + all_down = (X->Def.Nsite-tmp_res)/2; + + tmp_1 = Binomial(all_up,X->Def.Nup-num_up,comb2,all_up); + tmp_2 = Binomial(all_down,X->Def.Ndown-num_down,comb2,all_down); + jb += tmp_1*tmp_2; } - num_down=0; - for(j=1;j<=N2-1;j+=2){ - div=i & X->Def.Tpow[j]; - div=div/X->Def.Tpow[j]; - num_down+=div; + free_li_2d_allocate(comb2); + if(mythread != nthreads-1) jbthread[mythread+1] = jb; + #pragma omp barrier + #pragma omp single + { + jbthread[0] = 0; + for(j=1;jDef.Nsite%2; // even Ns-> 0, odd Ns -> 1 - all_up = (X->Def.Nsite+tmp_res)/2; - all_down = (X->Def.Nsite-tmp_res)/2; - - tmp_1 = Binomial(all_up,X->Def.Nup-num_up,comb,all_up); - tmp_2 = Binomial(all_down,X->Def.Ndown-num_down,comb,all_down); - jb += tmp_1*tmp_2; - } + #pragma omp for + for(ib=0;ibCheck.sdim;ib++){ + list_jb[ib] += jbthread[mythread]; + } + }//omp parallel + free_lui_1d_allocate(jbthread); //#pragma omp barrier TimeKeeper(X, cFileNameSzTimeKeep, cOMPSzMid, "a"); @@ -408,7 +434,6 @@ int sz break; } else if(hacker==1){ - // this part can not be parallelized iMinup=0; iAllup=X->Def.Ne; if(X->Def.Ne > X->Def.Nsite){ From c4af74c75e091b3d48d9adc2968c0c094486e9da Mon Sep 17 00:00:00 2001 From: Yuichi Motoyama Date: Fri, 1 Oct 2021 10:08:27 +0900 Subject: [PATCH 04/26] dos2unix run.sh --- samples/tutorial_1.1/run.sh | 14 +++++++------- samples/tutorial_1.2/run.sh | 6 +++--- samples/tutorial_1.3/run.sh | 4 ++-- samples/tutorial_1.4/run.sh | 10 +++++----- samples/tutorial_1.5/run.sh | 10 +++++----- samples/tutorial_1.6/run.sh | 6 +++--- samples/tutorial_2.1/run.sh | 14 +++++++------- samples/tutorial_2.2/run.sh | 8 ++++---- samples/tutorial_3.1/run.sh | 6 +++--- samples/tutorial_3.2/run.sh | 6 +++--- samples/tutorial_4.1/run.sh | 6 +++--- samples/tutorial_4.3/run.sh | 4 ++-- 12 files changed, 47 insertions(+), 47 deletions(-) diff --git a/samples/tutorial_1.1/run.sh b/samples/tutorial_1.1/run.sh index 2b52c98a6..ea3a03c50 100644 --- a/samples/tutorial_1.1/run.sh +++ b/samples/tutorial_1.1/run.sh @@ -1,7 +1,7 @@ -#!/bin/sh -$1 -s stan1.in -$1 -s stan2.in -$1 -s stan3.in -$1 -s stan4.in -$1 -s stan5a.in -$1 -s stan5b.in +#!/bin/sh +$1 -s stan1.in +$1 -s stan2.in +$1 -s stan3.in +$1 -s stan4.in +$1 -s stan5a.in +$1 -s stan5b.in diff --git a/samples/tutorial_1.2/run.sh b/samples/tutorial_1.2/run.sh index 7df0f50e0..f308b99dd 100644 --- a/samples/tutorial_1.2/run.sh +++ b/samples/tutorial_1.2/run.sh @@ -1,3 +1,3 @@ -#!/bin/sh -$1 -s stan1.in -$1 -s stan2.in +#!/bin/sh +$1 -s stan1.in +$1 -s stan2.in diff --git a/samples/tutorial_1.3/run.sh b/samples/tutorial_1.3/run.sh index 3f3bb47d4..267ecc2c0 100644 --- a/samples/tutorial_1.3/run.sh +++ b/samples/tutorial_1.3/run.sh @@ -1,2 +1,2 @@ -#!/bin/sh -$1 -s stan1.in +#!/bin/sh +$1 -s stan1.in diff --git a/samples/tutorial_1.4/run.sh b/samples/tutorial_1.4/run.sh index 65b9958a4..e51930351 100644 --- a/samples/tutorial_1.4/run.sh +++ b/samples/tutorial_1.4/run.sh @@ -1,5 +1,5 @@ -#!/bin/sh -$1 -s stan1.in -$1 -s stan2.in -$1 -s stan3.in -$1 -s stan4.in +#!/bin/sh +$1 -s stan1.in +$1 -s stan2.in +$1 -s stan3.in +$1 -s stan4.in diff --git a/samples/tutorial_1.5/run.sh b/samples/tutorial_1.5/run.sh index 20a079890..904cd6b91 100644 --- a/samples/tutorial_1.5/run.sh +++ b/samples/tutorial_1.5/run.sh @@ -1,5 +1,5 @@ -#!/bin/sh -$1 -sdry stan1.in -python3 MakeGreen.py -$1 -e namelist.def -python3 CalcSq.py +#!/bin/sh +$1 -sdry stan1.in +python3 MakeGreen.py +$1 -e namelist.def +python3 CalcSq.py diff --git a/samples/tutorial_1.6/run.sh b/samples/tutorial_1.6/run.sh index e4315910f..d2c92818d 100644 --- a/samples/tutorial_1.6/run.sh +++ b/samples/tutorial_1.6/run.sh @@ -1,3 +1,3 @@ -#!/bin/sh -python3 MakeDef.py -$1 -e namelist_cg.def +#!/bin/sh +python3 MakeDef.py +$1 -e namelist_cg.def diff --git a/samples/tutorial_2.1/run.sh b/samples/tutorial_2.1/run.sh index 5bdb977f4..756cf8643 100644 --- a/samples/tutorial_2.1/run.sh +++ b/samples/tutorial_2.1/run.sh @@ -1,7 +1,7 @@ -#!/bin/sh -$1 -s stan1.in -python3 Finite.py -$1 -s stan2.in -python3 AveSSrand.py -$1 -s stan3.in -python3 AveFlct.py +#!/bin/sh +$1 -s stan1.in +python3 Finite.py +$1 -s stan2.in +python3 AveSSrand.py +$1 -s stan3.in +python3 AveFlct.py diff --git a/samples/tutorial_2.2/run.sh b/samples/tutorial_2.2/run.sh index 5666cbd75..ab238f1ca 100644 --- a/samples/tutorial_2.2/run.sh +++ b/samples/tutorial_2.2/run.sh @@ -1,4 +1,4 @@ -#!/bin/sh -$1 -s stan1.in -$1 -s stan2a.in -python3 AveSSrand.py +#!/bin/sh +$1 -s stan1.in +$1 -s stan2a.in +python3 AveSSrand.py diff --git a/samples/tutorial_3.1/run.sh b/samples/tutorial_3.1/run.sh index 7df0f50e0..f308b99dd 100644 --- a/samples/tutorial_3.1/run.sh +++ b/samples/tutorial_3.1/run.sh @@ -1,3 +1,3 @@ -#!/bin/sh -$1 -s stan1.in -$1 -s stan2.in +#!/bin/sh +$1 -s stan1.in +$1 -s stan2.in diff --git a/samples/tutorial_3.2/run.sh b/samples/tutorial_3.2/run.sh index 7df0f50e0..f308b99dd 100644 --- a/samples/tutorial_3.2/run.sh +++ b/samples/tutorial_3.2/run.sh @@ -1,3 +1,3 @@ -#!/bin/sh -$1 -s stan1.in -$1 -s stan2.in +#!/bin/sh +$1 -s stan1.in +$1 -s stan2.in diff --git a/samples/tutorial_4.1/run.sh b/samples/tutorial_4.1/run.sh index 7df0f50e0..f308b99dd 100644 --- a/samples/tutorial_4.1/run.sh +++ b/samples/tutorial_4.1/run.sh @@ -1,3 +1,3 @@ -#!/bin/sh -$1 -s stan1.in -$1 -s stan2.in +#!/bin/sh +$1 -s stan1.in +$1 -s stan2.in diff --git a/samples/tutorial_4.3/run.sh b/samples/tutorial_4.3/run.sh index 28edb3a4a..8cca0cb4a 100644 --- a/samples/tutorial_4.3/run.sh +++ b/samples/tutorial_4.3/run.sh @@ -1,2 +1,2 @@ -#!/bin/sh -python spinchain_example.py $1 +#!/bin/sh +python spinchain_example.py $1 From a1acecf6ad627263e939dbfd9311c0caba6a1ee5 Mon Sep 17 00:00:00 2001 From: ultimatile Date: Sun, 10 Oct 2021 07:45:00 +0900 Subject: [PATCH 05/26] update old links (QLMS) with new ones (issp-center-dev) --- doc/en/locale/de/LC_MESSAGES/filespecification.po | 2 +- doc/en/locale/de/LC_MESSAGES/howtouse.po | 2 +- doc/en/locale/de/LC_MESSAGES/index.po | 4 ++-- doc/en/locale/ja/LC_MESSAGES/filespecification.po | 2 +- doc/en/locale/ja/LC_MESSAGES/howtouse.po | 2 +- doc/en/locale/ja/LC_MESSAGES/index.po | 4 ++-- doc/en/source/howtouse/installation_en.rst | 2 +- doc/en/source/index.rst | 2 +- doc/ja/locale/de/LC_MESSAGES/filespecification.po | 2 +- doc/ja/locale/de/LC_MESSAGES/howtouse.po | 2 +- doc/ja/locale/de/LC_MESSAGES/index.po | 4 ++-- doc/ja/locale/ja/LC_MESSAGES/filespecification.po | 2 +- doc/ja/locale/ja/LC_MESSAGES/howtouse.po | 2 +- doc/ja/locale/ja/LC_MESSAGES/index.po | 4 ++-- doc/ja/source/howtouse/installation_ja.rst | 2 +- doc/ja/source/index.rst | 2 +- src/HPhiMain.c | 8 ++++---- 17 files changed, 24 insertions(+), 24 deletions(-) diff --git a/doc/en/locale/de/LC_MESSAGES/filespecification.po b/doc/en/locale/de/LC_MESSAGES/filespecification.po index 72d4c9bc4..decfe53f0 100644 --- a/doc/en/locale/de/LC_MESSAGES/filespecification.po +++ b/doc/en/locale/de/LC_MESSAGES/filespecification.po @@ -1280,7 +1280,7 @@ msgid "" "**Description :** If CalcHS=1, an efficient algorithm for generating the " "restricted Hilbert space with the specified quantum number is used " "(Details of algorithm is shown in " -"http://qlms.github.io/HPhi/develop/tips.pdf [in Japanese]). Default value" +"https://www.pasums.issp.u-tokyo.ac.jp/wp-content/themes/HPhi/media/develop/tips.pdf [in Japanese]). Default value" " is 1 and the efficient algorithm is used." msgstr "" diff --git a/doc/en/locale/de/LC_MESSAGES/howtouse.po b/doc/en/locale/de/LC_MESSAGES/howtouse.po index bc0bf1292..02fc0875f 100644 --- a/doc/en/locale/de/LC_MESSAGES/howtouse.po +++ b/doc/en/locale/de/LC_MESSAGES/howtouse.po @@ -345,7 +345,7 @@ msgid "You can download :math:`{\\mathcal H}\\Phi` at the following location." msgstr "" #: ../../howtouse/installation_en.rst:6 -msgid "https://github.com/QLMS/HPhi/releases" +msgid "https://github.com/issp-center-dev/HPhi/releases" msgstr "" #: ../../howtouse/installation_en.rst:8 diff --git a/doc/en/locale/de/LC_MESSAGES/index.po b/doc/en/locale/de/LC_MESSAGES/index.po index 9b0efc782..0df8713ca 100644 --- a/doc/en/locale/de/LC_MESSAGES/index.po +++ b/doc/en/locale/de/LC_MESSAGES/index.po @@ -85,8 +85,8 @@ msgstr "" #: ../../index.rst:30 msgid "" "You can download software and source codes of :math:`{\\mathcal H}\\Phi` " -"from `GitHub page `_ or `release page " -"`_." +"from `GitHub page `_ or `release page " +"`_." msgstr "" #: ../../index.rst:34 diff --git a/doc/en/locale/ja/LC_MESSAGES/filespecification.po b/doc/en/locale/ja/LC_MESSAGES/filespecification.po index 72d4c9bc4..decfe53f0 100644 --- a/doc/en/locale/ja/LC_MESSAGES/filespecification.po +++ b/doc/en/locale/ja/LC_MESSAGES/filespecification.po @@ -1280,7 +1280,7 @@ msgid "" "**Description :** If CalcHS=1, an efficient algorithm for generating the " "restricted Hilbert space with the specified quantum number is used " "(Details of algorithm is shown in " -"http://qlms.github.io/HPhi/develop/tips.pdf [in Japanese]). Default value" +"https://www.pasums.issp.u-tokyo.ac.jp/wp-content/themes/HPhi/media/develop/tips.pdf [in Japanese]). Default value" " is 1 and the efficient algorithm is used." msgstr "" diff --git a/doc/en/locale/ja/LC_MESSAGES/howtouse.po b/doc/en/locale/ja/LC_MESSAGES/howtouse.po index bc0bf1292..02fc0875f 100644 --- a/doc/en/locale/ja/LC_MESSAGES/howtouse.po +++ b/doc/en/locale/ja/LC_MESSAGES/howtouse.po @@ -345,7 +345,7 @@ msgid "You can download :math:`{\\mathcal H}\\Phi` at the following location." msgstr "" #: ../../howtouse/installation_en.rst:6 -msgid "https://github.com/QLMS/HPhi/releases" +msgid "https://github.com/issp-center-dev/HPhi/releases" msgstr "" #: ../../howtouse/installation_en.rst:8 diff --git a/doc/en/locale/ja/LC_MESSAGES/index.po b/doc/en/locale/ja/LC_MESSAGES/index.po index 9b0efc782..0df8713ca 100644 --- a/doc/en/locale/ja/LC_MESSAGES/index.po +++ b/doc/en/locale/ja/LC_MESSAGES/index.po @@ -85,8 +85,8 @@ msgstr "" #: ../../index.rst:30 msgid "" "You can download software and source codes of :math:`{\\mathcal H}\\Phi` " -"from `GitHub page `_ or `release page " -"`_." +"from `GitHub page `_ or `release page " +"`_." msgstr "" #: ../../index.rst:34 diff --git a/doc/en/source/howtouse/installation_en.rst b/doc/en/source/howtouse/installation_en.rst index de4aa2d08..c73b89f6e 100644 --- a/doc/en/source/howtouse/installation_en.rst +++ b/doc/en/source/howtouse/installation_en.rst @@ -3,7 +3,7 @@ Installation You can download :math:`{\mathcal H}\Phi` at the following location. -https://github.com/QLMS/HPhi/releases +https://github.com/issp-center-dev/HPhi/releases You can obtain the :math:`{\mathcal H}\Phi` directory by typing diff --git a/doc/en/source/index.rst b/doc/en/source/index.rst index 7b041a761..41a2786bc 100644 --- a/doc/en/source/index.rst +++ b/doc/en/source/index.rst @@ -27,7 +27,7 @@ This software was developed with the support of \"*Project for advancement of so Download -------- -You can download software and source codes of :math:`{\mathcal H}\Phi` from `GitHub page `_ or `release page `_. +You can download software and source codes of :math:`{\mathcal H}\Phi` from `GitHub page `_ or `release page `_. Contents diff --git a/doc/ja/locale/de/LC_MESSAGES/filespecification.po b/doc/ja/locale/de/LC_MESSAGES/filespecification.po index 72d4c9bc4..decfe53f0 100644 --- a/doc/ja/locale/de/LC_MESSAGES/filespecification.po +++ b/doc/ja/locale/de/LC_MESSAGES/filespecification.po @@ -1280,7 +1280,7 @@ msgid "" "**Description :** If CalcHS=1, an efficient algorithm for generating the " "restricted Hilbert space with the specified quantum number is used " "(Details of algorithm is shown in " -"http://qlms.github.io/HPhi/develop/tips.pdf [in Japanese]). Default value" +"https://www.pasums.issp.u-tokyo.ac.jp/wp-content/themes/HPhi/media/develop/tips.pdf [in Japanese]). Default value" " is 1 and the efficient algorithm is used." msgstr "" diff --git a/doc/ja/locale/de/LC_MESSAGES/howtouse.po b/doc/ja/locale/de/LC_MESSAGES/howtouse.po index bc0bf1292..02fc0875f 100644 --- a/doc/ja/locale/de/LC_MESSAGES/howtouse.po +++ b/doc/ja/locale/de/LC_MESSAGES/howtouse.po @@ -345,7 +345,7 @@ msgid "You can download :math:`{\\mathcal H}\\Phi` at the following location." msgstr "" #: ../../howtouse/installation_en.rst:6 -msgid "https://github.com/QLMS/HPhi/releases" +msgid "https://github.com/issp-center-dev/HPhi/releases" msgstr "" #: ../../howtouse/installation_en.rst:8 diff --git a/doc/ja/locale/de/LC_MESSAGES/index.po b/doc/ja/locale/de/LC_MESSAGES/index.po index 9b0efc782..0df8713ca 100644 --- a/doc/ja/locale/de/LC_MESSAGES/index.po +++ b/doc/ja/locale/de/LC_MESSAGES/index.po @@ -85,8 +85,8 @@ msgstr "" #: ../../index.rst:30 msgid "" "You can download software and source codes of :math:`{\\mathcal H}\\Phi` " -"from `GitHub page `_ or `release page " -"`_." +"from `GitHub page `_ or `release page " +"`_." msgstr "" #: ../../index.rst:34 diff --git a/doc/ja/locale/ja/LC_MESSAGES/filespecification.po b/doc/ja/locale/ja/LC_MESSAGES/filespecification.po index 72d4c9bc4..decfe53f0 100644 --- a/doc/ja/locale/ja/LC_MESSAGES/filespecification.po +++ b/doc/ja/locale/ja/LC_MESSAGES/filespecification.po @@ -1280,7 +1280,7 @@ msgid "" "**Description :** If CalcHS=1, an efficient algorithm for generating the " "restricted Hilbert space with the specified quantum number is used " "(Details of algorithm is shown in " -"http://qlms.github.io/HPhi/develop/tips.pdf [in Japanese]). Default value" +"https://www.pasums.issp.u-tokyo.ac.jp/wp-content/themes/HPhi/media/develop/tips.pdf [in Japanese]). Default value" " is 1 and the efficient algorithm is used." msgstr "" diff --git a/doc/ja/locale/ja/LC_MESSAGES/howtouse.po b/doc/ja/locale/ja/LC_MESSAGES/howtouse.po index bc0bf1292..02fc0875f 100644 --- a/doc/ja/locale/ja/LC_MESSAGES/howtouse.po +++ b/doc/ja/locale/ja/LC_MESSAGES/howtouse.po @@ -345,7 +345,7 @@ msgid "You can download :math:`{\\mathcal H}\\Phi` at the following location." msgstr "" #: ../../howtouse/installation_en.rst:6 -msgid "https://github.com/QLMS/HPhi/releases" +msgid "https://github.com/issp-center-dev/HPhi/releases" msgstr "" #: ../../howtouse/installation_en.rst:8 diff --git a/doc/ja/locale/ja/LC_MESSAGES/index.po b/doc/ja/locale/ja/LC_MESSAGES/index.po index 9b0efc782..0df8713ca 100644 --- a/doc/ja/locale/ja/LC_MESSAGES/index.po +++ b/doc/ja/locale/ja/LC_MESSAGES/index.po @@ -85,8 +85,8 @@ msgstr "" #: ../../index.rst:30 msgid "" "You can download software and source codes of :math:`{\\mathcal H}\\Phi` " -"from `GitHub page `_ or `release page " -"`_." +"from `GitHub page `_ or `release page " +"`_." msgstr "" #: ../../index.rst:34 diff --git a/doc/ja/source/howtouse/installation_ja.rst b/doc/ja/source/howtouse/installation_ja.rst index 7d884bad9..acefdb79e 100644 --- a/doc/ja/source/howtouse/installation_ja.rst +++ b/doc/ja/source/howtouse/installation_ja.rst @@ -3,7 +3,7 @@ :math:`{\mathcal H}\Phi` は次の場所からダウンロードできます。 -https://github.com/QLMS/HPhi/releases +https://github.com/issp-center-dev/HPhi/releases ダウンロードしたファイルを次のように展開してください。 diff --git a/doc/ja/source/index.rst b/doc/ja/source/index.rst index c4ff1293c..826c9870d 100644 --- a/doc/ja/source/index.rst +++ b/doc/ja/source/index.rst @@ -26,7 +26,7 @@ Mitsuaki Kawamura, Kazuyoshi Yoshimi, Takahiro Misawa, Youhei Yamaji, Synge Todo ダウンロード ------------------ -:math:`{\mathcal H}\Phi` のソースコードは `GitHub page `_ or `release page `_ からダウンロードできます。 +:math:`{\mathcal H}\Phi` のソースコードは `GitHub page `_ or `release page `_ からダウンロードできます。 Contents diff --git a/src/HPhiMain.c b/src/HPhiMain.c index 554bddc8a..3d6918899 100644 --- a/src/HPhiMain.c +++ b/src/HPhiMain.c @@ -84,17 +84,17 @@ - @ref page_addexpert - @ref page_time - @ref page_log - - Some contrivances for HPhi (only in Jananese) http://qlms.github.io/HPhi/develop/tips.pdf + - Some contrivances for HPhi (only in Jananese) https://www.pasums.issp.u-tokyo.ac.jp/wp-content/themes/HPhi/media/develop/tips.pdf .

Link

- https://github.com/QLMS/HPhi + https://github.com/issp-center-dev/HPhi

Download

- https://github.com/QLMS/HPhi/releases + https://github.com/issp-center-dev/HPhi/releases

Forum

- https://github.com/QLMS/HPhi/issues + https://github.com/issp-center-dev/HPhi/issues

licence

GNU GPL version 3\n From 4a0b6355d3fb8e99e25d89c20353a62f6df9a0d5 Mon Sep 17 00:00:00 2001 From: Mitsuaki Kawamura Date: Tue, 30 Nov 2021 23:20:19 +0900 Subject: [PATCH 06/26] sz OpenMP: Use explicit loop decomposition rather than "omp for" to avoid ambiguous behavior. --- src/sz.c | 48 +++++++++++++++++++++++++++++++++++++----------- 1 file changed, 37 insertions(+), 11 deletions(-) diff --git a/src/sz.c b/src/sz.c index 15cdca0ee..028f5491e 100644 --- a/src/sz.c +++ b/src/sz.c @@ -71,7 +71,7 @@ int sz char sdt[D_FileNameMax],sdt_err[D_FileNameMax]; long unsigned int *HilbertNumToSz; long unsigned int i,icnt; - long unsigned int ib,jb; + long unsigned int ib,jb,ib_start,ib_end, sdim_div, sdim_rest; long unsigned int j; long unsigned int div; @@ -317,7 +317,8 @@ int sz jbthread = lui_1d_allocate(nthreads); #pragma omp parallel default(none) \ shared(X,list_jb,ihfbit,N2,nthreads,jbthread) \ - private(ib,i,j,num_up,num_down,div,tmp_res,tmp_1,tmp_2,jb,all_up,all_down,comb2,mythread) + private(ib,i,j,num_up,num_down,div,tmp_res,tmp_1,tmp_2,jb,all_up,all_down, \ + comb2,mythread,sdim_div,sdim_rest,ib_start,ib_end) { jb = 0; #ifdef _OPENMP @@ -326,8 +327,21 @@ int sz mythread = 0; #endif comb2 = li_2d_allocate(X->Def.Nsite+1,X->Def.Nsite+1); - #pragma omp for - for(ib=0;ibCheck.sdim;ib++){ + // + // explict loop decomposition is nessesary to fix the asignment to each thread + // + sdim_div = X->Check.sdim / nthreads; + sdim_rest = X->Check.sdim % nthreads; + if(mythread < sdim_rest){ + ib_start = sdim_div*mythread + mythread; + ib_end = ib_start + sdim_div + 1; + } + else{ + ib_start = sdim_div*mythread + sdim_rest; + ib_end = ib_start + sdim_div; + } + // + for(ib=ib_start;ibCheck.sdim;ib++){ + for(ib=ib_start;ibDef.Nsite+1,X->Def.Nsite+1); - #pragma omp for - for(ib=0;ibCheck.sdim;ib++){ + // + // explict loop decomposition is nessesary to fix the asignment to each thread + // + sdim_div = X->Check.sdim / nthreads; + sdim_rest = X->Check.sdim % nthreads; + if(mythread < sdim_rest){ + ib_start = sdim_div*mythread + mythread; + ib_end = ib_start + sdim_div + 1; + } + else{ + ib_start = sdim_div*mythread + sdim_rest; + ib_end = ib_start + sdim_div; + } + // + for(ib=ib_start;ibCheck.sdim;ib++){ + for(ib=ib_start;ib Date: Fri, 3 Dec 2021 17:18:40 +0900 Subject: [PATCH 07/26] Update Parameters_for_time-evolution.rst MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 説明のc^daggerをc^{\dagger}にした --- .../standardmode_ja/Parameters_for_time-evolution.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/ja/source/filespecification/standardmode_ja/Parameters_for_time-evolution.rst b/doc/ja/source/filespecification/standardmode_ja/Parameters_for_time-evolution.rst index eb51b05b5..ae7faeb59 100644 --- a/doc/ja/source/filespecification/standardmode_ja/Parameters_for_time-evolution.rst +++ b/doc/ja/source/filespecification/standardmode_ja/Parameters_for_time-evolution.rst @@ -17,7 +17,7 @@ :math:`U_{\rm quench} \sum_i n_{i \uparrow} n_{i \downarrow}`\ が加えられる。 ``"Pulse Laser"``, ``"AC Laser"``, ``"DC Laser"``\ では、 ホッピング項に - :math:`-\sum_{i j \sigma} t_{i j} \exp[-i{\bf A}(t) \cdot ({\bf R}_i-{\bf R}_j)/(2\pi)] c^dagger_{i \sigma} c_{j \sigma}` + :math:`-\sum_{i j \sigma} t_{i j} \exp[-i{\bf A}(t) \cdot ({\bf R}_i-{\bf R}_j)/(2\pi)] c^{\dagger}_{i \sigma} c_{j \sigma}` のように位相因子が付く。 ここで\ :math:`{\bf A}(t)`\ はベクトルポテンシャルであり、 ``"Pulse Laser"``\ では From 3f64bb91fb0720938e4a9896da038122c3be2d30 Mon Sep 17 00:00:00 2001 From: MasakiYama <94419424+MasakiYama@users.noreply.github.com> Date: Tue, 7 Dec 2021 10:33:39 +0900 Subject: [PATCH 08/26] Update Lanczos_ja.rst MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 式(5.4)の下の文で、「V_nを」を「V_nは」に変更した。 --- doc/ja/source/algorithm/Lanczos_ja.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/ja/source/algorithm/Lanczos_ja.rst b/doc/ja/source/algorithm/Lanczos_ja.rst index f04b5e724..507613fd3 100644 --- a/doc/ja/source/algorithm/Lanczos_ja.rst +++ b/doc/ja/source/algorithm/Lanczos_ja.rst @@ -69,7 +69,7 @@ Lanczos法では、 :math:`\mathcal{K}_{n}({\mathcal H},\vec{x}_{0})` T_{n}=V_{n}^{\dagger}{\mathcal H} V_{n}\end{aligned} と変形されます。 ここで、 -:math:`V_{n}`\ を\ :math:`\vec{v}_{i}(i=0,1,\dots,n-1)`\ を +:math:`V_{n}`\ は\ :math:`\vec{v}_{i}(i=0,1,\dots,n-1)`\ を 並べた行列です。 :math:`T_{n}`\ は三重対角行列であり、 その対角成分は :math:`\alpha_{i}`, 副対角成分は\ :math:`\beta_{i}`\ で与えられます。 この三重対角行列\ :math:`T_{n}`\ の From bffeb1bef0131aa51b47678d63185fd15aafc46d Mon Sep 17 00:00:00 2001 From: MasakiYama <94419424+MasakiYama@users.noreply.github.com> Date: Tue, 7 Dec 2021 10:41:57 +0900 Subject: [PATCH 09/26] Update Lanczos_en.rst MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Initial vectorの黒丸から始まる二つの文を、For・・・, 小文字・・・・にしました。 --- doc/en/source/algorithm/Lanczos_en.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/en/source/algorithm/Lanczos_en.rst b/doc/en/source/algorithm/Lanczos_en.rst index 3fe47ce74..547304bbc 100644 --- a/doc/en/source/algorithm/Lanczos_en.rst +++ b/doc/en/source/algorithm/Lanczos_en.rst @@ -147,8 +147,8 @@ Details of implementation For the Lanczos method, an initial vector is specified with ``initial_iv``:math:`(\equiv r_s)` defined in an input file for Standard mode or a ModPara file for Expert mode. The type of initial vector can be selected as a real number or complex number by using ``InitialVecType`` in a ModPara file. - * For canonical ensemble and ``initial_iv``:math:`\geq 0` - A component of a target of the Hilbert space is given by + * For canonical ensemble and ``initial_iv``:math:`\geq 0`, + a component of a target of the Hilbert space is given by .. math:: @@ -157,8 +157,8 @@ For the Lanczos method, an initial vector is specified with ``initial_iv``:math: where :math:`N_{\rm dim}` is the total number of the Hilbert spaces and :math:`N_{\rm dim}/2` is added to avoid selecting a special Hilbert space for a default value ``initial_iv`` :math:`=1`. When the type of initial vector is selected as a real number, the coefficient value is given by :math:`1`, while when it is selected as a complex number, the value is given by :math:`(1+i)/\sqrt{2}`. - * For a grand canonical ensemble or ``initial_iv`` :math:`<0` - The initial vector is given by using a random generator, i.e., the coefficients of all the components for the initial vector are given by random numbers. The seed is calculated as + * For a grand canonical ensemble or ``initial_iv`` :math:`<0`, + the initial vector is given by using a random generator, i.e., the coefficients of all the components for the initial vector are given by random numbers. The seed is calculated as .. math:: From 9daef21b9a452dd7fcbe3af680165bc1116850e3 Mon Sep 17 00:00:00 2001 From: MasakiYama <94419424+MasakiYama@users.noreply.github.com> Date: Tue, 7 Dec 2021 10:46:16 +0900 Subject: [PATCH 10/26] Update TPQ_en.rst MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 節 Initial vectorの下から三行目のandを数式モードの外に出しました。 --- doc/en/source/algorithm/TPQ_en.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/en/source/algorithm/TPQ_en.rst b/doc/en/source/algorithm/TPQ_en.rst index fddcc3a79..8b9c62249 100644 --- a/doc/en/source/algorithm/TPQ_en.rst +++ b/doc/en/source/algorithm/TPQ_en.rst @@ -90,7 +90,8 @@ For the TPQ method, the initial vector is given by using a random generator, i.e 123432+(n_{\rm run}+1)\times|r_s|+k_{\rm Thread}+N_{\rm Thread} \times k_{\rm Process}, where :math:`r_s` is the number given by an input file and :math:`n_{\rm run}` is the number of runs. :math:`r_s` and the maximum value of :math:`n_{\rm run}` are defined by ``initial_iv`` and ``NumAve`` in an input file for Standard mode or a ModPara file for Expert mode, respectively. Random numbers are generated by using SIMD-oriented Fast Mersenne Twister (dSFMT) [3]_ . We can select the type of initial vector as a real number or complex number by using ``InitialVecType`` in a ModPara file. -:math:`k_{\rm Thread}, N_{\rm Thread}, and k_{\rm Process}` indicate +:math:`k_{\rm Thread}, N_{\rm Thread},` +and :math:`k_{\rm Process}` indicate the thread ID, number of threads, process ID, respectively; the initial vector depends both on ``initial_iv`` and the number of parallelisms. From 53ac412c7ccefefb0525a95a218d70c84636c474 Mon Sep 17 00:00:00 2001 From: MasakiYama <94419424+MasakiYama@users.noreply.github.com> Date: Tue, 7 Dec 2021 10:49:18 +0900 Subject: [PATCH 11/26] Update Realtime_en.rst MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit exp^{}をexp()にしました。 --- doc/en/source/algorithm/Realtime_en.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/en/source/algorithm/Realtime_en.rst b/doc/en/source/algorithm/Realtime_en.rst index 0613e61fa..74c861f1f 100644 --- a/doc/en/source/algorithm/Realtime_en.rst +++ b/doc/en/source/algorithm/Realtime_en.rst @@ -7,14 +7,14 @@ In :math:`{\mathcal H}\Phi`, real time evolution calculation is done by using th .. math:: - |\Phi (t_n)\rangle = \exp^{-i {\cal H} \Delta t_n}|\Phi (t_{n-1})\rangle, + |\Phi (t_n)\rangle = \exp (-i {\cal H} \Delta t_n)|\Phi (t_{n-1})\rangle, where :math:`|\Phi(t_0)\rangle` is an initial wave function and :math:`t_n = \sum_{j=1}^n \Delta t_j`. -In calculation, we approximate :math:`\exp^{-i {\cal H} \Delta t_n}` as +In calculation, we approximate :math:`\exp (-i {\cal H} \Delta t_n)` as .. math:: - \exp^{-i {\cal H} \Delta t_n} =\sum_{l=0}^m \frac{1}{l!}(-i {\cal H} \Delta t_n)^l . + \exp (-i {\cal H} \Delta t_n) =\sum_{l=0}^m \frac{1}{l!}(-i {\cal H} \Delta t_n)^l . Here, the cut-off integer :math:`m` can be set by `ExpandCoef` in `ModPara`. We can judge whether the expansion order is enough or not by checking the norm conservation :math:`\langle \Phi (t_n)|\Phi (t_n)\rangle=1` and energy conservation :math:`\langle \Phi (t_n)|\hat{\cal H}|\Phi (t_n)\rangle=E`. From 159b59e88d5ed31b1f829ab7926d73c1e2156203 Mon Sep 17 00:00:00 2001 From: Mitsuaki Kawamura Date: Tue, 7 Dec 2021 15:21:02 +0900 Subject: [PATCH 12/26] Add Hubbard-Sz-unconserved test to check sz-OpenMP feature. --- test/CMakeLists.txt | 4 +++ test/lobcg_hubbard_szunconserv.sh | 44 +++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 test/lobcg_hubbard_szunconserv.sh diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index c1b9ff718..ccf5bcaed 100755 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -68,6 +68,10 @@ add_test( NAME lobcg_hubbard_square COMMAND ${CMAKE_SOURCE_DIR}/test/lobcg_hubbard_square.sh ) +add_test( + NAME lobcg_hubbard_szunconserv + COMMAND ${CMAKE_SOURCE_DIR}/test/lobcg_hubbard_szunconserv.sh +) add_test( NAME lobcg_kondo_chain COMMAND ${CMAKE_SOURCE_DIR}/test/lobcg_kondo_chain.sh diff --git a/test/lobcg_hubbard_szunconserv.sh b/test/lobcg_hubbard_szunconserv.sh new file mode 100644 index 000000000..e17fe59f7 --- /dev/null +++ b/test/lobcg_hubbard_szunconserv.sh @@ -0,0 +1,44 @@ +#!/bin/sh -e + +mkdir -p lobcg_hubbard_szconserv/ +cd lobcg_hubbard_szconserv + +cat > stan.in < reference.dat < paste.dat +diff=`awk 'BEGIN{diff=0.0} {diff+=sqrt(($2-$3)*($2-$3))} END{printf "%8.6f", diff}' paste.dat` +test "${diff}" = "0.000000" + +exit $? From 12db97aae0babd057290805e5086e2cc4037f3f4 Mon Sep 17 00:00:00 2001 From: Mitsuaki Kawamura Date: Tue, 7 Dec 2021 16:55:45 +0900 Subject: [PATCH 13/26] File mode for shell script should be 755 --- test/lobcg_hubbard_szunconserv.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 test/lobcg_hubbard_szunconserv.sh diff --git a/test/lobcg_hubbard_szunconserv.sh b/test/lobcg_hubbard_szunconserv.sh old mode 100644 new mode 100755 From 92660825b3e1aac445c13783931d5fd26a4b8d75 Mon Sep 17 00:00:00 2001 From: Mitsuaki Kawamura Date: Thu, 23 Dec 2021 15:58:36 +0900 Subject: [PATCH 14/26] BugFix : greenr2k+multi-orbital+TPQ/mVMC case The ordering of average and standard error is not the same as written in the comment. --- tool/greenr2k.F90 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tool/greenr2k.F90 b/tool/greenr2k.F90 index 0ac407ea8..5abfe1508 100644 --- a/tool/greenr2k.F90 +++ b/tool/greenr2k.F90 @@ -867,7 +867,13 @@ SUBROUTINE output_cor() END DO ! DO ik = 1, ikk - WRITE(fo,'(1000e15.5)') xk(ik), cor_ave(ik,1:6, 1:norb, 1:norb), cor_err(ik,1:6, 1:norb, 1:norb) + WRITE(fo,'(e15.5)',advance="no") xk(ik) + DO iorb = 1, norb + DO jorb = 1, norb + WRITE(fo,'(24e15.5)',advance="no") cor_ave(ik,1:6, jorb, iorb), cor_err(ik,1:6, jorb, iorb) + END DO + END DO + WRITE(fo,*) END DO ! CLOSE(fo) From c52763a78314b087eaf36b8d6fa456b3aad62a0e Mon Sep 17 00:00:00 2001 From: Mitsuaki Kawamura Date: Wed, 5 Jan 2022 12:51:02 +0900 Subject: [PATCH 15/26] Checking R=0 for the left operator of each correlation. If R != 0, it is ignored. --- tool/greenr2k.F90 | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/tool/greenr2k.F90 b/tool/greenr2k.F90 index 5abfe1508..e7590ca9a 100644 --- a/tool/greenr2k.F90 +++ b/tool/greenr2k.F90 @@ -467,7 +467,7 @@ END SUBROUTINE set_kpoints SUBROUTINE read_corrindx() ! USE fourier_val, ONLY : file_one, file_two, ncor1, ncor2, ncor, indx, & - & calctype, nr, rindx, orb, norb + & calctype, nr, rindx, orb, norb, irv IMPLICIT NONE ! INTEGER :: fi = 10, itmp(8), icor @@ -495,7 +495,14 @@ SUBROUTINE read_corrindx() ! ncor(1:2) = 0 DO icor = 1, ncor1 + ! READ(fi,*) itmp(1:4) + ! + IF(ANY(irv(1:3,1,rindx(itmp(1)+1)) /= 0)) THEN + WRITE(*,'(a,i0,a)') " REMARK : The left operator at # ", icor, " is not at R=0." + CYCLE + END IF + ! IF(itmp(2) == 0 .AND. itmp(4) == 0) THEN ! ! Up-Up correlation @@ -533,6 +540,11 @@ SUBROUTINE read_corrindx() READ(fi,*) itmp(1:8) ! IF(itmp(1) == itmp(3) .AND. itmp(5) == itmp(7)) THEN + ! + IF(ANY(irv(1:3,1,rindx(itmp(1)+1)) /= 0)) THEN + WRITE(*,'(a,i0,a)') " REMARK : The left operator at # ", icor, " is not at R=0." + CYCLE + END IF ! IF(itmp(2) == 0 .AND. itmp(4) == 0) THEN ! @@ -583,6 +595,11 @@ SUBROUTINE read_corrindx() END IF ! IF(calctype == 4 .AND. (itmp(1) == itmp(7) .AND. itmp(3) == itmp(5))) THEN + ! + IF(ANY(irv(1:3,1,rindx(itmp(1)+1)) /= 0)) THEN + WRITE(*,'(a,i0,a)') " REMARK : The left operator at # ", icor, " is not at R=0." + CYCLE + END IF ! ! S+S- & S-S+ for mVMC ! From 422fc0512faff1c2edc6fe14094bd9dedbff56a2 Mon Sep 17 00:00:00 2001 From: k-yoshimi Date: Tue, 11 Jan 2022 09:56:25 +0900 Subject: [PATCH 16/26] change long int to long unsigned int --- src/CalcSpectrumByBiCG.c | 4 +++- src/mltplyHubbard.c | 6 +++--- src/mltplySpin.c | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/CalcSpectrumByBiCG.c b/src/CalcSpectrumByBiCG.c index c6bdac3a3..28f8d1b1d 100644 --- a/src/CalcSpectrumByBiCG.c +++ b/src/CalcSpectrumByBiCG.c @@ -156,7 +156,9 @@ void InitShadowRes( double complex *v4//!<[out] [CheckList::idim_max] shadow residual vector ) { - long int idim, iv; + + long int iv; + long unsigned int idim; int mythread; double dnorm; /* diff --git a/src/mltplyHubbard.c b/src/mltplyHubbard.c index 6a0a9d845..4d7df4820 100644 --- a/src/mltplyHubbard.c +++ b/src/mltplyHubbard.c @@ -542,7 +542,7 @@ double complex pairhopp( double complex *tmp_v1,//!<[in] Input producted vector struct BindStruct *X//!<[inout] ) { - long int j; + long unsigned int j; long unsigned int i_max = X->Large.i_max; long unsigned int off = 0; double complex dam_pr = 0.0; @@ -771,7 +771,7 @@ double complex GC_pairhopp( double complex *tmp_v1,//!<[in] Input producted vector struct BindStruct *X//!<[inout] ) { - long int j; + long unsigned int j; long unsigned int i_max = X->Large.i_max; long unsigned int off = 0; double complex dam_pr = 0.0; @@ -793,7 +793,7 @@ double complex GC_exchange( double complex *tmp_v1, struct BindStruct *X ) { - long int j; + long unsigned int j; long unsigned int i_max = X->Large.i_max; long unsigned int off = 0; double complex dam_pr = 0.0; diff --git a/src/mltplySpin.c b/src/mltplySpin.c index 4296bc953..e8b52e106 100644 --- a/src/mltplySpin.c +++ b/src/mltplySpin.c @@ -1000,7 +1000,7 @@ double complex GC_pairlift_spin( double complex *tmp_v1,//!<[in] Input producted vector struct BindStruct *X//!<[inout] ) { - long int j; + long unsigned int j; long unsigned int i_max = X->Large.i_max; long unsigned int off = 0; double complex dam_pr = 0; From 29e64a48c5ae78b25e4b7391d70d1c5707bb8e5b Mon Sep 17 00:00:00 2001 From: Mitsuaki Kawamura Date: Tue, 11 Jan 2022 16:43:41 +0900 Subject: [PATCH 17/26] Checking whether the required indices for the to-body Green function is complete. If not, print missing indices and abort. --- tool/greenr2k.F90 | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/tool/greenr2k.F90 b/tool/greenr2k.F90 index e7590ca9a..5d1795d1c 100644 --- a/tool/greenr2k.F90 +++ b/tool/greenr2k.F90 @@ -470,7 +470,7 @@ SUBROUTINE read_corrindx() & calctype, nr, rindx, orb, norb, irv IMPLICIT NONE ! - INTEGER :: fi = 10, itmp(8), icor + INTEGER :: fi = 10, itmp(8), icor, ir, iorb, jorb CHARACTER(100) :: ctmp ! WRITE(*,*) @@ -619,6 +619,35 @@ SUBROUTINE read_corrindx() ! END DO ! + IF(COUNT(indx(1:nr,3:8,1:norb,1:norb) == 0) /= 0) THEN + WRITE(*,*) "ERROR! The following correelation function is missed:" + WRITE(*,*) "R, kind, orb1, orb2" + DO icor = 3, 8 + DO ir = 1, nr + DO iorb = 1, norb + DO jorb = 1, norb + IF(indx(ir,icor,iorb,jorb) == 0) THEN + IF(icor == 3) THEN + WRITE(*,'(i0,a,i0,2x,i0)') ir, " Up-Up-Up-Up ", iorb, jorb + ELSE IF(icor == 4) THEN + WRITE(*,'(i0,a,i0,2x,i0)') ir, " Up-Up-Down-Down ", iorb, jorb + ELSE IF(icor == 5) THEN + WRITE(*,'(i0,a,i0,2x,i0)') ir, " Down-Down-Up-Up ", iorb, jorb + ELSE IF(icor == 6) THEN + WRITE(*,'(i0,a,i0,2x,i0)') ir, " Down-Down-Down-Down ", iorb, jorb + ELSE IF(icor == 7) THEN + WRITE(*,'(i0,a,i0,2x,i0)') ir, " Up-Down-Down-Up ", iorb, jorb + ELSE + WRITE(*,'(i0,a,i0,2x,i0)') ir, " Down-Up-Up-Down ", iorb, jorb + END IF + END IF + END DO + END DO + END DO + END DO + STOP "Missing indices for the Green function." + END IF + ! WRITE(*,*) " Number of UpUpUpUp Index : ", COUNT(indx(1:nr, 3, 1:norb, 1:norb) /= 0) WRITE(*,*) " Number of UpUpDownDown Index : ", COUNT(indx(1:nr, 4, 1:norb, 1:norb) /= 0) WRITE(*,*) " Number of DownDownUpUp Index : ", COUNT(indx(1:nr, 5, 1:norb, 1:norb) /= 0) From 1d9d3ea7e807075c8aaf8b459d95dbb2c5ecd6b6 Mon Sep 17 00:00:00 2001 From: Mitsuaki Kawamura Date: Tue, 11 Jan 2022 16:51:58 +0900 Subject: [PATCH 18/26] Fix Typo --- tool/greenr2k.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tool/greenr2k.F90 b/tool/greenr2k.F90 index 5d1795d1c..1472978f3 100644 --- a/tool/greenr2k.F90 +++ b/tool/greenr2k.F90 @@ -620,7 +620,7 @@ SUBROUTINE read_corrindx() END DO ! IF(COUNT(indx(1:nr,3:8,1:norb,1:norb) == 0) /= 0) THEN - WRITE(*,*) "ERROR! The following correelation function is missed:" + WRITE(*,*) "ERROR! The following correlation function is missed:" WRITE(*,*) "R, kind, orb1, orb2" DO icor = 3, 8 DO ir = 1, nr From 52cec2801f211dcdb95100976249dedd4ec6cb1f Mon Sep 17 00:00:00 2001 From: k-yoshimi Date: Thu, 7 Apr 2022 21:14:08 +0900 Subject: [PATCH 19/26] bugfix for counting inteall interactions --- src/readdef.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/readdef.c b/src/readdef.c index 1e782e563..1437cdbcd 100644 --- a/src/readdef.c +++ b/src/readdef.c @@ -2320,7 +2320,8 @@ int CheckInterAllHermite } } else if (isite1 == itmpsite2 && isite2 == itmpsite1 && isite3 == itmpsite4 && isite4 == itmpsite3) { //for spin and Kondo - if (iCalcModel == Kondo || iCalcModel == KondoGC || iCalcModel == Spin || iCalcModel == SpinGC) { + //if (iCalcModel == Kondo || iCalcModel == KondoGC || iCalcModel == Spin || iCalcModel == SpinGC) { + if (iCalcModel == Kondo || iCalcModel == KondoGC) { if (isigma1 == itmpsigma2 && isigma2 == itmpsigma1 && isigma3 == itmpsigma4 && isigma4 == itmpsigma3) { ddiff_intall = ParaInterAllOffDiagonal[i] - conj(ParaInterAllOffDiagonal[j]); if (cabs(ddiff_intall) < eps_CheckImag0) { @@ -2362,7 +2363,8 @@ int CheckInterAllHermite } } - if (icntincorrect != 0) { + //if (icntincorrect != 0) { + if (icntincorrect != 0 || NInterAllOffDiagonal != 2*icntHermite) { return (-1); } From 3c5ff4907a3206b9ac5599c02b93a76cbff7748f Mon Sep 17 00:00:00 2001 From: k-yoshimi Date: Thu, 7 Apr 2022 21:19:05 +0900 Subject: [PATCH 20/26] update documents --- .../filespecification/expertmode_en/InterAll_file_en.rst | 6 ++++-- .../filespecification/expertmode_ja/InterAll_file_ja.rst | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/doc/en/source/filespecification/expertmode_en/InterAll_file_en.rst b/doc/en/source/filespecification/expertmode_en/InterAll_file_en.rst index 0d988351d..11b2cb745 100644 --- a/doc/en/source/filespecification/expertmode_en/InterAll_file_en.rst +++ b/doc/en/source/filespecification/expertmode_en/InterAll_file_en.rst @@ -13,7 +13,9 @@ integrals :math:`I_{ijkl\sigma_1\sigma_2\sigma_3\sigma_4}`, {\mathcal H}+=\sum_{i,j,k,l}\sum_{\sigma_1,\sigma_2, \sigma_3, \sigma_4} I_{ijkl\sigma_1\sigma_2\sigma_3\sigma_4}c_{i\sigma_1}^{\dagger}c_{j\sigma_2}c_{k\sigma_3}^{\dagger}c_{l\sigma_4}. -For spin, the conditions :math:`i=j` and :math:`k=l` must be satisfied. An example of the file format is as follows. +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. +For spin, the conditions :math:`i=j` and :math:`k=l` must be satisfied. +An example of the file format is as follows. :: @@ -138,4 +140,4 @@ Use rules .. raw:: latex - \newpage \ No newline at end of file + \newpage diff --git a/doc/ja/source/filespecification/expertmode_ja/InterAll_file_ja.rst b/doc/ja/source/filespecification/expertmode_ja/InterAll_file_ja.rst index e72ade5b7..effe4bb51 100644 --- a/doc/ja/source/filespecification/expertmode_ja/InterAll_file_ja.rst +++ b/doc/ja/source/filespecification/expertmode_ja/InterAll_file_ja.rst @@ -14,6 +14,7 @@ InterAll指定ファイル なお、スピンに関して計算する場合には、\ :math:`i=j, k=l`\ となるよう設定してください。 +また、オフダイアゴナル成分については、i1 sigma1 i2 sigma2 i3 sigma3 i4 sigma4 とi4 sigma4 i3 sigma3 i2 sigma2 i1 sigma1 のペアを必ず用意するようにしてください。 以下にファイル例を記載します。 :: From 1de59c292a0178f68e5a3c2cb4fc2f3c33d19e2e Mon Sep 17 00:00:00 2001 From: k-yoshimi Date: Thu, 14 Apr 2022 14:07:12 +0900 Subject: [PATCH 21/26] delete condition branch for interall --- src/readdef.c | 71 ++++++++++++++++++++++++++------------------------- 1 file changed, 36 insertions(+), 35 deletions(-) diff --git a/src/readdef.c b/src/readdef.c index 1437cdbcd..bd62d2417 100644 --- a/src/readdef.c +++ b/src/readdef.c @@ -2318,42 +2318,43 @@ int CheckInterAllHermite } } } - } else if (isite1 == itmpsite2 && isite2 == itmpsite1 && isite3 == itmpsite4 && - isite4 == itmpsite3) { //for spin and Kondo - //if (iCalcModel == Kondo || iCalcModel == KondoGC || iCalcModel == Spin || iCalcModel == SpinGC) { - if (iCalcModel == Kondo || iCalcModel == KondoGC) { - if (isigma1 == itmpsigma2 && isigma2 == itmpsigma1 && isigma3 == itmpsigma4 && isigma4 == itmpsigma3) { - ddiff_intall = ParaInterAllOffDiagonal[i] - conj(ParaInterAllOffDiagonal[j]); - if (cabs(ddiff_intall) < eps_CheckImag0) { - itmpret = 1; - if (icheckHermiteCount == FALSE) { - icheckHermiteCount = TRUE; // for not double-counting - if (i <= j) { - if (2 * icntHermite >= NInterAllOffDiagonal) { - fprintf(stdoutMPI, "Elements of InterAll are incorrect.\n"); - return (-1); - } - for (itmpIdx = 0; itmpIdx < 8; itmpIdx++) { - InterAll[2 * icntHermite][itmpIdx] = InterAllOffDiagonal[i][itmpIdx]; - } - for (itmpIdx = 0; itmpIdx < 4; itmpIdx++) { - InterAll[2 * icntHermite + 1][2 * itmpIdx] = InterAllOffDiagonal[i][6 - - 2 * - itmpIdx]; - InterAll[2 * icntHermite + 1][2 * itmpIdx + 1] = InterAllOffDiagonal[i][7 - 2 * - itmpIdx]; - - } - ParaInterAll[2 * icntHermite] = ParaInterAllOffDiagonal[i]; - ParaInterAll[2 * icntHermite + 1] = ParaInterAllOffDiagonal[j]; - icntHermite++; - } - break; - } - } - } - } } +// else if (isite1 == itmpsite2 && isite2 == itmpsite1 && isite3 == itmpsite4 && +// isite4 == itmpsite3) { //for spin and Kondo +// //if (iCalcModel == Kondo || iCalcModel == KondoGC || iCalcModel == Spin || iCalcModel == SpinGC) { +// if (iCalcModel == Kondo || iCalcModel == KondoGC) { +// if (isigma1 == itmpsigma2 && isigma2 == itmpsigma1 && isigma3 == itmpsigma4 && isigma4 == itmpsigma3) { +// ddiff_intall = ParaInterAllOffDiagonal[i] - conj(ParaInterAllOffDiagonal[j]); +// if (cabs(ddiff_intall) < eps_CheckImag0) { +// itmpret = 1; +// if (icheckHermiteCount == FALSE) { +// icheckHermiteCount = TRUE; // for not double-counting +// if (i <= j) { +// if (2 * icntHermite >= NInterAllOffDiagonal) { +// fprintf(stdoutMPI, "Elements of InterAll are incorrect.\n"); +// return (-1); +// } +// for (itmpIdx = 0; itmpIdx < 8; itmpIdx++) { +// InterAll[2 * icntHermite][itmpIdx] = InterAllOffDiagonal[i][itmpIdx]; +// } +// for (itmpIdx = 0; itmpIdx < 4; itmpIdx++) { +// InterAll[2 * icntHermite + 1][2 * itmpIdx] = InterAllOffDiagonal[i][6 - +// 2 * +// itmpIdx]; +// InterAll[2 * icntHermite + 1][2 * itmpIdx + 1] = InterAllOffDiagonal[i][7 - 2 * +// itmpIdx]; +// +// } +// ParaInterAll[2 * icntHermite] = ParaInterAllOffDiagonal[i]; +// ParaInterAll[2 * icntHermite + 1] = ParaInterAllOffDiagonal[j]; +// icntHermite++; +// } +// break; +// } +// } +// } +// } +// } } //if counterpart for satisfying hermite conjugate does not exist. if (itmpret != 1) { From 9c96e876b9d4c5b48976b498bd86f1c97d85150e Mon Sep 17 00:00:00 2001 From: k-yoshimi Date: Thu, 14 Apr 2022 17:01:43 +0900 Subject: [PATCH 22/26] add and modify condition branch for InterAll --- src/readdef.c | 185 ++++++++++++++++++++++++++------------------------ 1 file changed, 97 insertions(+), 88 deletions(-) diff --git a/src/readdef.c b/src/readdef.c index bd62d2417..a9a7f6840 100644 --- a/src/readdef.c +++ b/src/readdef.c @@ -2270,98 +2270,107 @@ int CheckInterAllHermite icntincorrect = 0; icntHermite = 0; for (i = 0; i < NInterAllOffDiagonal; i++) { - itmpret = 0; - isite1 = InterAllOffDiagonal[i][0]; - isigma1 = InterAllOffDiagonal[i][1]; - isite2 = InterAllOffDiagonal[i][2]; - isigma2 = InterAllOffDiagonal[i][3]; - isite3 = InterAllOffDiagonal[i][4]; - isigma3 = InterAllOffDiagonal[i][5]; - isite4 = InterAllOffDiagonal[i][6]; - isigma4 = InterAllOffDiagonal[i][7]; - icheckHermiteCount = FALSE; - - for (j = 0; j < NInterAllOffDiagonal; j++) { - itmpsite1 = InterAllOffDiagonal[j][0]; - itmpsigma1 = InterAllOffDiagonal[j][1]; - itmpsite2 = InterAllOffDiagonal[j][2]; - itmpsigma2 = InterAllOffDiagonal[j][3]; - itmpsite3 = InterAllOffDiagonal[j][4]; - itmpsigma3 = InterAllOffDiagonal[j][5]; - itmpsite4 = InterAllOffDiagonal[j][6]; - itmpsigma4 = InterAllOffDiagonal[j][7]; - - if (isite1 == itmpsite4 && isite2 == itmpsite3 && isite3 == itmpsite2 && isite4 == itmpsite1) { - if (isigma1 == itmpsigma4 && isigma2 == itmpsigma3 && isigma3 == itmpsigma2 && isigma4 == itmpsigma1) { - ddiff_intall = cabs(ParaInterAllOffDiagonal[i] - conj(ParaInterAllOffDiagonal[j])); - - if (cabs(ddiff_intall) < eps_CheckImag0) { - itmpret = 1; - if (icheckHermiteCount == FALSE) { - icheckHermiteCount = TRUE; //for not double counting - if (i <= j) { - if (2 * icntHermite >= NInterAllOffDiagonal) { - fprintf(stdoutMPI, "Elements of InterAll are incorrect.\n"); - return (-1); - } - - for (itmpIdx = 0; itmpIdx < 8; itmpIdx++) { - InterAll[2 * icntHermite][itmpIdx] = InterAllOffDiagonal[i][itmpIdx]; - InterAll[2 * icntHermite + 1][itmpIdx] = InterAllOffDiagonal[j][itmpIdx]; - } + itmpret = 0; + isite1 = InterAllOffDiagonal[i][0]; + isigma1 = InterAllOffDiagonal[i][1]; + isite2 = InterAllOffDiagonal[i][2]; + isigma2 = InterAllOffDiagonal[i][3]; + isite3 = InterAllOffDiagonal[i][4]; + isigma3 = InterAllOffDiagonal[i][5]; + isite4 = InterAllOffDiagonal[i][6]; + isigma4 = InterAllOffDiagonal[i][7]; + icheckHermiteCount = FALSE; + + for (j = 0; j < NInterAllOffDiagonal; j++) { + itmpsite1 = InterAllOffDiagonal[j][0]; + itmpsigma1 = InterAllOffDiagonal[j][1]; + itmpsite2 = InterAllOffDiagonal[j][2]; + itmpsigma2 = InterAllOffDiagonal[j][3]; + itmpsite3 = InterAllOffDiagonal[j][4]; + itmpsigma3 = InterAllOffDiagonal[j][5]; + itmpsite4 = InterAllOffDiagonal[j][6]; + itmpsigma4 = InterAllOffDiagonal[j][7]; + if (isite1 == itmpsite4 && isite2 == itmpsite3 && isite3 == itmpsite2 && isite4 == itmpsite1) { + if (isigma1 == itmpsigma4 && isigma2 == itmpsigma3 && isigma3 == itmpsigma2 && isigma4 == itmpsigma1) { + ddiff_intall = cabs(ParaInterAllOffDiagonal[i] - conj(ParaInterAllOffDiagonal[j])); + if (cabs(ddiff_intall) < eps_CheckImag0) { + itmpret = 1; + if (icheckHermiteCount == FALSE) { + if (i <= j) { + icheckHermiteCount = TRUE; //for not double counting + if (2 * icntHermite >= NInterAllOffDiagonal) { + fprintf(stdoutMPI, "Elements of InterAll are incorrect.\n"); + return (-1); + } + for (itmpIdx = 0; itmpIdx < 8; itmpIdx++) { + InterAll[2 * icntHermite][itmpIdx] = InterAllOffDiagonal[i][itmpIdx]; + InterAll[2 * icntHermite + 1][itmpIdx] = InterAllOffDiagonal[j][itmpIdx]; + } + ParaInterAll[2 * icntHermite] = ParaInterAllOffDiagonal[i]; + ParaInterAll[2 * icntHermite + 1] = ParaInterAllOffDiagonal[j]; + icntHermite++; + break; + } + } + } + } + } + } - ParaInterAll[2 * icntHermite] = ParaInterAllOffDiagonal[i]; - ParaInterAll[2 * icntHermite + 1] = ParaInterAllOffDiagonal[j]; - icntHermite++; + if (itmpret != 1) { + for (j = 0; j < NInterAllOffDiagonal; j++) { + itmpsite1 = InterAllOffDiagonal[j][0]; + itmpsigma1 = InterAllOffDiagonal[j][1]; + itmpsite2 = InterAllOffDiagonal[j][2]; + itmpsigma2 = InterAllOffDiagonal[j][3]; + itmpsite3 = InterAllOffDiagonal[j][4]; + itmpsigma3 = InterAllOffDiagonal[j][5]; + itmpsite4 = InterAllOffDiagonal[j][6]; + itmpsigma4 = InterAllOffDiagonal[j][7]; + if (isite1 == itmpsite2 && isite2 == itmpsite1 && isite3 == itmpsite4 && + isite4 == itmpsite3) { //for spin and Kondo + if (iCalcModel == Kondo || iCalcModel == KondoGC || iCalcModel == Spin || iCalcModel == SpinGC) { + if (isigma1 == itmpsigma2 && isigma2 == itmpsigma1 && isigma3 == itmpsigma4 && + isigma4 == itmpsigma3) { + ddiff_intall = ParaInterAllOffDiagonal[i] - conj(ParaInterAllOffDiagonal[j]); + if (cabs(ddiff_intall) < eps_CheckImag0) { + itmpret = 1; + if (i <= j) { + if (icheckHermiteCount == FALSE) { + icheckHermiteCount = TRUE; // for not double-counting + if (2 * icntHermite >= NInterAllOffDiagonal) { + fprintf(stdoutMPI, "Elements of InterAll are incorrect.\n"); + return (-1); + } + for (itmpIdx = 0; itmpIdx < 8; itmpIdx++) { + InterAll[2 * icntHermite][itmpIdx] = InterAllOffDiagonal[i][itmpIdx]; + } + for (itmpIdx = 0; itmpIdx < 4; itmpIdx++) { + InterAll[2 * icntHermite + 1][2 * itmpIdx] = InterAllOffDiagonal[i][6 - + 2 * + itmpIdx]; + InterAll[2 * icntHermite + 1][2 * itmpIdx + 1] = InterAllOffDiagonal[i][7 - + 2 * + itmpIdx]; + } + ParaInterAll[2 * icntHermite] = ParaInterAllOffDiagonal[i]; + ParaInterAll[2 * icntHermite + 1] = ParaInterAllOffDiagonal[j]; + icntHermite++; + break; + } + } + } + } + } } - break; - } } - } } -// else if (isite1 == itmpsite2 && isite2 == itmpsite1 && isite3 == itmpsite4 && -// isite4 == itmpsite3) { //for spin and Kondo -// //if (iCalcModel == Kondo || iCalcModel == KondoGC || iCalcModel == Spin || iCalcModel == SpinGC) { -// if (iCalcModel == Kondo || iCalcModel == KondoGC) { -// if (isigma1 == itmpsigma2 && isigma2 == itmpsigma1 && isigma3 == itmpsigma4 && isigma4 == itmpsigma3) { -// ddiff_intall = ParaInterAllOffDiagonal[i] - conj(ParaInterAllOffDiagonal[j]); -// if (cabs(ddiff_intall) < eps_CheckImag0) { -// itmpret = 1; -// if (icheckHermiteCount == FALSE) { -// icheckHermiteCount = TRUE; // for not double-counting -// if (i <= j) { -// if (2 * icntHermite >= NInterAllOffDiagonal) { -// fprintf(stdoutMPI, "Elements of InterAll are incorrect.\n"); -// return (-1); -// } -// for (itmpIdx = 0; itmpIdx < 8; itmpIdx++) { -// InterAll[2 * icntHermite][itmpIdx] = InterAllOffDiagonal[i][itmpIdx]; -// } -// for (itmpIdx = 0; itmpIdx < 4; itmpIdx++) { -// InterAll[2 * icntHermite + 1][2 * itmpIdx] = InterAllOffDiagonal[i][6 - -// 2 * -// itmpIdx]; -// InterAll[2 * icntHermite + 1][2 * itmpIdx + 1] = InterAllOffDiagonal[i][7 - 2 * -// itmpIdx]; -// -// } -// ParaInterAll[2 * icntHermite] = ParaInterAllOffDiagonal[i]; -// ParaInterAll[2 * icntHermite + 1] = ParaInterAllOffDiagonal[j]; -// icntHermite++; -// } -// break; -// } -// } -// } -// } -// } - } - //if counterpart for satisfying hermite conjugate does not exist. - if (itmpret != 1) { - fprintf(stdoutMPI, cErrNonHermiteInterAll, isite1, isigma1, isite2, isigma2, isite3, isigma3, isite4, isigma4, - creal(ParaInterAllOffDiagonal[i]), cimag(ParaInterAllOffDiagonal[i])); - icntincorrect++; - } + //if counterpart for satisfying hermite conjugate does not exist. + if (itmpret != 1) { + fprintf(stdoutMPI, cErrNonHermiteInterAll, isite1, isigma1, isite2, isigma2, isite3, isigma3, isite4, isigma4, + creal(ParaInterAllOffDiagonal[i]), cimag(ParaInterAllOffDiagonal[i])); + icntincorrect++; + } } //if (icntincorrect != 0) { From a9c76c8bb1758912e359c9f69e4cc0cf4ac88b7f Mon Sep 17 00:00:00 2001 From: k-yoshimi Date: Thu, 14 Apr 2022 21:24:47 +0900 Subject: [PATCH 23/26] change the line of for-loop and consider the condition, J!=L and I!=K. --- src/readdef.c | 75 ++++++++++++++++++++++++++------------------------- 1 file changed, 39 insertions(+), 36 deletions(-) diff --git a/src/readdef.c b/src/readdef.c index a9a7f6840..7cc808b47 100644 --- a/src/readdef.c +++ b/src/readdef.c @@ -2318,45 +2318,48 @@ int CheckInterAllHermite } if (itmpret != 1) { - for (j = 0; j < NInterAllOffDiagonal; j++) { - itmpsite1 = InterAllOffDiagonal[j][0]; - itmpsigma1 = InterAllOffDiagonal[j][1]; - itmpsite2 = InterAllOffDiagonal[j][2]; - itmpsigma2 = InterAllOffDiagonal[j][3]; - itmpsite3 = InterAllOffDiagonal[j][4]; - itmpsigma3 = InterAllOffDiagonal[j][5]; - itmpsite4 = InterAllOffDiagonal[j][6]; - itmpsigma4 = InterAllOffDiagonal[j][7]; - if (isite1 == itmpsite2 && isite2 == itmpsite1 && isite3 == itmpsite4 && - isite4 == itmpsite3) { //for spin and Kondo - if (iCalcModel == Kondo || iCalcModel == KondoGC || iCalcModel == Spin || iCalcModel == SpinGC) { - if (isigma1 == itmpsigma2 && isigma2 == itmpsigma1 && isigma3 == itmpsigma4 && - isigma4 == itmpsigma3) { - ddiff_intall = ParaInterAllOffDiagonal[i] - conj(ParaInterAllOffDiagonal[j]); - if (cabs(ddiff_intall) < eps_CheckImag0) { - itmpret = 1; - if (i <= j) { - if (icheckHermiteCount == FALSE) { - icheckHermiteCount = TRUE; // for not double-counting - if (2 * icntHermite >= NInterAllOffDiagonal) { - fprintf(stdoutMPI, "Elements of InterAll are incorrect.\n"); - return (-1); - } - for (itmpIdx = 0; itmpIdx < 8; itmpIdx++) { - InterAll[2 * icntHermite][itmpIdx] = InterAllOffDiagonal[i][itmpIdx]; - } - for (itmpIdx = 0; itmpIdx < 4; itmpIdx++) { - InterAll[2 * icntHermite + 1][2 * itmpIdx] = InterAllOffDiagonal[i][6 - - 2 * - itmpIdx]; - InterAll[2 * icntHermite + 1][2 * itmpIdx + 1] = InterAllOffDiagonal[i][7 - + if (iCalcModel == Kondo || iCalcModel == KondoGC || iCalcModel == Spin || iCalcModel == SpinGC) { + if (isite1 != isite3 && isigma1 != isigma3 && isite2 != isite4 && isigma2 != isigma4) { + for (j = 0; j < NInterAllOffDiagonal; j++) { + itmpsite1 = InterAllOffDiagonal[j][0]; + itmpsigma1 = InterAllOffDiagonal[j][1]; + itmpsite2 = InterAllOffDiagonal[j][2]; + itmpsigma2 = InterAllOffDiagonal[j][3]; + itmpsite3 = InterAllOffDiagonal[j][4]; + itmpsigma3 = InterAllOffDiagonal[j][5]; + itmpsite4 = InterAllOffDiagonal[j][6]; + itmpsigma4 = InterAllOffDiagonal[j][7]; + if (isite1 == itmpsite2 && isite2 == itmpsite1 && isite3 == itmpsite4 && + isite4 == itmpsite3) { //for spin and Kondo + if (isigma1 == itmpsigma2 && isigma2 == itmpsigma1 && isigma3 == itmpsigma4 && + isigma4 == itmpsigma3) { + ddiff_intall = ParaInterAllOffDiagonal[i] - conj(ParaInterAllOffDiagonal[j]); + if (cabs(ddiff_intall) < eps_CheckImag0) { + itmpret = 1; + if (i <= j) { + if (icheckHermiteCount == FALSE) { + icheckHermiteCount = TRUE; // for not double-counting + if (2 * icntHermite >= NInterAllOffDiagonal) { + fprintf(stdoutMPI, "Elements of InterAll are incorrect.\n"); + return (-1); + } + for (itmpIdx = 0; itmpIdx < 8; itmpIdx++) { + InterAll[2 * icntHermite][itmpIdx] = InterAllOffDiagonal[i][itmpIdx]; + } + for (itmpIdx = 0; itmpIdx < 4; itmpIdx++) { + InterAll[2 * icntHermite + 1][2 * itmpIdx] = InterAllOffDiagonal[i][6 - 2 * itmpIdx]; + InterAll[2 * icntHermite + 1][2 * itmpIdx + 1] = InterAllOffDiagonal[i][ + 7 - + 2 * + itmpIdx]; + } + ParaInterAll[2 * icntHermite] = ParaInterAllOffDiagonal[i]; + ParaInterAll[2 * icntHermite + 1] = ParaInterAllOffDiagonal[j]; + icntHermite++; + break; } - ParaInterAll[2 * icntHermite] = ParaInterAllOffDiagonal[i]; - ParaInterAll[2 * icntHermite + 1] = ParaInterAllOffDiagonal[j]; - icntHermite++; - break; } } } From b3ebac69474e8692021c82c2be44ce611ee68fdf Mon Sep 17 00:00:00 2001 From: Mitsuaki Kawamura Date: Fri, 10 Jun 2022 13:34:02 +0900 Subject: [PATCH 24/26] Adaptive preconditioning must be applyed with shifting the diagonal term as eigenvalue becomes positive. --- src/CalcByLOBPCG.c | 14 ++++++-------- src/include/struct.h | 1 + src/readdef.c | 4 ++++ 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/CalcByLOBPCG.c b/src/CalcByLOBPCG.c index d4d3bffaf..b26168693 100644 --- a/src/CalcByLOBPCG.c +++ b/src/CalcByLOBPCG.c @@ -135,10 +135,8 @@ static double calc_preshift( double k, i; double preshift; - if (fabs(eig) > 10.0) k = trunc(log10(fabs(eig))); - else k = 1.0; - if (res < 1.0) { + k = trunc(log10(fabs(eig))); if (eps_LOBPCG > res) i = ceil(log10(eps_LOBPCG)); else i = ceil(log10(res)); @@ -340,10 +338,10 @@ int LOBPCG_Main( ***hwxp/*[0] h*w, [1] h*x, [2] h*p of Ref.1*/, *hsub, *ovlp /*Subspace Hamiltonian and Overlap*/, **work; - double *eig, dnorm, eps_LOBPCG, eigabs_max, preshift, precon, dnormmax, *eigsub; - int do_precon = 0;//If = 1, use preconditioning (experimental) + double *eig, dnorm, eps_LOBPCG, eigabs_max, preshift, precon, dnormmax, *eigsub, eig_pos_shift; nsub = 3 * X->Def.k_exct; + eig_pos_shift = LargeValue * X->Def.NsiteMPI; eig = d_1d_allocate(X->Def.k_exct); eigsub = d_1d_allocate(nsub); @@ -421,14 +419,14 @@ int LOBPCG_Main( /**@brief
  • Preconditioning (Point Jacobi): @f${\bf w}={\hat T}^{-1} {\bf w}@f$
  • */ - if (do_precon == 1) { - preshift = calc_preshift(eig[ie], dnorm, eps_LOBPCG); + if (X->Def.PreCG == 1) { + preshift = calc_preshift(eig[ie]+ eig_pos_shift, dnorm, eps_LOBPCG) - eig_pos_shift; #pragma omp parallel for default(none) shared(wxp,ie,list_Diagonal,preshift,i_max,eps_LOBPCG) private(idim,precon) for (idim = 1; idim <= i_max; idim++) { precon = list_Diagonal[idim] - preshift; if(fabs(precon) > eps_LOBPCG) wxp[0][ie][idim] /= precon; } - }/*if(do_precon == 1)*/ + }/*if(X->Def.PreCG == 1)*/ /**@brief
  • Normalize residual vector: @f${\bf w}={\bf w}/|w|@f$ */ diff --git a/src/include/struct.h b/src/include/struct.h index 48762ab2c..e8b8b4c71 100644 --- a/src/include/struct.h +++ b/src/include/struct.h @@ -306,6 +306,7 @@ struct DefineList { int **SpinTEChemi; /**< [NTE][Nsite] */ double **ParaTEChemi; /**< [NTE][Nsite] */ //[e] For Time Evolution + int PreCG;/**< 1: Use preconditioning in LOBPCG */ };/*struct DefineList*/ /** @brief Size of the Hilbert space diff --git a/src/readdef.c b/src/readdef.c index 1e782e563..984706654 100644 --- a/src/readdef.c +++ b/src/readdef.c @@ -485,6 +485,7 @@ int ReadDefFileNInt( NumAve=1; X->Param.ExpecInterval=1; cFileNameListFile = malloc(sizeof(char)*D_CharTmpReadDef*D_iKWNumDef); + X->PreCG = 0; fprintf(stdoutMPI, cReadFileNamelist, xNameListFile); if(GetFileName(xNameListFile, cFileNameListFile)!=0){ @@ -642,6 +643,9 @@ int ReadDefFileNInt( else if(CheckWords(ctmp, "TargetTPQRand")==0) { X->irand=(int)dtmp; } + else if (CheckWords(ctmp, "PreCG") == 0) { + X->PreCG = (int)dtmp; + } else { return (-1); } From 035513ef7ca95e37f32dc9dd6825fc37e959b396 Mon Sep 17 00:00:00 2001 From: k-yoshimi Date: Tue, 14 Jun 2022 14:07:15 +0900 Subject: [PATCH 25/26] update version info in manuals --- doc/en/source/conf.py | 2 +- doc/en/source/introduction_en.rst | 7 +++++-- doc/ja/source/conf.py | 2 +- doc/ja/source/introduction_ja.rst | 8 +++++--- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/doc/en/source/conf.py b/doc/en/source/conf.py index 150639133..1d5bf24c9 100644 --- a/doc/en/source/conf.py +++ b/doc/en/source/conf.py @@ -56,7 +56,7 @@ # General information about the project. project = u'HΦ Documentation' -copyright = u'2021, The University of Tokyo' +copyright = u'2022, The University of Tokyo' author = u'The University of Tokyo' # The version info for the project you're documenting, acts as replacement for diff --git a/doc/en/source/introduction_en.rst b/doc/en/source/introduction_en.rst index 325d4e607..46a2e9ac0 100644 --- a/doc/en/source/introduction_en.rst +++ b/doc/en/source/introduction_en.rst @@ -31,6 +31,10 @@ Contributors This software was developed by the following contributors. +* ver.3.5.1 (released on 2022/6/14) + +* ver.3.5 (released on 2021/9/29) + * ver.3.4 (released on 2020/6/2) * Developers @@ -114,8 +118,7 @@ Operating environment :math:`{\mathcal H}\Phi` was tested on the following platforms -* The supercomputer system-B \"sekirei\" and system-C \"enaga\" in ISSP -* Fujitsu FX-10 +* The supercomputer system-B \"ohtaka\" in ISSP * Linux PC + Intel compiler * Linux PC + GCC. * Mac + GCC. diff --git a/doc/ja/source/conf.py b/doc/ja/source/conf.py index 763c24d9a..ec48d675d 100644 --- a/doc/ja/source/conf.py +++ b/doc/ja/source/conf.py @@ -54,7 +54,7 @@ # General information about the project. project = u'HΦ マニュアル' -copyright = u'2021, The University of Tokyo' +copyright = u'2022, The University of Tokyo' author = u'The University of Tokyo' # The version info for the project you're documenting, acts as replacement for diff --git a/doc/ja/source/introduction_ja.rst b/doc/ja/source/introduction_ja.rst index 55f949925..80b9ddff2 100644 --- a/doc/ja/source/introduction_ja.rst +++ b/doc/ja/source/introduction_ja.rst @@ -57,6 +57,10 @@ What is :math:`{\mathcal H}\Phi`? 本ソフトウェアは以下の開発貢献者により開発されています。 +- ver.3.5.1 (2022/6/14 リリース) + +- ver.3.5 (2021/9/29 リリース) + - ver.3.4 (2020/6/2 リリース) - 開発者 @@ -137,9 +141,7 @@ What is :math:`{\mathcal H}\Phi`? 以下の環境で動作することを確認しています。 -- 東京大学物性研究所スーパーコンピューターシステムB「sekirei」、システムC「enaga」 - -- 富士通 FX-10 +- 東京大学物性研究所スーパーコンピューターシステムB「ohtaka」 - Linux PC + intelコンパイラ From 7895506c99a12d5fac24c7a8fcd807ab60148d0b Mon Sep 17 00:00:00 2001 From: k-yoshimi Date: Tue, 14 Jun 2022 14:28:46 +0900 Subject: [PATCH 26/26] update manuals --- .../source/howtouse/directorystructure_en.rst | 4 +++- doc/en/source/howtouse/installation_en.rst | 12 +----------- doc/en/source/tutorial/fourier_en.rst | 8 +------- .../source/howtouse/directorystructure_ja.rst | 4 +++- doc/ja/source/howtouse/installation_ja.rst | 17 +---------------- doc/ja/source/tutorial/fourier_ja.rst | 9 +-------- 6 files changed, 10 insertions(+), 44 deletions(-) diff --git a/doc/en/source/howtouse/directorystructure_en.rst b/doc/en/source/howtouse/directorystructure_en.rst index 118e057af..f7d7f60cd 100644 --- a/doc/en/source/howtouse/directorystructure_en.rst +++ b/doc/en/source/howtouse/directorystructure_en.rst @@ -15,9 +15,11 @@ When HPhi-xxx.tar.gz is unzipped, the following directory structure is composed. |--doc/ | |--en/ | |--ja/ - | |--fourier/ + | |--tutorial/ + | |--tutorial_HPhi_en.pdf | |--userguide_en.pdf | |--userguide_jp.pdf + |--README.md |--samples/ |--src/ | |--*.c diff --git a/doc/en/source/howtouse/installation_en.rst b/doc/en/source/howtouse/installation_en.rst index de4aa2d08..3af6e6d11 100644 --- a/doc/en/source/howtouse/installation_en.rst +++ b/doc/en/source/howtouse/installation_en.rst @@ -3,23 +3,13 @@ Installation You can download :math:`{\mathcal H}\Phi` at the following location. -https://github.com/QLMS/HPhi/releases +https://github.com/issp-center-dev/HPhi/releases You can obtain the :math:`{\mathcal H}\Phi` directory by typing ``$ tar xzvf HPhi-xxx.tar.gz`` :math:`{\mathcal H}\Phi` can be installed by using cmake. - -.. tip:: - - | Before using cmake for sekirei, you must type - | ``module load cmake`` - | :math:`{\mathcal H}\Phi` has been preinstalled on ISSP supercomputers. - | If you want to use this preinstalled version, please type - | ``source /home/issp/materiapps/hphi/hphivars.sh`` -.. | ``source /home/issp/materiapps/tool/env.sh`` - We can compile :math:`{\mathcal H}\Phi` as:: cd $HOME/build/hphi diff --git a/doc/en/source/tutorial/fourier_en.rst b/doc/en/source/tutorial/fourier_en.rst index fde6ffe85..20950f32d 100644 --- a/doc/en/source/tutorial/fourier_en.rst +++ b/doc/en/source/tutorial/fourier_en.rst @@ -3,11 +3,5 @@ Fourier transformation of correlation functions =============================================== -This package has a utility which performs the Fourier transformation of the correlation function and plots that function. -The manual of this utility is located in :: - - doc/fourier/ja/_build/html/index.html - doc/fourier/ja/_build/latex/fourier.pdf - doc/fourier/en/_build/html/index.html - doc/fourier/en/_build/latex/fourier.pdf +This package has a utility which performs the Fourier transformation of the correlation function and plots that function. For details, see Appendix A. diff --git a/doc/ja/source/howtouse/directorystructure_ja.rst b/doc/ja/source/howtouse/directorystructure_ja.rst index 20bef5612..c41ae2aa8 100644 --- a/doc/ja/source/howtouse/directorystructure_ja.rst +++ b/doc/ja/source/howtouse/directorystructure_ja.rst @@ -15,9 +15,11 @@ HPhi-xxx.gzを解凍後に構成されるディレクトリ構成を以下に示 |--doc/ | |--en/ | |--ja/ - | |--fourier/ + | |--tutorial/ + | |--tutorial_HPhi_en.pdf | |--userguide_en.pdf | |--userguide_jp.pdf + |--README.md |--samples/ |--src/ | |--*.c diff --git a/doc/ja/source/howtouse/installation_ja.rst b/doc/ja/source/howtouse/installation_ja.rst index 7d884bad9..0d4811c76 100644 --- a/doc/ja/source/howtouse/installation_ja.rst +++ b/doc/ja/source/howtouse/installation_ja.rst @@ -3,28 +3,13 @@ :math:`{\mathcal H}\Phi` は次の場所からダウンロードできます。 -https://github.com/QLMS/HPhi/releases +https://github.com/issp-center-dev/HPhi/releases ダウンロードしたファイルを次のように展開してください。 ``$ tar xzvf HPhi-xxx.tar.gz`` :math:`{\mathcal H}\Phi`\ はcmakeを利用してインストールできます。 - - -.. tip:: - - | 物性研スパコンシステムであるsekireiとenaga で cmake を利用するには - | ``module load cmake`` - | をあらかじめ実行する必要があります。 - | なお、両システムでは :math:`{\mathcal H}\Phi` がプレインストールされております。 - | 詳しくは `スパコン公式ページ `_ をご参照ください。 - -.. | sekirei で cmake を利用するには - | ``source /home/issp/materiapps/tool/env.sh`` - | をあらかじめ実行する必要があります。 - - :math:`{\mathcal H}\Phi`\ を展開したディレクトリのパスを$PathTohphi 、ビルドディレクトリを$HOME/build/hphi (任意の場所を指定可能)とした場合に、 :: diff --git a/doc/ja/source/tutorial/fourier_ja.rst b/doc/ja/source/tutorial/fourier_ja.rst index f906a067d..c7b50cfd8 100644 --- a/doc/ja/source/tutorial/fourier_ja.rst +++ b/doc/ja/source/tutorial/fourier_ja.rst @@ -4,11 +4,4 @@ =============================================== このパッケージには、上で求めた相関関数をフーリエ変換し、プロットするユーティリティーが付属しています。 -このユーティリティーに関するマニュアルは :: - - doc/fourier/ja/_build/html/index.html - doc/fourier/ja/_build/latex/fourier.pdf - doc/fourier/en/_build/html/index.html - doc/fourier/en/_build/latex/fourier.pdf - -にありますので、そちらを参照してください。 +詳細についてはAppendix Aをご覧ください。