pyscf / pyscf/pyscf.github.io

Errors when running PCM model

Open
#138 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TeX
Stars
41
Forks
88
Avg merge
8d 9h
Merged PRs (30d)
3

Description

https://github.com/pyscf/pyscf.github.io/blame/2cd8b965a7959cb7e1f40a0eca5103dde7af28c2/source/user/solvent.rst#L39C4-L39C4
hello I get errors when I run the code from user guide https://pyscf.org/user/solvent.html#pcm-model
here is my input

import pyscf
mol = pyscf.M(atom='''
     C  0.    0.      -0.542
     O  0.    0.       0.677
     H  0.    0.935   -1.082
     H  0.   -0.935   -1.082''',
              basis='6-31g*', verbose=4)
mf = mol.RKS(xc='b3lyp').PCM()
mf.with_solvent.method = 'IEF-PCM' # C-PCM, SS(V)PE, COSMO
mf.with_solvent.eps = 78.3553 # for water
mf.run()

errors

Traceback (most recent call last):
  File "/home/ljw/test/testpyscf.py", line 20, in <module>
    mf = mol.RKS(xc='b3lyp').PCM()
  File "/home/ljw/.conda/envs/pyscf/lib/python3.7/site-packages/pyscf/scf/hf.py", line 1740, in __getattr__
    return object.__getattribute__(self, key)
AttributeError: 'RKS' object has no attribute 'PCM'

then I check the usage in souce code https://pyscf.org/_modules/pyscf/solvent.html#PCM

'''Initialize PCM model.

Examples:

>>> mf = PCM(scf.RHF(mol))
>>> mf.kernel()
>>> sol = PCM(mol)
>>> mc = PCM(CASCI(mf, 6, 6), sol)
>>> mc.kernel()
'''

so I change mf = mol.RKS(xc='b3lyp').PCM() into mf = pyscf.solvent.PCM(mol.RKS(xc='b3lyp')) and get no errors
am I miss something or they are the same function

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at source/user/solvent.rst around line 39 and compare the documented PCM example with the working pyscf.solvent.PCM usage shown in the issue. Confirm which form is supported, update the example if needed, and verify that the documented code runs without the reported AttributeError.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
documentation
Issue type
Documentation
Difficulty
1/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.