Skip to content

Commit 46c7f0d

Browse files
committed
Merge branch 'develop' into release-2.1
2 parents f23bfe5 + d4ecc9a commit 46c7f0d

File tree

5 files changed

+149
-87
lines changed

5 files changed

+149
-87
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ https://www.pasums.issp.u-tokyo.ac.jp/abics
6565

6666
## Author
6767

68-
Shusuke Kasamatsu, Yuichi Motoyama, Kazuyoshi Yoshimi
68+
Shusuke Kasamatsu, Yuichi Motoyama, Tatsumi Aoyama, Kazuyoshi Yoshimi
6969

7070
## Manual
7171

docs/sphinx/en/source/how_to_use/index.rst

+4-44
Original file line numberDiff line numberDiff line change
@@ -186,47 +186,7 @@ By using ``abics_sampling``, Monte Carlo sampling can be performed by using the
186186
Running the program will create directories named by the replica numbers under the current directory,
187187
and each replica runs the solver in it.
188188

189-
By using ``aenetPyLammps``, you can perform high-speed sampling using ``aenet`` which is libraryized by using ``lammps``.
190-
To use ``aenetPyLammps``, you need to install ``aenet-lammps`` and ``lammps``. See below for details.
191-
192-
aenetPyLammps
193-
**************
194-
195-
- URL : https://github.com/HidekiMori-CIT/aenet-lammps
196-
197-
- Use `the commit 5d0f4bca <https://github.com/HidekiMori-CIT/aenet-lammps/commit/5d0f4bcacb7cd3ecbcdb0e4fdd9dc3d7bf06af0a>`_ .
198-
199-
- ``git checkout 5d0f4bca``
200-
201-
- Please install ``aenet-lammps``` according to the procedure specified in the above URL. Below are notes on installation.
202-
203-
- ``aenet``
204-
205-
- Make sure to add ``-fPIC`` to ``FCFLAGS`` in ``makefiles/Makefile.*``.
206-
207-
- ``lammps``
208-
209-
- Make sure to add ``LMP_INC = -DLAMMPS_EXCEPTIONS`` in ``src/Makefile``.
210-
- Make sure to add ``mode=shared`` to the make command option as ``make mode=shared mpi`` (when GCC, for example).
211-
212-
- After completing the above installation, run ``make install-python``.
213-
214-
- ``lammps`` python package will be installed to the Python environment which is invoked by ``python`` command.
215-
216-
- Reference file rules
217-
218-
- Place the input file ``in.lammps`` for ``aenet-lammps`` in the ``predict`` directory to evaluate the energy for the input coordinates using the trained potential model.
219-
The format of ``in.lammmps`` is written in the README of ``aenet-lammps`` repository.
220-
221-
- abICS control file
222-
223-
- `In the ``[sampling.solver]`` section, set ``type`` to ``aenetPyLammps`` and ``run_scheme`` to ``function``.
224-
225-
.. code-block:: bash
226-
227-
type = “aenetPyLammps”
228-
run_scheme = ‘function’
229-
230-
231-
232-
.. solver_specific_notes:
189+
abICS can call the ``aenet`` library via the LAMMPS interface (``aenetPyLammps``).
190+
This is faster than calling ``aenet`` directly because it does not need file I/O.
191+
To use ``aenetPyLammps``, you need to install ``aenet-lammps`` and ``lammps``.
192+
For details, please refer to the :ref:`tutorial_aenet_lammps`.

docs/sphinx/en/source/tutorial/aenet.rst

+71
Original file line numberDiff line numberDiff line change
@@ -522,3 +522,74 @@ Also, please note that the number of Monte Carlo steps in this example input is
522522
fully converging the degree of inversion. It is recommended to perform a separate
523523
RXMC calculation using the obtained neural network model
524524
with a larger number of sampling steps to calculate thermodynamic averages.
525+
526+
527+
.. _tutorial_aenet_lammps:
528+
529+
Predict energy of annet model via LAMMPS interface
530+
----------------------------------------------------
531+
532+
abICS can call the ``aenet`` library via the LAMMPS interface (``aenetPyLammps``).
533+
This is faster than calling ``aenet`` directly because it does not need file I/O.
534+
The set of input files used in this tutorial can be found in ``examples/active_learning_qe``.
535+
536+
Install aenetPyLammps
537+
~~~~~~~~~~~~~~~~~~~~~~~~
538+
539+
To use ``aenetPyLammps``, you need to install ``aenet-lammps`` and ``lammps``.
540+
541+
- URL : https://github.com/HidekiMori-CIT/aenet-lammps
542+
543+
- Use `the commit 5d0f4bca <https://github.com/HidekiMori-CIT/aenet-lammps/commit/5d0f4bcacb7cd3ecbcdb0e4fdd9dc3d7bf06af0a>`_ .
544+
545+
- ``git checkout 5d0f4bca``
546+
547+
- Please install ``aenet-lammps``` according to the procedure specified in the above URL. Below are notes on installation.
548+
549+
- ``aenet``
550+
551+
- Make sure to add ``-fPIC`` to ``FCFLAGS`` in ``makefiles/Makefile.*``.
552+
553+
- ``lammps``
554+
555+
- Make sure to add ``LMP_INC = -DLAMMPS_EXCEPTIONS`` in ``src/Makefile``.
556+
- Make sure to add ``mode=shared`` to the make command option as ``make mode=shared mpi`` (when GCC, for example).
557+
558+
- After completing the above installation, run ``make install-python``.
559+
560+
- ``lammps`` python package will be installed to the Python environment which is invoked by ``python`` command.
561+
562+
563+
Training
564+
~~~~~~~~~~~~
565+
566+
The training procedure is the same as the previous section.
567+
568+
Sampling
569+
~~~~~~~~~~~
570+
571+
Input file for prediction
572+
****************************
573+
574+
Instead of the input file ``predict.in`` for ``predict.x``,
575+
place the input file ``in.lammps`` under the ``predict``::
576+
577+
pair_style aenet
578+
pair_coeff * * v00 Al Mg 15t-15t.nn Al Mg
579+
neighbor 0.1 bin
580+
581+
582+
The detailed format of ``in.lammmps`` is written in the README of ``aenet-lammps`` repository.
583+
584+
Input for Sampling
585+
********************
586+
587+
Change the ``type`` and ``run_scheme`` in the ``[sampling.solver]`` section of the input file to ``'aenetPyLammps'`` and ``'function'``, respectively.
588+
589+
.. code-block:: toml
590+
591+
[sampling.solver]
592+
type = 'aenetPyLammps'
593+
base_input_dir = ['./baseinput']
594+
perturb = 0.0
595+
run_scheme = 'function'

docs/sphinx/ja/source/how_to_use/index.rst

+5-42
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ OpenMX
128128
機械学習モデル訓練および評価用参照ファイルの準備
129129
---------------------------------------------------
130130

131-
使用する機械学習モデルソルバー(現在はaenet, aenetPyLammpsのみに対応)の入力形式に従った入力ファイルを用意します。
131+
使用する機械学習モデルソルバー(現在はaenetのみに対応)の入力形式に従った入力ファイルを用意します。
132132
参照ファイルのパスはabICSの入力ファイルにある ``[solver]`` セクションの ``base_input_dir`` で指定します。
133133
座標情報については、abICSの入力ファイルを参照するため、記載する必要はありません。
134134

@@ -166,7 +166,6 @@ aenet
166166
run_scheme = ‘subprocess’
167167
168168
169-
170169
学習データの作成
171170
-------------------
172171

@@ -187,44 +186,8 @@ aenet
187186

188187
``abics_sampling`` を用いてモンテカルロサンプリングを行います(MPI 実行時に指定するプロセス数はレプリカ数以上である必要があります)。
189188
実行すると、カレントディレクトリ以下にレプリカ番号を名前にもつディレクトリが作られ、各レプリカはその中でソルバーを実行します。
190-
なお、``aenetPyLammps`` を利用すると、 ``lammps`` を利用することでライブラリ化された ``aenet`` を用いた高速サンプリングが可能です。
191-
``aenetPyLammps`` の利用には、 ``aenet-lammps`` および ``lammps`` のインストールが必要です。詳細は以下をご覧ください。
192-
193-
194-
aenetPyLammps
195-
**************
196-
197-
- URL : https://github.com/HidekiMori-CIT/aenet-lammps
198-
199-
- `コミット 5d0f4bc <https://github.com/HidekiMori-CIT/aenet-lammps/commit/5d0f4bcacb7cd3ecbcdb0e4fdd9dc3d7bf06af0a>`_ で動作確認済。
200-
201-
- ``git checkout 5d0f4bc``
202-
203-
- 上記URLで指定された手順に従ってインストールしてください。以下、インストール時の注意事項です。
204-
205-
- ``aenet``
206-
207-
- ``makefiles/Makefile.*`` 中の ``FCFLAGS`` オプションに ``-fPIC`` を追加してください。
208-
- ``lammps``
209-
210-
- ``src/Makefile`` 中に ``LMP_INC = -DLAMMPS_EXCEPTIONS`` を追加してください。
211-
- make 時にオプションで ``mode=shared`` をつけるようにしてください。
212-
213-
- 上記のインストール終了後、 ``make install-python`` を実行してください。
214-
215-
- ``python`` コマンドで起動するPython 環境に ``lammps`` パッケージがインストールされます。
216-
217-
- 参照ファイル(参照ファイルの具体例についてはチュートリアル参照)
218-
219-
- ``aenet-lammps`` 用の入力ファイル ``in.lammps`` を ``[train]`` セクションの ``base_input_dir`` で設定したディレクトリ内の ``predict`` ディレクトリに設置してください。
220-
``in.lammmps`` のフォーマットは、 ``aenet-lammps`` のGitHubリポジトリにあるREADMEを参照してください。
221-
222-
- abICS 入力ファイル
223-
224-
- ``[sampling.solver]`` セクションで ``type`` に ``aenetPyLammps`` 、 ``run_scheme`` に ``function`` を設定してください。
225-
226-
.. code-block:: bash
227-
228-
type = “aenetPyLammps”
229-
run_scheme = ‘function’
189+
なお、 LAMMPSインターフェースをもちいた ``aenet`` ライブラリ呼び込みにも対応しています(``aenetPyLammps``)。
190+
ファイル入出力やプロセスフォークなどを行わないため、 ``aenet`` を直接呼び出すよりも高速に動作します。
191+
``aenetPyLammps`` の利用には、 `aenet-lammps <https://github.com/HidekiMori-CIT/>`_ および `LAMMPS <https://www.lammps.org/>`_ のインストールが必要です。
192+
インストールや使い方の詳細は :ref:`tutorial_aenet_lammps` を参照してください。
230193

docs/sphinx/ja/source/tutorial/aenet.rst

+68
Original file line numberDiff line numberDiff line change
@@ -538,3 +538,71 @@ VASPのPOSCARファイル形式で記載された各ステップごとの原子
538538
また、反転度の計算を完全に収束させるためには、例題のモンテカルロステップ数では不十分であることにご注意ください。
539539
能動学習のサイクルとは別にモンテカルロステップ数を増やした計算を行って、熱力学平均を計算することをおすすめ
540540
します。
541+
542+
543+
.. _tutorial_aenet_lammps:
544+
545+
LAMMPS インターフェースを利用したサンプリング
546+
----------------------------------------------
547+
548+
モンテカルロサンプリングにおいては、 LAMMPSインターフェースをもちいた ``aenet`` ライブラリ呼び出しにも対応しています(``aenetPyLammps`` ソルバー)。
549+
ファイル入出力などを行わないため、 ``aenet`` をプロセスとして呼び出すよりも高速に動作します。
550+
入力ファイル例としては ``examples/active_learning_qe_lammps`` を参考にしてください。
551+
552+
aenet-lammps のインストール
553+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
554+
555+
``aenetPyLammps`` の利用には、 ``aenet-lammps`` を組み込んだ LAMMPS のインストールが必要です。
556+
557+
- URL : https://github.com/HidekiMori-CIT/aenet-lammps
558+
559+
- `コミット 5d0f4bc <https://github.com/HidekiMori-CIT/aenet-lammps/commit/5d0f4bcacb7cd3ecbcdb0e4fdd9dc3d7bf06af0a>`_ で動作確認済。
560+
561+
- ``git checkout 5d0f4bc``
562+
563+
- 上記URLで指定された手順に従ってインストールしてください。以下、インストール時の注意事項です。
564+
565+
- ``aenet``
566+
567+
- ``makefiles/Makefile.*`` 中の ``FCFLAGS`` オプションに ``-fPIC`` を追加してください。
568+
- ``lammps``
569+
570+
- ``src/Makefile`` 中に ``LMP_INC = -DLAMMPS_EXCEPTIONS`` を追加してください。
571+
- make 時にオプションで ``mode=shared`` をつけるようにしてください。
572+
573+
- 上記のインストール終了後、 ``make install-python`` を実行してください。
574+
575+
- ``python`` コマンドで起動するPython 環境に ``lammps`` パッケージがインストールされます。
576+
577+
578+
モデル学習
579+
~~~~~~~~~~~
580+
581+
モデル学習のやりかたは前述の ``aenet`` によるものと同様です。
582+
583+
サンプリング
584+
~~~~~~~~~~~~~
585+
586+
predict 用入力ファイル
587+
**************************
588+
589+
``predict.x`` でつかわれていた入力ファイル ``predict.in`` のかわりに、以下のような入力ファイル ``in.lammps`` を ``predict`` ディレクトリに設置してください::
590+
591+
pair_style aenet
592+
pair_coeff * * v00 Al Mg 15t-15t.nn Al Mg
593+
neighbor 0.1 bin
594+
595+
入力ファイルフォーマットの詳細は ``aenet-lammps`` リポジトリの README を参照してください。
596+
597+
サンプリング
598+
******************
599+
600+
``[sanmping.solver]`` セクションの ``type`` を ``'aenetPyLammps'`` に、 ``run_scheme`` を ``'function'`` に設定すると、 LAMMPS インターフェースを利用したサンプリングを実行できます。
601+
602+
.. code-block:: toml
603+
604+
[sampling.solver]
605+
type = 'aenetPyLammps'
606+
base_input_dir = ['./baseinput']
607+
perturb = 0.0
608+
run_scheme = 'function'

0 commit comments

Comments
 (0)