-
Notifications
You must be signed in to change notification settings - Fork 19
RESP Charges #1552
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
base: master
Are you sure you want to change the base?
RESP Charges #1552
Changes from 4 commits
ce39641
f2711b9
5199f27
99767e5
9dd8327
8e221df
bcc3d8d
39a9780
10ce70d
ed3a6fe
a1df258
1114435
07575ee
9f9839a
6a67d5d
2d24e29
d5f18df
c088dc6
442682c
1b51ef8
011bf63
4ff04da
35d0301
386e3cf
1658d30
459c7bc
17ed988
9004ea4
8403107
e648476
0ce9713
a30e447
cf3ded5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -456,6 +456,34 @@ def test_am1bcc_parameterization(): | |
| # assert vjp_fn(charges_adjoints) == None | ||
|
|
||
|
|
||
| def test_resp_parameterization(): | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should add a test for determinism (either in the presence or absence of a seed) since the underlying algorithm uses a stochastic conformer generator. i.e. we want to make sure that calling RESP multiple items returns identical charges on fresh non-cached molecules. |
||
| # currently takes no parameters | ||
| smirks = [] | ||
| params = [] | ||
| props = None | ||
|
|
||
| cache_key = nonbonded.RESP | ||
| am1h = nonbonded.RESPHandler(smirks, params, props) | ||
| mol = Chem.AddHs(Chem.MolFromSmiles("C1CNCOC1F")) | ||
| AllChem.EmbedMolecule(mol) | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If RESP to be independent of the initial conformer, we should explicitly be calling |
||
|
|
||
| assert not mol.HasProp(cache_key) | ||
|
|
||
| charges = am1h.parameterize(mol) | ||
|
|
||
| assert len(charges) == mol.GetNumAtoms() | ||
| assert mol.HasProp(cache_key) | ||
|
|
||
| cached_charges = am1h.parameterize(mol) | ||
| np.testing.assert_equal(charges, cached_charges) | ||
|
|
||
| new_charges, vjp_fn = jax.vjp(functools.partial(am1h.partial_parameterize, None, mol)) | ||
|
|
||
| # charges_adjoints = np.random.randn(*charges.shape) | ||
|
tkramer-motion marked this conversation as resolved.
Outdated
|
||
|
|
||
| # assert vjp_fn(charges_adjoints) == None | ||
|
|
||
|
|
||
| def test_am1_ccc(): | ||
| patterns = [ | ||
| ["[#6X4:1]-[#1:2]", 0.46323257920556493], | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.