From 687cb5811919ee05cc64d189d17c210a1e49bdf6 Mon Sep 17 00:00:00 2001 From: MasakiYama <94419424+MasakiYama@users.noreply.github.com> Date: Tue, 14 Dec 2021 16:41:06 +0900 Subject: [PATCH 01/16] Update start.rst MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 256行目 次の用に→次のように --- doc/ja/source/start.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/ja/source/start.rst b/doc/ja/source/start.rst index 43693657..04c6e1ad 100644 --- a/doc/ja/source/start.rst +++ b/doc/ja/source/start.rst @@ -253,7 +253,7 @@ mVMCは次の二つのいずれかのモードで動作します。 また、エキスパートモード用の入力ファイルを自動生成した後、計算をする前にそれらを手動で編集して より広範なモデルに対応させることも可能です。 -これらのモードを用いて次の用に計算を行います。 +これらのモードを用いて次のように計算を行います。 #. 計算用ディレクトリの作成 From bb3c416efc6d62fcb36f1c909fee5b9f9a293098 Mon Sep 17 00:00:00 2001 From: MasakiYama <94419424+MasakiYama@users.noreply.github.com> Date: Tue, 14 Dec 2021 17:26:50 +0900 Subject: [PATCH 02/16] Update format.rst MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 13行目 スタンンダードモード→スタンダードモード --- doc/ja/source/fourier/format.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/ja/source/fourier/format.rst b/doc/ja/source/fourier/format.rst index 5791fda2..9dc217da 100644 --- a/doc/ja/source/fourier/format.rst +++ b/doc/ja/source/fourier/format.rst @@ -10,7 +10,7 @@ :ref:`tutorial` でのファイル名は ``geometry.dat`` . 各サイトの位置と軌道の情報は -mVMC/:math:`{\mathcal H}\Phi` のスタンンダードモードを用いた場合には +mVMC/:math:`{\mathcal H}\Phi` のスタンダードモードを用いた場合には 自動的に生成される. :: From c6e509cecb63e3986436dc46e550914eedf3616d Mon Sep 17 00:00:00 2001 From: MasakiYama <94419424+MasakiYama@users.noreply.github.com> Date: Tue, 18 Jan 2022 16:13:44 +0900 Subject: [PATCH 03/16] Update intro.rst --- doc/en/source/intro.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/en/source/intro.rst b/doc/en/source/intro.rst index 68d2631c..a36dd676 100644 --- a/doc/en/source/intro.rst +++ b/doc/en/source/intro.rst @@ -15,7 +15,7 @@ the low-energy effective models. One of the most reliable theoretical tools for treating the strongly correlated electron systems is the exact diagonalization method. However, applicable range of system size is strongly limited in the exact diagonalization method. Variational Monte -Carlo method [Gros_ ] is one of promising way to perform +Carlo method [Gros_ ] is one of the promising ways to perform the high-accuracy calculations for the larger system sizes beyond exact diagonalization method. Although the strong limitation of the variational wave function is the origin of the poor accuracy of the From 0988e77ce0926c45ddf282675736c9a69061543a Mon Sep 17 00:00:00 2001 From: MasakiYama <94419424+MasakiYama@users.noreply.github.com> Date: Tue, 18 Jan 2022 16:22:39 +0900 Subject: [PATCH 04/16] Update start.rst --- doc/en/source/start.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/en/source/start.rst b/doc/en/source/start.rst index 1ac589bc..a304b6f3 100644 --- a/doc/en/source/start.rst +++ b/doc/en/source/start.rst @@ -268,7 +268,7 @@ We can calculate by using these modes as follows: #. Run - Run a executable ``vmc.out`` in terminal by specifying the name of + Run an executable ``vmc.out`` in terminal by specifying the name of input file written in previous step (option ``-s`` is required). .. code-block:: bash @@ -296,7 +296,7 @@ We can calculate by using these modes as follows: In the above case, the calculation starts as soon as input files for Expert mode are generated. If we only generate files without starting - the calculation, we can use a executable ``vmcdry.out`` as follows + the calculation, we can use an executable ``vmcdry.out`` as follows (MPI is not used in this step): .. code-block:: bash From d79310cbd8baac26f31beda3832e45dd5df635c5 Mon Sep 17 00:00:00 2001 From: MasakiYama <94419424+MasakiYama@users.noreply.github.com> Date: Tue, 18 Jan 2022 16:56:51 +0900 Subject: [PATCH 05/16] Update tutorial.rst --- doc/en/source/tutorial.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/en/source/tutorial.rst b/doc/en/source/tutorial.rst index 3b2e1aa3..3922e84f 100644 --- a/doc/en/source/tutorial.rst +++ b/doc/en/source/tutorial.rst @@ -267,7 +267,7 @@ The details of these outputted files are shown in :ref:`OutputFile`. Output results ^^^^^^^^^^^^^^ -After finishing calculation normally, the files for the energy, the +After finishing the calculation normally, the files for the energy, the deviation, the optimized variational parameters and the time of execution for each calculation steps are outputted in ``output/`` directory. In the following, the outputted files are shown From e2d0d2ba7635bd001c5826f68271ddb75989b48d Mon Sep 17 00:00:00 2001 From: MasakiYama <94419424+MasakiYama@users.noreply.github.com> Date: Tue, 18 Jan 2022 17:03:26 +0900 Subject: [PATCH 06/16] Update standard.rst --- doc/en/source/standard.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/en/source/standard.rst b/doc/en/source/standard.rst index a47072cb..c7c068b6 100644 --- a/doc/en/source/standard.rst +++ b/doc/en/source/standard.rst @@ -42,7 +42,7 @@ An example of input file for the standard mode is shown below: 1. Parameters that must be specified (if not, ``vmcdry.out`` will stop with error messages), - 2. Parameters that is not necessary be specified (if not, default + 2. Parameters that are not necessary be specified (if not, default values are used), 3. Parameters that must not be specified (if specified, @@ -52,7 +52,7 @@ An example of input file for the standard mode is shown below: system. If you choose "model=spin", you should not specify ":math:`t`". -We explain each keywords as follows: +We explain each keyword as follows: Parameters about the kind of a calculation ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ From ba07cb2304bb434e7c378d73620c82c3f93bbfa6 Mon Sep 17 00:00:00 2001 From: MasakiYama <94419424+MasakiYama@users.noreply.github.com> Date: Tue, 18 Jan 2022 17:07:40 +0900 Subject: [PATCH 07/16] =?UTF-8?q?\.113=20has=E2=86=92have?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/en/source/standard.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/en/source/standard.rst b/doc/en/source/standard.rst index c7c068b6..28e81d89 100644 --- a/doc/en/source/standard.rst +++ b/doc/en/source/standard.rst @@ -110,7 +110,7 @@ Parameters about the kind of a calculation [Eqn. :eq:`hubbard` ], the :math:`S_z`-unconserved Spin model [Eqn. :eq:`spin` ], and the :math:`S_z`-unconserved Kondo lattice model [Eqn. :eq:`kondo` ], respectively. Note: Although - these flags has a word "GC"(=grandcanonical), the number of electrons + these flags have a word "GC"(=grandcanonical), the number of electrons are conserved in these system. - ``lattice`` From fff13a981880de69e420b87e78eb97ba81e1ab3c Mon Sep 17 00:00:00 2001 From: MasakiYama <94419424+MasakiYama@users.noreply.github.com> Date: Tue, 18 Jan 2022 17:14:19 +0900 Subject: [PATCH 08/16] =?UTF-8?q?l.235=20surrounds=E2=86=92surround?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/en/source/standard.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/en/source/standard.rst b/doc/en/source/standard.rst index 28e81d89..ee661f7a 100644 --- a/doc/en/source/standard.rst +++ b/doc/en/source/standard.rst @@ -232,7 +232,7 @@ using the following two methods. **Type :** Integer **Description :** We can specify two vectors - (:math:`{\vec a}_0, {\vec a}_1`) that surrounds the numerical cell + (:math:`{\vec a}_0, {\vec a}_1`) that surround the numerical cell (Fig. :num:`unitlatticepng` ). These vectors should be specified in the Fractional coordinate. From 20460fa148211294a2ac423fd34edb94a8f2bd5f Mon Sep 17 00:00:00 2001 From: MasakiYama <94419424+MasakiYama@users.noreply.github.com> Date: Tue, 18 Jan 2022 17:22:53 +0900 Subject: [PATCH 09/16] =?UTF-8?q?l.239=20these=20method=E2=86=92=20these?= =?UTF-8?q?=20methods?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/en/source/standard.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/en/source/standard.rst b/doc/en/source/standard.rst index ee661f7a..64fa0d01 100644 --- a/doc/en/source/standard.rst +++ b/doc/en/source/standard.rst @@ -236,7 +236,7 @@ using the following two methods. (Fig. :num:`unitlatticepng` ). These vectors should be specified in the Fractional coordinate. -If we use both of these method, ``vmcdry.out`` stops. +If we use both of these methods, ``vmcdry.out`` stops. We can check the shape of the numerical cell by using a file ``lattice.gp`` (only for square, trianguler, honeycomb, and kagome From 6a2b1d4dbdc542e0ccdc4cb1bd57b965b04df9d2 Mon Sep 17 00:00:00 2001 From: MasakiYama <94419424+MasakiYama@users.noreply.github.com> Date: Tue, 25 Jan 2022 14:05:34 +0900 Subject: [PATCH 10/16] wording correction --- doc/en/source/output.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/en/source/output.rst b/doc/en/source/output.rst index 5dd1c951..571fff72 100644 --- a/doc/en/source/output.rst +++ b/doc/en/source/output.rst @@ -56,11 +56,11 @@ energy optimized by the SR method are outputted in the following order: The type of average values is a complex number, while that of the deviation is a real number. Since the initial values of all variational parameters are specified at the beginning of the calculation, the -calculation of physical quantities is done by using this file file. +calculation of physical quantities is done by using this file. Here, \*\*\* is the header indicated by ``CParaFileHead`` in ``ModPara`` file. -Output files for variational parameters at each steps (xxx\_var\_yyy.dat) +Output files for variational parameters at each step (xxx\_var\_yyy.dat) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The average and deviation values of variational parameters and the @@ -138,9 +138,9 @@ where both ``NDataIdxStart`` and ``NDataQtySmp`` are defined in xxx\_CalcTimer.dat ~~~~~~~~~~~~~~~~~~~ -After finishing calculation, the processing time is outputted in the -order of the name, the number assigned by the process and the seconds at -each processes. An example of outputted file is shown as follows. +After finishing the calculation, the processing time is outputted in the +order of the name, the number assigned by the process, and the seconds at +each process. An example of outputted file is shown as follows. :: @@ -160,7 +160,7 @@ xxx\_time\_zzz.dat The calculation information at each bins are outputted in the order of the sampling number, the acceptance ratio for hopping and exchange term (acc\_hopp, acc\_ex), trial numbers to update for hopping and exchange -term (n\_hopp, n\_ex) and the time stamp. Here, xxx is the header +term (n\_hopp, n\_ex), and the time stamp. Here, xxx is the header indicated by ``CDataFileHead`` in ``ModPara`` file and zzz is a number given by ``NDataIdxStart`` in ``ModPara``. An example of outputted file is shown as follows. From 8c26c6bb92fc4e9da252402657b773c213af77a1 Mon Sep 17 00:00:00 2001 From: MasakiYama <94419424+MasakiYama@users.noreply.github.com> Date: Tue, 25 Jan 2022 14:13:56 +0900 Subject: [PATCH 11/16] wording correction --- doc/en/source/algorithm.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/en/source/algorithm.rst b/doc/en/source/algorithm.rst index c4fa620e..7ffaf523 100644 --- a/doc/en/source/algorithm.rst +++ b/doc/en/source/algorithm.rst @@ -92,7 +92,7 @@ Properties of the Pfaffian-Slater determinant In this section, we explain some properties of the Pfaffian-Slater determinant. We derive the general relation between a Pfaffian-Slater determinant and a single Slater determinant in :ref:`Antiparallel Pfaffian ` -and :ref:`General Pfaffian ` . We also discuss meaning of the singular value +and :ref:`General Pfaffian ` . We also discuss the meaning of the singular value decomposition of coefficients :math:`f_{ij}` in :ref:`SVD `. @@ -190,7 +190,7 @@ redundancy. Relation between :math:`F_{IJ}` and :math:`\Phi_{In}` (the case of the general pairing) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -We extend the relation between the Pfaffian-Slater wave function and the +We extend the relationship between the Pfaffian-Slater wave function and the single Slater wave function into the general pairing case including the spin-parallel pairing. We define the Pfaffian-Slater wave function and the single Slater wave function as From 22c51c4a9cf650ecb79ea8a0802b33490624bb48 Mon Sep 17 00:00:00 2001 From: MasakiYama <94419424+MasakiYama@users.noreply.github.com> Date: Tue, 25 Jan 2022 14:47:35 +0900 Subject: [PATCH 12/16] Update format.rst --- doc/en/source/wannier/format.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/en/source/wannier/format.rst b/doc/en/source/wannier/format.rst index 22a69992..5781980c 100644 --- a/doc/en/source/wannier/format.rst +++ b/doc/en/source/wannier/format.rst @@ -27,9 +27,9 @@ By editing this file, we can modify the number of orbitals treated in HPhi/mVMC. * Line 4 - The number of orbitals par unit cell treated by mVMC/HPhi. + The number of orbitals per unit cell treated by mVMC/HPhi. When we reduce the number by editing this file, - the model including the same number of orbitals from the top. + the model includes the same number of orbitals from the top. * Line 5 - end From b8908a97e0a141f0edb12ad6075c6c0082e8444b Mon Sep 17 00:00:00 2001 From: MasakiYama <94419424+MasakiYama@users.noreply.github.com> Date: Tue, 25 Jan 2022 14:50:19 +0900 Subject: [PATCH 13/16] wording correction --- doc/en/source/wannier/tutorial.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/en/source/wannier/tutorial.rst b/doc/en/source/wannier/tutorial.rst index e7829060..bb028e90 100644 --- a/doc/en/source/wannier/tutorial.rst +++ b/doc/en/source/wannier/tutorial.rst @@ -10,7 +10,7 @@ We use QuantumESPRESSO for the DFT calculation. Input files are served in ``samples/Wannier/Sr2CuO3`` directory. -In actual studies, the input files etc. of each solver should be modified for more high accuracy calculation. +In actual studies, the input files, etc. of each solver should be modified for more high accuracy calculation. Please refer to the manuals of each solver for the details of the input files. SCF calculation of charge density @@ -107,9 +107,9 @@ Quantum lattice mode for HPhi/mVMC ---------------------------------- Using standard mode of HPhi/mVMC, the calculation will be done by reading the files in ``dir-model`` folder. -First, the files in ``dir-model`` directory should be moved to the current directry. +First, the files in ``dir-model`` directory should be moved to the current directory. Then, the calculation will be started by using standard mode. -For example, in HPhi, the calculation will be dobe by typing the following command: +For example, in HPhi, the calculation will be done by typing the following command: :download:`stan.in <../../../../samples/Wannier/Sr2CuO3/stan.in>` From 16a422d16bcd729d9429bd86827b3335e9b991ad Mon Sep 17 00:00:00 2001 From: RuQing Xu Date: Thu, 18 Aug 2022 15:42:39 +0800 Subject: [PATCH 14/16] vmcdry's was not printing correctly the err msg Currently due to this wrong formatting, calling `vmcdry.out` without parameters would cause segfault. This fixes the problem and let the error message print correctly. --- src/mVMC/vmcdry.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mVMC/vmcdry.c b/src/mVMC/vmcdry.c index 9e01c538..b3200426 100644 --- a/src/mVMC/vmcdry.c +++ b/src/mVMC/vmcdry.c @@ -29,7 +29,7 @@ void StdFace_main(char *fname); int main(int argc, char *argv[]) { if (argc == 1){ - printf("Usage: %s StdFace.def\n"); + printf("Usage: %s StdFace.def\n", argv[0]); return 1; } From a9cf60465a022fd5dbb9870a9e891e2e8756d895 Mon Sep 17 00:00:00 2001 From: "T.Aoyama" Date: Tue, 27 Sep 2022 16:34:28 +0900 Subject: [PATCH 15/16] typo fixed in pairhop array index. --- src/ComplexUHF/cal_energy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ComplexUHF/cal_energy.c b/src/ComplexUHF/cal_energy.c index 9bed56ac..0570d6d5 100644 --- a/src/ComplexUHF/cal_energy.c +++ b/src/ComplexUHF/cal_energy.c @@ -142,7 +142,7 @@ void cal_energy(struct BindStruct *X) { E_PairHopping = 0.0; for (int_i = 0; int_i < X->Def.NPairHopping; int_i++) { site_1 = X->Def.PairHopping[int_i][0]; - site_2 = X->Def.PairHopping[int_i][2]; + site_2 = X->Def.PairHopping[int_i][1]; tmp = X->Def.ParaPairHopping[int_i]; From bf919829f9d80c67bae4ff0230631962ff8a8da9 Mon Sep 17 00:00:00 2001 From: "k.ido" <13773226+k-ido@users.noreply.github.com> Date: Sun, 23 Jul 2023 19:54:52 +0900 Subject: [PATCH 16/16] add beta ver. of rbm correlators --- doc/en/source/algorithm.rst | 4 +- doc/en/source/expert.rst | 425 ++++++++++++++++++++- doc/en/source/intro.rst | 2 +- doc/en/source/output.rst | 79 ++-- doc/en/source/standard.rst | 10 +- doc/en/source/start.rst | 4 +- doc/en/source/tutorial.rst | 2 +- doc/en/source/wannier/format.rst | 4 +- doc/en/source/wannier/tutorial.rst | 6 +- doc/ja/source/expert.rst | 423 ++++++++++++++++++++- doc/ja/source/fourier/format.rst | 2 +- doc/ja/source/output.rst | 68 ++-- doc/ja/source/start.rst | 2 +- src/mVMC/avevar.c | 75 ++++ src/mVMC/calgrn.c | 25 +- src/mVMC/calham.c | 72 ++-- src/mVMC/include/calgrn.h | 4 +- src/mVMC/include/calham.h | 3 +- src/mVMC/include/global.h | 23 ++ src/mVMC/include/locgrn.h | 9 +- src/mVMC/include/lslocgrn.h | 7 +- src/mVMC/include/rbm.h | 22 ++ src/mVMC/include/readdef.h | 55 ++- src/mVMC/include/version.h | 2 +- src/mVMC/include/vmcmain.h | 2 + src/mVMC/locgrn.c | 47 ++- src/mVMC/lslocgrn.c | 165 +++++--- src/mVMC/parameter.c | 35 +- src/mVMC/rbm.c | 580 +++++++++++++++++++++++++++++ src/mVMC/readdef.c | 455 +++++++++++++++++++++- src/mVMC/setmemory.c | 69 +++- src/mVMC/vmccal.c | 28 +- src/mVMC/vmcdry.c | 2 +- src/mVMC/vmcmake.c | 51 ++- 34 files changed, 2520 insertions(+), 242 deletions(-) create mode 100644 src/mVMC/include/rbm.h create mode 100644 src/mVMC/rbm.c diff --git a/doc/en/source/algorithm.rst b/doc/en/source/algorithm.rst index 7ffaf523..c4fa620e 100644 --- a/doc/en/source/algorithm.rst +++ b/doc/en/source/algorithm.rst @@ -92,7 +92,7 @@ Properties of the Pfaffian-Slater determinant In this section, we explain some properties of the Pfaffian-Slater determinant. We derive the general relation between a Pfaffian-Slater determinant and a single Slater determinant in :ref:`Antiparallel Pfaffian ` -and :ref:`General Pfaffian ` . We also discuss the meaning of the singular value +and :ref:`General Pfaffian ` . We also discuss meaning of the singular value decomposition of coefficients :math:`f_{ij}` in :ref:`SVD `. @@ -190,7 +190,7 @@ redundancy. Relation between :math:`F_{IJ}` and :math:`\Phi_{In}` (the case of the general pairing) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -We extend the relationship between the Pfaffian-Slater wave function and the +We extend the relation between the Pfaffian-Slater wave function and the single Slater wave function into the general pairing case including the spin-parallel pairing. We define the Pfaffian-Slater wave function and the single Slater wave function as diff --git a/doc/en/source/expert.rst b/doc/en/source/expert.rst index 03eaf5e1..b4f036cc 100644 --- a/doc/en/source/expert.rst +++ b/doc/en/source/expert.rst @@ -75,11 +75,12 @@ listed in parentheses correspond to the file made by vmcdry.out. .. math:: \begin{aligned} - |\psi \rangle &= {\cal P}_G{\cal P}_J{\cal P}_{d-h}^{(2)}{\cal P}_{d-h}^{(4)}{\cal L}^S{\cal L}^K{\cal L}^P |\phi_{\rm pair} \rangle,\\ + |\psi \rangle &= {\cal N}_{General RBM} {\cal P}_G{\cal P}_J{\cal P}_{d-h}^{(2)}{\cal P}_{d-h}^{(4)}{\cal L}^S{\cal L}^K{\cal L}^P |\phi_{\rm pair} \rangle,\\ {\cal P}_G&=\exp\left[ \sum_i g_i n_{i\uparrow} n_{i\downarrow} \right],\\ {\cal P}_J&=\exp\left[\frac{1}{2} \sum_{i\neq j} v_{ij} (n_i-1)(n_j-1)\right],\\ {\cal P}_{d-h}^{(2)}&= \exp \left[ \sum_t \sum_{n=0}^2 (\alpha_{2nt}^d \sum_{i}\xi_{i2nt}^d+\alpha_{2nt}^h \sum_{i}\xi_{i2nt}^h)\right],\\ {\cal P}_{d-h}^{(4)}&= \exp \left[ \sum_t \sum_{n=0}^4 (\alpha_{4nt}^d \sum_{i}\xi_{i4nt}^d+\alpha_{4nt}^h \sum_{i}\xi_{i4nt}^h)\right],\\ + {\cal N}_{\rm General RBM}&= \exp \left[ \sum_i a_{i\sigma} n_{i\sigma} \right] \prod_k^{N_h} \cosh \left[ b_k + \sum_{i\sigma} W_{i\sigma k} n_{i\sigma} \right],\\ {\cal L}_S&=\frac{2S+1}{8 \pi^2}\int d\Omega P_s(\cos \beta) \hat{R}(\Omega),\\ {\cal L}_K&=\frac{1}{N_s}\sum_{{\boldsymbol R}}e^{i {\boldsymbol K} \cdot{\boldsymbol R} } \hat{T}_{\boldsymbol R},\\ {\cal L}_P&=\sum_{\alpha}p_{\alpha} \hat{G}_{\alpha},\end{aligned} @@ -122,6 +123,12 @@ listed in parentheses correspond to the file made by vmcdry.out. :math:`\alpha_{4nt}^{d(h)}` in :math:`{\cal P}_{d-h}^{(4)}` to be optimized. + **GeneralRBM_PhysLayer**: Set the target variational parameters :math:`a_{i\sigma}` in the RBM correlation factor :math:`{\cal N}_{\rm General RBM}`. + + **GeneralRBM_HiddenLayer**: Set the target variational parameters :math:`h_{k}` in the RBM correlation factor :math:`{\cal N}_{\rm General RBM}`. + + **GeneralRBM_PhysHidden**: Set the target variational parameters :math:`W_{i\sigma k}` in the RBM correlation factor :math:`{\cal N}_{\rm General RBM}`. + **Orbital/OrbitalAntiParallel (orbitalidx.def)**: Set the pair orbital with anti-parallel spins :math:`f_{i\uparrow j\downarrow}` in :math:`|\phi_{\rm pair} \rangle` to be optimized. @@ -155,6 +162,12 @@ listed in parentheses correspond to the file made by vmcdry.out. **InDH4**: Set the initial values of :math:`\alpha_{4nt}^{d(h)}` in :math:`{\cal P}_{d-h}^{(4)}`. + + **InGeneralRBM_PhysLayer**: Set the initial values of :math:`a_{i\sigma}` in the RBM correlation factor :math:`{\cal N}_{\rm General RBM}`. + + **InGeneralRBM_HiddenLayer**: Set the initial values of :math:`h_{k}` in the RBM correlation factor :math:`{\cal N}_{\rm General RBM}`. + + **InGeneralRBM_PhysHidden**: Set the initial values of :math:`W_{i\sigma k}` in the RBM correlation factor :math:`{\cal N}_{\rm General RBM}`. **InOrbital /InOrbitalAntiParallel**: Set the initial values of :math:`f_{i\uparrow j\downarrow}` in @@ -246,6 +259,10 @@ Gutzwiller Gutzwiller factors. Jastrow Charge Jastrow factors. DH2 2-site doublon-holon correlation factors. DH4 4-site doublon-holon correlation factors. +GeneralRBM_PhysLayer A part of the general RBM correlation factor including variational parameters in a physical layer :math:`\alpha_{i\sigma}`. + + GeneralRBM_HiddenLayer A part of the general RBM correlation factor including variational parameters in a hidden layer :math:`\h_{k}`. + GeneralRBM_PhysHidden A part of the general RBM correlation factor including variational parameters which connect physical and hidden layers :math:`\W_{i\sigma k}`. Orbital :math:`^*` Pair orbital factors with anti-parallel spins :math:`f_{i\uparrow j\downarrow}`. OrbitalAntiParallel Pair orbital factors with anti-parallel spins :math:`f_{i\uparrow j\downarrow}`. OrbitalParallel Pair orbital factors with parallel spins :math:`f_{i\sigma j\sigma}`. @@ -255,6 +272,9 @@ InGutzwiller Initial values of Gutzwiller factors. InJastrow Initial values of charge Jastrow factors. InDH2 Initial values of 2-site doublon-holon correlation factors. InDH4 Initial values of 4-site doublon-holon correlation factors. + InGeneralRBM_PhysLayer Initial values of variational parameters of the general RBM correlation factors in a physical layer :math:`\alpha_{i\sigma}`. + InGeneralRBM_HiddenLayer Initial values of variational parameters of the general RBM correlation factors in a hidden layer :math:`\h_{k}`. + InGeneralRBM_PhysHidden Initial values of variational parameters of the general RBM correlation factors which connect physical and hidden layers :math:`\W_{i\sigma k}`. InOrbital Initial values of pair orbital factors :math:`f_{i\uparrow j\downarrow}`. InOrbitalAntiParallel Initial values of pair orbital factors :math:`f_{i\uparrow j\downarrow}`. InOrbitalParallel Initial values of pair orbital factors :math:`f_{i\sigma j\sigma}`. @@ -1827,6 +1847,407 @@ User rules - A program is terminated, when [ int02 ] - [ int10 ] are out of range from the defined values. + +GeneralRBM_PhysLayer file +~~~~~~~~ +In the general RBM correlation factors, + +.. math:: + + {\cal N}_{\rm General RBM}= \exp \left[ \sum_i a_{i\sigma} n_{i\sigma} \right] \prod_k^{N_{\rm neuronGeneral}} \cosh \left[ b_k + \sum_{i\sigma} W_{i\sigma k} n_{i\sigma} \right] + + +this file sets the calculation conditions of :math:`\exp \left[ \sum_i a_{i\sigma} n_{i\sigma} \right] ` . +A site index :math:`i`, a spin index :math:`\sigma` and the variational parameters +:math:`a_{i \sigma}` are specified. An example of the file format is shown as +follows. + +:: + + -------------------- + NRBM_PhysLayerIdx 1 + ComplexType 1 + i s RBM_PhysLayer_Idx + -------------------- + 0 0 0 + 0 1 0 + 1 0 0 + 1 1 0 + (continue...) + 0 1 + +File format +^^^^^^^^^^^ + +In the following, we define the total number of sites as :math:`N_s` and +variational parameters as :math:`N_{v}`, respectively. + +- Line 1: Header + +- Line 2: [string01] [int01] + +- Line 3: [string02] [int02] + +- Lines 4 - 5: Header + +- Lines 6 - (5+ :math:`2N_s`): [int03] [int04] [int05] + +- Lines (6+ :math:`2N_s` ) - + (5+ :math:`2N_s` + :math:`N_v`): [int06] [int07] + +Parameters +^^^^^^^^^^ + +- [ string01 ] + + **Type :** string-type (blank parameter not allowed) + + **Description :** A keyword for total number of variational + parameters :math:`a_{i\sigma}`. You can freely give a name of the keyword. + +- [ int01 ] + + **Type :** int-type (blank parameter not allowed) + + **Description :** An integer giving total number of variational + parameters :math:`a_{i\sigma}`. + +- [ string02 ] + + **Type :** string-type (blank parameter not allowed) + + **Description :** A keyword for indicating the double or complex type + of variational parameters :math:`a_{i\sigma}`. You can freely give a name + of the keyword. + +- [ int02 ] + + **Type :** int-type (blank parameter not allowed) + + **Description :** An integer indicates the double or complex type of + variational parameters :math:`a_{i\sigma}` (0: double, 1: complex). + +- [ int03 ] + + **Type :** int-type (blank parameter not allowed) + + **Description :** An integer giving a site index + (0 :math:`\leq` [ int03 ] :math:`<` ``Nsite``). + +- [ int04 ] + + **Type :** int-type (blank parameter not allowed) + + **Description :** An integer giving a spin index + ([int04] = 0 or 1). + +- [ int05 ] + + **Type :** int-type (blank parameter not allowed) + + **Description :** An integer setting kinds of variational parameters + :math:`v_{ij}` (0 :math:`\leq` [ int05 ] :math:`<` [ int01]). + +- [ int06 ] + + **Type :** int-type (blank parameter not allowed) + + **Description :** An integer giving kinds of variational parameters + (0 :math:`\leq` [ int06 ] :math:`<` [ int01]). + +- [ int07 ] + + **Type :** int-type (blank parameter not allowed) + + **Description :** An integer to select the target of variational + parameters indicated at [int06] to be optimized or not (0: not + optimize, 1: optimize). + +User rules +^^^^^^^^^^ + +- This function is a beta version. Please use it carefully. The file format and the implementation may be changed in the future release. + +- This function is available only for the VMC calculation with ``ComplexType=1`` and ``Orbital``. This function is not available for the Power Lanczos calculations. + +- Headers cannot be omitted. + +- A program is terminated, when [ int01 ] is + different from the total number of variational parameters defined in + this file. + +- A program is terminated, when [ int02 ] - + [ int07 ] are out of range from the defined values. + + +GeneralRBM_HiddenLayer file +~~~~~~~~ +In the general RBM correlation factors, + +.. math:: + + {\cal N}_{\rm General RBM}= \exp \left[ \sum_i a_{i\sigma} n_{i\sigma} \right] \prod_k^{N_{\rm neuronGeneral}} \cosh \left[ b_k + \sum_{i\sigma} W_{i\sigma k} n_{i\sigma} \right] + + +this file sets the calculation conditions of :math:`b_k` in :math:`\prod_k^{N_{\rm neuronGeneral}} \cosh \left[ b_k + \sum_{i\sigma} W_{i\sigma k} n_{i\sigma} \right] `. +A hidden neuron index :math:`k` and the variational parameters +:math:`h_{k}` are specified. An example of the file format is shown as +follows. + +:: + + -------------------- + NRBM_HiddenLayerIdx 2 + ComplexType 1 + k RBM_HiddenLayer_Idx + -------------------- + 0 0 + 1 0 + 2 0 + 3 0 + (continue...) + 0 1 + 1 1 + +File format +^^^^^^^^^^^ + +In the following, we define the total number of neurons as :math:`N_{\rm neuronGeneral}` and +variational parameters as :math:`N_{v}`, respectively. + +- Line 1: Header + +- Line 2: [string01] [int01] + +- Line 3: [string02] [int02] + +- Lines 4 - 5: Header + +- Lines 6 - (5+:math:`N_{\rm neuronGeneral}`): [int03] [int04] + +- Lines (6+ :math:`N_{\rm neuronGeneral}` ) - + (5+ :math:`N_{\rm neuronGeneral}` + :math:`N_v`): [int05] [int06] + +Parameters +^^^^^^^^^^ + +- [ string01 ] + + **Type :** string-type (blank parameter not allowed) + + **Description :** A keyword for total number of variational + parameters :math:`h_{k}`. You can freely give a name of the keyword. + +- [ int01 ] + + **Type :** int-type (blank parameter not allowed) + + **Description :** An integer giving total number of variational + parameters :math:`h_{k}`. + +- [ string02 ] + + **Type :** string-type (blank parameter not allowed) + + **Description :** A keyword for indicating the double or complex type + of variational parameters :math:`h_{k}`. You can freely give a name + of the keyword. + +- [ int02 ] + + **Type :** int-type (blank parameter not allowed) + + **Description :** An integer indicates the double or complex type of + variational parameters :math:`h_{k}` (0: double, 1: complex). + +- [ int03 ] + + **Type :** int-type (blank parameter not allowed) + + **Description :** An integer giving a neuron index + (0 :math:`\leq` [ int03 ] :math:`<` ``NneuronGeneral``). + +- [ int04 ] + + **Type :** int-type (blank parameter not allowed) + + **Description :** An integer setting kinds of variational parameters + :math:`h_{k}` (0 :math:`\leq` [ int05 ] :math:`<` [ int01]). + +- [ int05 ] + + **Type :** int-type (blank parameter not allowed) + + **Description :** An integer giving kinds of variational parameters + (0 :math:`\leq` [ int06 ] :math:`<` [ int01]). + +- [ int06 ] + + **Type :** int-type (blank parameter not allowed) + + **Description :** An integer to select the target of variational + parameters indicated at [int06] to be optimized or not (0: not + optimize, 1: optimize). + +User rules +^^^^^^^^^^ + +- This function is a beta version. Please use it carefully. The file format and the implementation may be changed in the future release. + +- This function is available only for the VMC calculation with ``ComplexType=1`` and ``Orbital``. This function is not available for the Power Lanczos calculations. + +- Headers cannot be omitted. + +- A program is terminated, when [ int01 ] is + different from the total number of variational parameters defined in + this file. + +- A program is terminated, when [ int02 ] - + [ int06 ] are out of range from the defined values. + + +GeneralRBM_PhysHidden file +~~~~~~~~ +In the general RBM correlation factors, + +.. math:: + + {\cal N}_{\rm General RBM}= \exp \left[ \sum_i a_{i\sigma} n_{i\sigma} \right] \prod_k^{N_{\rm neuronGeneral}} \cosh \left[ b_k + \sum_{i\sigma} W_{i\sigma k} n_{i\sigma} \right] + + +this file sets the calculation conditions of :math:`W_{i\sigma k}` in :math:`\prod_k^{N_{\rm neuronGeneral}} \cosh \left[ b_k + \sum_{i\sigma} W_{i\sigma k} n_{i\sigma} \right] `. +A site index :math:`i`, a spin index :math:`\sigma`, a hidden neuron index :math:`k` and the variational parameters +:math:`W_{i\sigma k}` are specified. An example of the file format is shown as +follows. + +:: + + -------------------- + NRBM_HiddenLayerIdx 32 + ComplexType 1 + i s k RBM_PhysHidden_Idx + -------------------- + 0 0 0 0 + 0 1 0 1 + 1 0 0 2 + 1 1 0 3 + 2 0 0 4 + 2 1 0 5 + (continue...) + 0 1 + 1 1 + (continue...) + +File format +^^^^^^^^^^^ + +In the following, we define the total number of sites as :math:`N_s`, the total number of neurons as :math:`N_{\rm neuronGeneral}` and +variational parameters as :math:`N_{v}`. + +- Line 1: Header + +- Line 2: [string01] [int01] + +- Line 3: [string02] [int02] + +- Lines 4 - 5: Header + +- Lines 6 - (5+:math:`2 N_s N_{\rm neuronGeneral}`): [int03] [int04] [int05] [int06] + +- Lines (6+ :math:`2 N_s N_{\rm neuronGeneral}` ) - + (5+ :math:`2 N_s N_{\rm neuronGeneral}` + :math:`N_v`): [int07] [int08] + +Parameters +^^^^^^^^^^ + +- [ string01 ] + + **Type :** string-type (blank parameter not allowed) + + **Description :** A keyword for total number of variational + parameters :math:`W_{i \sigma k}`. You can freely give a name of the keyword. + +- [ int01 ] + + **Type :** int-type (blank parameter not allowed) + + **Description :** An integer giving total number of variational + parameters :math:`W_{i \sigma k}`. + +- [ string02 ] + + **Type :** string-type (blank parameter not allowed) + + **Description :** A keyword for indicating the double or complex type + of variational parameters :math:`W_{i \sigma k}`. You can freely give a name + of the keyword. + +- [ int02 ] + + **Type :** int-type (blank parameter not allowed) + + **Description :** An integer indicates the double or complex type of + variational parameters :math:`W_{i \sigma k}` (0: double, 1: complex). + +- [ int03 ] + + **Type :** int-type (blank parameter not allowed) + + **Description :** An integer giving a site index + (0 :math:`\leq` [ int03 ] :math:`<` ``Nsite``). + +- [ int04 ] + + **Type :** int-type (blank parameter not allowed) + + **Description :** An integer giving a spin index + ([ int03 ] = 0 or 1 ). + +- [ int05 ] + + **Type :** int-type (blank parameter not allowed) + + **Description :** An integer giving a neuron index + (0 :math:`\leq` [ int03 ] :math:`<` ``NneuronGeneral``). + +- [ int06 ] + + **Type :** int-type (blank parameter not allowed) + + **Description :** An integer setting kinds of variational parameters + :math:`W_{i \sigma k}` (0 :math:`\leq` [ int05 ] :math:`<` [ int01]). + +- [ int07 ] + + **Type :** int-type (blank parameter not allowed) + + **Description :** An integer giving kinds of variational parameters + (0 :math:`\leq` [ int06 ] :math:`<` [ int01]). + +- [ int08 ] + + **Type :** int-type (blank parameter not allowed) + + **Description :** An integer to select the target of variational + parameters indicated at [int06] to be optimized or not (0: not + optimize, 1: optimize). + +User rules +^^^^^^^^^^ + +- This function is a beta version. Please use it carefully. The file format and the implementation may be changed in the future release. + +- This function is available only for the VMC calculation with ``ComplexType=1`` and ``Orbital``. This function is not available for the Power Lanczos calculations. + +- Headers cannot be omitted. + +- A program is terminated, when [ int01 ] is + different from the total number of variational parameters defined in + this file. + +- A program is terminated, when [ int02 ] - + [ int06 ] are out of range from the defined values. + Orbital/OrbitalAntiParallel file (orbitalidx.def) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -2374,7 +2795,7 @@ Files to set initial values of variational parameters This file sets the initial values of variational parameters. The kinds of variational parameters are specified by setting the following keywords in ``List`` file (namelist.def): -``InGutzwiller``, ``InJastrow``, ``InDH2``, ``InDH4``, ``InOrbital``, +``InGutzwiller``, ``InJastrow``, ``InDH2``, ``InDH4``, ``InGeneralRBM_PhysLayer``, ``InGeneralRBM_HiddenLayer``, ``InGeneralRBM_PhysHidden``, ``InOrbital``, ``InOrbitalAntiParallel``, ``InOrbitalParallel``, ``InOrbitalGeneral``. The file format is common and an example of the ``InJastrow`` file is diff --git a/doc/en/source/intro.rst b/doc/en/source/intro.rst index a36dd676..68d2631c 100644 --- a/doc/en/source/intro.rst +++ b/doc/en/source/intro.rst @@ -15,7 +15,7 @@ the low-energy effective models. One of the most reliable theoretical tools for treating the strongly correlated electron systems is the exact diagonalization method. However, applicable range of system size is strongly limited in the exact diagonalization method. Variational Monte -Carlo method [Gros_ ] is one of the promising ways to perform +Carlo method [Gros_ ] is one of promising way to perform the high-accuracy calculations for the larger system sizes beyond exact diagonalization method. Although the strong limitation of the variational wave function is the origin of the poor accuracy of the diff --git a/doc/en/source/output.rst b/doc/en/source/output.rst index 571fff72..743a277d 100644 --- a/doc/en/source/output.rst +++ b/doc/en/source/output.rst @@ -14,33 +14,39 @@ where both ``NDataIdxStart`` and ``NDataQtySmp`` are defined in ``ModPara`` file and zzz is a number given by ``NDataIdxStart`` in ``ModPara``. -+--------------------------------------+---------------------------------------------------------------+ -| Name | Details for corresponding files | -+======================================+===============================================================+ -| \*\*\*\_opt.dat | All optimized parameters. | -+--------------------------------------+---------------------------------------------------------------+ -| \*\*\*\_gutzwiller\_opt.dat | Optimized gutzwiller factors. | -+--------------------------------------+---------------------------------------------------------------+ -| \*\*\*\_jastrow\_opt.dat | Optimized jastrow factors. | -+--------------------------------------+---------------------------------------------------------------+ -| \*\*\*\_doublonHolon2site\_opt.dat | Optimized 2-site doublon-holon correlation factors. | -+--------------------------------------+---------------------------------------------------------------+ -| \*\*\*\_doublonHolon4site\_opt.dat | Optimized 4-site doublon-holon correlation factors. | -+--------------------------------------+---------------------------------------------------------------+ -| \*\*\*\_orbital\_opt.dat | Optimized pair orbital factors. | -+--------------------------------------+---------------------------------------------------------------+ -| xxx\_out\_yyy.dat | Energy and deviation. | -+--------------------------------------+---------------------------------------------------------------+ -| xxx\_var\_yyy.dat | Progress information for optimizing variational parameters. | -+--------------------------------------+---------------------------------------------------------------+ -| xxx\_CalcTimer.dat | Computation time for each processes. | -+--------------------------------------+---------------------------------------------------------------+ -| xxx\_time\_zzz.dat | Progress information for MonteCalro samplings. | -+--------------------------------------+---------------------------------------------------------------+ -| xxx\_cisajs\_yyy.dat | One body Green’s functions. | -+--------------------------------------+---------------------------------------------------------------+ -| xxx\_cisajscktalt\_yyy.dat | Correlation functions. | -+--------------------------------------+---------------------------------------------------------------+ ++------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ +| Name | Details for corresponding files | ++==========================================+========================================================================================================================+ +| \*\*\*\_opt.dat | All optimized parameters. | ++------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ +| \*\*\*\_gutzwiller\_opt.dat | Optimized gutzwiller factors. | ++------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ +| \*\*\*\_jastrow\_opt.dat | Optimized jastrow factors. | ++------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ +| \*\*\*\_doublonHolon2site\_opt.dat | Optimized 2-site doublon-holon correlation factors. | ++------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ +| \*\*\*\_doublonHolon4site\_opt.dat | Optimized 4-site doublon-holon correlation factors. | ++------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ +| \*\*\*\_generalRBM\_physlayer\_opt.dat | Optimized variational parameters of the general RBM correlation factors only in a physical layer. | ++------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ +| \*\*\*\_generalRBM\_hiddenlayer\_opt.dat | Optimized variational parameters of the general RBM correlation factors only in a hidden layer. | ++------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ +| \*\*\*\_orbital\_opt.dat | Optimized variational parameters of the general RBM correlation factors which connect physical and hidden layers. | ++------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ +| \*\*\*\_orbital\_opt.dat | Optimized pair orbital factors. | ++------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ +| xxx\_out\_yyy.dat | Energy and deviation. | ++------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ +| xxx\_var\_yyy.dat | Progress information for optimizing variational parameters. | ++------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ +| xxx\_CalcTimer.dat | Computation time for each processes. | ++------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ +| xxx\_time\_zzz.dat | Progress information for Monte Carlo samplings. | ++------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ +| xxx\_cisajs\_yyy.dat | One body Green’s functions. | ++------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ +| xxx\_cisajscktalt\_yyy.dat | Correlation functions. | ++------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ Output file for variational parameters (\*\*\*\_opt.dat) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -56,11 +62,11 @@ energy optimized by the SR method are outputted in the following order: The type of average values is a complex number, while that of the deviation is a real number. Since the initial values of all variational parameters are specified at the beginning of the calculation, the -calculation of physical quantities is done by using this file. +calculation of physical quantities is done by using this file file. Here, \*\*\* is the header indicated by ``CParaFileHead`` in ``ModPara`` file. -Output files for variational parameters at each step (xxx\_var\_yyy.dat) +Output files for variational parameters at each steps (xxx\_var\_yyy.dat) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The average and deviation values of variational parameters and the @@ -100,6 +106,13 @@ The optimized 4-site doublon-holon correlation factors by SR method are outputted. The file format is same as the ``InDH4`` file defined in Sec. :ref:`InputParam`. +Output files for general RBM factors(\*\*\*\_generalRBM\_physlayer\_opt.dat, \*\*\*\_generalRBM\_hiddenlayer\_opt.dat, \*\*\*\_generalRBM\_physhidden\_opt.dat) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The optimized general RBM correlation factors by SR method are outputted. +The file format is same as the ``InGeneralRBM_PhysLayer``, ``InGeneralRBM_HiddenLayer`` and ``InGeneralRBM_PhysHidden`` files defined in Sec. +:ref:`InputParam`. + Output file for pair orbitals (\*\*\*\_orbital\_opt.dat) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -138,9 +151,9 @@ where both ``NDataIdxStart`` and ``NDataQtySmp`` are defined in xxx\_CalcTimer.dat ~~~~~~~~~~~~~~~~~~~ -After finishing the calculation, the processing time is outputted in the -order of the name, the number assigned by the process, and the seconds at -each process. An example of outputted file is shown as follows. +After finishing calculation, the processing time is outputted in the +order of the name, the number assigned by the process and the seconds at +each processes. An example of outputted file is shown as follows. :: @@ -160,7 +173,7 @@ xxx\_time\_zzz.dat The calculation information at each bins are outputted in the order of the sampling number, the acceptance ratio for hopping and exchange term (acc\_hopp, acc\_ex), trial numbers to update for hopping and exchange -term (n\_hopp, n\_ex), and the time stamp. Here, xxx is the header +term (n\_hopp, n\_ex) and the time stamp. Here, xxx is the header indicated by ``CDataFileHead`` in ``ModPara`` file and zzz is a number given by ``NDataIdxStart`` in ``ModPara``. An example of outputted file is shown as follows. diff --git a/doc/en/source/standard.rst b/doc/en/source/standard.rst index 64fa0d01..a47072cb 100644 --- a/doc/en/source/standard.rst +++ b/doc/en/source/standard.rst @@ -42,7 +42,7 @@ An example of input file for the standard mode is shown below: 1. Parameters that must be specified (if not, ``vmcdry.out`` will stop with error messages), - 2. Parameters that are not necessary be specified (if not, default + 2. Parameters that is not necessary be specified (if not, default values are used), 3. Parameters that must not be specified (if specified, @@ -52,7 +52,7 @@ An example of input file for the standard mode is shown below: system. If you choose "model=spin", you should not specify ":math:`t`". -We explain each keyword as follows: +We explain each keywords as follows: Parameters about the kind of a calculation ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -110,7 +110,7 @@ Parameters about the kind of a calculation [Eqn. :eq:`hubbard` ], the :math:`S_z`-unconserved Spin model [Eqn. :eq:`spin` ], and the :math:`S_z`-unconserved Kondo lattice model [Eqn. :eq:`kondo` ], respectively. Note: Although - these flags have a word "GC"(=grandcanonical), the number of electrons + these flags has a word "GC"(=grandcanonical), the number of electrons are conserved in these system. - ``lattice`` @@ -232,11 +232,11 @@ using the following two methods. **Type :** Integer **Description :** We can specify two vectors - (:math:`{\vec a}_0, {\vec a}_1`) that surround the numerical cell + (:math:`{\vec a}_0, {\vec a}_1`) that surrounds the numerical cell (Fig. :num:`unitlatticepng` ). These vectors should be specified in the Fractional coordinate. -If we use both of these methods, ``vmcdry.out`` stops. +If we use both of these method, ``vmcdry.out`` stops. We can check the shape of the numerical cell by using a file ``lattice.gp`` (only for square, trianguler, honeycomb, and kagome diff --git a/doc/en/source/start.rst b/doc/en/source/start.rst index a304b6f3..1ac589bc 100644 --- a/doc/en/source/start.rst +++ b/doc/en/source/start.rst @@ -268,7 +268,7 @@ We can calculate by using these modes as follows: #. Run - Run an executable ``vmc.out`` in terminal by specifying the name of + Run a executable ``vmc.out`` in terminal by specifying the name of input file written in previous step (option ``-s`` is required). .. code-block:: bash @@ -296,7 +296,7 @@ We can calculate by using these modes as follows: In the above case, the calculation starts as soon as input files for Expert mode are generated. If we only generate files without starting - the calculation, we can use an executable ``vmcdry.out`` as follows + the calculation, we can use a executable ``vmcdry.out`` as follows (MPI is not used in this step): .. code-block:: bash diff --git a/doc/en/source/tutorial.rst b/doc/en/source/tutorial.rst index 3922e84f..3b2e1aa3 100644 --- a/doc/en/source/tutorial.rst +++ b/doc/en/source/tutorial.rst @@ -267,7 +267,7 @@ The details of these outputted files are shown in :ref:`OutputFile`. Output results ^^^^^^^^^^^^^^ -After finishing the calculation normally, the files for the energy, the +After finishing calculation normally, the files for the energy, the deviation, the optimized variational parameters and the time of execution for each calculation steps are outputted in ``output/`` directory. In the following, the outputted files are shown diff --git a/doc/en/source/wannier/format.rst b/doc/en/source/wannier/format.rst index 5781980c..22a69992 100644 --- a/doc/en/source/wannier/format.rst +++ b/doc/en/source/wannier/format.rst @@ -27,9 +27,9 @@ By editing this file, we can modify the number of orbitals treated in HPhi/mVMC. * Line 4 - The number of orbitals per unit cell treated by mVMC/HPhi. + The number of orbitals par unit cell treated by mVMC/HPhi. When we reduce the number by editing this file, - the model includes the same number of orbitals from the top. + the model including the same number of orbitals from the top. * Line 5 - end diff --git a/doc/en/source/wannier/tutorial.rst b/doc/en/source/wannier/tutorial.rst index bb028e90..e7829060 100644 --- a/doc/en/source/wannier/tutorial.rst +++ b/doc/en/source/wannier/tutorial.rst @@ -10,7 +10,7 @@ We use QuantumESPRESSO for the DFT calculation. Input files are served in ``samples/Wannier/Sr2CuO3`` directory. -In actual studies, the input files, etc. of each solver should be modified for more high accuracy calculation. +In actual studies, the input files etc. of each solver should be modified for more high accuracy calculation. Please refer to the manuals of each solver for the details of the input files. SCF calculation of charge density @@ -107,9 +107,9 @@ Quantum lattice mode for HPhi/mVMC ---------------------------------- Using standard mode of HPhi/mVMC, the calculation will be done by reading the files in ``dir-model`` folder. -First, the files in ``dir-model`` directory should be moved to the current directory. +First, the files in ``dir-model`` directory should be moved to the current directry. Then, the calculation will be started by using standard mode. -For example, in HPhi, the calculation will be done by typing the following command: +For example, in HPhi, the calculation will be dobe by typing the following command: :download:`stan.in <../../../../samples/Wannier/Sr2CuO3/stan.in>` diff --git a/doc/ja/source/expert.rst b/doc/ja/source/expert.rst index a7262773..24c23b38 100644 --- a/doc/ja/source/expert.rst +++ b/doc/ja/source/expert.rst @@ -74,11 +74,12 @@ .. math:: \begin{aligned} - |\psi \rangle &= {\cal P}_G{\cal P}_J{\cal P}_{d-h}^{(2)}{\cal P}_{d-h}^{(4)}{\cal L}^S{\cal L}^K{\cal L}^P |\phi_{\rm pair} \rangle,\\ + |\psi \rangle &= {\cal N}_{General RBM} {\cal P}_G{\cal P}_J{\cal P}_{d-h}^{(2)}{\cal P}_{d-h}^{(4)}{\cal L}^S{\cal L}^K{\cal L}^P |\phi_{\rm pair} \rangle,\\ {\cal P}_G&=\exp\left[ \sum_i g_i n_{i\uparrow} n_{i\downarrow} \right],\\ {\cal P}_J&=\exp\left[\frac{1}{2} \sum_{i\neq j} v_{ij} (n_i-1)(n_j-1)\right],\\ {\cal P}_{d-h}^{(2)}&= \exp \left[ \sum_t \sum_{n=0}^2 (\alpha_{2nt}^d \sum_{i}\xi_{i2nt}^d+\alpha_{2nt}^h \sum_{i}\xi_{i2nt}^h)\right],\\ {\cal P}_{d-h}^{(4)}&= \exp \left[ \sum_t \sum_{n=0}^4 (\alpha_{4nt}^d \sum_{i}\xi_{i4nt}^d+\alpha_{4nt}^h \sum_{i}\xi_{i4nt}^h)\right],\\ + {\cal N}_{\rm General RBM}&= \exp \left[ \sum_i a_{i\sigma} n_{i\sigma} \right] \prod_k^{N_h} \cosh \left[ b_k + \sum_{i\sigma} W_{i\sigma k} n_{i\sigma} \right],\\ {\cal L}_S&=\frac{2S+1}{8 \pi^2}\int d\Omega P_s(\cos \beta) \hat{R}(\Omega),\\ {\cal L}_K&=\frac{1}{N_s}\sum_{{\boldsymbol R}}e^{i {\boldsymbol K} \cdot{\boldsymbol R} } \hat{T}_{\boldsymbol R},\\ {\cal L}_P&=\sum_{\alpha}p_{\alpha} \hat{G}_{\alpha}, @@ -118,6 +119,15 @@ **DH4**: :math:`{\cal P}_{d-h}^{(4)}` で表される4サイトのダブロン・ホロン相関因子を指定します。 + + **GeneralRBM_PhysLayer**: + :math:`{\cal N}_{\rm General RBM}` で表されるRBM相関因子のうち、最適化の対象とする変分パラメータ :math:`a_{i\sigma}` を指定します。 + + **GeneralRBM_HiddenLayer**: + :math:`{\cal N}_{\rm General RBM}` で表されるRBM相関因子のうち、最適化の対象とする変分パラメータ :math:`h_{k}` を指定します。 + + **GeneralRBM_PhysHidden**: + :math:`{\cal N}_{\rm General RBM}` で表されるRBM相関因子のうち、最適化の対象とする変分パラメータ :math:`W_{i\sigma k}` を指定します。 **Orbital/OrbitalAntiParallel (orbitalidx.def)**: スピンが反平行のペア軌道 :math:`|\phi_{\rm pair} \rangle` を設定します。 @@ -149,6 +159,15 @@ **InDH4**: :math:`{\cal P}_{d-h}^{(4)}` 内の4サイトのダブロン・ホロン相関因子 :math:`\alpha_{4nt}^{d(h)}` の初期値を設定します。 + + **InGeneralRBM_PhysLayer**: + :math:`{\cal N}_{\rm General RBM}` で表されるRBM相関因子のうち、最適化の対象とする変分パラメータ :math:`a_{i\sigma}` の初期値を設定します。 + + **InGeneralRBM_HiddenLayer**: + :math:`{\cal N}_{\rm General RBM}` で表されるRBM相関因子のうち、最適化の対象とする変分パラメータ :math:`h_{k}` の初期値を設定します。 + + **InGeneralRBM_PhysHidden**: + :math:`{\cal N}_{\rm General RBM}` で表されるRBM相関因子のうち、最適化の対象とする変分パラメータ :math:`W_{i\sigma k}` の初期値を設定します。 **InOrbital/InOrbitalAntiParallel**: ペア軌道 :math:`|\phi_{\rm pair} \rangle` の :math:`f_{i\uparrow j\downarrow}` @@ -239,7 +258,10 @@ Gutzwiller 最適化するGutzwiller因子を設定します。 Jastrow 最適化する電荷Jastrow因子を指定します。 DH2 最適化する2サイトダブロン・ホロン相関因子を指定します。 - DH4 最適化する4サイトダブロン・ホロン相関因子を指定します。 + DH4 最適化する4サイトダブロン・ホロン相関因子を指定します。 + GeneralRBM_PhysLayer 一般的なRBM相関因子のうち、最適化する物理層での変分パラメータを指定します。 + GeneralRBM_HiddenLayer 一般的なRBM相関因子のうち、最適化する隠れ層での変分パラメータを指定します。 + GeneralRBM_PhysHidden 一般的なRBM相関因子のうち、最適化する物理層と隠れ層を繋ぐ変分パラメータを指定します。 Orbital :math:`^*` 反平行のスピンを持つペア軌道因子を指定します。 OrbitalAntiParallel 反平行のスピンを持つペア軌道因子を指定します。 OrbitalParallel 平行のスピンを持つペア軌道因子を指定します。 @@ -248,7 +270,10 @@ InGutzwiller Gutzwiller因子の初期値を設定します。 InJastrow 電荷Jastrow因子の初期値を設定します。 InDH2 2サイトダブロン・ホロン相関因子の初期値を設定します。 - InDH4 4サイトダブロン・ホロン相関因子の初期値を設定します。 + InDH4 4サイトダブロン・ホロン相関因子の初期値を設定します。 + InGeneralRBM_PhysLayer 一般的なRBM相関因子のうち、最適化する物理層での変分パラメータの初期値を設定します。 + InGeneralRBM_HiddenLayer 一般的なRBM相関因子のうち、最適化する隠れ層での変分パラメータの初期値を設定します。 + InGeneralRBM_PhysHidden 一般的なRBM相関因子のうち、最適化する物理層と隠れ層を繋ぐ変分パラメータの初期値を設定します。 InOrbital ペア軌道因子 :math:`f_{i\uparrow j\downarrow}` の初期値を設定します。 InOrbitalAntiParallel ペア軌道因子 :math:`f_{i\uparrow j\downarrow}` の初期値を設定します。 InOrbitalParallel ペア軌道因子 :math:`f_{i\sigma j\sigma}` の初期値を設定します。 @@ -294,7 +319,8 @@ ModParaファイル (modpara.def) NExUpdatePath 0 RndSeed 11272 NSplitSize 1 - NStore 1 + NStore 1 + NneuronGeneral 32 ファイル形式 ^^^^^^^^^^^^ @@ -552,6 +578,12 @@ ModParaファイル (modpara.def) を陽に構築せずに解くことでメモリを削減する [4]_ オプション[NeuscammanUmrigarChan_ ](1で機能On, ``NStore`` は1に固定されます)。 +- ``NneuronGeneral`` + + **形式 :** int型 (デフォルト値=0) + + **説明 :** RBMの隠れ層にあるニューロン数 :math:`N_{\rm General RBM}`を指定する整数。 + LocSpin指定ファイル(locspn.def) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -1757,6 +1789,383 @@ DH4指定ファイル - [ int02 ]-[ int10 ] を指定する際、範囲外の整数を指定した場合はエラー終了します。 +GeneralRBM_PhysLayer指定ファイル +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +RBM因子 + +.. math:: + + {\cal N}_{\rm General RBM}= \exp \left[ \sum_i a_{i\sigma} n_{i\sigma} \right] \prod_k^{N_{\rm neuronGeneral}} \cosh \left[ b_k + \sum_{i\sigma} W_{i\sigma k} n_{i\sigma} \right] + +のうち、 :math:`\exp \left[ \sum_i a_{i\sigma} n_{i\sigma} \right] ` の設定を行います。指定するパラメータはサイト番号 :math:`i`、スピン番号 :math:`\sigma`、および :math:`a_{i \sigma}` の変分パラメータの番号です。以下にファイル例を記載します。 + +:: + + -------------------- + NRBM_PhysLayerIdx 1 + ComplexType 1 + i s RBM_PhysLayer_Idx + -------------------- + 0 0 0 + 0 1 0 + 1 0 0 + 1 1 0 + (continue...) + 0 1 + +ファイル形式 +^^^^^^^^^^^^ + +以下のように行数に応じ異なる形式をとります( :math:`N_s` はサイト数、 :math:`N_v` は変分パラメータの種類の数)。 + +- 1行: ヘッダ(何が書かれても問題ありません)。 + +- 2行: [string01] [int01] + +- 3行: [string02] [int02] + +- 4-5行: ヘッダ(何が書かれても問題ありません)。 + +- 6 - (5+ :math:`2N_s`) 行: [int03] [int04] [int05] + +- (6+ :math:`2N_s` ) - + (5+ :math:`2N_s` + :math:`N_v`)行:[int06] [int07] + +パラメータ +^^^^^^^^^^ + +- [ string01 ] + + **形式 :** string型 (空白不可) + + **説明 :** + :math:`a_{i \sigma }` の変分パラメータの種類の総数のキーワード名を指定します(任意)。 + +- [ int01 ] + + **形式 :** int型 (空白不可) + + **説明 :** :math:`a_{i \sigma }` の変分パラメータの種類の総数を指定します。 + +- [ string02 ] + + **形式 :** string型 (空白不可) + + **説明 :** + :math:`a_{i \sigma }` の変分パラメータの型を指定するためのキーワード名を指定します(任意)。 + +- [ int02 ] + + **形式 :** int型 (空白不可) + + **説明 :** + :math:`a_{i \sigma }` の変分パラメータの型を指定します。0が実数、1が複素数に対応します。 + +- [ int03 ] + + **形式 :** int型 (空白不可) + + **説明 :** + サイト番号を指定する整数。0以上 ``Nsite`` 未満で指定します。 + +- [ int04 ] + + **形式 :** int型 (空白不可) + + **説明 :** + スピン番号を指定する整数。0もしくは1で指定します。 + +- [ int05 ] + + **形式 :** int型 (空白不可) + + **説明 :** + :math:`a_{i \sigma }` の変分パラメータの種類を表します。0以上[int01]未満で指定します。 + +- [ int06 ] + + **形式 :** int型 (空白不可) + + **説明 :** + :math:`a_{i \sigma }` の変分パラメータの種類を表します(最適化有無の設定用)。0以上[int01]未満で指定します。 + +- [ int07 ] + + **形式 :** int型 (空白不可) + + **説明 :** + [int06]で指定した :math:`a_{i \sigma }` の変分パラメータの最適化有無を設定します。最適化する場合は1、最適化しない場合は0とします。 + +使用ルール +^^^^^^^^^^ + +本ファイルを使用するにあたってのルールは以下の通りです。 + +- 本機能はベータ版のため、使用には十分注意してください。また、正式リリースした際に、ファイル形式や実装が変更される可能性があります。 + +- 本機能は ``ComplexType=1`` かつ ペア軌道のうち ``Orbital`` のみを指定したVMC計算のみ使用可能です。Power Lanczosの計算には対応していません。 + +- 行数固定で読み込みを行う為、ヘッダの省略はできません。 + +- [ int01 ] と定義されている変分パラメータの種類の総数が異なる場合はエラー終了します。 + +- [ int02 ]-[ int07 ] を指定する際、範囲外の整数を指定した場合はエラー終了します。 + + +GeneralRBM_HiddenLayer指定ファイル +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +RBM因子 + +.. math:: + + {\cal N}_{\rm General RBM}= \exp \left[ \sum_i a_{i\sigma} n_{i\sigma} \right] \prod_k^{N_{\rm neuronGeneral}} \cosh \left[ b_k + \sum_{i\sigma} W_{i\sigma k} n_{i\sigma} \right] + + +のうち、 :math:`\prod_k^{N_{\rm neuronGeneral}} \cosh \left[ b_k + \sum_{i\sigma} W_{i\sigma k} n_{i\sigma} \right] ` の隠れ層のみが関わる箇所の設定を行います。指定するパラメータは隠れニューロンの番号 :math:`k` と :math:`h_{k}` の変分パラメータの番号です。以下にファイル例を記載します。 + +:: + + -------------------- + NRBM_HiddenLayerIdx 2 + ComplexType 1 + k RBM_HiddenLayer_Idx + -------------------- + 0 0 + 1 0 + 2 0 + 3 0 + (continue...) + 0 1 + 1 1 + +ファイル形式 +^^^^^^^^^^^^ + +以下のように行数に応じ異なる形式をとります( :math:`N_{\rm neuronGeneral}` は隠れニューロンの数、 :math:`N_v` は変分パラメータの種類の数)。 + +- 1行: ヘッダ(何が書かれても問題ありません)。 + +- 2行: [string01] [int01] + +- 3行: [string02] [int02] + +- 4-5行: ヘッダ(何が書かれても問題ありません)。 + +- 6 - (5+ :math:`N_{\rm neuronGeneral}`) 行: [int03] [int04] + +- (6+ :math:`N_{\rm neuronGeneral}` ) - + (5+ :math:`N_{\rm neuronGeneral}` + :math:`N_v`)行:[int05] [int06] + +パラメータ +^^^^^^^^^^ + +- [ string01 ] + + **形式 :** string型 (空白不可) + + **説明 :** + :math:`h_{k}` の変分パラメータの種類の総数のキーワード名を指定します(任意)。 + +- [ int01 ] + + **形式 :** int型 (空白不可) + + **説明 :** :math:`h_{k}` の変分パラメータの種類の総数を指定します。 + +- [ string02 ] + + **形式 :** string型 (空白不可) + + **説明 :** + :math:`h_{k}` の変分パラメータの型を指定するためのキーワード名を指定します(任意)。 + +- [ int02 ] + + **形式 :** int型 (空白不可) + + **説明 :** + :math:`h_{k}` の変分パラメータの型を指定します。0が実数、1が複素数に対応します。 + +- [ int03 ] + + **形式 :** int型 (空白不可) + + **説明 :** + サイト番号を指定する整数。0以上 ``NneuronGeneral`` 未満で指定します。 + +- [ int04 ] + + **形式 :** int型 (空白不可) + + **説明 :** + :math:`h_{k}` の変分パラメータの種類を表します。0以上[int01]未満で指定します。 + +- [ int05 ] + + **形式 :** int型 (空白不可) + + **説明 :** + :math:`h_{k}` の変分パラメータの種類を表します(最適化有無の設定用)。0以上[int01]未満で指定します。 + +- [ int06 ] + + **形式 :** int型 (空白不可) + + **説明 :** + [int06]で指定した :math:`h_{k}` の変分パラメータの最適化有無を設定します。最適化する場合は1、最適化しない場合は0とします。 + +使用ルール +^^^^^^^^^^ + +本ファイルを使用するにあたってのルールは以下の通りです。 + +- 本機能はベータ版のため、使用には十分注意してください。また、正式リリースした際に、ファイル形式や実装が変更される可能性があります。 + +- 本機能は ``ComplexType=1`` かつ ペア軌道のうち ``Orbital`` のみを指定したVMC計算のみ使用可能です。Power Lanczosの計算には対応していません。 + +- 行数固定で読み込みを行う為、ヘッダの省略はできません。 + +- [ int01 ] と定義されている変分パラメータの種類の総数が異なる場合はエラー終了します。 + +- [ int02 ]-[ int06 ] を指定する際、範囲外の整数を指定した場合はエラー終了します。 + +GeneralRBM_PhysHidden指定ファイル +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +RBM因子 + +.. math:: + + {\cal N}_{\rm General RBM}= \exp \left[ \sum_i a_{i\sigma} n_{i\sigma} \right] \prod_k^{N_{\rm neuronGeneral}} \cosh \left[ b_k + \sum_{i\sigma} W_{i\sigma k} n_{i\sigma} \right] + + +のうち、 :math:`\prod_k^{N_{\rm neuronGeneral}} \cosh \left[ b_k + \sum_{i\sigma} W_{i\sigma k} n_{i\sigma} \right] ` の隠れ層と物理層どちらも関わる箇所の設定を行います。指定するパラメータはサイト番号、スピン番号、および隠れニューロンの番号 :math:`i \sigma k` と :math:`W_{i \sigma k}` の変分パラメータの番号です。以下にファイル例を記載します。 + +:: + + -------------------- + NRBM_HiddenLayerIdx 32 + ComplexType 1 + i s k RBM_PhysHidden_Idx + -------------------- + 0 0 0 0 + 0 1 0 1 + 1 0 0 2 + 1 1 0 3 + 2 0 0 4 + 2 1 0 5 + (continue...) + 0 1 + 1 1 + (continue...) + +ファイル形式 +^^^^^^^^^^^^ + +以下のように行数に応じ異なる形式をとります( :math:`N_s` はサイト数、:math:`N_{\rm neuronGeneral}` は隠れニューロンの数、 :math:`N_v` は変分パラメータの種類の数)。 + +- 1行: ヘッダ(何が書かれても問題ありません)。 + +- 2行: [string01] [int01] + +- 3行: [string02] [int02] + +- 4-5行: ヘッダ(何が書かれても問題ありません)。 + +- 6 - (5+ :math:`2 N_s N_{\rm neuronGeneral}`) 行: [int03] [int04] [int05] [int06] + +- (6+ :math:`2 N_s N_{\rm neuronGeneral}` ) - + (5+ :math:`2 N_s N_{\rm neuronGeneral}` + :math:`N_v`)行:[int07] [int08] + +パラメータ +^^^^^^^^^^ + +- [ string01 ] + + **形式 :** string型 (空白不可) + + **説明 :** + :math:`W_{i \sigma k}` の変分パラメータの種類の総数のキーワード名を指定します(任意)。 + +- [ int01 ] + + **形式 :** int型 (空白不可) + + **説明 :** :math:`W_{i \sigma k}` の変分パラメータの種類の総数を指定します。 + +- [ string02 ] + + **形式 :** string型 (空白不可) + + **説明 :** + :math:`W_{i \sigma k}` の変分パラメータの型を指定するためのキーワード名を指定します(任意)。 + +- [ int02 ] + + **形式 :** int型 (空白不可) + + **説明 :** + :math:`W_{i \sigma k}` の変分パラメータの型を指定します。0が実数、1が複素数に対応します。 + +- [ int03 ] + + **形式 :** int型 (空白不可) + + **説明 :** + サイト番号を指定する整数。0以上 ``Nsite`` 未満で指定します。 + +- [ int04 ] + + **形式 :** int型 (空白不可) + + **説明 :** + スピン番号を指定する整数。0もしくは1で指定します。 + +- [ int05 ] + + **形式 :** int型 (空白不可) + + **説明 :** + サイト番号を指定する整数。0以上 ``NneuronGeneral`` 未満で指定します。 + +- [ int06 ] + + **形式 :** int型 (空白不可) + + **説明 :** + :math:`W_{i \sigma k}` の変分パラメータの種類を表します。0以上[int01]未満で指定します。 + +- [ int07 ] + + **形式 :** int型 (空白不可) + + **説明 :** + :math:`W_{i \sigma k}` の変分パラメータの種類を表します(最適化有無の設定用)。0以上[int01]未満で指定します。 + +- [ int08 ] + + **形式 :** int型 (空白不可) + + **説明 :** + [int06]で指定した :math:`W_{i \sigma k}` の変分パラメータの最適化有無を設定します。最適化する場合は1、最適化しない場合は0とします。 + +使用ルール +^^^^^^^^^^ + +本ファイルを使用するにあたってのルールは以下の通りです。 + +- 本機能はベータ版のため、使用には十分注意してください。また、正式リリースした際に、ファイル形式や実装が変更される可能性があります。 + +- 本機能は ``ComplexType=1`` かつ ペア軌道のうち ``Orbital`` のみを指定したVMC計算のみ使用可能です。Power Lanczosの計算には対応していません。 + +- 行数固定で読み込みを行う為、ヘッダの省略はできません。 + +- [ int01 ] と定義されている変分パラメータの種類の総数が異なる場合はエラー終了します。 + +- [ int02 ]-[ int08 ] を指定する際、範囲外の整数を指定した場合はエラー終了します。 + Orbital/OrbitalAntiParallel指定ファイル(orbitalidx.def) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -1864,7 +2273,7 @@ Orbital/OrbitalAntiParallel指定ファイル(orbitalidx.def) **形式 :** int型 (空白不可) **説明 :** - [int06]で指定した変分パラメータの最適化有無を設定します。最適化する場合は1、最適化しない場合は0とします。 + [int07]で指定した変分パラメータの最適化有無を設定します。最適化する場合は1、最適化しない場合は0とします。 使用ルール ^^^^^^^^^^ @@ -2234,7 +2643,7 @@ TransSym指定ファイル(qptransidx.def) 各変分パラメータの初期値を設定することが可能です。 変分パラメータの種類は :ref:`InputFileList` において -``InGutzwiller``, ``InJastrow``, ``InDH2``, ``InDH4``, ``InOrbital``, +``InGutzwiller``, ``InJastrow``, ``InDH2``, ``InDH4``, ``InGeneralRBM_PhysLayer``, ``InGeneralRBM_HiddenLayer``, ``InGeneralRBM_PhysHidden``, ``InOrbital``, ``InOrbitalAntiParallel``, ``InOrbitalParallel``, ``InOrbitalGeneral`` をキーワードとして指定することで区別します。なお、ファイルフォーマットは全て共通です。 以下、 ``InJastrow`` ファイルの例を記載します。 @@ -2301,6 +2710,8 @@ TransSym指定ファイル(qptransidx.def) 本ファイルを使用するにあたってのルールは以下の通りです。 +- RBM相関因子のインプット機能は、現バージョンではベータ版です。今後のバージョンアップにより、ファイル形式や実装が変更される可能性があります。本機能を使用する際は、十分な検証を行ってください。 + - 行数固定で読み込みを行う為、ヘッダの省略はできません。 - [ int01 ] と定義されている変分パラメータの総数が異なる場合はエラー終了します。 diff --git a/doc/ja/source/fourier/format.rst b/doc/ja/source/fourier/format.rst index 9dc217da..5791fda2 100644 --- a/doc/ja/source/fourier/format.rst +++ b/doc/ja/source/fourier/format.rst @@ -10,7 +10,7 @@ :ref:`tutorial` でのファイル名は ``geometry.dat`` . 各サイトの位置と軌道の情報は -mVMC/:math:`{\mathcal H}\Phi` のスタンダードモードを用いた場合には +mVMC/:math:`{\mathcal H}\Phi` のスタンンダードモードを用いた場合には 自動的に生成される. :: diff --git a/doc/ja/source/output.rst b/doc/ja/source/output.rst index e37d2566..d53d906c 100644 --- a/doc/ja/source/output.rst +++ b/doc/ja/source/output.rst @@ -8,33 +8,39 @@ 出力ファイルの一覧は下記の通りです。\*\*\*には ``ModPara`` ファイルの ``CParaFileHead`` で指定されるヘッダが、xxxには ``CDataFileHead`` で指定されるヘッダが、yyyには ``ModPara`` ファイルの ``NDataIdxStart``, ``NDataQtySmp`` に従い ``NDataIdxStart`` :math:`\cdots` ``NDataIdxStart`` + ``NDataQtySmp`` の順に記載されます。また、zzzには ``ModPara`` ファイルの ``NDataIdxStart`` が記載されます。 -+--------------------------------------+-----------------------------------------------+ -| ファイル名 | 対応するファイルの中身 | -+======================================+===============================================+ -| \*\*\*\_opt.dat | 最適化された全パラメータ. | -+--------------------------------------+-----------------------------------------------+ -| \*\*\*\_gutzwiller\_opt.dat | 最適化されたGutzwiller因子. | -+--------------------------------------+-----------------------------------------------+ -| \*\*\*\_jastrow\_opt.dat | 最適化されたJastrow因子. | -+--------------------------------------+-----------------------------------------------+ -| \*\*\*\_doublonHolon2site\_opt.dat | 最適化された2サイトダブロン-ホロン相関因子. | -+--------------------------------------+-----------------------------------------------+ -| \*\*\*\_doublonHolon4site\_opt.dat | 最適化された4サイトダブロン-ホロン相関因子. | -+--------------------------------------+-----------------------------------------------+ -| \*\*\*\_orbital\_opt.dat | 最適化されたペア軌道因子. | -+--------------------------------------+-----------------------------------------------+ -| xxx\_out\_yyy.dat | エネルギーとその分散. | -+--------------------------------------+-----------------------------------------------+ -| xxx\_var\_yyy.dat | パラメータ最適化過程の情報. | -+--------------------------------------+-----------------------------------------------+ -| xxx\_CalcTimer.dat | 各プロセスに対する計算時間に関する情報. | -+--------------------------------------+-----------------------------------------------+ -| xxx\_time\_zzz.dat | モンテカルロサンプリングの過程に関する情報. | -+--------------------------------------+-----------------------------------------------+ -| xxx\_cisajs\_yyy.dat | 一体グリーン関数. | -+--------------------------------------+-----------------------------------------------+ -| xxx\_cisajscktalt\_yyy.dat | 二体グリーン関数. | -+--------------------------------------+-----------------------------------------------+ ++------------------------------------------+----------------------------------------------------------------------+ +| ファイル名 | 対応するファイルの中身 | ++==========================================+======================================================================+ +| \*\*\*\_opt.dat | 最適化された全パラメータ. | ++------------------------------------------+----------------------------------------------------------------------+ +| \*\*\*\_gutzwiller\_opt.dat | 最適化されたGutzwiller因子. | ++------------------------------------------+----------------------------------------------------------------------+ +| \*\*\*\_jastrow\_opt.dat | 最適化されたJastrow因子. | ++------------------------------------------+----------------------------------------------------------------------+ +| \*\*\*\_doublonHolon2site\_opt.dat | 最適化された2サイトダブロン-ホロン相関因子. | ++------------------------------------------+----------------------------------------------------------------------+ +| \*\*\*\_doublonHolon4site\_opt.dat | 最適化された4サイトダブロン-ホロン相関因子. | ++------------------------------------------+----------------------------------------------------------------------+ +| \*\*\*\_generalRBM\_physlayer\_opt.dat | 最適化されたRBM相関因子のうち、物理層のみに関わる変分パラメータ. | ++------------------------------------------+----------------------------------------------------------------------+ +| \*\*\*\_generalRBM\_hiddenlayer\_opt.dat | 最適化されたRBM相関因子のうち、隠れ層のみに関わる変分パラメータ. | ++------------------------------------------+----------------------------------------------------------------------+ +| \*\*\*\_generalRBM\_physhidden\_opt.dat | 最適化されたRBM相関因子のうち、物理層と隠れ層を繋ぐ変分パラメータ. | ++------------------------------------------+----------------------------------------------------------------------+ +| \*\*\*\_orbital\_opt.dat | 最適化されたペア軌道因子. | ++------------------------------------------+----------------------------------------------------------------------+ +| xxx\_out\_yyy.dat | エネルギーとその分散. | ++------------------------------------------+----------------------------------------------------------------------+ +| xxx\_var\_yyy.dat | パラメータ最適化過程の情報. | ++------------------------------------------+----------------------------------------------------------------------+ +| xxx\_CalcTimer.dat | 各プロセスに対する計算時間に関する情報. | ++------------------------------------------+----------------------------------------------------------------------+ +| xxx\_time\_zzz.dat | モンテカルロサンプリングの過程に関する情報. | ++------------------------------------------+----------------------------------------------------------------------+ +| xxx\_cisajs\_yyy.dat | 一体グリーン関数. | ++------------------------------------------+----------------------------------------------------------------------+ +| xxx\_cisajscktalt\_yyy.dat | 二体グリーン関数. | ++------------------------------------------+----------------------------------------------------------------------+ 変分パラメータ出力ファイル(\*\*\*\_opt.dat) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -43,7 +49,7 @@ SR法で最適化された変分パラメータとエネルギーが一斉出力 変分パラメータが一斉に読み込めるため、変分パラメータ最適化後の物理量の計算を行う場合に使用します。 出力されるデータは -.. math:: \langle H \rangle, \langle H^2 \rangle, g_i, v_{ij}, \alpha_{2nt}^{d(h)}, \alpha_{4nt}^{d(h)}, f_{ij} \nonumber +.. math:: \langle H \rangle, \langle H^2 \rangle, g_i, v_{ij}, \alpha_{2nt}^{d(h)}, \alpha_{4nt}^{d(h)}, a_{i\sigma}, b_{k}, W_{i\sigma k}, f_{ij} \nonumber で、それぞれの平均値と標準偏差が出力されます(平均値は実数、虚数の順に、標準偏差は実数のみ出力)。 @@ -82,6 +88,12 @@ SR法で最適化された2サイトのdoublon-holon相関因子が出力され SR法で最適化された4サイトのdoublon-holon相関因子が出力されます。 出力形式は :ref:`InputParam` のInDH4指定ファイルと同じです。 +RBM相関因子出力ファイル(\*\*\*\_generalRBM\_physlayer\_opt.dat, \*\*\*\_generalRBM\_hiddenlayer\_opt.dat, \*\*\*\_generalRBM\_physhidden\_opt.dat) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +SR法で最適化されたRBM相関因子が出力されます。 +それぞれの出力形式は :ref:`InputParam` のInGeneralRBM_PhysLayer, InGeneralRBM_HiddenLayer, InGeneralRBM_PhysHidden指定ファイルと同じです。 + ペア軌道出力ファイル(\*\*\*\_orbital\_opt.dat) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/doc/ja/source/start.rst b/doc/ja/source/start.rst index 04c6e1ad..43693657 100644 --- a/doc/ja/source/start.rst +++ b/doc/ja/source/start.rst @@ -253,7 +253,7 @@ mVMCは次の二つのいずれかのモードで動作します。 また、エキスパートモード用の入力ファイルを自動生成した後、計算をする前にそれらを手動で編集して より広範なモデルに対応させることも可能です。 -これらのモードを用いて次のように計算を行います。 +これらのモードを用いて次の用に計算を行います。 #. 計算用ディレクトリの作成 diff --git a/src/mVMC/avevar.c b/src/mVMC/avevar.c index e7157d48..99e7d06e 100644 --- a/src/mVMC/avevar.c +++ b/src/mVMC/avevar.c @@ -146,6 +146,81 @@ void OutputOptData() { count_i +=2*5*NDoublonHolon4siteIdx; } +//RBM + if(NChargeRBM_PhysLayerIdx != 0){ + sprintf(fileName, "%s_chargeRBM_physlayer_opt.dat", CParaFileHead); + Child_OutputOptData(fp, fileName, "NChargeRBM_PhysLayerIdx", + NChargeRBM_PhysLayerIdx, NChargeRBM_PhysLayerIdx, + count_i, n); + count_i += NChargeRBM_PhysLayerIdx; + } + + if(NSpinRBM_PhysLayerIdx != 0){ + sprintf(fileName, "%s_spinRBM_physlayer_opt.dat", CParaFileHead); + Child_OutputOptData(fp, fileName, "NSpinRBM_PhysLayerIdx", + NSpinRBM_PhysLayerIdx, NSpinRBM_PhysLayerIdx, + count_i, n); + count_i += NSpinRBM_PhysLayerIdx; + } + + if(NGeneralRBM_PhysLayerIdx != 0){ + sprintf(fileName, "%s_generalRBM_physlayer_opt.dat", CParaFileHead); + Child_OutputOptData(fp, fileName, "NGeneralRBM_PhysLayerIdx", + NGeneralRBM_PhysLayerIdx, NGeneralRBM_PhysLayerIdx, + count_i, n); + count_i += NGeneralRBM_PhysLayerIdx; + } + + if(NChargeRBM_HiddenLayerIdx != 0){ + sprintf(fileName, "%s_chargeRBM_hiddenlayer_opt.dat", CParaFileHead); + Child_OutputOptData(fp, fileName, "NChargeRBM_HiddenLayerIdx", + NChargeRBM_HiddenLayerIdx, NChargeRBM_HiddenLayerIdx, + count_i, n); + count_i += NChargeRBM_HiddenLayerIdx; + } + + if(NSpinRBM_HiddenLayerIdx != 0){ + sprintf(fileName, "%s_spinRBM_hiddenlayer_opt.dat", CParaFileHead); + Child_OutputOptData(fp, fileName, "NSpinRBM_HiddenLayerIdx", + NSpinRBM_HiddenLayerIdx, NSpinRBM_HiddenLayerIdx, + count_i, n); + count_i += NSpinRBM_HiddenLayerIdx; + } + + if(NGeneralRBM_HiddenLayerIdx != 0){ + sprintf(fileName, "%s_generalRBM_hiddenlayer_opt.dat", CParaFileHead); + Child_OutputOptData(fp, fileName, "NGeneralRBM_HiddenLayerIdx", + NGeneralRBM_HiddenLayerIdx, NGeneralRBM_HiddenLayerIdx, + count_i, n); + count_i += NGeneralRBM_HiddenLayerIdx; + } + + + if(NChargeRBM_PhysHiddenIdx != 0){ + sprintf(fileName, "%s_chargeRBM_physhidden_opt.dat", CParaFileHead); + Child_OutputOptData(fp, fileName, "NChargeRBM_PhysHiddenIdx", + NChargeRBM_PhysHiddenIdx, NChargeRBM_PhysHiddenIdx, + count_i, n); + count_i += NChargeRBM_PhysHiddenIdx; + } + + if(NSpinRBM_PhysHiddenIdx != 0){ + sprintf(fileName, "%s_spinRBM_physhidden_opt.dat", CParaFileHead); + Child_OutputOptData(fp, fileName, "NSpinRBM_PhysHiddenIdx", + NSpinRBM_PhysHiddenIdx, NSpinRBM_PhysHiddenIdx, + count_i, n); + count_i += NSpinRBM_PhysHiddenIdx; + } + + if(NGeneralRBM_PhysHiddenIdx != 0){ + sprintf(fileName, "%s_generalRBM_physhidden_opt.dat", CParaFileHead); + Child_OutputOptData(fp, fileName, "NGeneralRBM_PhysHiddenIdx", + NGeneralRBM_PhysHiddenIdx, NGeneralRBM_PhysHiddenIdx, + count_i, n); + count_i += NGeneralRBM_PhysHiddenIdx; + } +//RBM + if(NSlater != 0){ if(iFlgOrbitalGeneral==0) { sprintf(fileName, "%s_orbital_opt.dat", CParaFileHead); diff --git a/src/mVMC/calgrn.c b/src/mVMC/calgrn.c index 8d13215b..0ccd0dc9 100644 --- a/src/mVMC/calgrn.c +++ b/src/mVMC/calgrn.c @@ -30,25 +30,28 @@ along with this program. If not, see http://www.gnu.org/licenses/. #define _CALGRN_SRC void CalculateGreenFunc(const double w, const double complex ip, int *eleIdx, int *eleCfg, - int *eleNum, int *eleProjCnt) { + int *eleNum, int *eleProjCnt, const double complex *rbmCnt) { int idx,idx0,idx1; int ri,rj,s,rk,rl,t; double complex tmp; int *myEleIdx, *myEleNum, *myProjCntNew; double complex *myBuffer; + double complex *myRBMCntNew; RequestWorkSpaceThreadInt(Nsize+Nsite2+NProj); - RequestWorkSpaceThreadComplex(NQPFull+2*Nsize); + RequestWorkSpaceThreadComplex(NQPFull+2*Nsize + FlagRBM*NRBM_PhysLayerIdx+Nneuron); + //RequestWorkSpaceThreadComplex(NQPFull+2*Nsize); /* GreenFunc1: NQPFull, GreenFunc2: NQPFull+2*Nsize */ - #pragma omp parallel default(shared) \ - private(myEleIdx,myEleNum,myProjCntNew,myBuffer,idx) +#pragma omp parallel default(shared) \ + private(myRBMCntNew, myEleIdx,myEleNum,myProjCntNew,myBuffer,idx) { myEleIdx = GetWorkSpaceThreadInt(Nsize); myEleNum = GetWorkSpaceThreadInt(Nsite2); myProjCntNew = GetWorkSpaceThreadInt(NProj); myBuffer = GetWorkSpaceThreadComplex(NQPFull+2*Nsize); + myRBMCntNew = GetWorkSpaceThreadComplex(NRBM_PhysLayerIdx+Nneuron); #pragma loop noalias for(idx=0;idx4.0 [ip] MUST be specified. // Hence we have to fall back to default(shared) here. #pragma omp parallel default(shared) \ - private(myEleIdx,myEleNum,myProjCntNew,myBuffer,myEnergy, idx, ri, rj, rk, rl, s, t) \ - firstprivate(Nsize, Nsite2, NProj, NQPFull, NCoulombIntra, CoulombIntra, ParaCoulombIntra, \ + private(myRBMCntNew, myEleIdx,myEleNum,myProjCntNew,myBuffer,myEnergy, idx, ri, rj, rk, rl, s, t) \ + firstprivate(NRBM_PhysLayerIdx, Nneuron, Nsize, Nsite2, NProj, NQPFull, NCoulombIntra, CoulombIntra, ParaCoulombIntra, \ NCoulombInter, CoulombInter, ParaCoulombInter, NHundCoupling, HundCoupling, ParaHundCoupling, \ NTransfer, Transfer, ParaTransfer, NPairHopping, PairHopping, ParaPairHopping, \ NExchangeCoupling, ExchangeCoupling, ParaExchangeCoupling, NInterAll, InterAll, ParaInterAll, n0, n1) \ - shared(eleCfg, eleProjCnt, eleIdx, eleNum) reduction(+:e) + shared(eleCfg, eleProjCnt, eleIdx, eleNum, rbmCnt, FlagRBM) reduction(+:e) { myEleIdx = GetWorkSpaceThreadInt(Nsize); myEleNum = GetWorkSpaceThreadInt(Nsite2); myProjCntNew = GetWorkSpaceThreadInt(NProj); + if (FlagRBM) { + myRBMCntNew = GetWorkSpaceThreadComplex(NRBM_PhysLayerIdx+Nneuron); + } myBuffer = GetWorkSpaceThreadComplex(NQPFull+2*Nsize); #pragma loop noalias @@ -135,7 +139,7 @@ double complex CalculateHamiltonian(const double complex ip, int *eleIdx, const s = Transfer[idx][3]; myEnergy -= ParaTransfer[idx] - * GreenFunc1(ri,rj,s,ip,myEleIdx,eleCfg,myEleNum,eleProjCnt,myProjCntNew,myBuffer); + * GreenFunc1(ri,rj,s,ip,myEleIdx,eleCfg,myEleNum,eleProjCnt,myProjCntNew,rbmCnt, myRBMCntNew, myBuffer); /* Caution: negative sign */ } @@ -149,7 +153,7 @@ double complex CalculateHamiltonian(const double complex ip, int *eleIdx, const rj = PairHopping[idx][1]; myEnergy += ParaPairHopping[idx] - * GreenFunc2(ri,rj,ri,rj,0,1,ip,myEleIdx,eleCfg,myEleNum,eleProjCnt,myProjCntNew,myBuffer); + * GreenFunc2(ri,rj,ri,rj,0,1,ip,myEleIdx,eleCfg,myEleNum,eleProjCnt,myProjCntNew,rbmCnt,myRBMCntNew,myBuffer); } /* Exchange Coupling */ @@ -157,9 +161,9 @@ double complex CalculateHamiltonian(const double complex ip, int *eleIdx, const for(idx=0;idx void CalculateGreenFunc(const double w, const double complex ip, int *eleIdx, int *eleCfg, - int *eleNum, int *eleProjCnt); + int *eleNum, int *eleProjCnt, const double complex *rbmCnt); void CalculateGreenFuncBF(const double w, const double ip, int *eleIdx, int *eleCfg, int *eleNum, int *eleProjCnt, const int *eleProjBFCnt); -#endif +#endif \ No newline at end of file diff --git a/src/mVMC/include/calham.h b/src/mVMC/include/calham.h index 44bff34f..ae7ab542 100644 --- a/src/mVMC/include/calham.h +++ b/src/mVMC/include/calham.h @@ -2,7 +2,8 @@ #define _CALHAM #include -double complex CalculateHamiltonian(const double complex ip, int *eleIdx, const int *eleCfg, int *eleNum, const int *eleProjCnt); +double complex CalculateHamiltonian(const double complex ip, int *eleIdx, const int *eleCfg, + int *eleNum, const int *eleProjCnt, const double complex *rbmCnt); double complex CalculateHamiltonian0(const int *eleNum); diff --git a/src/mVMC/include/global.h b/src/mVMC/include/global.h index c0ab8e6d..6e5cf5c9 100644 --- a/src/mVMC/include/global.h +++ b/src/mVMC/include/global.h @@ -130,6 +130,20 @@ int iFlgOrbitalGeneral=0; int iNOrbitalParallel=0; int iNOrbitalAntiParallel=0; +/* restricted Boltzman Machine for variational parameters */ +int Nneuron,NneuronGeneral,NneuronCharge,NneuronSpin; +int NRBM_HiddenLayerIdx,NRBM_PhysLayerIdx,NRBM_PhysHiddenIdx; +int NGeneralRBM_HiddenLayerIdx, *GeneralRBM_HiddenLayerIdx; /* [Nneuron] */ +int NGeneralRBM_PhysLayerIdx, *GeneralRBM_PhysLayerIdx; /* [Nsite2] */ +int NGeneralRBM_PhysHiddenIdx, **GeneralRBM_PhysHiddenIdx; /* [Nsite2][Nneuron] */ +int NChargeRBM_HiddenLayerIdx, *ChargeRBM_HiddenLayerIdx; /* [Nneuron] */ +int NChargeRBM_PhysLayerIdx, *ChargeRBM_PhysLayerIdx; /* [Nsite] */ +int NChargeRBM_PhysHiddenIdx, **ChargeRBM_PhysHiddenIdx; /* [Nsite][Nneuron] */ +int NSpinRBM_HiddenLayerIdx, *SpinRBM_HiddenLayerIdx; /* [Nneuron] */ +int NSpinRBM_PhysLayerIdx, *SpinRBM_PhysLayerIdx; /* [Nsite] */ +int NSpinRBM_PhysHiddenIdx, **SpinRBM_PhysHiddenIdx; /* [Nsite][Nneuron] */ +int NBlockSize_RBMRatio; /* block size for RBMRatio function. It is Tuning for performance. */ + /* zqptransidx.def */ int NQPTrans, **QPTrans, **QPTransInv; /* [NQPTrans][Nsite] */ int **QPTransSgn; /* QPTransSgn[NQPTrans][NSite] = +1 or -1 */ @@ -151,6 +165,9 @@ int NCisAjsCktAltLz, **CisAjsCktAltLzIdx; int *OptFlag; /* [NPara] 1: optimized, 0 or 2: fixed */ int AllComplexFlag;/* 0 -> all real variables, !=0-> including complex variables*/ +/* flag for RBM */ +int FlagRBM=0; + /* flag for anti-periodic boundry condition */ int APFlag; /* 0: periodic, 1: anti-periodic */ @@ -172,6 +189,7 @@ int NFileFlushInterval=1; /***** Variational Parameters *****/ int NPara; /* the total number of variational prameters NPara= NProj + NSlater+ NOptTrans */ int NProj; /* the number of correlation factor */ +int NRBM, NRBM_PhysLayerIdx, NRBM_HiddenLayerIdx; int NProjBF; /* the number of correlation factor */ int NSlater; /* the number of pair orbital (f_ij) = NOrbitalIdx */ int NOptTrans; /* the number of weights for OptTrans. This is used only for variatonal parameters */ @@ -179,6 +197,7 @@ int NOptTrans; /* the number of weights for OptTrans. This is used only for vari int **etaFlag; /* Back Flow correlation factor (eta = 1.0 or ProjBF[0])*/ double complex *Para; /* variatonal parameters */ double complex *Proj; /* correlation factor (Proj =Para) */ +double complex *RBM; /* (Proj =Para) */ double complex *ProjBF; /* Back flow correlation factor (Proj =Para) */ double complex *Slater; /* pair orbital (Slater =Para+NProj) */ double complex *OptTrans; /* weights (OptTrans=Para+NProj+NSlater) */ @@ -197,6 +216,7 @@ int *EleNum; /* EleIdx[sample][ri+si*Nsite] */ int *EleProjCnt; /* EleProjCnt[sample][proj] */ //[s] MERGE BY TM int *EleSpn; /* EleIdx[sample][mi+si*Ne] */ //fsz +double complex *RBMCnt; int *EleProjBFCnt; /* EleProjCnt[sample][proj] */ //[e] MERGE BY TM double *logSqPfFullSlater; /* logSqPfFullSlater[sample] */ @@ -214,12 +234,14 @@ int *TmpEleProjCnt; int *TmpEleSpn; int *TmpEleProjBFCnt; //[e] MERGE BY TM +double complex *TmpRBMCnt; int *BurnEleIdx; int *BurnEleCfg; int *BurnEleNum; int *BurnEleProjCnt; int *BurnEleSpn; +double complex *BurnRBMCnt; int BurnFlag=0; /* 0: off, 1: on */ /***** Slater Elements ******/ @@ -315,6 +337,7 @@ FILE *FileLSCisAjsCktAlt; /***** HitachiTimer *****/ const int NTimer=1000; double Timer[1000], TimerStart[1000]; +double ccc[100]; /* flag for SROptimization*/ int SRFlag; /* 0: periodic, 1: Diagonalization */ diff --git a/src/mVMC/include/locgrn.h b/src/mVMC/include/locgrn.h index d103d294..b856e463 100644 --- a/src/mVMC/include/locgrn.h +++ b/src/mVMC/include/locgrn.h @@ -5,17 +5,18 @@ double complex GreenFunc1(const int ri, const int rj, const int s, const double complex ip, int *eleIdx, const int *eleCfg, int *eleNum, const int *eleProjCnt, - int *projCntNew, double complex *buffer); + int *projCntNew, const double complex *rbmCnt, double complex *rbmCntNew, double complex *buffer); + double complex GreenFunc2(const int ri, const int rj, const int rk, const int rl, const int s, const int t, const double complex ip, int *eleIdx, const int *eleCfg, int *eleNum, const int *eleProjCnt, - int *projCntNew, double complex *buffer); + int *projCntNew, const double complex *rbmCnt, double complex *rbmCntNew, double complex *buffer); double complex GreenFuncN(const int n, int *rsi, int *rsj, const double complex ip, int *eleIdx, const int *eleCfg, int *eleNum, const int *eleProjCnt, - double complex *buffer, int *bufferInt); + const double complex *rbmCnt, double complex *rbmCntNew, double complex *buffer, int *bufferInt); double complex GreenFunc1BF(const int ri, const int rj, const int s, const double complex ip, double complex* bufM, int *eleIdx, int *eleCfg, int *eleNum, const int *eleProjCnt, int *projCntNew, const int *eleProjBFCnt,int *projBFCntNew, double complex* buffer); -#endif +#endif \ No newline at end of file diff --git a/src/mVMC/include/lslocgrn.h b/src/mVMC/include/lslocgrn.h index dd1b5f32..27dd2414 100644 --- a/src/mVMC/include/lslocgrn.h +++ b/src/mVMC/include/lslocgrn.h @@ -3,9 +3,8 @@ #include #include "global.h" -void LSLocalQ(const double complex h1, const double complex ip, int *eleIdx, int *eleCfg, int *eleNum, int *eleProjCnt, double complex* _LSLocalQ); +void LSLocalQ(const double complex h1, const double complex ip, int *eleIdx, int *eleCfg, int *eleNum, int *eleProjCnt, double complex *rbmCnt, double complex* _LSLocalQ); -void LSLocalCisAjs(const double complex h1, const double complex ip, int *eleIdx, int *eleCfg, int *eleNum, int *eleProjCnt); +void LSLocalCisAjs(const double complex h1, const double complex ip, int *eleIdx, int *eleCfg, int *eleNum, int *eleProjCnt, double complex *rbmCnt); - -#endif +#endif \ No newline at end of file diff --git a/src/mVMC/include/rbm.h b/src/mVMC/include/rbm.h new file mode 100644 index 00000000..387882b7 --- /dev/null +++ b/src/mVMC/include/rbm.h @@ -0,0 +1,22 @@ +#ifndef _RBM_ +#define _RBM_ + +extern inline double complex WeightRBM(const double complex *rbmCnt); +extern inline double complex LogWeightRBM(const double complex *rbmCnt); +extern inline double complex RBMRatio(const double complex *rbmCntNew, const double complex *rbmCntOld); +extern inline double complex LogRBMRatio(const double complex *rbmCntNew, const double complex *rbmCntOld); + +void copyFromBurnSampleRBM(double complex *rbmCnt); +void copyToBurnSampleRBM(double complex *rbmCnt); +void saveRBMCnt(const int sample, const double complex *rbmCnt); + +void RBMDiff(double complex *srOptO, const double complex *rbmCnt, const int *eleNum); + + +void MakeRBMCnt(double complex *rbmCnt, const int *eleNum); +void UpdateRBMCnt(const int ri, const int rj, const int s, + double complex *rbmCntNew, const double complex *rbmCntOld, const int *eleNum); + +void UpdateRBMCnt_fsz(const int ri, const int rj, const int s, const int t, + double complex *rbmCntNew, const double complex *rbmCntOld) ; +#endif diff --git a/src/mVMC/include/readdef.h b/src/mVMC/include/readdef.h index 478e1797..bf86c42f 100644 --- a/src/mVMC/include/readdef.h +++ b/src/mVMC/include/readdef.h @@ -35,10 +35,22 @@ static char cKWListOfFileNameList[][D_CharTmpReadDef]={ "Trans", "CoulombIntra", "CoulombInter", "Hund", "PairHop", "Exchange", "Gutzwiller", "Jastrow", - "DH2", "DH4", "Orbital", "OrbitalAntiParallel", + "DH2", "DH4", + //RBM + "ChargeRBM_HiddenLayer","ChargeRBM_PhysLayer", "ChargeRBM_PhysHidden", + "SpinRBM_HiddenLayer","SpinRBM_PhysLayer", "SpinRBM_PhysHidden", + "GeneralRBM_HiddenLayer","GeneralRBM_PhysLayer", "GeneralRBM_PhysHidden", + //RBM + "Orbital", "OrbitalAntiParallel", "OrbitalParallel", "OrbitalGeneral", "TransSym", "InGutzwiller", "InJastrow", - "InDH2", "InDH4", "InOrbital", "InOrbitalAntiParallel", + "InDH2", "InDH4", + //RBM + "InChargeRBM_HiddenLayer","InChargeRBM_PhysLayer", "InChargeRBM_PhysHidden", + "InSpinRBM_HiddenLayer","InSpinRBM_PhysLayer", "InSpinRBM_PhysHidden", + "InGeneralRBM_HiddenLayer","InGeneralRBM_PhysLayer", "InGeneralRBM_PhysHidden", + //RBM + "InOrbital", "InOrbitalAntiParallel", "InOrbitalParallel", "InOrbitalGeneral", "OneBodyG", "TwoBodyG", "TwoBodyGEx", "InterAll", "OptTrans", "InOptTrans", @@ -53,10 +65,22 @@ enum KWIdxInt{ KWTrans, KWCoulombIntra,KWCoulombInter, KWHund, KWPairHop, KWExchange, KWGutzwiller, KWJastrow, - KWDH2, KWDH4, KWOrbital, KWOrbitalAntiParallel, + KWDH2, KWDH4, + //RBM + KWChargeRBM_HiddenLayer,KWChargeRBM_PhysLayer,KWChargeRBM_PhysHidden, + KWSpinRBM_HiddenLayer,KWSpinRBM_PhysLayer,KWSpinRBM_PhysHidden, + KWGeneralRBM_HiddenLayer,KWGeneralRBM_PhysLayer,KWGeneralRBM_PhysHidden, + //RBM + KWOrbital, KWOrbitalAntiParallel, KWOrbitalParallel, KWOrbitalGeneral, KWTransSym, KWInGutzwiller, KWInJastrow, - KWInDH2, KWInDH4, KWInOrbital,KWInOrbitalAntiParallel, + KWInDH2, KWInDH4, + //RBM + KWInChargeRBM_HiddenLayer,KWInChargeRBM_PhysLayer,KWInChargeRBM_PhysHidden, + KWInSpinRBM_HiddenLayer,KWInSpinRBM_PhysLayer,KWInSpinRBM_PhysHidden, + KWInGeneralRBM_HiddenLayer,KWInGeneralRBM_PhysLayer,KWInGeneralRBM_PhysHidden, + //RBM + KWInOrbital,KWInOrbitalAntiParallel, KWInOrbitalParallel, KWInorbitalGeneral, KWOneBodyG, KWTwoBodyG, KWTwoBodyGEx, KWInterAll, KWOptTrans, KWInOptTrans, @@ -73,6 +97,9 @@ static char (*cFileNameListFile)[D_CharTmpReadDef]; enum ParamIdxInt{ IdxVMCCalcMode, IdxLanczosMode, IdxDataIdxStart, IdxDataQtySmp, IdxNsite, IdxNe, + //RBM + IdxNneuron, IdxNneuronCharge, IdxNneuronSpin,IdxNneuronGeneral, + //RBM IdxSPGaussLeg, IdxSPStot, IdxMPTrans, IdxSROptItrStep, IdxSROptItrSmp, IdxSROptFixSmp, IdxVMCWarmUp, IdxVMCInterval, IdxVMCSample, @@ -80,7 +107,14 @@ enum ParamIdxInt{ IdxNLocSpin,IdxNTrans,IdxNCoulombIntra, IdxNCoulombInter, IdxNHund, IdxNPairHop, IdxNExchange, IdxNGutz, IdxNJast, - IdxNDH2, IdxNDH4, IdxNOrbit, IdxNOrbitGeneral, + IdxNDH2, IdxNDH4, + //RBM + IdxNChargeRBM_HiddenLayer,IdxNChargeRBM_PhysLayer, IdxNChargeRBM_PhysHidden, + IdxNSpinRBM_HiddenLayer,IdxNSpinRBM_PhysLayer, IdxNSpinRBM_PhysHidden, + IdxNGeneralRBM_HiddenLayer,IdxNGeneralRBM_PhysLayer, IdxNGeneralRBM_PhysHidden, + IdxNBlockSize_RBMRatio, + //RBM + IdxNOrbit, IdxNOrbitGeneral, IdxNQPTrans, IdxNOneBodyG, IdxNTwoBodyG, IdxNTwoBodyGEx, IdxNInterAll, IdxNQPOptTrans, IdxSROptCGMaxIter, @@ -113,3 +147,14 @@ int iComplexFlgOrbital=0; int iComplexFlgOrbitalAntiParallel=0; int iComplexFlgOrbitalParallel=0; int iComplexFlgOrbitalGeneral=0; +//RBM +int iComplexFlgGeneralRBM_PhysLayer=0; +int iComplexFlgGeneralRBM_HiddenLayer=0; +int iComplexFlgGeneralRBM_PhysHidden=0; +int iComplexFlgChargeRBM_PhysLayer=0; +int iComplexFlgChargeRBM_HiddenLayer=0; +int iComplexFlgChargeRBM_PhysHidden=0; +int iComplexFlgSpinRBM_PhysLayer=0; +int iComplexFlgSpinRBM_HiddenLayer=0; +int iComplexFlgSpinRBM_PhysHidden=0; +//RBM diff --git a/src/mVMC/include/version.h b/src/mVMC/include/version.h index 0e89e120..2a7f91d0 100644 --- a/src/mVMC/include/version.h +++ b/src/mVMC/include/version.h @@ -29,7 +29,7 @@ along with this program. If not, see http://www.gnu.org/licenses/. /* ..- */ #define VERSION_MAJOR 1 #define VERSION_MINOR 2 -#define VERSION_PATCH 0 +#define VERSION_PATCH 1 #define VERSION_PRERELEASE "" /* "alpha", "beta.1", etc. */ diff --git a/src/mVMC/include/vmcmain.h b/src/mVMC/include/vmcmain.h index 090c7b69..e8bb1db8 100644 --- a/src/mVMC/include/vmcmain.h +++ b/src/mVMC/include/vmcmain.h @@ -115,4 +115,6 @@ extern int omp_get_thread_num(void); #include "../vmccal.c" #include "../vmccal_fsz.c" +#include "../rbm.c" + #endif /* _VMC_INCLUDE_FILES */ diff --git a/src/mVMC/locgrn.c b/src/mVMC/locgrn.c index 0f8837c3..2351a19e 100644 --- a/src/mVMC/locgrn.c +++ b/src/mVMC/locgrn.c @@ -28,6 +28,7 @@ along with this program. If not, see http://www.gnu.org/licenses/. #pragma once #include "locgrn.h" #include "projection.h" +#include "rbm.h" #include "pfupdate.h" #include "pfupdate_two_fcmp.h" #include "qp.h" @@ -39,7 +40,7 @@ double complex calculateNewPfMN_child(const int qpidx, const int n, const int *m /* buffer size = NQPFull */ double complex GreenFunc1(const int ri, const int rj, const int s, const double complex ip, int *eleIdx, const int *eleCfg, int *eleNum, const int *eleProjCnt, - int *projCntNew, double complex *buffer) { + int *projCntNew, const double complex *rbmCnt, double complex *rbmCntNew, double complex *buffer) { double complex z; int mj,msj,rsi,rsj; double complex *pfMNew = buffer; /* NQPFull */ @@ -57,7 +58,16 @@ double complex GreenFunc1(const int ri, const int rj, const int s, const double eleNum[rsj] = 0; eleNum[rsi] = 1; UpdateProjCnt(rj, ri, s, projCntNew, eleProjCnt, eleNum); + + if (FlagRBM) { + UpdateRBMCnt(rj, ri, s, rbmCntNew, rbmCnt, eleNum); + z = ProjRatio(projCntNew,eleProjCnt); + z *= RBMRatio(rbmCntNew,rbmCnt); + } + else { + UpdateProjCnt(rj, ri, s, projCntNew, eleProjCnt, eleNum); z = ProjRatio(projCntNew,eleProjCnt); + } /* calculate Pfaffian */ CalculateNewPfM(mj, s, pfMNew, eleIdx, 0, NQPFull); @@ -76,7 +86,7 @@ double complex GreenFunc1(const int ri, const int rj, const int s, const double double complex GreenFunc2(const int ri, const int rj, const int rk, const int rl, const int s, const int t, const double complex ip, int *eleIdx, const int *eleCfg, int *eleNum, const int *eleProjCnt, - int *projCntNew, double complex *buffer) { + int *projCntNew, const double complex *rbmCnt, double complex *rbmCntNew, double complex *buffer) { double complex z; int mj,msj,ml,mtl; int rsi,rsj,rtk,rtl; @@ -92,36 +102,36 @@ double complex GreenFunc2(const int ri, const int rj, const int rk, const int rl if(rk==rl) { /* CisAjsNks */ if(eleNum[rtk]==0) return 0.0; else return GreenFunc1(ri,rj,s,ip,eleIdx,eleCfg,eleNum, - eleProjCnt,projCntNew,buffer); /* CisAjs */ + eleProjCnt,projCntNew,rbmCnt,rbmCntNew,buffer); /* CisAjs */ }else if(rj==rl) { return 0.0; /* CisAjsCksAjs (j!=k) */ }else if(ri==rl) { /* AjsCksNis */ if(eleNum[rsi]==0) return 0.0; else if(rj==rk) return 1.0-eleNum[rsj]; else return -GreenFunc1(rk,rj,s,ip,eleIdx,eleCfg,eleNum, - eleProjCnt,projCntNew,buffer); /* -CksAjs */ + eleProjCnt,projCntNew,rbmCnt,rbmCntNew,buffer); /* -CksAjs */ }else if(rj==rk) { /* CisAls(1-Njs) */ if(eleNum[rsj]==1) return 0.0; else if(ri==rl) return eleNum[rsi]; else return GreenFunc1(ri,rl,s,ip,eleIdx,eleCfg,eleNum, - eleProjCnt,projCntNew,buffer); /* CisAls */ + eleProjCnt,projCntNew,rbmCnt,rbmCntNew,buffer); /* CisAls */ }else if(ri==rk) { return 0.0; /* CisAjsCisAls (i!=j) */ }else if(ri==rj) { /* NisCksAls (i!=k,l) */ if(eleNum[rsi]==0) return 0.0; else return GreenFunc1(rk,rl,s,ip,eleIdx,eleCfg,eleNum, - eleProjCnt,projCntNew,buffer); /* CksAls */ + eleProjCnt,projCntNew,rbmCnt,rbmCntNew,buffer); /* CksAls */ } }else{ if(rk==rl) { /* CisAjsNkt */ if(eleNum[rtk]==0) return 0.0; else if(ri==rj) return eleNum[rsi]; else return GreenFunc1(ri,rj,s,ip,eleIdx,eleCfg,eleNum, - eleProjCnt,projCntNew,buffer); /* CisAjs */ + eleProjCnt,projCntNew,rbmCnt,rbmCntNew,buffer); /* CisAjs */ }else if(ri==rj) { /* NisCktAlt */ if(eleNum[rsi]==0) return 0.0; else return GreenFunc1(rk,rl,t,ip,eleIdx,eleCfg,eleNum, - eleProjCnt,projCntNew,buffer); /* CktAlt */ + eleProjCnt,projCntNew,rbmCnt,rbmCntNew,buffer); /* CktAlt */ } } @@ -137,12 +147,21 @@ double complex GreenFunc2(const int ri, const int rj, const int rk, const int rl eleNum[rtl] = 0; eleNum[rtk] = 1; UpdateProjCnt(rl, rk, t, projCntNew, eleProjCnt, eleNum); + if (FlagRBM) { + UpdateRBMCnt(rl, rk, t, rbmCntNew, rbmCnt, eleNum); + } eleIdx[msj] = ri; eleNum[rsj] = 0; eleNum[rsi] = 1; UpdateProjCnt(rj, ri, s, projCntNew, projCntNew, eleNum); + if (FlagRBM) { + UpdateRBMCnt(rj, ri, s, rbmCntNew, rbmCntNew, eleNum); + } z = ProjRatio(projCntNew,eleProjCnt); + if (FlagRBM) { + z *= RBMRatio(rbmCntNew,rbmCnt); + } /* calculate Pfaffian */ CalculateNewPfMTwo_fcmp(ml, t, mj, s, pfMNew, eleIdx, 0, NQPFull, bufV); @@ -172,7 +191,7 @@ double complex GreenFunc2(const int ri, const int rj, const int rk, const int rl double complex GreenFuncN(const int n, int *rsi, int *rsj, const double complex ip, int *eleIdx, const int *eleCfg, int *eleNum, const int *eleProjCnt, - double complex *buffer, int *bufferInt){ + const double complex *rbmCnt, double complex *rbmCntNew, double complex *buffer, int *bufferInt){ int ri,rj,rk,rl,si,sj,sk,mj; int k,l,m,rsk; double complex z,x; @@ -195,7 +214,7 @@ double complex GreenFuncN(const int n, int *rsi, int *rsj, const double complex ri = rsi[0]%Nsite; rj = rsj[0]%Nsite; si = rsi[0]/Nsite; - return GreenFunc1(ri,rj,si,ip,eleIdx,eleCfg,eleNum,eleProjCnt,projCntNew,buffer); + return GreenFunc1(ri,rj,si,ip,eleIdx,eleCfg,eleNum,eleProjCnt,projCntNew,rbmCnt,rbmCntNew,buffer); } else if(n==2) { ri = rsi[0]%Nsite; rj = rsj[0]%Nsite; @@ -203,7 +222,7 @@ double complex GreenFuncN(const int n, int *rsi, int *rsj, const double complex rk = rsi[1]%Nsite; rl = rsj[1]%Nsite; sk = rsi[1]/Nsite; - return GreenFunc2(ri,rj,rk,rl,si,sk,ip,eleIdx,eleCfg,eleNum,eleProjCnt,projCntNew,buffer); + return GreenFunc2(ri,rj,rk,rl,si,sk,ip,eleIdx,eleCfg,eleNum,eleProjCnt,projCntNew,rbmCnt,rbmCntNew,buffer); } /* reduction */ @@ -218,7 +237,7 @@ double complex GreenFuncN(const int n, int *rsi, int *rsj, const double complex rsi[m] = rsi[m+1]; rsj[m] = rsj[m+1]; } - return GreenFuncN(n-1,rsi,rsj,ip,eleIdx,eleCfg,eleNum,eleProjCnt,buffer,bufferInt); + return GreenFuncN(n-1,rsi,rsj,ip,eleIdx,eleCfg,eleNum,eleProjCnt,rbmCnt,rbmCntNew,buffer,bufferInt); } /* rsj[k] == rsj[l] */ if(rsk==rsj[l]) return 0; @@ -234,7 +253,7 @@ double complex GreenFuncN(const int n, int *rsi, int *rsj, const double complex rsi[m] = rsi[m+1]; rsj[m] = rsj[m+1]; } - return GreenFuncN(n-1,rsi,rsj,ip,eleIdx,eleCfg,eleNum,eleProjCnt,buffer,bufferInt); + return GreenFuncN(n-1,rsi,rsj,ip,eleIdx,eleCfg,eleNum,eleProjCnt,rbmCnt,rbmCntNew,buffer,bufferInt); } for(l=k+1;l/ */ -void LSLocalQ(const double complex h1, const double complex ip, int *eleIdx, int *eleCfg, int *eleNum, int *eleProjCnt, double complex *_LSLQ) +void LSLocalQ(const double complex h1, const double complex ip, int *eleIdx, int *eleCfg, int *eleNum, int *eleProjCnt, double complex *rbmCnt, double complex *_LSLQ) { double complex e0,h2; e0 = CalculateHamiltonian0(eleNum); /* V */ h2 = h1*e0; /* HV = (V+K+W)V */ - h2 += calculateHK(h1,ip,eleIdx,eleCfg,eleNum,eleProjCnt); - h2 += calculateHW(h1,ip,eleIdx,eleCfg,eleNum,eleProjCnt); + h2 += calculateHK(h1,ip,eleIdx,eleCfg,eleNum,eleProjCnt,rbmCnt); + h2 += calculateHW(h1,ip,eleIdx,eleCfg,eleNum,eleProjCnt,rbmCnt); /* calculate local Q (IQ) */ _LSLQ[0] = 1.0; /* I */ @@ -96,7 +95,7 @@ void LSLocalQ(const double complex h1, const double complex ip, int *eleIdx, int } /* Calculate / */ -void LSLocalCisAjs(const double complex h1, const double complex ip, int *eleIdx, int *eleCfg, int *eleNum, int *eleProjCnt) { +void LSLocalCisAjs(const double complex h1, const double complex ip, int *eleIdx, int *eleCfg, int *eleNum, int *eleProjCnt, double complex *rbmCnt) { const int nCisAjs=NCisAjs; double complex*lsLCisAjs = LSLCisAjs; double complex*localCisAjs = LocalCisAjs; @@ -115,13 +114,13 @@ void LSLocalCisAjs(const double complex h1, const double complex ip, int *eleIdx s = CisAjsIdx[idx][3]; /* calculate local HCisAjs */ - LSLCisAjs[idx+nCisAjs] = calHCA(ri,rj,s,h1,ip,eleIdx,eleCfg,eleNum,eleProjCnt); + LSLCisAjs[idx+nCisAjs] = calHCA(ri,rj,s,h1,ip,eleIdx,eleCfg,eleNum,eleProjCnt,rbmCnt); } return; } double complex calculateHK(const double complex h1, const double complex ip, int *eleIdx, int *eleCfg, - int *eleNum, int *eleProjCnt) { + int *eleNum, int *eleProjCnt, double complex *rbmCnt) { int idx,ri,rj,s; double complex val=0.0; @@ -129,8 +128,8 @@ double complex calculateHK(const double complex h1, const double complex ip, int ri = Transfer[idx][0]; rj = Transfer[idx][2]; s = Transfer[idx][3]; - - val -= ParaTransfer[idx] * calHCA(ri,rj,s,h1,ip,eleIdx,eleCfg,eleNum,eleProjCnt); + + val -= ParaTransfer[idx] * calHCA(ri,rj,s,h1,ip,eleIdx,eleCfg,eleNum,eleProjCnt,rbmCnt); /* Caution: negative sign */ } @@ -138,7 +137,7 @@ double complex calculateHK(const double complex h1, const double complex ip, int } double complex calculateHW(const double complex h1, const double complex ip, int *eleIdx, int *eleCfg, - int *eleNum, int *eleProjCnt) { + int *eleNum, int *eleProjCnt, double complex *rbmCnt) { int idx,ri,rj,s,rk,rl,t; double complex val=0.0,tmp; @@ -148,16 +147,16 @@ double complex calculateHW(const double complex h1, const double complex ip, int rj = PairHopping[idx][1]; val += ParaPairHopping[idx] - * calHCACA(ri,rj,ri,rj,0,1,h1,ip,eleIdx,eleCfg,eleNum,eleProjCnt); + * calHCACA(ri,rj,ri,rj,0,1,h1,ip,eleIdx,eleCfg,eleNum,eleProjCnt,rbmCnt); } /* Exchange Coupling */ for(idx=0;idx/ */ double complex calHCA(const int ri, const int rj, const int s, const double complex h1, const double complex ip, int *eleIdx, int *eleCfg, - int *eleNum, int *eleProjCnt) { + int *eleNum, int *eleProjCnt, double complex *rbmCnt) { int rsi=ri+s*Nsite; int rsj=rj+s*Nsite; double complex val; @@ -197,9 +196,9 @@ double complex calHCA(const int ri, const int rj, const int s, g = checkGF1(ri,rj,s,ip,eleIdx,eleCfg,eleNum); if(cabs(g)>1.0e-12) { - val = calHCA1(ri,rj,s,ip,eleIdx,eleCfg,eleNum,eleProjCnt); + val = calHCA1(ri,rj,s,ip,eleIdx,eleCfg,eleNum,eleProjCnt,rbmCnt); } else { - val = calHCA2(ri,rj,s,ip,eleIdx,eleCfg,eleNum,eleProjCnt); + val = calHCA2(ri,rj,s,ip,eleIdx,eleCfg,eleNum,eleProjCnt,rbmCnt); } return val; @@ -236,10 +235,11 @@ double complex checkGF1(const int ri, const int rj, const int s, const double co /* calculate / = / * / */ double complex calHCA1(const int ri, const int rj, const int s, const double complex ip, int *eleIdx, int *eleCfg, - int *eleNum, int *eleProjCnt) { + int *eleNum, int *eleProjCnt, double complex *rbmCnt) { complex double *oldInvM; /* [NQPFull*Nsize*Nsize;] */ complex double *oldPfM; /* [NQPFull] */ int *projCntNew; + double complex *rbmCntNew; int rsi=ri+s*Nsite; int rsj=rj+s*Nsite; @@ -247,11 +247,14 @@ double complex calHCA1(const int ri, const int rj, const int s, double complex ipNew,z,e; RequestWorkSpaceInt(NProj); - RequestWorkSpaceComplex(NQPFull*(Nsize*Nsize+1)); + RequestWorkSpaceComplex(NQPFull*(Nsize*Nsize+1) + FlagRBM*(NRBM_PhysLayerIdx+Nneuron)); projCntNew = GetWorkSpaceInt(NProj); oldInvM = GetWorkSpaceComplex(NQPFull*Nsize*Nsize); oldPfM = GetWorkSpaceComplex(NQPFull); + if (FlagRBM) { + rbmCntNew = GetWorkSpaceComplex(NRBM_PhysLayerIdx + Nneuron); + } /* copy InvM and PfM */ copyMAll(InvM,PfM,oldInvM,oldPfM); @@ -265,12 +268,18 @@ double complex calHCA1(const int ri, const int rj, const int s, eleNum[rsi] = 1; UpdateProjCnt(rj, ri, s, projCntNew, eleProjCnt, eleNum); + if (FlagRBM) { + UpdateRBMCnt(rj, ri, s, rbmCntNew, rbmCnt, eleNum); + } z = ProjRatio(projCntNew,eleProjCnt); + if (FlagRBM) { + z *= RBMRatio(rbmCntNew,rbmCnt); + } UpdateMAll(mj,s,eleIdx,0,NQPFull); ipNew = CalculateIP_fcmp(PfM,0,NQPFull,MPI_COMM_SELF); - e = CalculateHamiltonian(ipNew,eleIdx,eleCfg,eleNum,projCntNew); + e = CalculateHamiltonian(ipNew,eleIdx,eleCfg,eleNum,projCntNew,rbmCntNew); /* revert hopping */ eleIdx[mj+s*Ne] = rj; @@ -291,7 +300,7 @@ double complex calHCA1(const int ri, const int rj, const int s, /* Assuming ri!=rj, eleNum[rsi]=1, eleNum[rsj]=0 */ double complex calHCA2(const int ri, const int rj, const int s, const double complex ip, int *eleIdx, int *eleCfg, - int *eleNum, int *eleProjCnt) { + int *eleNum, int *eleProjCnt, double complex *rbmCnt) { const int nsize=Nsize; const int nsite2=Nsite2; @@ -310,18 +319,22 @@ double complex calHCA2(const int ri, const int rj, const int s, double complex *myBuffer; double complex myValue=0; double complex v=0.0; + double complex *rbmCntNew, *myRBMCntNew; RequestWorkSpaceInt(NProj); /* for GreenFunc1 */ - RequestWorkSpaceComplex(NQPFull); /* for GreenFunc1 */ + RequestWorkSpaceComplex(NQPFull + FlagRBM*(NRBM_PhysLayerIdx+Nneuron)); /* for GreenFunc1 */ RequestWorkSpaceThreadInt(Nsize+Nsite2+NProj+6); - RequestWorkSpaceThreadComplex(NQPFull+3*Nsize); + RequestWorkSpaceThreadComplex(NQPFull+3*Nsize + FlagRBM*(NRBM_PhysLayerIdx+Nneuron)); bufferInt = GetWorkSpaceInt(NProj); buffer = GetWorkSpaceComplex(NQPFull); + if (FlagRBM) { + rbmCntNew = GetWorkSpaceComplex(NRBM_PhysLayerIdx+Nneuron); + } /* H0 term */ /* / = H0(x') / */ - g = GreenFunc1(ri,rj,s,ip,eleIdx,eleCfg,eleNum,eleProjCnt,bufferInt,buffer); + g = GreenFunc1(ri,rj,s,ip,eleIdx,eleCfg,eleNum,eleProjCnt,bufferInt,rbmCnt,rbmCntNew,buffer); /* hopping */ eleNum[rsi] = 1; @@ -336,7 +349,7 @@ double complex calHCA2(const int ri, const int rj, const int s, /* end of H0 term */ #pragma omp parallel default(shared)\ - private(myEleIdx,myEleNum,myBufferInt,myBuffer,myValue,myRsi,myRsj) \ + private(myRBMCntNew,myEleIdx,myEleNum,myBufferInt,myBuffer,myValue,myRsi,myRsj) \ reduction(+:v) { myEleIdx = GetWorkSpaceThreadInt(Nsize); @@ -345,6 +358,9 @@ double complex calHCA2(const int ri, const int rj, const int s, myRsi = GetWorkSpaceThreadInt(3); myRsj = GetWorkSpaceThreadInt(3); myBuffer = GetWorkSpaceThreadComplex(NQPFull+3*Nsize); + if (FlagRBM) { + myRBMCntNew = GetWorkSpaceThreadComplex(NRBM_PhysLayerIdx+Nneuron); + } #pragma loop noalias for(idx=0;idx1.0e-12) { - val = calHCACA1(ri,rj,rk,rl,si,sk,ip,eleIdx,eleCfg,eleNum,eleProjCnt); + val = calHCACA1(ri,rj,rk,rl,si,sk,ip,eleIdx,eleCfg,eleNum,eleProjCnt,rbmCnt); } else { - val = calHCACA2(ri,rj,rk,rl,si,sk,ip,eleIdx,eleCfg,eleNum,eleProjCnt); + val = calHCACA2(ri,rj,rk,rl,si,sk,ip,eleIdx,eleCfg,eleNum,eleProjCnt,rbmCnt); } return val; @@ -532,10 +548,11 @@ double complex checkGF2(const int ri, const int rj, const int rk, const int rl, double complex calHCACA1(const int ri, const int rj, const int rk, const int rl, const int si,const int sk, const double complex ip, int *eleIdx, int *eleCfg, - int *eleNum, int *eleProjCnt) { + int *eleNum, int *eleProjCnt, double complex *rbmCnt) { double complex *oldInvM; /* [NQPFull*Nsize*Nsize;] */ double complex *oldPfM; /* [NQPFull] */ int *projCntNew; + double complex *rbmCntNew; int rsi=ri+si*Nsite; int rsj=rj+si*Nsite; @@ -545,11 +562,14 @@ double complex calHCACA1(const int ri, const int rj, const int rk, const int rl, double complex ipNew,z,e; RequestWorkSpaceInt(NProj); - RequestWorkSpaceComplex(NQPFull*(Nsize*Nsize+1)); + RequestWorkSpaceComplex(NQPFull*(Nsize*Nsize+1) + FlagRBM*(NRBM_PhysLayerIdx+Nneuron)); projCntNew = GetWorkSpaceInt(NProj); oldInvM = GetWorkSpaceComplex(NQPFull*Nsize*Nsize); oldPfM = GetWorkSpaceComplex(NQPFull); + if (FlagRBM) { + rbmCntNew = GetWorkSpaceComplex(NRBM_PhysLayerIdx + Nneuron); + } /* copy InvM and PfM */ copyMAll(InvM,PfM,oldInvM,oldPfM); @@ -562,6 +582,9 @@ double complex calHCACA1(const int ri, const int rj, const int rk, const int rl, eleNum[rsl] = 0; eleNum[rsk] = 1; UpdateProjCnt(rl, rk, sk, projCntNew, eleProjCnt, eleNum); + if (FlagRBM) { + UpdateRBMCnt(rl, rk, sk, rbmCntNew, rbmCnt, eleNum); + } /* The mj-th electron with spin si hops from rj to ri */ mj = eleCfg[rsj]; @@ -571,13 +594,19 @@ double complex calHCACA1(const int ri, const int rj, const int rk, const int rl, eleNum[rsj] = 0; eleNum[rsi] = 1; UpdateProjCnt(rj, ri, si, projCntNew, projCntNew, eleNum); + if (FlagRBM) { + UpdateRBMCnt(rj, ri, si, rbmCntNew, rbmCntNew, eleNum); + } z = ProjRatio(projCntNew,eleProjCnt); + if (FlagRBM) { + z *= RBMRatio(rbmCntNew,rbmCnt); + } UpdateMAllTwo_fcmp(ml, sk, mj, si, rl, rj, eleIdx, 0, NQPFull); ipNew = CalculateIP_fcmp(PfM,0,NQPFull,MPI_COMM_SELF); - e = CalculateHamiltonian(ipNew,eleIdx,eleCfg,eleNum,projCntNew); + e = CalculateHamiltonian(ipNew,eleIdx,eleCfg,eleNum,projCntNew,rbmCnt); /* revert hopping */ eleIdx[mj+si*Ne] = rj; @@ -597,14 +626,19 @@ double complex calHCACA1(const int ri, const int rj, const int rk, const int rl, ReleaseWorkSpaceInt(); ReleaseWorkSpaceComplex(); - return e*z*ipNew/ip; + if (FlagRBM) { + return e*conj(z*ipNew/ip); + } + else { + return e*z*ipNew/ip; + } } /* calculate / for /=0 */ /* Assuming ri,rj,rk,rl are different, eleNum[rsi]=1, eleNum[rsj]=0, eleNum[rsk]=1, eleNum[rsl]=0 */ double complex calHCACA2(const int ri, const int rj, const int rk, const int rl, const int si,const int sk, - const double complex ip, int *eleIdx, int *eleCfg, int *eleNum, int *eleProjCnt) { + const double complex ip, int *eleIdx, int *eleCfg, int *eleNum, int *eleProjCnt, double complex *rbmCnt) { const int nsize=Nsize; const int nsite2=Nsite2; @@ -625,19 +659,23 @@ double complex calHCACA2(const int ri, const int rj, const int rk, const int rl, double complex *myBuffer; double complex myValue=0.0; double complex v=0.0; + double complex *rbmCntNew, *myRBMCntNew; RequestWorkSpaceInt(NProj); /* for GreenFunc2 */ - RequestWorkSpaceComplex(NQPFull+2*Nsize); /* for GreenFunc2 */ + RequestWorkSpaceComplex(NQPFull+2*Nsize + FlagRBM * (NRBM_PhysLayerIdx+Nneuron)); /* for GreenFunc1 */ RequestWorkSpaceThreadInt(Nsize+Nsite2+NProj+8); - RequestWorkSpaceThreadComplex(NQPFull+3*Nsize); + RequestWorkSpaceThreadComplex(NQPFull+3*Nsize + FlagRBM * (NRBM_PhysLayerIdx+Nneuron)); bufferInt = GetWorkSpaceInt(NProj); buffer = GetWorkSpaceComplex(NQPFull+2*Nsize); + if (FlagRBM) { + rbmCntNew = GetWorkSpaceComplex(NRBM_PhysLayerIdx+Nneuron); + } /* H0 term */ /* / = H0(x') / */ g = GreenFunc2(ri,rj,rk,rl,si,sk,ip, - eleIdx,eleCfg,eleNum,eleProjCnt,bufferInt,buffer); + eleIdx,eleCfg,eleNum,eleProjCnt,bufferInt,rbmCnt,myRBMCntNew,buffer); /* hopping */ eleNum[rsi] = 1; @@ -656,7 +694,7 @@ double complex calHCACA2(const int ri, const int rj, const int rk, const int rl, /* end of H0 term */ #pragma omp parallel default(shared)\ - private(myEleIdx,myEleNum,myBufferInt,myBuffer,myValue,myRsi,myRsj) \ + private(myRBMCntNew,myEleIdx,myEleNum,myBufferInt,myBuffer,myValue,myRsi,myRsj) \ reduction(+:v) { myEleIdx = GetWorkSpaceThreadInt(Nsize); @@ -665,6 +703,9 @@ double complex calHCACA2(const int ri, const int rj, const int rk, const int rl, myRsi = GetWorkSpaceThreadInt(4); myRsj = GetWorkSpaceThreadInt(4); myBuffer = GetWorkSpaceThreadComplex(NQPFull+4*Nsize); + if (FlagRBM) { + myRBMCntNew = GetWorkSpaceThreadComplex(NRBM_PhysLayerIdx+Nneuron); + } #pragma loop noalias for(idx=0;idx 0){ //TBC + RBM[i] = 0.01*(genrand_real2() -0.5)/(double)Nneuron; /* uniform distribution [0,1) */ + } else { + RBM[i] = 0.0; + } + } + }else{ + for(i=0;i 0){ //TBC + RBM[i] = 1e-2*genrand_real2()*cexp(2.0*I*M_PI*genrand_real2()); + //RBM[i] = 1e-2*genrand_real2()*cexp(2.0*I*M_PI*genrand_real2())/(double)Nneuron; + } else { + RBM[i] = 0.0; + } + } + } + } + if(AllComplexFlag==0){ for(i=0;i 0){ //TBC + if(OptFlag[2*i+2*NProj + 2*FlagRBM*NRBM] > 0){ //TBC Slater[i] = 2*(genrand_real2()-0.5); /* uniform distribution [-1,1) */ //Slater[i] = 1*genrand_real2(); /* uniform distribution [0,1) */ //Slater[i] += 1*I*genrand_real2(); /* uniform distribution [0,1) */ @@ -51,7 +73,7 @@ void InitParameter() { } else{ for(i=0;i 0){ //TBC + if(OptFlag[2*i+2*NProj + 2*FlagRBM*NRBM] > 0){ //TBC Slater[i] = 2*(genrand_real2()-0.5); /* uniform distribution [-1,1) */ Slater[i] += 2*I*(genrand_real2()-0.5); /* uniform distribution [-1,1) */ Slater[i] /=sqrt(2.0); @@ -60,8 +82,8 @@ void InitParameter() { Slater[i] = 0.0; } } - } + for(i=0;i Nneuron) hiend = Nneuron; + zz=1.0; +#pragma omp parallel default(shared) private(hi,RbmCntNew,RbmCntOld,zzTmp,icnt) firstprivate(NRBM_PhysLayerIdx,Nneuron) reduction(+:z) reduction(*:zz) + { + icnt=0; +#pragma loop swp +#pragma omp for + for(hi=hist;hi Nneuron) hiend = Nneuron; + zz=1.0; +#pragma omp parallel default(shared) private(hi,RbmCntNew,RbmCntOld,zzTmp,icnt) firstprivate(NRBM_PhysLayerIdx,Nneuron) reduction(+:z) reduction(*:zz) + { + icnt=0; +#pragma loop swp +#pragma omp for + for(hi=hist;hi0) { + for(ri=0;ri0) { + offset = NChargeRBM_PhysLayerIdx; + for(ri=0;ri0) { + offset = NChargeRBM_PhysLayerIdx + NSpinRBM_PhysLayerIdx; + for(ri=0;ri