venuspython 1.1.1__tar.gz → 1.1.3__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.
Files changed (25) hide show
  1. {venuspython-1.1.1 → venuspython-1.1.3}/PKG-INFO +34 -7
  2. {venuspython-1.1.1 → venuspython-1.1.3}/README.md +33 -6
  3. venuspython-1.1.3/venuspy/__init__.py +1 -0
  4. {venuspython-1.1.1 → venuspython-1.1.3}/venuspy/calc/psi4calc.py +24 -1
  5. {venuspython-1.1.1 → venuspython-1.1.3}/venuspy/calc/qcengineGAMESScalc.py +55 -9
  6. {venuspython-1.1.1 → venuspython-1.1.3}/venuspy/initialSampling.py +4 -4
  7. {venuspython-1.1.1 → venuspython-1.1.3}/venuspython.egg-info/PKG-INFO +34 -7
  8. venuspython-1.1.1/venuspy/__init__.py +0 -1
  9. {venuspython-1.1.1 → venuspython-1.1.3}/pyproject.toml +0 -0
  10. {venuspython-1.1.1 → venuspython-1.1.3}/setup.cfg +0 -0
  11. {venuspython-1.1.1 → venuspython-1.1.3}/venuspy/calc/bagelcalc.py +0 -0
  12. {venuspython-1.1.1 → venuspython-1.1.3}/venuspy/calc/chempotpycalc.py +0 -0
  13. {venuspython-1.1.1 → venuspython-1.1.3}/venuspy/calc/minisgdmlcalc.py +0 -0
  14. {venuspython-1.1.1 → venuspython-1.1.3}/venuspy/calc/mopaccalc.py +0 -0
  15. {venuspython-1.1.1 → venuspython-1.1.3}/venuspy/calc/nwchemcalc.py +0 -0
  16. {venuspython-1.1.1 → venuspython-1.1.3}/venuspy/calc/nwchemexcalc.py +0 -0
  17. {venuspython-1.1.1 → venuspython-1.1.3}/venuspy/calc/original_nwchemexcalc.py +0 -0
  18. {venuspython-1.1.1 → venuspython-1.1.3}/venuspy/calc/physnetcalc.py +0 -0
  19. {venuspython-1.1.1 → venuspython-1.1.3}/venuspy/calc/xtbcalc.py +0 -0
  20. {venuspython-1.1.1 → venuspython-1.1.3}/venuspy/cli.py +0 -0
  21. {venuspython-1.1.1 → venuspython-1.1.3}/venuspy/md.py +0 -0
  22. {venuspython-1.1.1 → venuspython-1.1.3}/venuspython.egg-info/SOURCES.txt +0 -0
  23. {venuspython-1.1.1 → venuspython-1.1.3}/venuspython.egg-info/dependency_links.txt +0 -0
  24. {venuspython-1.1.1 → venuspython-1.1.3}/venuspython.egg-info/entry_points.txt +0 -0
  25. {venuspython-1.1.1 → venuspython-1.1.3}/venuspython.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: venuspython
3
- Version: 1.1.1
3
+ Version: 1.1.3
4
4
  Summary: VENUSpy Initial Sampling and Molecular Dynamics
5
5
  Keywords: moleculardynamics,initialsampling
6
6
  Classifier: Development Status :: 5 - Production/Stable
@@ -70,17 +70,17 @@ Water is a nonlinear molecule with three atoms, so it has three normal modes. Th
70
70
  venuspy-cli examples/H2O.input.xyz examples/H2O.input.xtb . --atomsInFirstGroup "1 2 3" --production 100 --interval 1 --time_step 0.15 --INITQPa "thermal" --TVIBa 298.0 --TROTa 0.001 --n_threads 1 > production.log
71
71
  ```
72
72
 
73
- While tracking the normal mode breakdown of energies over the entire trajectory is slow (this requires a Hessian calculation at each step), this can be done for the first frame from the initial sampling. Search for the `Evibs` keyword in the output to see energies of each mode (in eV).
73
+ While tracking the normal mode breakdown of energies over the entire trajectory is slow (this requires a Hessian calculation at each step), this can be done for the first frame from the initial sampling. Search for the `EVIBS` keyword in the output to see energies of each mode (in eV).
74
74
 
75
75
  ```
76
- grep Evibs production.log
76
+ grep "#VENUS EVIBS" production.log
77
77
  ```
78
78
 
79
79
  When this is done repeatedly, we can get some statistical information by looking at the distribution of individual and total vibrational energies sampled.
80
80
 
81
81
  <img align="center" width="600" height="250" src="images/canonical.298K.png">
82
82
 
83
- The resulting distribution of vibrational energies in each mode is shown in the figure above. Nearly all molecules are in their ground vibrational state with energies of 0.23, 0.23, and 0.10 kcal/mol. This results in only a single possible combination of energies sampled. At higher temperatures, the higher vibrational states start to get populated. At 3000K, if we repeat the procedure with the argument `--TVIBa 3000.0`, we instead see a distribution as follows:
83
+ The resulting distribution of vibrational energies in each mode is shown in the figure above. Nearly all molecules are in their ground vibrational state with energies of 0.23, 0.23, and 0.10 eV. This results in only a single possible combination of energies sampled. At higher temperatures, the higher vibrational states start to get populated. At 3000K, if we repeat the procedure with the argument `--TVIBa 3000.0`, we instead see a distribution as follows:
84
84
 
85
85
  <img align="center" width="600" height="250" src="images/canonical.3000K.png">
86
86
 
@@ -97,22 +97,49 @@ Water is a nonlinear molecule with three atoms, so it has three normal modes. Th
97
97
  venuspy-cli examples/H2O.input.xyz examples/H2O.input.xtb . --atomsInFirstGroup "1 2 3" --production 100 --interval 1 --time_step 0.15 --INITQPa "microcanonical" --EVIBa 12.6372 --EROTa 0.00001 --n_threads 1 > production.log
98
98
  ```
99
99
 
100
- While tracking the normal mode breakdown of energies over the entire trajectory is slow (this requires a Hessian calculation at each step), this can be done for the first frame from the initial sampling. Search for the `Evibs` keyword in the output to see energies of each mode (in eV).
100
+ While tracking the normal mode breakdown of energies over the entire trajectory is slow (this requires a Hessian calculation at each step), this can be done for the first frame from the initial sampling. Search for the `EVIBS` keyword in the output to see energies of each mode (in eV).
101
101
 
102
102
  ```
103
- grep Evibs production.log
103
+ grep "#VENUS EVIBS" production.log
104
104
  ```
105
105
 
106
106
  When this is done repeatedly, we can get some statistical information by looking at the distribution of individual and total vibrational energies sampled.
107
107
 
108
108
  <img align="center" width="600" height="250" src="images/microcanonical.12.63.png">
109
109
 
110
- The resulting distribution of vibrational energies in each mode is shown in the figure above. Although only a single total vibrational energy is sampled, the energy is uniformly mixed over all three modes, resulting in a seemingly random distribution of combinations of energies. In this way, a microcanonical ensemble favors mixing mode energies over explicit quantizations. The same behaviour is seen at all excitations, including one corresponding to the avereage energy of the 3000K canonical ensemble (21.22 kcal/mol) from the previous example. If we repeat the procedure with the argument `--EVIBa 21.220`, we then see a distribution as follows:
110
+ The resulting distribution of vibrational energies in each mode is shown in the figure above. Although only a single total vibrational energy is sampled, the energy is uniformly mixed over all three modes, resulting in a seemingly random distribution of combinations of energies. In this way, a microcanonical ensemble favors mixing mode energies over explicit quantizations. The same behaviour is seen at all excitations, including one corresponding to the average energy of the 3000K canonical ensemble (21.22 kcal/mol) from the previous example. If we repeat the procedure with the argument `--EVIBa 21.220`, we then see a distribution as follows:
111
111
 
112
112
  <img align="center" width="600" height="250" src="images/microcanonical.21.22.png">
113
113
 
114
114
  </details>
115
115
 
116
+ ### Normal Mode Sampling
117
+
118
+ <details>
119
+ <summary>Click here to do the example</summary>
120
+
121
+ Water is a nonlinear molecule with three atoms, so it has three normal modes. If a specific amount of energy is needed to be sampled for each mode, then instead a microcanonical normal mode sampling can be done with the `--INITQPa "microcanonicalnormalmode"` argument. The frequency of the modes dictates the absolute amount of energy ultimately given to a mode. With xTB, these frequencies are 3653 cm<sup>-1</sup> > 3645 cm<sup>-1</sup> > 1538 cm<sup>-1</sup> for the symmetric stretch, asymmetric stretch, and bending modes, respectively. For example, for an equal-energy sampling, VENUSpy can sample these with:
122
+
123
+ ```
124
+ venuspy-cli examples/H2O.input.xyz examples/H2O.input.xtb . --atomsInFirstGroup "1 2 3" --production 100 --interval 1 --time_step 0.15 --INITQPa "microcanonicalnormalmode" --EVIBNMODESa 4.21,4.21,4.21 --EROTa 0.00001 --n_threads 1 > production.log
125
+ ```
126
+
127
+ While tracking the normal mode breakdown of energies over the entire trajectory is slow (this requires a Hessian calculation at each step), this can be done for the first frame from the initial sampling. Search for the `EVIBS` keyword in the output to see energies of each mode (in eV).
128
+
129
+ ```
130
+ grep "#VENUS EVIBS" production.log
131
+ ```
132
+
133
+ When this is done repeatedly, we can get some statistical information by looking at the distribution of individual and total vibrational energies sampled.
134
+
135
+ <img align="center" width="600" height="250" src="images/normalmode.1to1to1.12.63.png">
136
+
137
+ The resulting distribution of vibrational energies in each mode is shown in the figure above. Each mode is given a specific amount of energy so effectively a single state and total energy are sampled. However, the amount of energy is arbitrary and any mix can be requested. For example, if we repeat the procedure with the argument `--EVIBNMODESa X,Y,0.0` where X and Y are two random numbers that add to 12.63 kcal/mol, we then see a distribution as follows:
138
+
139
+ <img align="center" width="600" height="250" src="images/normalmode.RtoRto0.12.63.png">
140
+
141
+ </details>
142
+
116
143
  ### Semiclassical Sampling
117
144
 
118
145
  Finally, there is one more special case for diatomic molecules. Because polyatomic molecules have multiple normal modes, experimentally there is often more leeway in assigning exact rovibrational states to molecules---a difficult and often intractable problem. However, diatomic molecules can have exact rovibrational states assigned through computational quantization procedures. The phase and kinetic/potential distribution of the vibration can then be sampled classically. This semiclassical method is the preferred sampling method for diatoms.
@@ -57,17 +57,17 @@ Water is a nonlinear molecule with three atoms, so it has three normal modes. Th
57
57
  venuspy-cli examples/H2O.input.xyz examples/H2O.input.xtb . --atomsInFirstGroup "1 2 3" --production 100 --interval 1 --time_step 0.15 --INITQPa "thermal" --TVIBa 298.0 --TROTa 0.001 --n_threads 1 > production.log
58
58
  ```
59
59
 
60
- While tracking the normal mode breakdown of energies over the entire trajectory is slow (this requires a Hessian calculation at each step), this can be done for the first frame from the initial sampling. Search for the `Evibs` keyword in the output to see energies of each mode (in eV).
60
+ While tracking the normal mode breakdown of energies over the entire trajectory is slow (this requires a Hessian calculation at each step), this can be done for the first frame from the initial sampling. Search for the `EVIBS` keyword in the output to see energies of each mode (in eV).
61
61
 
62
62
  ```
63
- grep Evibs production.log
63
+ grep "#VENUS EVIBS" production.log
64
64
  ```
65
65
 
66
66
  When this is done repeatedly, we can get some statistical information by looking at the distribution of individual and total vibrational energies sampled.
67
67
 
68
68
  <img align="center" width="600" height="250" src="images/canonical.298K.png">
69
69
 
70
- The resulting distribution of vibrational energies in each mode is shown in the figure above. Nearly all molecules are in their ground vibrational state with energies of 0.23, 0.23, and 0.10 kcal/mol. This results in only a single possible combination of energies sampled. At higher temperatures, the higher vibrational states start to get populated. At 3000K, if we repeat the procedure with the argument `--TVIBa 3000.0`, we instead see a distribution as follows:
70
+ The resulting distribution of vibrational energies in each mode is shown in the figure above. Nearly all molecules are in their ground vibrational state with energies of 0.23, 0.23, and 0.10 eV. This results in only a single possible combination of energies sampled. At higher temperatures, the higher vibrational states start to get populated. At 3000K, if we repeat the procedure with the argument `--TVIBa 3000.0`, we instead see a distribution as follows:
71
71
 
72
72
  <img align="center" width="600" height="250" src="images/canonical.3000K.png">
73
73
 
@@ -84,22 +84,49 @@ Water is a nonlinear molecule with three atoms, so it has three normal modes. Th
84
84
  venuspy-cli examples/H2O.input.xyz examples/H2O.input.xtb . --atomsInFirstGroup "1 2 3" --production 100 --interval 1 --time_step 0.15 --INITQPa "microcanonical" --EVIBa 12.6372 --EROTa 0.00001 --n_threads 1 > production.log
85
85
  ```
86
86
 
87
- While tracking the normal mode breakdown of energies over the entire trajectory is slow (this requires a Hessian calculation at each step), this can be done for the first frame from the initial sampling. Search for the `Evibs` keyword in the output to see energies of each mode (in eV).
87
+ While tracking the normal mode breakdown of energies over the entire trajectory is slow (this requires a Hessian calculation at each step), this can be done for the first frame from the initial sampling. Search for the `EVIBS` keyword in the output to see energies of each mode (in eV).
88
88
 
89
89
  ```
90
- grep Evibs production.log
90
+ grep "#VENUS EVIBS" production.log
91
91
  ```
92
92
 
93
93
  When this is done repeatedly, we can get some statistical information by looking at the distribution of individual and total vibrational energies sampled.
94
94
 
95
95
  <img align="center" width="600" height="250" src="images/microcanonical.12.63.png">
96
96
 
97
- The resulting distribution of vibrational energies in each mode is shown in the figure above. Although only a single total vibrational energy is sampled, the energy is uniformly mixed over all three modes, resulting in a seemingly random distribution of combinations of energies. In this way, a microcanonical ensemble favors mixing mode energies over explicit quantizations. The same behaviour is seen at all excitations, including one corresponding to the avereage energy of the 3000K canonical ensemble (21.22 kcal/mol) from the previous example. If we repeat the procedure with the argument `--EVIBa 21.220`, we then see a distribution as follows:
97
+ The resulting distribution of vibrational energies in each mode is shown in the figure above. Although only a single total vibrational energy is sampled, the energy is uniformly mixed over all three modes, resulting in a seemingly random distribution of combinations of energies. In this way, a microcanonical ensemble favors mixing mode energies over explicit quantizations. The same behaviour is seen at all excitations, including one corresponding to the average energy of the 3000K canonical ensemble (21.22 kcal/mol) from the previous example. If we repeat the procedure with the argument `--EVIBa 21.220`, we then see a distribution as follows:
98
98
 
99
99
  <img align="center" width="600" height="250" src="images/microcanonical.21.22.png">
100
100
 
101
101
  </details>
102
102
 
103
+ ### Normal Mode Sampling
104
+
105
+ <details>
106
+ <summary>Click here to do the example</summary>
107
+
108
+ Water is a nonlinear molecule with three atoms, so it has three normal modes. If a specific amount of energy is needed to be sampled for each mode, then instead a microcanonical normal mode sampling can be done with the `--INITQPa "microcanonicalnormalmode"` argument. The frequency of the modes dictates the absolute amount of energy ultimately given to a mode. With xTB, these frequencies are 3653 cm<sup>-1</sup> > 3645 cm<sup>-1</sup> > 1538 cm<sup>-1</sup> for the symmetric stretch, asymmetric stretch, and bending modes, respectively. For example, for an equal-energy sampling, VENUSpy can sample these with:
109
+
110
+ ```
111
+ venuspy-cli examples/H2O.input.xyz examples/H2O.input.xtb . --atomsInFirstGroup "1 2 3" --production 100 --interval 1 --time_step 0.15 --INITQPa "microcanonicalnormalmode" --EVIBNMODESa 4.21,4.21,4.21 --EROTa 0.00001 --n_threads 1 > production.log
112
+ ```
113
+
114
+ While tracking the normal mode breakdown of energies over the entire trajectory is slow (this requires a Hessian calculation at each step), this can be done for the first frame from the initial sampling. Search for the `EVIBS` keyword in the output to see energies of each mode (in eV).
115
+
116
+ ```
117
+ grep "#VENUS EVIBS" production.log
118
+ ```
119
+
120
+ When this is done repeatedly, we can get some statistical information by looking at the distribution of individual and total vibrational energies sampled.
121
+
122
+ <img align="center" width="600" height="250" src="images/normalmode.1to1to1.12.63.png">
123
+
124
+ The resulting distribution of vibrational energies in each mode is shown in the figure above. Each mode is given a specific amount of energy so effectively a single state and total energy are sampled. However, the amount of energy is arbitrary and any mix can be requested. For example, if we repeat the procedure with the argument `--EVIBNMODESa X,Y,0.0` where X and Y are two random numbers that add to 12.63 kcal/mol, we then see a distribution as follows:
125
+
126
+ <img align="center" width="600" height="250" src="images/normalmode.RtoRto0.12.63.png">
127
+
128
+ </details>
129
+
103
130
  ### Semiclassical Sampling
104
131
 
105
132
  Finally, there is one more special case for diatomic molecules. Because polyatomic molecules have multiple normal modes, experimentally there is often more leeway in assigning exact rovibrational states to molecules---a difficult and often intractable problem. However, diatomic molecules can have exact rovibrational states assigned through computational quantization procedures. The phase and kinetic/potential distribution of the vibration can then be sampled classically. This semiclassical method is the preferred sampling method for diatoms.
@@ -0,0 +1 @@
1
+ __version__ = "1.1.3"
@@ -63,8 +63,10 @@ class psi4calculator(Calculator):
63
63
  self.charge = 0
64
64
  self.multiplicity = 2 # 2s+1
65
65
 
66
+ self.print = 1
66
67
  self.memory = 1500 # In MB
67
68
  self.scratchdir = "/tmp"
69
+ self.init_wfn = None
68
70
 
69
71
  # Read in the psi4 input
70
72
  with open(input_path, 'r') as f:
@@ -88,10 +90,15 @@ class psi4calculator(Calculator):
88
90
  if (entries[0] == "maxiter"): self.maxiter = int(entries[1])
89
91
  if (entries[0] == "d_convergence"): self.d_convergence = float(entries[1])
90
92
  if (entries[0] == "e_convergence"): self.e_convergence = float(entries[1])
93
+ if (entries[0] == "init_wfn"): self.init_wfn = str(entries[1])
94
+ if (entries[0] == "soscf"): self.soscf = int(entries[1])
95
+
96
+ if (entries[0] == "print"): self.print = int(entries[1])
91
97
 
92
98
  # Set up the options for the psi4 calculation
93
99
  # Check keywords in the documentation: https://psicode.org/psi4manual/master/autodoc_glossary_options_c.html
94
100
  psi4.set_memory(str(self.memory)+' MB')
101
+ psi4.set_options({'PRINT': self.print}) # 0 = minimal, 1 = normal, 2 = verbose, 3+ = very detailed
95
102
  psi4.set_options({'maxiter': self.maxiter})
96
103
  psi4.set_options({'d_convergence': self.d_convergence})
97
104
  psi4.set_options({'e_convergence': self.e_convergence})
@@ -153,6 +160,16 @@ class psi4calculator(Calculator):
153
160
  #print(geometry_string)
154
161
  psi4.geometry(geometry_string)
155
162
 
163
+ # This is for initial guesses (only done ONCE at the start)
164
+ if (not (self.init_wfn is None)):
165
+ try:
166
+ print("Reading in initial wavefunction: ({0})".format(self.init_wfn),flush=True)
167
+ e, self.ref_wfn = psi4.energy(self.psi4method,restart_file=self.init_wfn,write_orbitals=self.movecs,return_wfn=True)
168
+ print("Succeeded reading in initial wavefunction!",flush=True)
169
+ except:
170
+ print("Failed reading in initial wavefunction (check if file is correct / correctly copied...)!",flush=True)
171
+ self.init_wfn = None
172
+
156
173
  # Try the SCF convergence a few times with different approaches:
157
174
  # (1) Try using the reference wavefunction (from the previous step)
158
175
  # (2) Try the default superposition of atomic densities (SAD)
@@ -203,6 +220,12 @@ class psi4calculator(Calculator):
203
220
  self.oeprop.add("MULLIKEN_CHARGES")
204
221
  self.oeprop.compute()
205
222
 
223
+ if (self.soscf==1):
224
+ psi4.set_options({'soscf': False})
225
+ #psi4.set_options({'soscf_max_iter': self.maxiter})
226
+ #psi4.set_options({'soscf_conv': self.d_convergence})
227
+ #psi4.set_options({'soscf_start_convergence': 1.0e-6})
228
+
206
229
  # Convert model units to ASE default units (eV and Ang)
207
230
  e *= self.E_to_eV
208
231
  f *= -self.F_to_eV_Ang
@@ -217,7 +240,7 @@ class psi4calculator(Calculator):
217
240
  for i in range(Natoms):
218
241
  anAtom = atoms[i]
219
242
  print("{0:2s} {1:16.8f} {2:16.8f} {3:16.8f} {4:18.10f} {5:18.10f} {6:18.10f}".format(anAtom.symbol,*anAtom.position, *f[i]))
220
- print("")
243
+ print("",flush=True)
221
244
 
222
245
  self.results = {'energy': e, 'forces': f}
223
246
 
@@ -52,11 +52,13 @@ class qcengineGAMESScalculator(Calculator):
52
52
  self.referencemethod = 'uhf'
53
53
  self.freeze_core = 0
54
54
  self.df_ints_io = "None"
55
- self.method = 'b3lyp' # LevelOfTheory
56
- self.basis_set = '6-31g*' # BasisSet
55
+ self.method = 'b3lyp' # LevelOfTheory
56
+ self.libxc_functional = None # LibXC Functional (if method="uselibxc")
57
+ self.basis_set = '6-31g*' # BasisSet
57
58
  self.mulliken = 0
58
59
  self.charge = 0
59
60
  self.multiplicity = 2 # 2s+1
61
+ self.printlevel = 7 # default is 7
60
62
 
61
63
  self.memory = 1500 # In MB
62
64
  self.scratchdir = "/tmp"
@@ -71,11 +73,18 @@ class qcengineGAMESScalculator(Calculator):
71
73
  if (entries[0] == "referencemethod"): self.referencemethod = str(entries[1])
72
74
  if (entries[0] == "freeze_core"): self.freeze_core = int(entries[1])
73
75
  if (entries[0] == "df_ints_io"): self.df_ints_io = str(entries[1])
74
- if (entries[0] == "method"): self.method = str(entries[1])
75
- if (entries[0] == "basis_set"): self.basis_set = str(entries[1])
76
+ # if (entries[0] == "method"): self.method = str(entries[1])
77
+ if (entries[0] == "method"):
78
+ subentries = str(entries[1]).split("/")
79
+ self.method = str(subentries[0])
80
+ if (len(subentries) > 1):
81
+ self.basis_set = str(subentries[1])
82
+ # if (entries[0] == "basis_set"): self.basis_set = str(entries[1])
83
+ if (entries[0] == "libxc_functional"): self.libxc_functional = str(entries[1])
76
84
  if (entries[0] == "mulliken"): self.mulliken = int(entries[1])
77
85
  if (entries[0] == "charge"): self.charge = int(entries[1])
78
86
  if (entries[0] == "multiplicity"): self.multiplicity = int(entries[1])
87
+ if (entries[0] == "print"): self.printlevel = str(entries[1])
79
88
 
80
89
  # By default, we start off with no initial MO guess
81
90
  self.ref_wfn = None
@@ -94,8 +103,34 @@ class qcengineGAMESScalculator(Calculator):
94
103
  "scf__diis" : ".true.",
95
104
  "scf__ethrsh" : 1.0, # DIIS error to start DIIS (deafult = 0.5 hartree)
96
105
  "scf__conv" : self.d_convergence,
106
+ "contrl__nprint" : self.printlevel,
97
107
  }
98
108
 
109
+ # If LibXC is available, use it
110
+ if (self.method == "uselibxc"):
111
+ if (self.libxc_functional is None):
112
+ raise ValueError("If setting 'uselibxc', need to specify 'libxc_functional' in the input file! ... e.g,\n'libxc_functional b3lyp'")
113
+ self.keywords["libxc__functional"] = self.libxc_functional
114
+
115
+ # From the GAMESS documentation:
116
+ #NPUNCH = option for output to the PUNCH file
117
+ # = 0 do not punch out the final orbitals
118
+ # = 1 punch out the occupied orbitals
119
+ # = 2 punch out occupied and virtual orbitals
120
+ # The default is NPUNCH = 2.
121
+ #NPREO = energy and orbital printing options, applied
122
+ # after other output options, for example NPRINT=-5
123
+ # for no orbital output overrules NPREO. NPREO
124
+ # affects only printing, see NPUNCH just above.
125
+ # Default: 1,9999,2,1 (meaning print all orbitals,
126
+ # but no separate list of orbital energies).
127
+ # To print only HOMO and "LUMO" LCAO coefficients,
128
+ # and all orbital energies, enter:
129
+ # NPREO(1)=0,-1,1,9999
130
+ if True:
131
+ self.keywords["scf__npunch"] = "0"
132
+ self.keywords["scf__npreo(1)"] = "0,-1,1,9999"
133
+
99
134
  self.MPIconfig = {
100
135
  # "use_mpiexec" : True,
101
136
  # "mpiexec_command": mpiexec_command,
@@ -134,7 +169,8 @@ class qcengineGAMESScalculator(Calculator):
134
169
  out += anAtom.symbol + " " + str(anAtom.position[0]) + " " + str(anAtom.position[1]) + " " + str(anAtom.position[2]) + "\n"
135
170
 
136
171
  # Fixing CoM and orientation and turning off symmetry to prevent molecular translation
137
- mol = qcel.models.Molecule.from_data(out, fix_com=True, fix_orientation=True, fix_symmetry="C1") # Doesn't seem to work?
172
+ mol = qcel.models.v2.Molecule.from_data(out, fix_com=True, fix_orientation=True, fix_symmetry="C1") # The newest version uses "v2" models
173
+ # mol = qcel.models.Molecule.from_data(out, fix_com=True, fix_orientation=True, fix_symmetry="C1") # Doesn't seem to work?
138
174
  # mol = qcel.models.Molecule.from_data(out, fix_com=True, fix_symmetry="C1")
139
175
 
140
176
  # Try the SCF convergence a few times with different approaches:
@@ -165,14 +201,24 @@ class qcengineGAMESScalculator(Calculator):
165
201
  # print("SCF convergence (0) ... will now use a SAD guess")
166
202
  # self.ref_wfn = None
167
203
 
168
- inp = qcel.models.AtomicInput(molecule=mol, driver="gradient", model=self.model, keywords=self.keywords)
204
+ # spec = qcel.models.v2.AtomicSpecification(driver=qcel.models.v2.DriverEnum.gradient,model=qcel.models.v2.Model(method=self.method,basis="sto",),keywords=self.keywords)
205
+ spec = qcel.models.v2.AtomicSpecification(driver=qcel.models.v2.DriverEnum.gradient,model=qcel.models.v2.Model(method=self.method,basis=self.basis_set),keywords=self.keywords)
206
+ inp = qcel.models.v2.AtomicInput(molecule=mol,specification=spec) # The newest version uses "v2" models
207
+ # inp = qcel.models.AtomicInput(molecule=mol, driver="gradient", model=self.model, keywords=self.keywords)
169
208
  if (self.ref_wfn is not None):
170
209
  inp.extras["VECguess"] = self.ref_wfn
171
210
  inp.extras["VECnorb"] = self.Norb
172
211
 
173
212
  f_results = qcng.compute(inp, 'gamess', task_config=self.MPIconfig)
174
- self.ref_wfn = f_results.extras["VEC"]
175
- self.Norb = f_results.extras["VECnorb"]
213
+
214
+ if ("VEC" in f_results.extras) and ("VECnorb" in f_results.extras):
215
+ self.ref_wfn = f_results.extras["VEC"]
216
+ self.Norb = f_results.extras["VECnorb"]
217
+
218
+ try:
219
+ print(f_results.stdout)
220
+ except:
221
+ print(f_results.error.error_message)
176
222
 
177
223
  e = float(f_results.extras["qcvars"]["CURRENT ENERGY"])
178
224
  f = f_results.return_result
@@ -203,7 +249,7 @@ class qcengineGAMESScalculator(Calculator):
203
249
  for i in range(Natoms):
204
250
  anAtom = atoms[i]
205
251
  print("{0:2s} {1:16.8f} {2:16.8f} {3:16.8f} {4:18.10f} {5:18.10f} {6:18.10f}".format(anAtom.symbol,*anAtom.position, *f[i]))
206
- print("")
252
+ print("",flush=True)
207
253
 
208
254
  self.results = {'energy': e, 'forces': f}
209
255
 
@@ -858,8 +858,8 @@ class initialSampling:
858
858
  qq += nmodes[i] * dq[i]
859
859
 
860
860
  for i in range(Natoms):
861
- p[i] = p[i] * np.sqrt(masses[i]) # The (M^1/2) factor "cancels out" the mass-weighting of the normal modes (M^-1/2)(NMODE)
862
- q[i] = q0[i] + qq[i] / np.sqrt(masses[i]) # Now, Q = (M^-1) P = (M^-1/2) (M^-1/2)(NMODE)
861
+ p[i] = p[i] * masses[i] # The (M^1/2) factor "cancels out" the mass-weighting of the normal modes (M^-1/2)(NMODE)
862
+ q[i] = q0[i] + qq[i] # Now, Q = (M^-1) P = (M^-1/2) (M^-1/2)(NMODE)
863
863
 
864
864
  qCM = self.getCenterOfMass(masses,q)
865
865
 
@@ -1043,8 +1043,8 @@ class initialSampling:
1043
1043
  qq += nmodes[i] * dq[i]
1044
1044
 
1045
1045
  for i in range(Natoms):
1046
- p[i] = p[i] * np.sqrt(masses[i]) # The (M^1/2) factor "cancels out" the mass-weighting of the normal modes (M^-1/2)(NMODE)
1047
- q[i] = q0[i] + qq[i] / np.sqrt(masses[i]) # Now, Q = (M^-1) P = (M^-1/2) (M^-1/2)(NMODE)
1046
+ p[i] = p[i] * masses[i] # The (M^1/2) factor "cancels out" the mass-weighting of the normal modes (M^-1/2)(NMODE)
1047
+ q[i] = q0[i] + qq[i] # Now, Q = (M^-1) P = (M^-1/2) (M^-1/2)(NMODE)
1048
1048
 
1049
1049
  qCM = self.getCenterOfMass(masses,q)
1050
1050
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: venuspython
3
- Version: 1.1.1
3
+ Version: 1.1.3
4
4
  Summary: VENUSpy Initial Sampling and Molecular Dynamics
5
5
  Keywords: moleculardynamics,initialsampling
6
6
  Classifier: Development Status :: 5 - Production/Stable
@@ -70,17 +70,17 @@ Water is a nonlinear molecule with three atoms, so it has three normal modes. Th
70
70
  venuspy-cli examples/H2O.input.xyz examples/H2O.input.xtb . --atomsInFirstGroup "1 2 3" --production 100 --interval 1 --time_step 0.15 --INITQPa "thermal" --TVIBa 298.0 --TROTa 0.001 --n_threads 1 > production.log
71
71
  ```
72
72
 
73
- While tracking the normal mode breakdown of energies over the entire trajectory is slow (this requires a Hessian calculation at each step), this can be done for the first frame from the initial sampling. Search for the `Evibs` keyword in the output to see energies of each mode (in eV).
73
+ While tracking the normal mode breakdown of energies over the entire trajectory is slow (this requires a Hessian calculation at each step), this can be done for the first frame from the initial sampling. Search for the `EVIBS` keyword in the output to see energies of each mode (in eV).
74
74
 
75
75
  ```
76
- grep Evibs production.log
76
+ grep "#VENUS EVIBS" production.log
77
77
  ```
78
78
 
79
79
  When this is done repeatedly, we can get some statistical information by looking at the distribution of individual and total vibrational energies sampled.
80
80
 
81
81
  <img align="center" width="600" height="250" src="images/canonical.298K.png">
82
82
 
83
- The resulting distribution of vibrational energies in each mode is shown in the figure above. Nearly all molecules are in their ground vibrational state with energies of 0.23, 0.23, and 0.10 kcal/mol. This results in only a single possible combination of energies sampled. At higher temperatures, the higher vibrational states start to get populated. At 3000K, if we repeat the procedure with the argument `--TVIBa 3000.0`, we instead see a distribution as follows:
83
+ The resulting distribution of vibrational energies in each mode is shown in the figure above. Nearly all molecules are in their ground vibrational state with energies of 0.23, 0.23, and 0.10 eV. This results in only a single possible combination of energies sampled. At higher temperatures, the higher vibrational states start to get populated. At 3000K, if we repeat the procedure with the argument `--TVIBa 3000.0`, we instead see a distribution as follows:
84
84
 
85
85
  <img align="center" width="600" height="250" src="images/canonical.3000K.png">
86
86
 
@@ -97,22 +97,49 @@ Water is a nonlinear molecule with three atoms, so it has three normal modes. Th
97
97
  venuspy-cli examples/H2O.input.xyz examples/H2O.input.xtb . --atomsInFirstGroup "1 2 3" --production 100 --interval 1 --time_step 0.15 --INITQPa "microcanonical" --EVIBa 12.6372 --EROTa 0.00001 --n_threads 1 > production.log
98
98
  ```
99
99
 
100
- While tracking the normal mode breakdown of energies over the entire trajectory is slow (this requires a Hessian calculation at each step), this can be done for the first frame from the initial sampling. Search for the `Evibs` keyword in the output to see energies of each mode (in eV).
100
+ While tracking the normal mode breakdown of energies over the entire trajectory is slow (this requires a Hessian calculation at each step), this can be done for the first frame from the initial sampling. Search for the `EVIBS` keyword in the output to see energies of each mode (in eV).
101
101
 
102
102
  ```
103
- grep Evibs production.log
103
+ grep "#VENUS EVIBS" production.log
104
104
  ```
105
105
 
106
106
  When this is done repeatedly, we can get some statistical information by looking at the distribution of individual and total vibrational energies sampled.
107
107
 
108
108
  <img align="center" width="600" height="250" src="images/microcanonical.12.63.png">
109
109
 
110
- The resulting distribution of vibrational energies in each mode is shown in the figure above. Although only a single total vibrational energy is sampled, the energy is uniformly mixed over all three modes, resulting in a seemingly random distribution of combinations of energies. In this way, a microcanonical ensemble favors mixing mode energies over explicit quantizations. The same behaviour is seen at all excitations, including one corresponding to the avereage energy of the 3000K canonical ensemble (21.22 kcal/mol) from the previous example. If we repeat the procedure with the argument `--EVIBa 21.220`, we then see a distribution as follows:
110
+ The resulting distribution of vibrational energies in each mode is shown in the figure above. Although only a single total vibrational energy is sampled, the energy is uniformly mixed over all three modes, resulting in a seemingly random distribution of combinations of energies. In this way, a microcanonical ensemble favors mixing mode energies over explicit quantizations. The same behaviour is seen at all excitations, including one corresponding to the average energy of the 3000K canonical ensemble (21.22 kcal/mol) from the previous example. If we repeat the procedure with the argument `--EVIBa 21.220`, we then see a distribution as follows:
111
111
 
112
112
  <img align="center" width="600" height="250" src="images/microcanonical.21.22.png">
113
113
 
114
114
  </details>
115
115
 
116
+ ### Normal Mode Sampling
117
+
118
+ <details>
119
+ <summary>Click here to do the example</summary>
120
+
121
+ Water is a nonlinear molecule with three atoms, so it has three normal modes. If a specific amount of energy is needed to be sampled for each mode, then instead a microcanonical normal mode sampling can be done with the `--INITQPa "microcanonicalnormalmode"` argument. The frequency of the modes dictates the absolute amount of energy ultimately given to a mode. With xTB, these frequencies are 3653 cm<sup>-1</sup> > 3645 cm<sup>-1</sup> > 1538 cm<sup>-1</sup> for the symmetric stretch, asymmetric stretch, and bending modes, respectively. For example, for an equal-energy sampling, VENUSpy can sample these with:
122
+
123
+ ```
124
+ venuspy-cli examples/H2O.input.xyz examples/H2O.input.xtb . --atomsInFirstGroup "1 2 3" --production 100 --interval 1 --time_step 0.15 --INITQPa "microcanonicalnormalmode" --EVIBNMODESa 4.21,4.21,4.21 --EROTa 0.00001 --n_threads 1 > production.log
125
+ ```
126
+
127
+ While tracking the normal mode breakdown of energies over the entire trajectory is slow (this requires a Hessian calculation at each step), this can be done for the first frame from the initial sampling. Search for the `EVIBS` keyword in the output to see energies of each mode (in eV).
128
+
129
+ ```
130
+ grep "#VENUS EVIBS" production.log
131
+ ```
132
+
133
+ When this is done repeatedly, we can get some statistical information by looking at the distribution of individual and total vibrational energies sampled.
134
+
135
+ <img align="center" width="600" height="250" src="images/normalmode.1to1to1.12.63.png">
136
+
137
+ The resulting distribution of vibrational energies in each mode is shown in the figure above. Each mode is given a specific amount of energy so effectively a single state and total energy are sampled. However, the amount of energy is arbitrary and any mix can be requested. For example, if we repeat the procedure with the argument `--EVIBNMODESa X,Y,0.0` where X and Y are two random numbers that add to 12.63 kcal/mol, we then see a distribution as follows:
138
+
139
+ <img align="center" width="600" height="250" src="images/normalmode.RtoRto0.12.63.png">
140
+
141
+ </details>
142
+
116
143
  ### Semiclassical Sampling
117
144
 
118
145
  Finally, there is one more special case for diatomic molecules. Because polyatomic molecules have multiple normal modes, experimentally there is often more leeway in assigning exact rovibrational states to molecules---a difficult and often intractable problem. However, diatomic molecules can have exact rovibrational states assigned through computational quantization procedures. The phase and kinetic/potential distribution of the vibration can then be sampled classically. This semiclassical method is the preferred sampling method for diatoms.
@@ -1 +0,0 @@
1
- __version__ = "1.1.1"
File without changes
File without changes
File without changes
File without changes