Skip to content

Conversation

@loriab
Copy link
Member

@loriab loriab commented May 19, 2025

Description

replace half of #3272

User API & Changelog headlines

  • psi4.QMMMbohr is further discouraged, and external point charges specification (always in Bohr, regardless of molecule units) now more flexibly takes in lists, numpy arrays, and psi4.core.Matrix es. (It also takes in more arrangements, but none of them will save keystrokes from the point charges case.)

Dev notes & details

  • As discussed at the 7 Feb Patkowski/Pederson/CDSgroup meeting, we want to route more user permanent potentials through the external_potential keyword (embedding charges in MBE). This is step 1 to allow point charges, diffuse charges, and (Nao, Nao) matrices to pass through, validated, with backwards compatible syntax. (diffuse and matrices are disallowed at the next step before hitting c-side.)
  • Started trying to retire driver/qmmm.py, as the pb11 export of core.ExternalPotential should be sufficient. Fortunately, its direct use was already deprecated. Only MDI needed a line change. QMMMbohr() will raise a FutureWarning now
  • Filled in the test mark so -m extern runs all EP tests.
  • The extern.cc looks like a lot of changes, but it's really just hiding a block behind if (charges_.size()) {...} which is future prep.
  • Ubuntu image 20.04 has retired, so we're oging to have to bump testing from clang v6 (2018) to clang v11 (2020)

Questions

  • Question1

Checklist

Status

  • Ready for review
  • Ready for merge

@loriab loriab changed the title parse expanding external_potential: parsing, take 2 May 19, 2025
@loriab loriab marked this pull request as ready for review May 19, 2025 21:26
@loriab loriab added this to the Psi4 1.10 milestone May 20, 2025
@loriab loriab moved this to LAB Done in LAB's v1.10 Release May 20, 2025
Copy link
Contributor

@JonathonMisiewicz JonathonMisiewicz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, that change was what was needed to make the code more readable. There's one more comment I'd like you to add, but otherwise, LGTM.

else:
raise ValidationError(f"external_potential: primary or sec keys should be among {mode_keys_list}, not {frag_ep.keys()}. Full input: {external_potential}")
elif isinstance(frag_ep, list):
if (w := validate_charge_list(frag_ep)):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A comment explaining the logic in this if-clause would be helpful.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

# list might be new-fangled structure holding one or many among points, diffuse, matrix (the `else` branch), or it might be the outer list of an longstanding list-o-points (the `if` branch), in which case it'll pass the `validate_charge_list` check and needs wrapping in an outer list to match the new-fangled structure.

Sure, I think the above is what's needed. I'll add it to the follow-up PR, as I'd like to get this in since everything needs rebasing against it to fix CI.

@loriab loriab enabled auto-merge May 20, 2025 16:56
@loriab loriab added this pull request to the merge queue May 20, 2025
Merged via the queue into psi4:master with commit 228c142 May 20, 2025
6 checks passed
@github-project-automation github-project-automation bot moved this from LAB Done to Done in LAB's v1.10 Release May 20, 2025
@loriab loriab deleted the expanding_extern_rb1 branch May 20, 2025 21:30
@loriab loriab mentioned this pull request Sep 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants