Ever since we added mapping from atomistic to CG bead masses, the unit test that checks for equivalence in mass has failed. I think I figured out why. openbabel's smarts matching only returns atom indices for the heavy atoms, so when mapping back to the mbuild compounds, the xyz mapping is mostly correct, but the masses are off (hydrogens aren't included).
For example:
SMARTS matching on benzene only returns a list of length 6 even though the pybel molecule has 12 atoms
So, where the mapping actually happens, hydrogens are never accounted for
173 def _cg_particles(self):
174 """Set the beads in the coarse-structure."""
175 for key, inds in self.mapping.items():
176 name, smarts = key.split("...")
177 for group in inds:
178 mass = sum([self.atomistic[i].mass for i in group])
179 bead_xyz = self.atomistic.xyz[group, :]
180 avg_xyz = np.mean(bead_xyz, axis=0)
181 bead = Bead(name=name, pos=avg_xyz, smarts=smarts, mass=mass)
182 self.add(bead)
Ever since we added mapping from atomistic to CG bead masses, the unit test that checks for equivalence in mass has failed. I think I figured out why. openbabel's smarts matching only returns atom indices for the heavy atoms, so when mapping back to the mbuild compounds, the xyz mapping is mostly correct, but the masses are off (hydrogens aren't included).
For example:
SMARTS matching on benzene only returns a list of length 6 even though the pybel molecule has 12 atoms
So, where the mapping actually happens, hydrogens are never accounted for