Closed SimonBoothroyd closed 8 months ago
I think the output should include both 4 and 5? IIUC the toolkit assigns two parameters here, so two particles should be created:
In [8]: len(force_field.label_molecules(molecule.to_topology())[0]["VirtualSites"][(0,)])
Out[8]: 2
swapping the SMIRKS as suggested changes it to be length 1
@j-wags what's the correct behavior here?
Good question... I think you may be right but this is probably a case where the spec is under-defined?
I think when considering matches as 'different' i'd only class them so if their orientation or parent atoms were different, and ignore any other atoms in the SMIRKS. But I bet there's cases where this could also be undesirable...
Yeah, my first-pass thought on this is that only one vsite should be getting created. Two are getting created because the match is symmetric about the Hs (if I make the smirks be "[#6:2]=[#8:1]"
then only one vsite is made). The root cause is probably that naive SMARTS matching returns two instances of the same tuple due to the H symmetry, which we should be deduplicating. IIRC we should be deduplicating on tuples like (name, type, parent_atoms)
.
Interchange is naive and trusting of what it gets from the toolkit, and I'd like to keep it that way if possible - I think changing this behavior would happen in the toolkit?
we should be deduplicating on tuples like (name, type, parent_atoms)
+1 (assuming parent_atoms
are all tagged atoms)
Thanks - I agree with moving this to the Toolkit!
Description
An incorrect topology idx is assigned to v-sites in certain cases.
Reproduction
Output
{VirtualSiteKey with atom indices None: 5}
where I'd expect instead
{VirtualSiteKey with atom indices None: 4}
If you swap the SMIRKS to be
"[#6:2]=[#8:1]"
then the correct output is printed.Software versions
conda
conda list
?openff-interchange-base 0.3.14