Giter Club home page Giter Club logo

Comments (8)

lkwagner avatar lkwagner commented on September 4, 2024

Hi David,

Thanks for the issue! The documentation has been updated there. You might find the HOWTOs more useful than the developer documentation:
https://pyqmc.readthedocs.io/en/latest/snippets.html

We currently don't support CISD wave functions natively. See Issue #241 It is possible to construct a determinant list by hand, if you like. It wouldn't be too hard to do that.

However, these days we don't typically use CISD because it's almost always worse than HCI or CASSCF/CASCI. You will probably get similar results to the article if you do something like the following, which will get you the ground-state Jastrow:

def run_casci(scf_checkfile, ci_checkfile):
    mol, mf = pyq.recover_pyscf(scf_checkfile, cancel_outputs=False)
    mc = mcscf.CASCI(mf, 6, 6)
    mc.nroots=12
    mc.kernel()

    with h5py.File(ci_checkfile, "a") as f:
        f.create_group("mc")
        f["mc/ncas"] = mc.ncas
        f["mc/nelecas"] = list(mc.nelecas)
        f["mc/ci"] = mc.ci
        f["mc/mo_coeff"] = mc.mo_coeff
    return mc



if __name__ == "__main__":
    run_mf("mf.chk")
    run_casscf("mf.chk", "cas.chk")
    pyq.OPTIMIZE("mf.chk", "opt.chk", ci_checkfile="cas.chk", nconfig=1000)

After that, you will want to attach the ground state Jastrow to the CAS roots to get approximate excited states. I have some examples of that somewhere, but let me know if this works for you.

from pyqmc.

davidsousarj avatar davidsousarj commented on September 4, 2024

Hi @lkwagner .

I tried to run these lines of code but it does not work. Here is the error message:

Traceback (most recent call last):
  File "/home/david/MEGA/ACADÊMICO/A_POST_DOC_EUA/QMC/6_Benzene_LucasWagner.py", line 122, in <module>
    pyq.OPTIMIZE("mf.chk", "opt.chk", ci_checkfile="cas.chk", nconfig=1000)
  File "/home/david/.local/lib/python3.10/site-packages/pyqmc/recipes.py", line 45, in OPTIMIZE
    wf, configs, acc = initialize_qmc_objects(
  File "/home/david/.local/lib/python3.10/site-packages/pyqmc/recipes.py", line 186, in initialize_qmc_objects
    mol, mf, mc = pyscftools.recover_pyscf(dft_checkfile, ci_checkfile=ci_checkfile)
  File "/home/david/.local/lib/python3.10/site-packages/pyqmc/pyscftools.py", line 69, in recover_pyscf
    if len(casdict["mo_coeff"].shape) == 3:
TypeError: 'NoneType' object is not subscriptable

from pyqmc.

willwheelera avatar willwheelera commented on September 4, 2024

Hi David, I apologize for the confusion. The example code I added to the documentation was outdated. Could you try this instead? The label "mc" is changed to "ci"

def run_casci(scf_checkfile, ci_checkfile):
    mol, mf = pyq.recover_pyscf(scf_checkfile, cancel_outputs=False)
    mc = mcscf.CASCI(mf, 2, 2)
    mc.kernel()

    with h5py.File(ci_checkfile, "a") as f:
        f.create_group("ci")
        f["ci/ncas"] = mc.ncas
        f["ci/nelecas"] = list(mc.nelecas)
        f["ci/ci"] = mc.ci
        f["ci/mo_coeff"] = mc.mo_coeff
    return mc

from pyqmc.

davidsousarj avatar davidsousarj commented on September 4, 2024

Hi @willwheelera . I tried this one. Now it raises other error message:

Traceback (most recent call last):
  File "/home/david/MEGA/ACADÊMICO/A_POST_DOC_EUA/QMC/6_Benzene_LucasWagner.py", line 133, in <module>
    pyq.OPTIMIZE("mf.chk", "opt.chk", ci_checkfile="cas.chk", nconfig=1000)
  File "/home/david/.local/lib/python3.10/site-packages/pyqmc/recipes.py", line 45, in OPTIMIZE
    wf, configs, acc = initialize_qmc_objects(
  File "/home/david/.local/lib/python3.10/site-packages/pyqmc/recipes.py", line 189, in initialize_qmc_objects
    elif mc.orbitals is None:
AttributeError: 'CASCI' object has no attribute 'orbitals'

from pyqmc.

willwheelera avatar willwheelera commented on September 4, 2024

Hi David, thanks for trying that and following up. I recognize where your error is coming from, and I think our current version of the code no longer does that. Can you try it again using the current version? If you installed with pip, you can do pip install git+git://github.com/WagnerGroup/pyqmc --upgrade

from pyqmc.

davidsousarj avatar davidsousarj commented on September 4, 2024

Thank you @willwheelera . I tried to install using pip but it did not work for some reason. Then I downloaded the zip file from github and installed it manually.

I am sorry, but it is still not working. There is another error now:

Traceback (most recent call last):
  File "/home/dms7983/MEGAsync/ACADÊMICO/A_POST_DOC_EUA/QMC/6_Benzene_LucasWagner.py", line 127, in <module>
    pyq.OPTIMIZE("mf.chk", "opt.chk", ci_checkfile="cas.chk", nconfig=1000)
  File "/home/dms7983/.local/lib/python3.10/site-packages/pyqmc/recipes.py", line 45, in OPTIMIZE
    wf, configs, acc = initialize_qmc_objects(
  File "/home/dms7983/.local/lib/python3.10/site-packages/pyqmc/recipes.py", line 199, in initialize_qmc_objects
    wf, to_opt = wftools.generate_wf(
  File "/home/dms7983/.local/lib/python3.10/site-packages/pyqmc/wftools.py", line 157, in generate_wf
    wf1, to_opt1 = generate_slater(mol, mf, mc=mc, **slater_kws)
  File "/home/dms7983/.local/lib/python3.10/site-packages/pyqmc/wftools.py", line 28, in generate_slater
    wf = slater.Slater(mol, mf, **kwargs)
  File "/home/dms7983/.local/lib/python3.10/site-packages/pyqmc/slater.py", line 166, in __init__
    ) = pyqmc.orbitals.choose_evaluator_from_pyscf(
  File "/home/dms7983/.local/lib/python3.10/site-packages/pyqmc/orbitals.py", line 59, in choose_evaluator_from_pyscf
    return MoleculeOrbitalEvaluator.from_pyscf(
  File "/home/dms7983/.local/lib/python3.10/site-packages/pyqmc/orbitals.py", line 87, in from_pyscf
    detcoeff, occup, det_map = pyqmc.determinant_tools.interpret_ci(mc, tol)
  File "/home/dms7983/.local/lib/python3.10/site-packages/pyqmc/determinant_tools.py", line 69, in interpret_ci
    deters = fci.addons.large_ci(mc.ci, mc.ncas, mc.nelecas, tol=-1)
  File "/home/dms7983/.local/lib/python3.10/site-packages/pyscf/fci/addons.py", line 36, in large_ci
    assert (ci.shape == (na, nb))
AssertionError

I will send you my script just to make sure I am not doing anything wrong.
6_Benzene_LucasWagner.py.txt

from pyqmc.

willwheelera avatar willwheelera commented on September 4, 2024

Hi David, thanks for following up and thanks for your patience with all the errors.

We just added a fix that I think should solve this error. Could you try it again with the update?

from pyqmc.

davidsousarj avatar davidsousarj commented on September 4, 2024

@willwheelera sorry for the delay. I run the script but it took over 24 hours to finish. It run without errors.

from pyqmc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.