From c3011b013525b52cc94275cb6b26b994ac3b34e9 Mon Sep 17 00:00:00 2001 From: "k.ido" <13773226+k-ido@users.noreply.github.com> Date: Wed, 26 Jul 2023 10:18:28 +0900 Subject: [PATCH 1/6] update readme --- README.md | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8bf07967..3ae5fa7d 100644 --- a/README.md +++ b/README.md @@ -27,9 +27,11 @@ You can install HΦ and also get a manual for HΦ from a [release note](https:// ## Licence -The distribution of the program package and the source codes for HPhi follow GNU General Public License version 3 ([GPL v3](http://www.gnu.org/licenses/gpl-3.0.en.html)).We hope that you cite the following reference when you publish the results using HΦ (hphi): +The distribution of the program package and the source codes for HPhi follow GNU General Public License version 3 ([GPL v3](http://www.gnu.org/licenses/gpl-3.0.en.html)).We hope that you cite the following references when you publish the results using HΦ (hphi): -[“Quantum lattice model solver HΦ”, M. Kawamura, K. Yoshimi, T. Misawa, Y. Yamaji, S. Todo, and N. Kawashima, Computer Physics Communications 217, 180 (2017).](https://github.com/issp-center-dev/HPhi/edit/master/README.md) +[“Quantum lattice model solver HΦ”, M. Kawamura, K. Yoshimi, T. Misawa, Y. Yamaji, S. Todo, and N. Kawashima, Computer Physics Communications 217, 180 (2017).](https://doi.org/10.1016/j.cpc.2017.04.006) + +[“Update of HΦ: Newly added functions and methods in versions 2 and 3”, K. Ido, M. Kawamura, Y. Motoyama, K. Yoshimi, Y. Yamaji, S. Todo, N. Kawashima, and T. Misawa, arXiv:2307.13222.](https://arxiv.org/abs/2307.13222) Bibtex: @@ -45,6 +47,14 @@ url = {https://www.sciencedirect.com/science/article/pii/S0010465517301200}, author = {Mitsuaki Kawamura and Kazuyoshi Yoshimi and Takahiro Misawa and Youhei Yamaji and Synge Todo and Naoki Kawashima} } +@misc{ido2023update, + title={Update of $\mathcal{H}\Phi$: Newly added functions and methods in versions 2 and 3}, + author={Kota Ido and Mitsuaki Kawamura and Yuichi Motoyama and Kazuyoshi Yoshimi and Youhei Yamaji and Synge Todo and Naoki Kawashima and Takahiro Misawa}, + year={2023}, + eprint={2307.13222}, + archivePrefix={arXiv}, + primaryClass={cond-mat.str-el} +} ## Official page From f441fc62c427ccba206e2d8820ec446db7970cda Mon Sep 17 00:00:00 2001 From: Yuichi Motoyama Date: Wed, 22 Feb 2023 16:50:25 +0900 Subject: [PATCH 2/6] correct np.dtypes --- .../en/source/zero_temperature/vector.rst | 4 +- samples/tutorial_1.5/CalcSq.py | 4 +- samples/tutorial_1.7/read_gs.py | 4 +- samples/tutorial_2.1/Finite.py | 2 +- samples/tutorial_2.1/Norm_TPQ.py | 38 ++++++++--------- samples/tutorial_2.2/Finite.py | 2 +- test/Ave_SS.py | 42 +++++++++---------- tool/ExpertSpin/MakeDef.py | 18 ++++---- tool/FiniteT/Finite.py | 2 +- tool/ForSq/CalcSq.py | 4 +- 10 files changed, 60 insertions(+), 60 deletions(-) diff --git a/doc/tutorial/en/source/zero_temperature/vector.rst b/doc/tutorial/en/source/zero_temperature/vector.rst index f62008fd..4a763667 100644 --- a/doc/tutorial/en/source/zero_temperature/vector.rst +++ b/doc/tutorial/en/source/zero_temperature/vector.rst @@ -17,12 +17,12 @@ For example, the following python function (``samples/tutorial-1.7/read_gs.py``) with open(filename, "rb") as f: f.read(4) nelems = unpack("L", f.read(8))[0] - ret = np.zeros(nelems, dtype=np.complex) + ret = np.zeros(nelems, dtype=np.complex128) f.read(16) for i in range(nelems): re = unpack("d", f.read(8))[0] im = unpack("d", f.read(8))[0] - ret[i] = np.complex(re, im) + ret[i] = complex(re, im) return ret Exercise diff --git a/samples/tutorial_1.5/CalcSq.py b/samples/tutorial_1.5/CalcSq.py index 58a0abce..7b96c2b4 100755 --- a/samples/tutorial_1.5/CalcSq.py +++ b/samples/tutorial_1.5/CalcSq.py @@ -58,8 +58,8 @@ def func_input(list_lat): #[e] initialize #[s] allocate -Sq = np.zeros([Lx+1,Ly+1],dtype=np.float) -Sq_err = np.zeros([Lx+1,Ly+1],dtype=np.float) +Sq = np.zeros([Lx+1,Ly+1],dtype=np.float64) +Sq_err = np.zeros([Lx+1,Ly+1],dtype=np.float64) #[e] allocate max_num = 1 for num_cg in range(0,max_num): diff --git a/samples/tutorial_1.7/read_gs.py b/samples/tutorial_1.7/read_gs.py index 77dee82e..e178c94e 100644 --- a/samples/tutorial_1.7/read_gs.py +++ b/samples/tutorial_1.7/read_gs.py @@ -8,10 +8,10 @@ def read_gs(*, index=0, rank=0): with open(filename, "rb") as f: f.read(4) nelems = unpack("L", f.read(8))[0] - ret = np.zeros(nelems, dtype=np.complex) + ret = np.zeros(nelems, dtype=np.complex128) f.read(16) for i in range(nelems): re = unpack("d", f.read(8))[0] im = unpack("d", f.read(8))[0] - ret[i] = np.complex(re, im) + ret[i] = complex(re, im) return ret diff --git a/samples/tutorial_2.1/Finite.py b/samples/tutorial_2.1/Finite.py index 3135cefa..596e00a7 100644 --- a/samples/tutorial_2.1/Finite.py +++ b/samples/tutorial_2.1/Finite.py @@ -8,7 +8,7 @@ data = f.read() data = data.split("\n") max_eigen = len(data)-1 - Energy = np.zeros([max_eigen],dtype=np.float) + Energy = np.zeros([max_eigen],dtype=np.float64) print("max_eigen= ", max_eigen) #[s] count not empty elements cnt = 0 diff --git a/samples/tutorial_2.1/Norm_TPQ.py b/samples/tutorial_2.1/Norm_TPQ.py index 9ea8056b..110e21dd 100644 --- a/samples/tutorial_2.1/Norm_TPQ.py +++ b/samples/tutorial_2.1/Norm_TPQ.py @@ -34,7 +34,7 @@ def mainBasic(num_sample,dir_Norm): phys_Z,phys_Ene,phys_Ene2,phys_Sz,phys_Sz2,phys_InvTemp = CalcBasic(Norm,Ene,Ene2,Sz,Sz2,InvTemp,tpq_type) - log_Z = np.zeros([num_step],dtype=np.float) + log_Z = np.zeros([num_step],dtype=np.float64) with open("%s/Norm.dat" % (dir_Norm),'w') as f: tmp_log_Z = -math.log(Norm[0][0]) for k in range(0,num_step): @@ -79,14 +79,14 @@ def read_file(num_sample): data = f.read() data = data.split("\n") num_step = int(len(data)-2) - Norm = np.zeros([num_sample,num_step],dtype=np.float) - InvTemp = np.zeros([num_sample,num_step],dtype=np.float) - Ene = np.zeros([num_sample,num_step],dtype=np.float) - Ene2 = np.zeros([num_sample,num_step],dtype=np.float) - Spc = np.zeros([num_sample,num_step],dtype=np.float) - Sz = np.zeros([num_sample,num_step],dtype=np.float) - Sz2 = np.zeros([num_sample,num_step],dtype=np.float) - chi = np.zeros([num_sample,num_step],dtype=np.float) + Norm = np.zeros([num_sample,num_step],dtype=np.float64) + InvTemp = np.zeros([num_sample,num_step],dtype=np.float64) + Ene = np.zeros([num_sample,num_step],dtype=np.float64) + Ene2 = np.zeros([num_sample,num_step],dtype=np.float64) + Spc = np.zeros([num_sample,num_step],dtype=np.float64) + Sz = np.zeros([num_sample,num_step],dtype=np.float64) + Sz2 = np.zeros([num_sample,num_step],dtype=np.float64) + chi = np.zeros([num_sample,num_step],dtype=np.float64) for cnt_samp in range(num_sample): in_file = "output/Norm_rand%d.dat" % (cnt_samp) @@ -136,12 +136,12 @@ def CalcBasic(Norm,Ene,Ene2,Sz,Sz2,InvTemp,tpq_type): num_sample = Norm.shape[0] num_step = Norm.shape[1] print(num_step) - phys_InvTemp = np.zeros([num_sample,num_step],dtype=np.float) - phys_Z = np.zeros([num_sample,num_step],dtype=np.float) - phys_Ene = np.zeros([num_sample,num_step],dtype=np.float) - phys_Ene2 = np.zeros([num_sample,num_step],dtype=np.float) - phys_Sz = np.zeros([num_sample,num_step],dtype=np.float) - phys_Sz2 = np.zeros([num_sample,num_step],dtype=np.float) + phys_InvTemp = np.zeros([num_sample,num_step],dtype=np.float64) + phys_Z = np.zeros([num_sample,num_step],dtype=np.float64) + phys_Ene = np.zeros([num_sample,num_step],dtype=np.float64) + phys_Ene2 = np.zeros([num_sample,num_step],dtype=np.float64) + phys_Sz = np.zeros([num_sample,num_step],dtype=np.float64) + phys_Sz2 = np.zeros([num_sample,num_step],dtype=np.float64) #NB: cnt_samp=0, Z is always 1 for k in range(0,num_step): phys_Z[0][k] = 1.0 @@ -214,7 +214,7 @@ def CalcPhys(IPL_Z,IPL_InvTemp,Phys,tpq_type): num_step = Phys.shape[1] num_phys = Phys.shape[2] print(num_sample,num_step,num_phys) - Norm_Phys = np.zeros([num_sample,num_step,num_phys],dtype=np.float) + Norm_Phys = np.zeros([num_sample,num_step,num_phys],dtype=np.float64) for k in range(0,num_step): for cnt_phys in range(0,num_phys): Norm_Phys[0][k][cnt_phys] = Phys[0][k][cnt_phys] @@ -255,7 +255,7 @@ def read_phys(num_sample,dir_Phys,header): num_phys = len(tmp) print(num_step) print(num_phys) - Phys = np.zeros([num_sample,num_step,num_phys],dtype=np.float) + Phys = np.zeros([num_sample,num_step,num_phys],dtype=np.float64) for cnt_samp in range(num_sample): in_file = "%s/%s_set%d.dat" % (dir_Phys,header,cnt_samp) @@ -278,8 +278,8 @@ def read_Norm(num_sample,dir_Norm): data = data.split("\n") num_step = int(len(data)-2) print("num_step=",num_step) - IPL_Z = np.zeros([num_sample,num_step],dtype=np.float) - IPL_InvTemp = np.zeros([num_sample,num_step],dtype=np.float) + IPL_Z = np.zeros([num_sample,num_step],dtype=np.float64) + IPL_InvTemp = np.zeros([num_sample,num_step],dtype=np.float64) for cnt_samp in range(num_sample): in_file = "%s/TPQ_%d.dat" % (dir_Norm,cnt_samp) diff --git a/samples/tutorial_2.2/Finite.py b/samples/tutorial_2.2/Finite.py index 3135cefa..596e00a7 100644 --- a/samples/tutorial_2.2/Finite.py +++ b/samples/tutorial_2.2/Finite.py @@ -8,7 +8,7 @@ data = f.read() data = data.split("\n") max_eigen = len(data)-1 - Energy = np.zeros([max_eigen],dtype=np.float) + Energy = np.zeros([max_eigen],dtype=np.float64) print("max_eigen= ", max_eigen) #[s] count not empty elements cnt = 0 diff --git a/test/Ave_SS.py b/test/Ave_SS.py index c397a145..b43e2edd 100644 --- a/test/Ave_SS.py +++ b/test/Ave_SS.py @@ -14,30 +14,30 @@ def main(): #[e] read modpara # - Ref_ave_Temp = np.zeros([max_eigen],dtype=np.float) - Ref_err_Temp = np.zeros([max_eigen],dtype=np.float) - Ref_ave_Ene = np.zeros([max_eigen],dtype=np.float) - Ref_err_Ene = np.zeros([max_eigen],dtype=np.float) + Ref_ave_Temp = np.zeros([max_eigen],dtype=np.float64) + Ref_err_Temp = np.zeros([max_eigen],dtype=np.float64) + Ref_ave_Ene = np.zeros([max_eigen],dtype=np.float64) + Ref_err_Ene = np.zeros([max_eigen],dtype=np.float64) # - ave_Temp = np.zeros([max_eigen],dtype=np.float) - err_Temp = np.zeros([max_eigen],dtype=np.float) + ave_Temp = np.zeros([max_eigen],dtype=np.float64) + err_Temp = np.zeros([max_eigen],dtype=np.float64) # - InvTemp = np.zeros([max_set,max_eigen],dtype=np.float) - ave_InvTemp = np.zeros([max_eigen],dtype=np.float) - err_InvTemp = np.zeros([max_eigen],dtype=np.float) - Ene = np.zeros([max_set,max_eigen],dtype=np.float) - ave_Ene = np.zeros([max_eigen],dtype=np.float) - err_Ene = np.zeros([max_eigen],dtype=np.float) - Ene2 = np.zeros([max_set,max_eigen],dtype=np.float) - ave_Ene2 = np.zeros([max_eigen],dtype=np.float) - err_Ene2 = np.zeros([max_eigen],dtype=np.float) + InvTemp = np.zeros([max_set,max_eigen],dtype=np.float64) + ave_InvTemp = np.zeros([max_eigen],dtype=np.float64) + err_InvTemp = np.zeros([max_eigen],dtype=np.float64) + Ene = np.zeros([max_set,max_eigen],dtype=np.float64) + ave_Ene = np.zeros([max_eigen],dtype=np.float64) + err_Ene = np.zeros([max_eigen],dtype=np.float64) + Ene2 = np.zeros([max_set,max_eigen],dtype=np.float64) + ave_Ene2 = np.zeros([max_eigen],dtype=np.float64) + err_Ene2 = np.zeros([max_eigen],dtype=np.float64) # - Spc = np.zeros([max_set,max_eigen],dtype=np.float) - ave_Spc = np.zeros([max_eigen],dtype=np.float) - err_Spc = np.zeros([max_eigen],dtype=np.float) - Ent = np.zeros([max_set,max_eigen-1],dtype=np.float) - ave_Ent = np.zeros([max_eigen-1],dtype=np.float) - err_Ent = np.zeros([max_eigen-1],dtype=np.float) + Spc = np.zeros([max_set,max_eigen],dtype=np.float64) + ave_Spc = np.zeros([max_eigen],dtype=np.float64) + err_Spc = np.zeros([max_eigen],dtype=np.float64) + Ent = np.zeros([max_set,max_eigen-1],dtype=np.float64) + ave_Ent = np.zeros([max_eigen-1],dtype=np.float64) + err_Ent = np.zeros([max_eigen-1],dtype=np.float64) # for cnt_set in range(0,max_set): diff --git a/tool/ExpertSpin/MakeDef.py b/tool/ExpertSpin/MakeDef.py index b2456520..3824a43e 100644 --- a/tool/ExpertSpin/MakeDef.py +++ b/tool/ExpertSpin/MakeDef.py @@ -19,17 +19,17 @@ All_N = max_site #[e] set input. #[s] interaction -Ising = np.zeros([max_site,max_site],dtype=np.float) -Exchange = np.zeros([max_site,max_site],dtype=np.float) -PairLift = np.zeros([max_site,max_site],dtype=np.float) -InterAll = np.zeros([max_site,2,max_site,2,max_site,2,max_site,2],dtype=np.complex) +Ising = np.zeros([max_site,max_site],dtype=np.float64) +Exchange = np.zeros([max_site,max_site],dtype=np.float64) +PairLift = np.zeros([max_site,max_site],dtype=np.float64) +InterAll = np.zeros([max_site,2,max_site,2,max_site,2,max_site,2],dtype=np.complex128) #[e] interaction #[s] read pair.txt -siteI = np.zeros([num],dtype=np.int) -siteJ = np.zeros([num],dtype=np.int) -intT1 = np.zeros([num],dtype=np.unicode) -intT2 = np.zeros([num],dtype=np.unicode) -para = np.zeros([num],dtype=np.double) +siteI = np.zeros([num],dtype=np.int64) +siteJ = np.zeros([num],dtype=np.int64) +intT1 = np.zeros([num],dtype=np.unicode_) +intT2 = np.zeros([num],dtype=np.unicode_) +para = np.zeros([num],dtype=np.float64) read.func_readpair(tmp_sdt,siteI,siteJ,intT1,intT2,para) #[e] read pair.txt diff --git a/tool/FiniteT/Finite.py b/tool/FiniteT/Finite.py index 3135cefa..596e00a7 100644 --- a/tool/FiniteT/Finite.py +++ b/tool/FiniteT/Finite.py @@ -8,7 +8,7 @@ data = f.read() data = data.split("\n") max_eigen = len(data)-1 - Energy = np.zeros([max_eigen],dtype=np.float) + Energy = np.zeros([max_eigen],dtype=np.float64) print("max_eigen= ", max_eigen) #[s] count not empty elements cnt = 0 diff --git a/tool/ForSq/CalcSq.py b/tool/ForSq/CalcSq.py index 3226279b..467bb39b 100755 --- a/tool/ForSq/CalcSq.py +++ b/tool/ForSq/CalcSq.py @@ -29,8 +29,8 @@ #[e] initialize #[s] allocate -Sq = np.zeros([Lx+1,Ly+1],dtype=np.float) -Sq_err = np.zeros([Lx+1,Ly+1],dtype=np.float) +Sq = np.zeros([Lx+1,Ly+1],dtype=np.float64) +Sq_err = np.zeros([Lx+1,Ly+1],dtype=np.float64) #[e] allocate max_num = 1 for num_cg in range(0,max_num): From 077960ea61709490b58655d1578ee2a0a05cd9ed Mon Sep 17 00:00:00 2001 From: Yuichi Motoyama Date: Wed, 22 Feb 2023 16:06:22 +0900 Subject: [PATCH 3/6] CI test on Ubuntu 22.04 --- .github/workflows/main.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 69dfe9de..b5aeb0ad 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -8,13 +8,16 @@ jobs: strategy: matrix: - os: [ubuntu-20.04] + os: [ubuntu-22.04] mpisize: [1, 4, 16] ompsize: [1, 3] include: - os: macos-10.15 mpisize: 1 ompsize: 1 + - os: ubuntu-20.04 + mpisize: 1 + ompsize: 1 fail-fast: false env: From b0db1f2beb043d30ba44a1c40c212d9d7ad8303a Mon Sep 17 00:00:00 2001 From: Yuichi Motoyama Date: Wed, 22 Feb 2023 17:45:20 +0900 Subject: [PATCH 4/6] test on macos-11 instead of macos-10.05 --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b5aeb0ad..ec27e2a7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,7 +12,7 @@ jobs: mpisize: [1, 4, 16] ompsize: [1, 3] include: - - os: macos-10.15 + - os: macos-11 mpisize: 1 ompsize: 1 - os: ubuntu-20.04 From f69125edb51f648590a069a015846df4ed5c7478 Mon Sep 17 00:00:00 2001 From: Yuichi Motoyama Date: Tue, 16 Jan 2024 23:53:20 +0900 Subject: [PATCH 5/6] remove too slow tests --- .github/workflows/main.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ec27e2a7..c32d0193 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,6 +18,11 @@ jobs: - os: ubuntu-20.04 mpisize: 1 ompsize: 1 + exclude: + - mpisize: 16 + ompsize: 3 + - mpisize: 4 + - ompsize: 3 fail-fast: false env: From 1432558ae709bc9dc1320c596e32ca59301c84e5 Mon Sep 17 00:00:00 2001 From: Yuichi Motoyama Date: Tue, 16 Jan 2024 23:54:30 +0900 Subject: [PATCH 6/6] correct script --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c32d0193..e04447f9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -22,7 +22,7 @@ jobs: - mpisize: 16 ompsize: 3 - mpisize: 4 - - ompsize: 3 + ompsize: 3 fail-fast: false env: