Skip to content

Errors when running PCM model #138

@coldflsh

Description

@coldflsh

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions