MolSSI / QCEngine

Quantum chemistry program executor and IO standardizer (QCSchema).
https://molssi.github.io/QCEngine/
BSD 3-Clause "New" or "Revised" License
162 stars 78 forks source link

How to get CCSD(T) dipoles via qcengine? #430

Closed pavankum closed 8 months ago

pavankum commented 10 months ago

Hi,

I am trying to get CCSD(T) dipole moments via qcengine but I am not able to translate the example using psi4 api from here to qcschema. With psi4 api this works perfectly,

import psi4

geom_inp ="""
0 1
o
h 1 0.958
h 1 0.958 2 104.4776
"""

psi4.set_memory('10 GB')
psi4.core.set_output_file('output.dat', False)
psi4.set_options({'basis': 'aug-cc-pVTZ',
                  'scf_type': 'df',
                  'cc_type': 'df',
                  'freeze_core': True,
                  'guess': 'sad'})

geom = psi4.geometry(geom_inp)
_, wfn = psi4.gradient('CCSD(T)', molecule=geom, return_wfn=True)
oeprop = psi4.core.OEProp(wfn)
oeprop.add("DIPOLE")
oeprop.compute()

I see cc_properties in here but I am not sure how to pass it in AtomicInput, I tried passing with keywords but that fails. What are the changes needed to make the following code to get CCSD(T) dipole similar to above? Right now I get CCSD(T) energy, pair energies, and other SCF properties, but the CCSD(T) dipole moment field comes out as None - ccsd_prt_pr_dipole_moment=None

import qcengine
from qcelemental.models.common_models import Model
from qcelemental.models import AtomicInput

qcmol = qcengine.get_molecule("water")
method = 'ccsd(t)'
basis = 'aug-cc-pVTZ'
program = 'psi4'
result = compute(input_data=AtomicInput(molecule=qcmol,
                                        driver='gradient', 
                                        model=Model(method=method, 
                                                    basis=basis,
                                                   ),
                                        keywords={'scf_type': 'df', 
                                                  'cc_type': 'df',
                                                  'freeze_core': True,
                                                  'guess': 'sad',
                                                  'scf_properties':["dipole",
                                                                    "quadrupole",
                                                                    "mulliken_charges",
                                                                    "lowdin_charges",
                                                                    "wiberg_lowdin_indices",
                                                                    "mayer_indices",
                                                                   ],
                                                 },
                                       ),
                 program=program)
loriab commented 8 months ago

Unfortunately, because two steps are required -- wfn = psi4.gradient; oeprop(wfn) -- it doesn't map into qcschema. We (the psi4 devs) really ought to get this incorporated into psi4.properties.

pavankum commented 8 months ago

Thank you Lori! I will close this issue then.