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

Problem with gbasis wrapper #199

Closed
JannisErhard opened this issue Aug 6, 2024 · 3 comments
Closed

Problem with gbasis wrapper #199

JannisErhard opened this issue Aug 6, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@JannisErhard
Copy link

JannisErhard commented Aug 6, 2024

Whenever I try to read scf data from ".molden" or ".fchk", I run into a problem with gbasis. It complains that "AttributeError: 'MolecularBasis' object has no attribute 'get_segmented'". I am actually working with atomdb but the source iof the problem seems to be gbasis.

I am using this code snipped to generate to dump scf data in a molden file

    mol = gto.Mole() 
    mol.build()
    mf = scf.RHF( mol )
    mf.scf()
    molden.from_scf(mf, f"{fname}.molden", ignore_h=True)

And I use this snippet to the read the file:

atomdb.compile(atnum, charge, mult, 0, 'hci', datapath=MYDATAPATH)

It prompts the error

Traceback (most recent call last):
  File "/scratch/jerhard/Benchmark_sto-3g/compile.py", line 69, in <module>
    wrap_compile(atnum, charges)
  File "/scratch/jerhard/Benchmark_sto-3g/compile.py", line 33, in wrap_compile
    atomdb.compile(atnum, charge, mult, 0, 'hci', datapath=MYDATAPATH)
  File "/home/jerhard/envs/AtomDB/atomdb/species.py", line 747, in compile
    species = submodule.run(elem, charge, mult, nexc, dataset, datapath)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/jerhard/envs/AtomDB/atomdb/datasets/hci/run.py", line 128, in run
    obasis = from_iodata(scfdata)
             ^^^^^^^^^^^^^^^^^^^^
  File "/home/jerhard/envs/heat_bath_fci/gbasis/gbasis/wrappers.py", line 126, in from_iodata
    molbasis = mol.obasis.get_segmented()
               ^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'MolecularBasis' object has no attribute 'get_segmented'
``

I am actually not sure if this is a problem with atomdb, iodata or gbasis, but I have been digging for a while and trying an alternative path where I use the fchk format, corespondingly a different part of atomdb and I end up with the same error in gbasis. Since this is the strongest hint I have I thought it would be best to reach out here. 
@JannisErhard JannisErhard added the bug Something isn't working label Aug 6, 2024
@JannisErhard JannisErhard changed the title [BUG] Problem with gbasis wrapper Aug 6, 2024
@leila-pujal
Copy link
Collaborator

Hi @JannisErhard, this was reported in issue #195. I just merged the PR #196 and if you pull the last commit from Gbasis it should work now. Let me know if this fixes your issue.

@JannisErhard
Copy link
Author

wow that was fast, yes that resolves my issue thanks

@leila-pujal
Copy link
Collaborator

Perfect! Your message was useful because the PR fixing that problem was already finalized and I was planning to merge it. I will close the issue then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants