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

sanitize molecule names for dfhelper #2984

Merged
merged 2 commits into from Jun 17, 2023
Merged

sanitize molecule names for dfhelper #2984

merged 2 commits into from Jun 17, 2023

Conversation

loriab
Copy link
Member

@loriab loriab commented Jun 13, 2023

Description

User API & Changelog headlines

  • While not recommended to use a / character in your molecule labels, if you do, at least now it won't segfault if density fitting is involved. Thanks to @bennybp for the bug report.

Dev notes & details

  • Error can be triggered with below. Shows up in DFHelper::put_tensor()
import psi4

mymol = psi4.Molecule.from_arrays(geom=[0, 0, 0, 2, 0, 0], elem=["h", "h"], name="h2/mol")

# segfaults if any DF (that is, following line commented). runs if DF suppressed (following line active)
#psi4.set_options({"scf_type": "pk", "df_basis_guess": "false"})

ene = psi4.energy("b3lyp/cc-pvtz", molecule=mymol)
print(ene)

Checklist

Status

  • Ready for review
  • Ready for merge

@loriab loriab added this to the Psi4 1.9 milestone Jun 13, 2023
@JonathonMisiewicz
Copy link
Contributor

Can we have a test case, out of paranoia?

@loriab
Copy link
Member Author

loriab commented Jun 13, 2023

Can we have a test case, out of paranoia?

Sure thing, added.

@loriab loriab added this pull request to the merge queue Jun 17, 2023
Merged via the queue into master with commit 6ebe472 Jun 17, 2023
5 checks passed
@loriab loriab deleted the loriab-patch-2 branch July 10, 2023 19:53
loriab added a commit that referenced this pull request Jul 10, 2023
* Update dfhelper.cc

* Update test_misc.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants