UPD3: The following input file shown an example how to export the natural orbitals for MP2/CISD/CCSD wavefunction with PSI4 (tested on version Psi4 1.2a1.dev781 Git: Rev {master} 837e345). Notice, that unlike some other quantum chemistry codes, PSI4 does not freeze core electrons by default in such calculations.
memory 4000 mb set { basis def2-tzvpp } molecule struct { symmetry c1 0 1 Br 1.0367834885 -0.0459074527 0.1499467136 Br 4.0596218490 0.2523472440 2.2664374324 Se 3.3832208791 -0.0615041980 0.0388586478 } e, wfn = properties('mp2', return_wfn=True) d = wfn.Da().to_array() s = wfn.S().to_array() c = wfn.Ca().to_array() occs = c.T.dot(s.dot(d).dot(s).dot(c)) molden(wfn, 'mp2.molden', density_a = psi4.core.Matrix.from_array(occs))
In this example (applicable to a closed-shell systems!) wfn.Da()
is the 'SO density' (doc) (i.e., the coefficients of expansion of 1-RDM over AOs), whereas molden
method (in fact, psi4.driver.molden
) requires its density_a
argument to be the density in the MO basis. Therefore, the occs = c.T.dot(s.dot(d).dot(s).dot(c))
is used to transform wfn.Da()
to the MO basis.
UPD2: As of PSI4 1.1 release we recommend using Molden2AIM for converting basis set infromation written into .molden files by psi4 into a conventional molden format. The new ('corrected') file produced by Molden2AIM is typically named X_new.molden where X stands for an original input file.
Note that as of version 4.1.4, Molden2AIM supports only spherical harmonics.
Alternatively, psi4 1.1 's molden files can be converted to a conventional molden format with molden2molden program using the following syntax
java -jar molden2molden.jar -NormalizeBF -i moldenFileProducedByPsi4_11 -o conventionalMoldenFile
In case of Cartesian basis set, use the following combination:
java -jar molden2molden.jar -frompsi4v1mo -NormalizeBF -cart2pure -i initial.molden -o final.molden
UPD: As of Psi4 1.0 release (not beta) there is not need in using molden2molden converter for adaptation of
.molden files produced by Psi4 with pure spherical harmonics (option PUREAM true
) for the janpa input. Just run a calculation and use the .molden file produced by Psi4 (option MOLDEN_WRITE true
) as an input for janpa program.
However, when the same version of Psi4 is used with cartesian basis functions (option PUREAM false
), some
adaptation is still necessary. In this case, the workflow is as following:
hydrazine.dat
given below)When the calculation is finished, hydrazine.out.struct.molden
file will be created
run molden2molden in order to convert hydrazine.out.struct.molden
from Cartesian to pure
basis and turn its basis set definitions to proper MOLDEN conventions:
java -jar molden2molden.jar -i hydrazine.out.struct.molden -o hydrazine.PURE -frompsi4v1mo -cart2pure
Note that -frompsi4v1mo
instead of -frompsi4b4bf
should be used for 1.0 release of Psi4.
After this hydrazine.PURE MOLDEN file (in an 'extended' MOLDEN format) will be created.
This file can now be used to perform NPA analysis with Janpa:
java -jar janpa.jar -i hydrazine.PURE -npacharges hydrazine.npa -ignorefock > hydrazine.JANPA
Note: there was -ignorefock
option in JANPA versions prior to 2.02. Using this option was highly recommended for analyzing the orbitals obtained from a correlated wavefunction, since in this case no 'energies' of the orbitals are available. For the same reason the default behaviour has been changed in JANPA v. 2.02, so that the Fock matrix is ignored by default. In case if for some reason the Fock matrix analysis is still needed, the option -doFock
should be used.
The following examples were tested in Psi4 beta 5 and beta 4:
run PSI4 with the following input file (say, hydrazine.dat
)
memory 2500 mb molecule struct { symmetry c1 no_reorient # no_com # whether to move the origin to the center of masses 0 1 N 0.00000000 0.74444600 0.00000000 N 0.00000000 -0.74444600 0.00000000 H 0.59942200 0.97574000 0.79671100 H 0.59942200 0.97574000 -0.79671100 H -0.59942200 -0.97574000 0.79671100 H -0.59942200 -0.97574000 -0.79671100 } set { basis 6-31G* # Do use pure angular momentum basis functions? PUREAM false SCF_TYPE DIRECT # An out-of-core, presorted algorithm using exact ERIs. MOLDEN_WRITE true } energy('b3lyp')
When the calculation is finished, hydrazine.out.struct.molden
file will be created
run molden2molden in order to convert hydrazine.out.struct.molden
from Cartesian to pure
basis and turn its basis set definitions to proper MOLDEN conventions:
java -jar molden2molden.jar -i hydrazine.out.struct.molden -o hydrazine.PURE -frompsi4b4bf -cart2pure
After this hydrazine.PURE MOLDEN file (in an 'extended' MOLDEN format) will be created.
Use Janpa to perform NPA analysis:
java -jar janpa.jar -i hydrazine.PURE -npacharges hydrazine.npa -ignorefock > hydrazine.JANPA
Here -npacharges hydrazine.npa
options are used to export NPA charges to the file hydrazine.npa
,
and -ignorefock
suppresses Fock matrix analysis.
You can also Download all files of this example