@@ -98,45 +98,11 @@ def psi4_casscf(geom, basis, reference, restricted_docc, active, options={}) ->
98
98
# pipe output to the file output.dat
99
99
psi4 .core .set_output_file ("output.dat" , True )
100
100
101
- # psi4.core.clean()
102
-
103
101
# run scf and return the energy and a wavefunction object (will work only if pass return_wfn=True)
104
102
E_scf , wfn = psi4 .energy ("casscf" , molecule = mol , return_wfn = True )
105
103
return (E_scf , wfn )
106
104
107
105
108
- def psi4_casscf (geom , basis , mo_spaces ):
109
- """
110
- Run a Psi4 SCF.
111
- :param geom: a string for molecular geometry
112
- :param basis: a string for basis set
113
- :param reference: a string for the type of reference
114
- :return: a tuple of (scf energy, psi4 Wavefunction)
115
- """
116
- psi4 .core .clean ()
117
- mol = psi4 .geometry (geom )
118
-
119
- psi4 .set_options (
120
- {
121
- "basis" : basis ,
122
- "scf_type" : "pk" ,
123
- "e_convergence" : 1e-13 ,
124
- "d_convergence" : 1e-6 ,
125
- "restricted_docc" : mo_spaces ["RESTRICTED_DOCC" ],
126
- "active" : mo_spaces ["ACTIVE" ],
127
- "mcscf_maxiter" : 100 ,
128
- "mcscf_e_convergence" : 1.0e-11 ,
129
- "mcscf_r_convergence" : 1.0e-6 ,
130
- "mcscf_diis_start" : 20 ,
131
- }
132
- )
133
- psi4 .core .set_output_file ("output.dat" , False )
134
-
135
- Escf , wfn = psi4 .energy ("casscf" , return_wfn = True )
136
- psi4 .core .clean ()
137
- return Escf , wfn
138
-
139
-
140
106
def psi4_cubeprop (wfn , path = "." , orbs = [], nocc = 0 , nvir = 0 , density = False , frontier_orbitals = False , load = False ):
141
107
"""
142
108
Run a psi4 cubeprop computation to generate cube files from a given Wavefunction object
@@ -184,7 +150,7 @@ def psi4_cubeprop(wfn, path=".", orbs=[], nocc=0, nvir=0, density=False, frontie
184
150
185
151
186
152
def prepare_forte_objects (
187
- wfn , mo_spaces = None , active_space = "ACTIVE" , core_spaces = ["RESTRICTED_DOCC" ], localize = False , localize_spaces = []
153
+ wfn , mo_spaces , active_space = "ACTIVE" , core_spaces = ["RESTRICTED_DOCC" ], localize = False , localize_spaces = []
188
154
):
189
155
"""Take a psi4 wavefunction object and prepare the ForteIntegrals, SCFInfo, and MOSpaceInfo objects
190
156
@@ -235,15 +201,18 @@ def prepare_forte_objects(
235
201
point_group = wfn .molecule ().point_group ().symbol ()
236
202
237
203
# create a MOSpaceInfo object
238
- if mo_spaces is None :
239
- mo_space_info = forte .make_mo_space_info (nmopi , point_group , options )
240
- else :
241
- mo_space_info = forte .make_mo_space_info_from_map (nmopi , point_group , mo_spaces )
204
+ mo_space_info = forte .make_mo_space_info_from_map (nmopi , point_group , mo_spaces )
205
+
206
+ # These variables are needed in make_state_weights_map
207
+ nel = wfn .nalpha () + wfn .nbeta ()
208
+ multiplicity = 1
242
209
210
+ options .set_int ("NEL" , nel )
211
+ options .set_int ("MULTIPLICITY" , multiplicity )
243
212
state_weights_map = forte .make_state_weights_map (options , mo_space_info )
244
213
245
214
# make a ForteIntegral object
246
- ints = forte .make_ints_from_psi4 (wfn , options , mo_space_info )
215
+ ints = forte .make_ints_from_psi4 (wfn , options , scf_info , mo_space_info )
247
216
248
217
if localize :
249
218
localizer = forte .Localize (forte .forte_options , ints , mo_space_info )
0 commit comments