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

Incomplete support for Gaussian basis set format #1270

Closed
susilehtola opened this issue Sep 29, 2018 · 4 comments
Closed

Incomplete support for Gaussian basis set format #1270

susilehtola opened this issue Sep 29, 2018 · 4 comments

Comments

@susilehtola
Copy link
Member

The following input

molecule {
0 1
Li
Li 1 1.63
}

basis {
spherical
****
Li 1
S 1 1.0
 20.0 1.0
S 1 1.0
 2.0 1.0
****
Li 2
S 1 1.0
 10.0 1.0
S 1 1.0
 1.0 1.0
****
}

energy('scf')

should give me the first basis set on atom 1 and the second basis set on atom 2. What I get instead is

$ psi4 

QcdbException BasisSetNotFound: BasisSet::construct: Unable to find a basis set for atom 1 for key BASIS among:
  Shell Entries: ['LI']
  Basis Sets: [('anonymous8452ca2a', 'anonymous8452ca2a', None)]
  File Path: /tmp/crc, /tmp/crc, /home/work/psi4/install/share/psi4/basis
  Input Blocks: anonymous8452ca2a



Traceback (most recent call last):
  File "/home/work/psi4/install/bin/psi4", line 271, in <module>
    exec(content)
  File "<string>", line 48, in <module>
  File "/home/work/psi4/install/lib/psi4/driver/driver.py", line 493, in energy
    wfn = procedures['energy'][lowername](lowername, molecule=molecule, **kwargs)
  File "/home/work/psi4/install/lib/psi4/driver/procrouting/proc.py", line 2006, in run_scf
    scf_wfn = scf_helper(name, post_scf=False, **kwargs)
  File "/home/work/psi4/install/lib/psi4/driver/procrouting/proc.py", line 1266, in scf_helper
    base_wfn = core.Wavefunction.build(scf_molecule, core.get_global_option('BASIS'))
  File "/home/work/psi4/install/lib/psi4/driver/p4util/python_helpers.py", line 115, in pybuild_wavefunction
    basis = core.BasisSet.build(mol, "ORBITAL", basis)
  File "/home/work/psi4/install/lib/psi4/driver/p4util/python_helpers.py", line 77, in pybuild_basis
    return_atomlist=return_atomlist)
  File "/home/work/psi4/install/lib/psi4/driver/qcdb/libmintsbasisset.py", line 683, in pyconstruct
    verbose=verbose)
  File "/home/work/psi4/install/lib/psi4/driver/qcdb/libmintsbasisset.py", line 902, in construct
    (at + 1, key, text2))

BasisSetNotFound: BasisSet::construct: Unable to find a basis set for atom 1 for key BASIS among:
  Shell Entries: ['LI']
  Basis Sets: [('anonymous8452ca2a', 'anonymous8452ca2a', None)]
  File Path: /tmp/crc, /tmp/crc, /home/work/psi4/install/share/psi4/basis
  Input Blocks: anonymous8452ca2a
@loriab
Copy link
Member

loriab commented Sep 29, 2018

Yes, that's expected. While we want to support Gaussian basis format for all the basis set specification, the connection of that basis to the molecule is a separate part, IMO. Integer labeling of atoms is problematic, especially for SAPT and n-body molecules. So all basis sets for Psi use the Fe 0 scheme (that is, generic per element), then you can assign different basis sets to different atoms per element or per indiv atom via label through assign statements in a basis [name] {...} block, as in the mints2 test case.

@susilehtola
Copy link
Member Author

I feel like this should be addressed by checking on line 185 of libmintsbasissetparser.py that the input atom number is always zero.

@susilehtola
Copy link
Member Author

I don't really understand what the Python code is doing

@loriab
Copy link
Member

loriab commented Jan 17, 2019

I agree, it'd be nice to catch those and warn ppl off from that feature of GBS format. In the existing logic https://github.com/psi4/psi4/blob/master/psi4/driver/qcdb/libmintsbasissetparser.py#L183-L184 is already catching only <element symbol(s)> 0 through the zero near the end of https://github.com/psi4/psi4/blob/master/psi4/driver/qcdb/libmintsbasissetparser.py#L115.

This would be a general (to all files read), not specific, catch, but if you change that 0 in the regex to \d+ then add the below after https://github.com/psi4/psi4/blob/master/psi4/driver/qcdb/libmintsbasissetparser.py#L184, does that catch and provide better guidance?

gbsint = int(atom_array.match(line).group(2))
if gbsint != 0:
    raise ValidationError("""Gaussian94BasisSetParser::parse: Unsupported basis to atom by number assignment. Use "assign" statements as in https://github.com/psi4/psi4/blob/master/tests/mints2/input.dat : line %d: %s""" % (lineno, line))

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