venuspython 1.1.2__tar.gz → 1.1.4__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.2 → venuspython-1.1.4}/PKG-INFO +1 -1
  2. venuspython-1.1.4/venuspy/__init__.py +1 -0
  3. {venuspython-1.1.2 → venuspython-1.1.4}/venuspy/calc/psi4calc.py +38 -3
  4. {venuspython-1.1.2 → venuspython-1.1.4}/venuspy/calc/qcengineGAMESScalc.py +55 -9
  5. {venuspython-1.1.2 → venuspython-1.1.4}/venuspython.egg-info/PKG-INFO +1 -1
  6. venuspython-1.1.2/venuspy/__init__.py +0 -1
  7. {venuspython-1.1.2 → venuspython-1.1.4}/README.md +0 -0
  8. {venuspython-1.1.2 → venuspython-1.1.4}/pyproject.toml +0 -0
  9. {venuspython-1.1.2 → venuspython-1.1.4}/setup.cfg +0 -0
  10. {venuspython-1.1.2 → venuspython-1.1.4}/venuspy/calc/bagelcalc.py +0 -0
  11. {venuspython-1.1.2 → venuspython-1.1.4}/venuspy/calc/chempotpycalc.py +0 -0
  12. {venuspython-1.1.2 → venuspython-1.1.4}/venuspy/calc/minisgdmlcalc.py +0 -0
  13. {venuspython-1.1.2 → venuspython-1.1.4}/venuspy/calc/mopaccalc.py +0 -0
  14. {venuspython-1.1.2 → venuspython-1.1.4}/venuspy/calc/nwchemcalc.py +0 -0
  15. {venuspython-1.1.2 → venuspython-1.1.4}/venuspy/calc/nwchemexcalc.py +0 -0
  16. {venuspython-1.1.2 → venuspython-1.1.4}/venuspy/calc/original_nwchemexcalc.py +0 -0
  17. {venuspython-1.1.2 → venuspython-1.1.4}/venuspy/calc/physnetcalc.py +0 -0
  18. {venuspython-1.1.2 → venuspython-1.1.4}/venuspy/calc/xtbcalc.py +0 -0
  19. {venuspython-1.1.2 → venuspython-1.1.4}/venuspy/cli.py +0 -0
  20. {venuspython-1.1.2 → venuspython-1.1.4}/venuspy/initialSampling.py +0 -0
  21. {venuspython-1.1.2 → venuspython-1.1.4}/venuspy/md.py +0 -0
  22. {venuspython-1.1.2 → venuspython-1.1.4}/venuspython.egg-info/SOURCES.txt +0 -0
  23. {venuspython-1.1.2 → venuspython-1.1.4}/venuspython.egg-info/dependency_links.txt +0 -0
  24. {venuspython-1.1.2 → venuspython-1.1.4}/venuspython.egg-info/entry_points.txt +0 -0
  25. {venuspython-1.1.2 → venuspython-1.1.4}/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.2
3
+ Version: 1.1.4
4
4
  Summary: VENUSpy Initial Sampling and Molecular Dynamics
5
5
  Keywords: moleculardynamics,initialsampling
6
6
  Classifier: Development Status :: 5 - Production/Stable
@@ -0,0 +1 @@
1
+ __version__ = "1.1.4"
@@ -53,6 +53,7 @@ class psi4calculator(Calculator):
53
53
  self.referencemethod = 'uhf'
54
54
  self.freeze_core = 0
55
55
  self.mp2_type = "df"
56
+ self.soscf = 0
56
57
  self.qc_module = None
57
58
  self.df_ints_io = "None"
58
59
  self.dft_spherical_points = 302 # The default for DFT jobs
@@ -63,8 +64,10 @@ class psi4calculator(Calculator):
63
64
  self.charge = 0
64
65
  self.multiplicity = 2 # 2s+1
65
66
 
67
+ self.print = 1
66
68
  self.memory = 1500 # In MB
67
69
  self.scratchdir = "/tmp"
70
+ self.init_wfn = None
68
71
 
69
72
  # Read in the psi4 input
70
73
  with open(input_path, 'r') as f:
@@ -88,10 +91,15 @@ class psi4calculator(Calculator):
88
91
  if (entries[0] == "maxiter"): self.maxiter = int(entries[1])
89
92
  if (entries[0] == "d_convergence"): self.d_convergence = float(entries[1])
90
93
  if (entries[0] == "e_convergence"): self.e_convergence = float(entries[1])
94
+ if (entries[0] == "init_wfn"): self.init_wfn = str(entries[1])
95
+ if (entries[0] == "soscf"): self.soscf = int(entries[1])
96
+
97
+ if (entries[0] == "print"): self.print = int(entries[1])
91
98
 
92
99
  # Set up the options for the psi4 calculation
93
100
  # Check keywords in the documentation: https://psicode.org/psi4manual/master/autodoc_glossary_options_c.html
94
101
  psi4.set_memory(str(self.memory)+' MB')
102
+ psi4.set_options({'PRINT': self.print}) # 0 = minimal, 1 = normal, 2 = verbose, 3+ = very detailed
95
103
  psi4.set_options({'maxiter': self.maxiter})
96
104
  psi4.set_options({'d_convergence': self.d_convergence})
97
105
  psi4.set_options({'e_convergence': self.e_convergence})
@@ -115,7 +123,7 @@ class psi4calculator(Calculator):
115
123
  psi4.set_options({'qc_module': self.qc_module})
116
124
 
117
125
  # Some alternate psi4 SCF convergence options for second-order SCF (SOSCF):
118
- if (False):
126
+ if (self.soscf>0):
119
127
  psi4.set_options({'soscf': True})
120
128
  psi4.set_options({'soscf_max_iter': self.maxiter})
121
129
  psi4.set_options({'soscf_conv': self.d_convergence})
@@ -153,6 +161,16 @@ class psi4calculator(Calculator):
153
161
  #print(geometry_string)
154
162
  psi4.geometry(geometry_string)
155
163
 
164
+ # This is for initial guesses (only done ONCE at the start)
165
+ if (not (self.init_wfn is None)):
166
+ try:
167
+ print("Reading in initial wavefunction: ({0})".format(self.init_wfn),flush=True)
168
+ e, self.ref_wfn = psi4.energy(self.psi4method,restart_file=self.init_wfn,write_orbitals=self.movecs,return_wfn=True)
169
+ print("Succeeded reading in initial wavefunction!",flush=True)
170
+ except:
171
+ print("Failed reading in initial wavefunction (check if file is correct / correctly copied...)!",flush=True)
172
+ self.init_wfn = None
173
+
156
174
  # Try the SCF convergence a few times with different approaches:
157
175
  # (1) Try using the reference wavefunction (from the previous step)
158
176
  # (2) Try the default superposition of atomic densities (SAD)
@@ -176,9 +194,20 @@ class psi4calculator(Calculator):
176
194
  psi4.set_options({'e_convergence': tmp_e_convergence})
177
195
  else:
178
196
  try:
179
- e, self.ref_wfn = psi4.energy(self.psi4method,restart_file=self.movecs,write_orbitals=self.movecs,return_wfn=True)
197
+ e, tmp_wfn = psi4.energy(self.psi4method,restart_file=self.movecs,write_orbitals=self.movecs,return_wfn=True)
198
+ self.ref_wfn = tmp_wfn
180
199
  break
181
200
  except SCFConvergenceError:
201
+
202
+ # Try using SOSCF (if soscf=1 in the input file) before continuing
203
+ if (self.soscf==1):
204
+ try:
205
+ psi4.set_options({'soscf': True})
206
+ e, self.ref_wfn = psi4.energy(self.psi4method,restart_file=self.movecs,write_orbitals=self.movecs,return_wfn=True)
207
+ break
208
+ except SCFConvergenceError:
209
+ pass
210
+
182
211
  print("SCF convergence (0) ... will now use a SAD guess")
183
212
  self.ref_wfn = None
184
213
 
@@ -203,6 +232,12 @@ class psi4calculator(Calculator):
203
232
  self.oeprop.add("MULLIKEN_CHARGES")
204
233
  self.oeprop.compute()
205
234
 
235
+ if (self.soscf==1):
236
+ psi4.set_options({'soscf': False})
237
+ #psi4.set_options({'soscf_max_iter': self.maxiter})
238
+ #psi4.set_options({'soscf_conv': self.d_convergence})
239
+ #psi4.set_options({'soscf_start_convergence': 1.0e-6})
240
+
206
241
  # Convert model units to ASE default units (eV and Ang)
207
242
  e *= self.E_to_eV
208
243
  f *= -self.F_to_eV_Ang
@@ -217,7 +252,7 @@ class psi4calculator(Calculator):
217
252
  for i in range(Natoms):
218
253
  anAtom = atoms[i]
219
254
  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("")
255
+ print("",flush=True)
221
256
 
222
257
  self.results = {'energy': e, 'forces': f}
223
258
 
@@ -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
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: venuspython
3
- Version: 1.1.2
3
+ Version: 1.1.4
4
4
  Summary: VENUSpy Initial Sampling and Molecular Dynamics
5
5
  Keywords: moleculardynamics,initialsampling
6
6
  Classifier: Development Status :: 5 - Production/Stable
@@ -1 +0,0 @@
1
- __version__ = "1.1.2"
File without changes
File without changes
File without changes
File without changes
File without changes