Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation error #398

Closed
lkwagner opened this issue Aug 10, 2023 · 1 comment
Closed

Documentation error #398

lkwagner opened this issue Aug 10, 2023 · 1 comment
Assignees

Comments

@lkwagner
Copy link
Contributor

According to the documentation, I think this should work:

import pyscf
import pyscf.mcscf as mcscf
import numpy as np
import h5py
if __name__=="__main__":
    mol = pyscf.gto.Mole(atom="C 0. 0. 0.; O 0. 0. 1.2171071",
                         ecp='ccecp',
                         basis='ccecpccpvtz')
    mf = pyscf.scf.RHF(mol)
    mf.chkfile = 'mf.chk'
    mf.kernel()
    print(mf.mo_energy)
    print(mf.mo_occ)

    mc = mcscf.CASSCF(mf, 6,6)
    mc.chkfile = 'cas.chk'
    mc.kernel()

    with h5py.File(mc.chkfile, "a") as f:
        f["mcscf/nelecas"] = list(mc.nelecas)
        f["mcscf/ci"] = mc.ci
import pyqmc.api as pyq
mol, mf, mc = pyq.recover_pyscf('mf.chk',ci_checkfile='cas.chk')

However, I get an error as follows:

Traceback (most recent call last):
  File "/projects/wagner/lkwagner/co_newopt/opt_3state.py", line 53, in <module>
    run_optimization(nstates=nstates, nconfig=nconfig,
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/projects/wagner/lkwagner/co_newopt/opt_3state.py", line 14, in run_optimization
    mol, mf, mc = pyq.recover_pyscf('mf.chk',ci_checkfile='cas.chk')
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/lkwagner/pyqmc/pyqmc/pyscftools.py", line 73, in recover_pyscf
    mc = pyscf.mcscf.CASCI(mol, casdict["ncas"], casdict["nelecas"])
                                ~~~~~~~^^^^^^^^
@lkwagner
Copy link
Contributor Author

hmm, I think that there was some cruft left in some of the files; I don't get the same error when rerunning it. Is there some issue with it looking in the mf versus cas check file?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants