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

AM1-BCC charges used in TIP3P water? #1144

Closed
mattwthompson opened this issue Jan 15, 2025 · 2 comments
Closed

AM1-BCC charges used in TIP3P water? #1144

mattwthompson opened this issue Jan 15, 2025 · 2 comments
Labels
needs-info Needs more information from user(s)

Comments

@mattwthompson
Copy link
Member

Description

@timbernat suspects that AM1-BCC charges are used when (only TIP3P) is provided as a force field. I can't reproduce this myself with the latest version (0.4.0) and packages that are largely similar to what was reported in that issue.

Tim - any other details here that might cause charge assignment hierarchy to not be followed? We've put a fair amount of work into following the SMIRNOFF spec here, so it would be problematic if something leaked through

Reproduction

Modified from https://docs.openforcefield.org/projects/interchange/en/latest/using/advanced.html#charge-assignment-logging

In [1]: import logging
   ...:
   ...: from openff.toolkit import ForceField, Molecule
   ...:
   ...: logging.basicConfig(level=logging.INFO)
   ...:
   ...: ForceField("tip3p.offxml").create_interchange(
   ...:     Molecule.from_smiles("O").to_topology()
   ...: )['Electrostatics'].charges
   ...:
   ...:
/Users/mattthompson/micromamba/envs/openff-interchange-env/lib/python3.11/site-packages/openff/utilities/provenance.py:23: CondaExecutableNotFoundWarning: No conda/mamba/micromamba executable found. Unable to determine package versions.
  warnings.warn(
INFO:openff.interchange.smirnoff._nonbonded:Charge section LibraryCharges applied to topology atom index 0
INFO:openff.interchange.smirnoff._nonbonded:Charge section LibraryCharges applied to topology atom index 1
INFO:openff.interchange.smirnoff._nonbonded:Charge section LibraryCharges applied to topology atom index 2
Out[1]:
{TopologyKey with atom indices (0,): -0.834 <Unit('elementary_charge')>,
 TopologyKey with atom indices (1,): 0.417 <Unit('elementary_charge')>,
 TopologyKey with atom indices (2,): 0.417 <Unit('elementary_charge')>}
@timbernat
Copy link
Contributor

After a little further testing, I'm happy to close this issue and chalk it up to confusion on my part. Splitting up the MRE I provided in #1141 confirms that the Omega message is due to Molecule.generate_conformers:

...: from openff.toolkit import Molecule, ForceField
...:
...: offmol = Molecule.from_smiles('O')
...: offmol.generate_conformers(n_conformers=1)
Warning: Cannot perform Hydrogen sampling with GPU-Omega: GPU-Omega disabled.

and that the snippet above does yield partial charges consistent with the TIP3P definition:

...: import logging
...: logging.basicConfig(level=logging.INFO)
...: 
...: from openff.toolkit import ForceField, Molecule
...: 
...: ForceField("tip3p.offxml").create_interchange(
...: Molecule.from_smiles("O").to_topology()
...: )['Electrostatics'].charges
INFO:rdkit:Enabling RDKit 2023.09.6 jupyter extensions
{TopologyKey with atom indices (0,): -0.834 <Unit('elementary_charge')>,
 TopologyKey with atom indices (1,): 0.417 <Unit('elementary_charge')>,
 TopologyKey with atom indices (2,): 0.417 <Unit('elementary_charge')>}

I will add however that I'm unable to get any log output from the SMIRNOFF ChargeHandlers, either in the snippet above or by running the charge assignment logging demo:

...: import logging
...: 
...: from openff.toolkit import ForceField, Molecule
...: 
...: logging.basicConfig(level=logging.INFO)
...: 
...: ForceField("openff-2.2.0.offxml").create_interchange(
...:     Molecule.from_smiles("CCO").to_topology()
...: )
Warning: Cannot perform Hydrogen sampling with GPU-Omega: GPU-Omega disabled.
Interchange with 7 collections, non-periodic topology with 9 atoms.

Is there some simple config setting or install that I've missed? Seems like this should work out-of-box

@mattwthompson
Copy link
Member Author

Whoops - that's not in a release yet. It's in the main branch if you want to install it from there, but it's better practice to only use released versions. ETA next week or the week after (#1139)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-info Needs more information from user(s)
Projects
None yet
Development

No branches or pull requests

2 participants