|
1 | | -import libra_py.units as units |
2 | | -from libra_py import data_conv |
3 | | -import libra_py.data_read as data_read |
4 | | -import util.libutil as comn |
5 | | -import matplotlib.pyplot as plt |
6 | | -import sys |
7 | | -import cmath |
8 | | -import math |
| 1 | +# ********************************************************************************* |
| 2 | +# * Copyright (C) 2025 Daeho Han and Alexey V. Akimov |
| 3 | +# * |
| 4 | +# * This file is distributed under the terms of the GNU General Public License |
| 5 | +# * as published by the Free Software Foundation, either version 3 of |
| 6 | +# * the License, or (at your option) any later version. |
| 7 | +# * See the file LICENSE in the root directory of this distribution |
| 8 | +# * or <http://www.gnu.org/licenses/>. |
| 9 | +# * |
| 10 | +# *********************************************************************************/ |
| 11 | + |
| 12 | +""" |
| 13 | +.. module:: rpi |
| 14 | + :platform: Unix, Windows |
| 15 | + :synopsis: this module implements restricted path integral (RPI) calculations |
| 16 | +
|
| 17 | +.. moduleauthor:: Daeho Han, Alexey V. Akimov |
| 18 | +
|
| 19 | +""" |
| 20 | + |
9 | 21 | import os |
10 | | -import multiprocessing as mp |
11 | | -import time |
| 22 | +import sys |
12 | 23 | import numpy as np |
13 | 24 | import h5py |
14 | | -import scipy.sparse as sp |
| 25 | +import time |
15 | 26 | import multiprocessing as mp |
16 | | - |
17 | 27 | if sys.platform == "cygwin": |
18 | 28 | from cyglibra_core import * |
19 | 29 | elif sys.platform == "linux" or sys.platform == "linux2": |
20 | 30 | from liblibra_core import * |
| 31 | +import libra_py.units as units |
| 32 | +from libra_py import data_conv |
| 33 | +import libra_py.data_read as data_read |
| 34 | +import util.libutil as comn |
21 | 35 |
|
22 | 36 | def run_patch_rpi(rpi_params): |
23 | 37 | """ |
@@ -61,6 +75,14 @@ def run_patch_rpi(rpi_params): |
61 | 75 | Return: |
62 | 76 | None: but performs the action |
63 | 77 | """ |
| 78 | + |
| 79 | + critical_params = ["path_to_save_Hvibs", "iread", "fread", "nsteps", "npatches", "nstates", "path_to_save_patch"] |
| 80 | + default_params = {"run_slurm": False, "submit_template": 'submit_template.slm', "submission_exe": 'sbatch', |
| 81 | + "run_python_file": 'run_template.py', |
| 82 | + "iconds": [0], |
| 83 | + "dt": 1.0*units.fs2au, |
| 84 | + } |
| 85 | + comn.check_input(rpi_params, default_params, critical_params) |
64 | 86 |
|
65 | 87 | out_dir = rpi_params["path_to_save_patch"] |
66 | 88 | if not os.path.exists(out_dir): |
@@ -197,6 +219,11 @@ def run_sum_rpi(rpi_params): |
197 | 219 | Return: |
198 | 220 | None: but performs the action |
199 | 221 | """ |
| 222 | + critical_params = ["nsteps", "npatches", "nstates", "path_to_save_patch"] |
| 223 | + default_params = {"nprocs": 1, "prefix": 'out', "dt": 1.0*units.fs2au, "istate": 0, "iconds": [0]} |
| 224 | + |
| 225 | + comn.check_input(rpi_params, default_params, critical_params) |
| 226 | + |
200 | 227 | nprocs = rpi_params["nprocs"] |
201 | 228 |
|
202 | 229 | nsteps, dt = rpi_params["nsteps"], rpi_params["dt"] |
@@ -248,6 +275,10 @@ def run_sum_rpi_crude(rpi_params): |
248 | 275 | Return: |
249 | 276 | None: but performs the action |
250 | 277 | """ |
| 278 | + critical_params = ["nsteps", "npatches", "nstates", "path_to_save_patch"] |
| 279 | + default_params = {"prefix": 'out', "dt": 1.0*units.fs2au, "istate": 0, "iconds": [0]} |
| 280 | + |
| 281 | + comn.check_input(rpi_params, default_params, critical_params) |
251 | 282 |
|
252 | 283 | nsteps, dt, istate = rpi_params["nsteps"], rpi_params["dt"], rpi_params["istate"] |
253 | 284 |
|
|
0 commit comments