venuspython 1.0.6__tar.gz → 1.0.7__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {venuspython-1.0.6 → venuspython-1.0.7}/PKG-INFO +1 -1
- venuspython-1.0.7/venuspy/__init__.py +1 -0
- {venuspython-1.0.6 → venuspython-1.0.7}/venuspy/cli.py +113 -80
- {venuspython-1.0.6 → venuspython-1.0.7}/venuspy/initialSampling.py +413 -113
- {venuspython-1.0.6 → venuspython-1.0.7}/venuspy/md.py +2 -2
- {venuspython-1.0.6 → venuspython-1.0.7}/venuspython.egg-info/PKG-INFO +1 -1
- venuspython-1.0.6/venuspy/__init__.py +0 -1
- {venuspython-1.0.6 → venuspython-1.0.7}/README.md +0 -0
- {venuspython-1.0.6 → venuspython-1.0.7}/pyproject.toml +0 -0
- {venuspython-1.0.6 → venuspython-1.0.7}/setup.cfg +0 -0
- {venuspython-1.0.6 → venuspython-1.0.7}/venuspy/calc/bagelcalc.py +0 -0
- {venuspython-1.0.6 → venuspython-1.0.7}/venuspy/calc/chempotpycalc.py +0 -0
- {venuspython-1.0.6 → venuspython-1.0.7}/venuspy/calc/minisgdmlcalc.py +0 -0
- {venuspython-1.0.6 → venuspython-1.0.7}/venuspy/calc/mopaccalc.py +0 -0
- {venuspython-1.0.6 → venuspython-1.0.7}/venuspy/calc/nwchemcalc.py +0 -0
- {venuspython-1.0.6 → venuspython-1.0.7}/venuspy/calc/nwchemexcalc.py +0 -0
- {venuspython-1.0.6 → venuspython-1.0.7}/venuspy/calc/original_nwchemexcalc.py +0 -0
- {venuspython-1.0.6 → venuspython-1.0.7}/venuspy/calc/physnetcalc.py +0 -0
- {venuspython-1.0.6 → venuspython-1.0.7}/venuspy/calc/psi4calc.py +0 -0
- {venuspython-1.0.6 → venuspython-1.0.7}/venuspy/calc/qcengineGAMESScalc.py +0 -0
- {venuspython-1.0.6 → venuspython-1.0.7}/venuspy/calc/xtbcalc.py +0 -0
- {venuspython-1.0.6 → venuspython-1.0.7}/venuspython.egg-info/SOURCES.txt +0 -0
- {venuspython-1.0.6 → venuspython-1.0.7}/venuspython.egg-info/dependency_links.txt +0 -0
- {venuspython-1.0.6 → venuspython-1.0.7}/venuspython.egg-info/entry_points.txt +0 -0
- {venuspython-1.0.6 → venuspython-1.0.7}/venuspython.egg-info/top_level.txt +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "1.0.7"
|
|
@@ -24,38 +24,38 @@ from .md import regularMD, pingpongMD, smoothedMD, r2threshold
|
|
|
24
24
|
try:
|
|
25
25
|
from .calc.bagelcalc import bagelcalculator
|
|
26
26
|
except ImportError:
|
|
27
|
-
print("WARNING: BAGEL
|
|
27
|
+
print("#VENUS WARNING: BAGEL HAS NOT BEEN LOADED ... IT WILL NOT BE AVAILABLE FOR INITIAL SAMPLING")
|
|
28
28
|
|
|
29
29
|
# Try importing psi4
|
|
30
30
|
try:
|
|
31
31
|
from .calc.psi4calc import psi4calculator
|
|
32
32
|
except ImportError:
|
|
33
|
-
print("WARNING:
|
|
33
|
+
print("#VENUS WARNING: PSI4 HAS NOT BEEN LOADED ... IT WILL NOT BE AVAILABLE FOR INITIAL SAMPLING")
|
|
34
34
|
|
|
35
35
|
# Try importing xtb (fast, semi-empirical DFT):
|
|
36
36
|
try:
|
|
37
37
|
# from tblite.ase import TBLite
|
|
38
38
|
from .calc.xtbcalc import TBLite
|
|
39
39
|
except ImportError:
|
|
40
|
-
print("WARNING:
|
|
40
|
+
print("#VENUS WARNING: XTB HAS NOT BEEN LOADED ... IT WILL NOT BE AVAILABLE FOR INITIAL SAMPLING")
|
|
41
41
|
|
|
42
42
|
# Try import NWChem (not NWChemEx)
|
|
43
43
|
try:
|
|
44
44
|
from .calc.nwchemcalc import nwchemcalculator
|
|
45
45
|
except ImportError:
|
|
46
|
-
print("WARNING:
|
|
46
|
+
print("#VENUS WARNING: NWCHEM HAS NOT BEEN LOADED ... IT WILL NOT BE AVAILABLE FOR INITIAL SAMPLING")
|
|
47
47
|
|
|
48
48
|
# Try importing NWChemEx
|
|
49
49
|
try:
|
|
50
50
|
from .calc.nwchemexcalc import nwchemexcalculator
|
|
51
51
|
except ImportError:
|
|
52
|
-
print("WARNING:
|
|
52
|
+
print("#VENUS WARNING: NWCHEMEX HAS NOT BEEN LOADED ... IT WILL NOT BE AVAILABLE FOR INITIAL SAMPLING")
|
|
53
53
|
|
|
54
54
|
# Try importing QCEngine/GAMESS
|
|
55
55
|
try:
|
|
56
56
|
from .calc.qcengineGAMESScalc import qcengineGAMESScalculator
|
|
57
57
|
except ImportError:
|
|
58
|
-
print("WARNING:
|
|
58
|
+
print("#VENUS WARNING: QCENGINE/GAMESS HAS NOT BEEN LOADED ... IT WILL NOT BE AVAILABLE FOR INITIAL SAMPLING")
|
|
59
59
|
|
|
60
60
|
# Try importing sGDML
|
|
61
61
|
try:
|
|
@@ -67,26 +67,26 @@ try:
|
|
|
67
67
|
from .calc.minisgdmlcalc import miniSGDMLCalculator
|
|
68
68
|
|
|
69
69
|
except ImportError:
|
|
70
|
-
print("WARNING:
|
|
70
|
+
print("#VENUS WARNING: SGDML HAS NOT BEEN LOADED ... IT WILL NOT BE AVAILABLE FOR INITIAL SAMPLING")
|
|
71
71
|
|
|
72
72
|
# Try importing chempotpy
|
|
73
73
|
try:
|
|
74
74
|
from .calc.chempotpycalc import chempotpyCalculator
|
|
75
75
|
except ImportError:
|
|
76
|
-
print("WARNING:
|
|
76
|
+
print("#VENUS WARNING: CHEMPOTPY HAS NOT BEEN LOADED ... IT WILL NOT BE AVAILABLE FOR INITIAL SAMPLING")
|
|
77
77
|
|
|
78
78
|
# Try importing Schnet
|
|
79
79
|
try:
|
|
80
80
|
import schnetpack as spk
|
|
81
81
|
import torch
|
|
82
82
|
except ImportError:
|
|
83
|
-
print("WARNING:
|
|
83
|
+
print("#VENUS WARNING: SCHNET HAS NOT BEEN LOADED ... IT WILL NOT BE AVAILABLE FOR INITIAL SAMPLING")
|
|
84
84
|
|
|
85
85
|
# Try importing Physnet
|
|
86
86
|
try:
|
|
87
87
|
from .calc.physnetcalc import PNCalculator
|
|
88
88
|
except ImportError:
|
|
89
|
-
print("WARNING:
|
|
89
|
+
print("#VENUS WARNING: PHYSNET HAS NOT BEEN LOADED ... IT WILL NOT BE AVAILABLE FOR INITIAL SAMPLING")
|
|
90
90
|
|
|
91
91
|
|
|
92
92
|
|
|
@@ -130,17 +130,19 @@ def main():
|
|
|
130
130
|
parser.add_argument("--E0", type=float, help="The initial total energy to track the drift in total energy (e.g. if the trajectory is being restarted)",default=None)
|
|
131
131
|
parser.add_argument("--n_threads", type=int, help="The number of threads to ask psi4 to use")
|
|
132
132
|
|
|
133
|
-
parser.add_argument("--INITQPa", type=str, help="Initial sampling method for atoms in first group ('semiclassical', 'microcanonical', 'thermal', or None)", default="")
|
|
133
|
+
parser.add_argument("--INITQPa", type=str, help="Initial sampling method for atoms in first group ('semiclassical', 'microcanonical', 'thermal', 'microcanonicalnormalmode', or None)", default="")
|
|
134
134
|
parser.add_argument("--NVIBa", type=int, help="Vibrational quantum number of atoms in first group (supply if using the 'semiclassical' initial sampling)")
|
|
135
135
|
parser.add_argument("--NROTa", type=int, help="Rotational quantum number of atoms in first group (supply if using the 'semiclassical' initial sampling)")
|
|
136
|
+
parser.add_argument("--EVIBNMODESa", type=str, help="List of normal mode vibrational energies of atoms in first group (supply if using the 'microcanonicalnormalmode' initial sampling)")
|
|
136
137
|
parser.add_argument("--EVIBa", type=float, help="Vibrational energy of atoms in first group (supply if using the 'microcanonical' initial sampling)")
|
|
137
138
|
parser.add_argument("--EROTa", type=float, help="Rotational energy of atoms in first group (supply if using the 'microcanonical' initial sampling)")
|
|
138
139
|
parser.add_argument("--TVIBa", type=float, help="Vibrational temperature of atoms in first group (supply if using the 'thermal' initial sampling)")
|
|
139
140
|
parser.add_argument("--TROTa", type=float, help="Rotational temperature of atoms in first group (supply if using the 'thermal' initial sampling)")
|
|
140
141
|
|
|
141
|
-
parser.add_argument("--INITQPb", type=str, help="Initial sampling method for atoms in second group ('semiclassical', 'microcanonical', 'thermal', or None)", default="")
|
|
142
|
+
parser.add_argument("--INITQPb", type=str, help="Initial sampling method for atoms in second group ('semiclassical', 'microcanonical', 'thermal', 'microcanonicalnormalmode', or None)", default="")
|
|
142
143
|
parser.add_argument("--NVIBb", type=int, help="Vibrational quantum number of atoms in second group (supply if using the 'semiclassical' initial sampling)")
|
|
143
144
|
parser.add_argument("--NROTb", type=int, help="Rotational quantum number of atoms in second group (supply if using the 'semiclassical' initial sampling)")
|
|
145
|
+
parser.add_argument("--EVIBNMODESb", type=str, help="List of normal mode vibrational energies of atoms in second group (supply if using the 'microcanonicalnormalmode' initial sampling)")
|
|
144
146
|
parser.add_argument("--EVIBb", type=float, help="Vibrational energy of atoms in second group (supply if using the 'microcanonical' initial sampling)")
|
|
145
147
|
parser.add_argument("--EROTb", type=float, help="Rotational energy of atoms in second group (supply if using the 'microcanonical' initial sampling)")
|
|
146
148
|
parser.add_argument("--TVIBb", type=float, help="Vibrational temperature of atoms in second group (supply if using the 'thermal' initial sampling)")
|
|
@@ -149,21 +151,6 @@ def main():
|
|
|
149
151
|
|
|
150
152
|
########################################################################################
|
|
151
153
|
|
|
152
|
-
# A function to print the potential, kinetic and total energy
|
|
153
|
-
def printenergy(a,step,energyflag):
|
|
154
|
-
if ("ERROR" in energyflag):
|
|
155
|
-
epot = 0.0
|
|
156
|
-
ekin = a.get_kinetic_energy() / (units.kcal/units.mol)
|
|
157
|
-
print('@Epot = %.3f Ekin = %.3f (T=%3.0fK) '
|
|
158
|
-
'Etot = %.3f kcal/mol Step = %8d %s' % (epot, ekin, ekin / (len(a) * 1.5 * 8.617281e-5), epot + ekin, step, energyflag))
|
|
159
|
-
else:
|
|
160
|
-
epot = a.get_potential_energy() / (units.kcal/units.mol)
|
|
161
|
-
ekin = a.get_kinetic_energy() / (units.kcal/units.mol)
|
|
162
|
-
print('@Epot = %.3f Ekin = %.3f (T=%3.0fK) '
|
|
163
|
-
'Etot = %.3f kcal/mol Step = %8d %s' % (epot, ekin, ekin / (len(a) * 1.5 * 8.617281e-5), epot + ekin, step, energyflag))
|
|
164
|
-
|
|
165
|
-
########################################################################################
|
|
166
|
-
|
|
167
154
|
# Get the various arguments
|
|
168
155
|
Qfile = args["initialGeometryFile"]
|
|
169
156
|
input_path = args["PESinputFile"]
|
|
@@ -193,18 +180,29 @@ def main():
|
|
|
193
180
|
optimize_flag = args["optimize"]
|
|
194
181
|
|
|
195
182
|
if ((Nsteps is None) or (Nprint is None) or (dt is None)):
|
|
196
|
-
raise ValueError("
|
|
183
|
+
raise ValueError("#VENUS FOR MD, NEED TO SPECIFY THESE THREE ARGUMENTS: --production --interval --time_step")
|
|
197
184
|
|
|
198
185
|
n_threads = args["n_threads"]
|
|
199
186
|
if (n_threads is None): n_threads = 1
|
|
200
187
|
|
|
188
|
+
|
|
201
189
|
samplingMethod = [ args["INITQPa"], args["INITQPb"] ]
|
|
202
190
|
vibrationSampling = []
|
|
203
191
|
rotationSampling = []
|
|
204
192
|
if (samplingMethod[0] == "semiclassical"):
|
|
205
193
|
vibrationSampling.append(args["NVIBa"])
|
|
206
194
|
rotationSampling.append(args["NROTa"])
|
|
207
|
-
elif (
|
|
195
|
+
elif (samplingMethod[0] == "microcanonicalnormalmode"):
|
|
196
|
+
normalmodeinput = args["EVIBNMODESa"]
|
|
197
|
+
try:
|
|
198
|
+
vibrationSampling.append([float(x) for x in normalmodeinput.split(",")])
|
|
199
|
+
except:
|
|
200
|
+
raise ValueError("#VENUS ERROR IN READING NORMAL MODE SAMPLING INPUTS (EVIBNMODESA) ... SHOULD BE COMMA-SEPARATED STRING OF VIBRATIONAL ENERGIES FOR EACH MODE")
|
|
201
|
+
rotationSampling.append(args["EROTa"])
|
|
202
|
+
elif (samplingMethod[0] == "microcanonical"):
|
|
203
|
+
vibrationSampling.append(args["EVIBa"])
|
|
204
|
+
rotationSampling.append(args["EROTa"])
|
|
205
|
+
elif (samplingMethod[0] == "microcanonical-quantum"):
|
|
208
206
|
vibrationSampling.append(args["EVIBa"])
|
|
209
207
|
rotationSampling.append(args["EROTa"])
|
|
210
208
|
else:
|
|
@@ -213,12 +211,23 @@ def main():
|
|
|
213
211
|
if (samplingMethod[1] == "semiclassical"):
|
|
214
212
|
vibrationSampling.append(args["NVIBb"])
|
|
215
213
|
rotationSampling.append(args["NROTb"])
|
|
216
|
-
elif (
|
|
214
|
+
elif (samplingMethod[1] == "microcanonicalnormalmode"):
|
|
215
|
+
normalmodeinput = args["EVIBNMODESb"]
|
|
216
|
+
try:
|
|
217
|
+
vibrationSampling.append([float(x) for x in normalmodeinput.split(",")])
|
|
218
|
+
except:
|
|
219
|
+
raise ValueError("#VENUS ERROR IN READING NORMAL MODE SAMPLING INPUTS (EVIBNMODESB) ... SHOULD BE COMMA-SEPARATED STRING OF VIBRATIONAL ENERGIES FOR EACH MODE")
|
|
220
|
+
rotationSampling.append(args["EROTb"])
|
|
221
|
+
elif (samplingMethod[1] == "microcanonical"):
|
|
222
|
+
vibrationSampling.append(args["EVIBb"])
|
|
223
|
+
rotationSampling.append(args["EROTb"])
|
|
224
|
+
elif (samplingMethod[1] == "microcanonical-quantum"):
|
|
217
225
|
vibrationSampling.append(args["EVIBb"])
|
|
218
226
|
rotationSampling.append(args["EROTb"])
|
|
219
227
|
else:
|
|
220
228
|
vibrationSampling.append(args["TVIBb"])
|
|
221
229
|
rotationSampling.append(args["TROTb"])
|
|
230
|
+
|
|
222
231
|
|
|
223
232
|
# Note:
|
|
224
233
|
# Right now, all arguments are mandatory (even though this does
|
|
@@ -245,16 +254,16 @@ def main():
|
|
|
245
254
|
try_qcenginegamess = False
|
|
246
255
|
if (input_path.endswith(('.npz',))):
|
|
247
256
|
|
|
248
|
-
print("
|
|
257
|
+
print("#VENUS INPUT FILE '"+input_path+"' LOOKS LIKE A SGDML FILE SO WILL ATTEMPT TO READ IT IN AS SUCH...")
|
|
249
258
|
try:
|
|
250
259
|
calc = SGDMLCalculator(input_path)
|
|
251
260
|
try_sgdml = True
|
|
252
261
|
except:
|
|
253
|
-
print("
|
|
262
|
+
print("#VENUS COULD NOT LOAD FILE '"+input_path+"' AS A SGDML MODEL!")
|
|
254
263
|
try_psi4 = True
|
|
255
264
|
|
|
256
265
|
elif (input_path.endswith(('.physnet.config',))):
|
|
257
|
-
print("
|
|
266
|
+
print("#VENUS INPUT FILE '"+input_path+"' LOOKS LIKE A PHYSNET CONFIG FILE SO WILL ATTEMPT TO READ IT IN AS SUCH...")
|
|
258
267
|
|
|
259
268
|
if True:
|
|
260
269
|
tmp_mol = read(Qfile)
|
|
@@ -294,25 +303,40 @@ def main():
|
|
|
294
303
|
if (try_schnet):
|
|
295
304
|
|
|
296
305
|
# Initialize the ML ase interface
|
|
306
|
+
|
|
307
|
+
spk_rcut = 6.0
|
|
297
308
|
|
|
298
|
-
# To accomodate for the older versions of numpy used in
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
309
|
+
# To accomodate for the older versions of numpy used in Schnetpack version < 2.0
|
|
310
|
+
if True:
|
|
311
|
+
np.int = np.int32
|
|
312
|
+
np.float = np.float64
|
|
313
|
+
np.bool = np.bool_
|
|
314
|
+
|
|
315
|
+
# The appropriate arguments for the current Schnetpack version >= 2.0
|
|
316
|
+
if True:
|
|
317
|
+
calc = spk.interfaces.SpkCalculator(
|
|
318
|
+
input_path,
|
|
319
|
+
device="cpu",
|
|
320
|
+
energy_unit="eV",
|
|
321
|
+
position_unit="Angstrom",
|
|
322
|
+
neighbor_list=spk.transform.ASENeighborList(spk_rcut),
|
|
323
|
+
)
|
|
324
|
+
|
|
325
|
+
# The appropriate arguments for the original Schnetpack version < 2.0
|
|
326
|
+
else:
|
|
327
|
+
calc = spk.interfaces.SpkCalculator(
|
|
304
328
|
input_path,
|
|
305
329
|
device="cpu",
|
|
306
330
|
energy="energy", # Name of energies
|
|
307
331
|
forces="forces", # Name of forces
|
|
308
332
|
energy_units="kcal/mol",
|
|
309
333
|
forces_units="kcal/mol/A",
|
|
310
|
-
neighbor_list=spk.transform.ASENeighborList(
|
|
311
|
-
|
|
334
|
+
neighbor_list=spk.transform.ASENeighborList(spk_rcut),
|
|
335
|
+
)
|
|
312
336
|
|
|
313
337
|
|
|
314
338
|
if (try_bagel):
|
|
315
|
-
print("
|
|
339
|
+
print("#VENUS READING INPUT FILE '"+input_path+"' AS A BAGEL INPUT FILE...")
|
|
316
340
|
calc = bagelcalculator(custominputfile=input_path,command='mpirun /mnt/lustre/koa/koastore/rsun_group/camels/BAGEL_1_AV/BAGEL/bin/BAGEL bagel0.json > bagel0.out')
|
|
317
341
|
|
|
318
342
|
# calc.restarts_max = 2 # Max number of allowable SCF restarts
|
|
@@ -325,7 +349,7 @@ def main():
|
|
|
325
349
|
calc.F_to_eV_Ang = (units.Ha / units.Bohr)
|
|
326
350
|
|
|
327
351
|
if (try_psi4):
|
|
328
|
-
print("
|
|
352
|
+
print("#VENUS READING INPUT FILE '"+input_path+"' AS A PSI4 INPUT FILE...")
|
|
329
353
|
calc = psi4calculator(input_path,n_threads=n_threads)
|
|
330
354
|
|
|
331
355
|
calc.restarts_max = 2 # Max number of allowable SCF restarts
|
|
@@ -338,11 +362,11 @@ def main():
|
|
|
338
362
|
calc.F_to_eV_Ang = (units.Ha / units.Bohr)
|
|
339
363
|
|
|
340
364
|
if (try_xtb):
|
|
341
|
-
print("
|
|
365
|
+
print("#VENUS READING INPUT FILE '"+input_path+"' AS A XTB INPUT FILE...")
|
|
342
366
|
calc = TBLite(input_path)
|
|
343
367
|
|
|
344
368
|
if (try_qcenginegamess):
|
|
345
|
-
print("
|
|
369
|
+
print("#VENUS READING INPUT FILE '"+input_path+"' AS A QCENGINE/GAMESS INPUT FILE...")
|
|
346
370
|
calc = qcengineGAMESScalculator(input_path,n_threads=n_threads)
|
|
347
371
|
|
|
348
372
|
# To conform to VENUS, we are going to keep the units
|
|
@@ -353,7 +377,7 @@ def main():
|
|
|
353
377
|
calc.F_to_eV_Ang = (units.Ha / units.Bohr)
|
|
354
378
|
|
|
355
379
|
if (try_nwchemex):
|
|
356
|
-
print("
|
|
380
|
+
print("#VENUS READING INPUT FILE '"+input_path+"' AS A NWCHEMEX INPUT FILE...")
|
|
357
381
|
calc = nwchemexcalculator(input_path,output_path=output_path,n_threads=n_threads)
|
|
358
382
|
|
|
359
383
|
# To conform to VENUS, we are going to keep the units
|
|
@@ -364,7 +388,7 @@ def main():
|
|
|
364
388
|
calc.F_to_eV_Ang = (units.Ha / units.Bohr)
|
|
365
389
|
|
|
366
390
|
if (try_nwchem):
|
|
367
|
-
print("
|
|
391
|
+
print("#VENUS READING INPUT FILE '"+input_path+"' AS A NWCHEM (NOT NWCHEMEX) INPUT FILE...")
|
|
368
392
|
calc = nwchemcalculator(input_path,output_path=output_path,n_threads=n_threads)
|
|
369
393
|
|
|
370
394
|
# To conform to VENUS, we are going to keep the units
|
|
@@ -376,7 +400,7 @@ def main():
|
|
|
376
400
|
|
|
377
401
|
if (try_chempotpy):
|
|
378
402
|
|
|
379
|
-
print("
|
|
403
|
+
print("#VENUS READING INPUT FILE '"+input_path+"' AS A CHEMPOTPY INPUT FILE...")
|
|
380
404
|
|
|
381
405
|
# Read the input file
|
|
382
406
|
with open(input_path, 'r') as f:
|
|
@@ -391,7 +415,7 @@ def main():
|
|
|
391
415
|
|
|
392
416
|
calc = chempotpyCalculator(totallines[0])
|
|
393
417
|
strippedline=" ".join(line.split()[2:])
|
|
394
|
-
print("
|
|
418
|
+
print("#VENUS SINGLE STATE: {:s} - CHEMPOTPY INPUT: {:s}".format(totalentries[0],strippedline))
|
|
395
419
|
|
|
396
420
|
# Note, different chempotpy PES have different maximum allowed distances
|
|
397
421
|
# For O3 surfaces, 100 A is okay (= 2 * 50 A)
|
|
@@ -402,7 +426,7 @@ def main():
|
|
|
402
426
|
|
|
403
427
|
|
|
404
428
|
if (try_mopac):
|
|
405
|
-
print("
|
|
429
|
+
print("#VENUS READING INPUT FILE '"+input_path+"' AS A MOPAC INPUT FILE...")
|
|
406
430
|
calc = mopaccalculator(input_path,output_path=output_path)
|
|
407
431
|
|
|
408
432
|
# To conform to VENUS, we are going to keep the units
|
|
@@ -429,14 +453,14 @@ def main():
|
|
|
429
453
|
newMasses = massFile.readlines()
|
|
430
454
|
massFile.close()
|
|
431
455
|
if (len(newMasses) != len(mol)): #.masses)):
|
|
432
|
-
raise ValueError("
|
|
456
|
+
raise ValueError("#VENUS NUMBER OF MASSES PROVIDED IN THE ISOTOPE MASS FILE DOES NOT MATCH THE INPUT XYZ! EXITING ...")
|
|
433
457
|
mol.set_masses([float(i) for i in newMasses])
|
|
434
458
|
|
|
435
459
|
# If a rewind-restart file is given, read in the coordinates (Q),
|
|
436
460
|
# momenta (P), and energies, for a possible restart
|
|
437
461
|
if not (rrQPfile is None):
|
|
438
462
|
|
|
439
|
-
print("REWIND-RESTARTING
|
|
463
|
+
print("#VENUS REWIND-RESTARTING USING THIS FILE: " + rrQPfile)
|
|
440
464
|
|
|
441
465
|
# Look at the last 1500 frames to restart from (but skip the last rrNskip)
|
|
442
466
|
rrQPfilehandle = open(rrQPfile)
|
|
@@ -460,12 +484,12 @@ def main():
|
|
|
460
484
|
Nconsecutivegoodframes += 1
|
|
461
485
|
E_restart = mol.get_potential_energy()
|
|
462
486
|
dE = abs(E_original - E_restart) / (units.kcal/units.mol)
|
|
463
|
-
print("REWIND-RESTARTING
|
|
487
|
+
print("#VENUS REWIND-RESTARTING SEES THAT THE %d-TH TO LAST FRAME (1-TH TO LAST = LAST FRAME) HAS ORIGINAL ENERGY %.3f AND RESTART ENERGY %.3f KCAL/MOL"
|
|
464
488
|
% (rrNskip+i+1, E_original / (units.kcal/units.mol), E_restart / (units.kcal/units.mol)))
|
|
465
489
|
except:
|
|
466
490
|
Nconsecutivegoodframes = 0
|
|
467
491
|
dE = rrQPdEmax * 2
|
|
468
|
-
print("REWIND-RESTARTING
|
|
492
|
+
print("#VENUS REWIND-RESTARTING SEES THAT THE %d-TH TO LAST FRAME (1-TH TO LAST = LAST FRAME) HAS ORIGINAL ENERGY %.3f AND RESTART ENERGY NAN KCAL/MOL"
|
|
469
493
|
% (rrNskip+i+1, E_original / (units.kcal/units.mol)))
|
|
470
494
|
|
|
471
495
|
# If they agree within the threshold, then go ahead with the restart
|
|
@@ -476,11 +500,11 @@ def main():
|
|
|
476
500
|
if (MDtype == "smoothed"): continue
|
|
477
501
|
|
|
478
502
|
rrQPflag = False
|
|
479
|
-
print("REWIND-RESTARTING
|
|
503
|
+
print("#VENUS REWIND-RESTARTING ACCEPTS USING THE %d-TH TO LAST FRAME! (1-TH TO LAST = LAST FRAME)" % (rrNskip+i+1,))
|
|
480
504
|
break
|
|
481
505
|
|
|
482
506
|
if (rrQPflag):
|
|
483
|
-
raise ValueError("REWIND-RESTARTING
|
|
507
|
+
raise ValueError("#VENUS REWIND-RESTARTING FAILED ... NO ACCEPTABLE FRAMES TO RESTART FROM")
|
|
484
508
|
|
|
485
509
|
# If a momenta file is given, read in the momenta
|
|
486
510
|
# Read it in as a geometry, and then set it into the molecule
|
|
@@ -512,33 +536,34 @@ def main():
|
|
|
512
536
|
if ((len(atomsInFirstGroup) > 0) and (len(atomsInSecondGroup) > 0)):
|
|
513
537
|
bimolecular_flag = True
|
|
514
538
|
if ((ce is None) or (b is None) or (dCM is None)):
|
|
515
|
-
raise ValueError("
|
|
539
|
+
raise ValueError("#VENUS LACKING AN ARGUMENT FOR BIMOLECULAR SAMPLING (COLLISION ENERGY, IMPACT PARAMETER, OR CENTER OF MASS DISTANCE)")
|
|
516
540
|
else:
|
|
517
541
|
bimolecular_flag = False
|
|
518
542
|
|
|
519
|
-
print("")
|
|
520
|
-
print("GEOMETRY INPUT")
|
|
521
|
-
print("
|
|
522
|
-
print("
|
|
523
|
-
print("
|
|
524
|
-
print("SAMPLING INPUT")
|
|
525
|
-
print("
|
|
543
|
+
print("#VENUS ")
|
|
544
|
+
print("#VENUS GEOMETRY INPUT")
|
|
545
|
+
print("#VENUS INPUT GEOMETRY FILE: ", Qfile)
|
|
546
|
+
print("#VENUS ATOMS IN FIRST GROUP: ", *atomsInFirstGroup)
|
|
547
|
+
print("#VENUS ATOMS IN SECOND GROUP: ", *atomsInSecondGroup)
|
|
548
|
+
print("#VENUS SAMPLING INPUT")
|
|
549
|
+
print("#VENUS INPUT MOMENTA FILE: ", Pfile)
|
|
526
550
|
if (Pfile is None):
|
|
527
|
-
print("
|
|
528
|
-
print("
|
|
529
|
-
print("
|
|
530
|
-
print("
|
|
531
|
-
print("
|
|
532
|
-
print("
|
|
533
|
-
print("
|
|
534
|
-
print("
|
|
535
|
-
print("
|
|
536
|
-
print("
|
|
551
|
+
print("#VENUS OPTIMIZE MOLECULES? ", optimize_flag)
|
|
552
|
+
print("#VENUS GROUP A SAMPLING METHOD: ", samplingMethod[0])
|
|
553
|
+
print("#VENUS GROUP A VIBRATION: ", vibrationSampling[0])
|
|
554
|
+
print("#VENUS GROUP A ROTATION: ", rotationSampling[0])
|
|
555
|
+
print("#VENUS GROUP B SAMPLING METHOD: ", samplingMethod[1])
|
|
556
|
+
print("#VENUS GROUP B VIBRATION: ", vibrationSampling[1])
|
|
557
|
+
print("#VENUS GROUP B ROTATION: ", rotationSampling[1])
|
|
558
|
+
print("#VENUS IMPACT PARAMETER (A): ", b)
|
|
559
|
+
print("#VENUS INITIAL SEPARATION (A): ", dCM)
|
|
560
|
+
print("#VENUS COLLSION ENERGY (KCAL/MOL): ", ce)
|
|
537
561
|
else:
|
|
538
|
-
print("
|
|
562
|
+
print("#VENUS INPUT MOMENTA FILE: ", Pfile)
|
|
539
563
|
|
|
540
|
-
print("
|
|
541
|
-
print("")
|
|
564
|
+
print("#VENUS")
|
|
565
|
+
print("#VENUS ##############################################################")
|
|
566
|
+
print("#VENUS")
|
|
542
567
|
|
|
543
568
|
# Sample the internal positions and momenta of each of
|
|
544
569
|
# the two molecules
|
|
@@ -547,15 +572,23 @@ def main():
|
|
|
547
572
|
samplingMethodA=samplingMethod[0],vibrationalSampleA=vibrationSampling[0],rotationalSampleA=rotationSampling[0],
|
|
548
573
|
samplingMethodB=samplingMethod[1],vibrationalSampleB=vibrationSampling[1],rotationalSampleB=rotationSampling[1])
|
|
549
574
|
|
|
550
|
-
print("
|
|
575
|
+
print("#VENUS SAMPLING INTERNAL DEGREES OF FREEDOM ...")
|
|
551
576
|
sampler.sampleRelativeQP()
|
|
577
|
+
|
|
578
|
+
print("#VENUS")
|
|
579
|
+
print("#VENUS ##############################################################")
|
|
580
|
+
print("#VENUS")
|
|
552
581
|
|
|
553
582
|
if (bimolecular_flag):
|
|
554
|
-
print("Sampling relative degrees of freedom...")
|
|
583
|
+
print("#VENUS Sampling relative degrees of freedom...")
|
|
555
584
|
sampler.sampleAbsoluteQP(ce,dCM=dCM,b=b)
|
|
556
585
|
|
|
557
586
|
else:
|
|
558
587
|
sampler.centerMolecule(range(Natoms))
|
|
588
|
+
|
|
589
|
+
print("#VENUS")
|
|
590
|
+
print("#VENUS DONE!")
|
|
591
|
+
print("#VENUS")
|
|
559
592
|
|
|
560
593
|
########################################################################################
|
|
561
594
|
|
|
@@ -573,7 +606,7 @@ def main():
|
|
|
573
606
|
MDgen = smoothedMD(mol,trajfile,dt,Nprint=Nprint,Nrewindsteps=Nrewindsteps,dEmax=dEmax,Edriftmax=Edriftmax,E0=E0,n_threads=n_threads)
|
|
574
607
|
|
|
575
608
|
else:
|
|
576
|
-
raise ValueError("MD
|
|
609
|
+
raise ValueError("#VENUS MD TYPE '"+MDtype+"' IS NOT VALID! EXITING ...")
|
|
577
610
|
|
|
578
611
|
MDgen.production(Nsteps)
|
|
579
612
|
|