Measure Tool (etc.) with Unit Cells

As I continue to work on the auto optimize tool and the optimization framework, I need to add support for unit cells / periodic boundary conditions. That means handling the minimum images (e.g., a bond might go across a unit cell boundary).

Thus, I was measuring some distances in periodic systems (e.g., from CIF files.… Should the measure tool (and others) also use the minimum image convention?

  • e.g. if I have silicon and I click on an atom, should it report the direct distance, or consider the periodic distance. (I think the latter)
  • or should the interface offer both distances somehow?

I think the current code is incomplete because you can pick an atom that’s 5Å across the unit cell, but 2.2Å away using the unit cell boundaries.

@ghutchis The closest distance between one atom “in the unit cell” (e.g., a silicon) to the next e.g., chlorine of \ce{SiCl4} might be very well indeed “across the unit cell” since e.g., 1.2 units along \vec{a} can be equivalent (by translational symmetry of the parallelepiped) of 0.2 units of \vec{a}.

It might be worth to check if a) conceptual useful, b) practical in terms of implementation within Avogadro2 here if (as an intermediate) the .cif serves to “reconstruct” the molecules with bonds/bond orders. Best working with .cif about small organic molecules of covalent bounds is e.g., codcif2sdf on the CLI within the set of COD’s cod-tools. Like the database, distributed with a permissive license (repackaged for debichem), if memory serves well implemented in Perl. (Though CIF dictionaries know multiple keywords for and about bonds, they are not mandatory content of the .cif files.)

That’s exactly my question. Should the UI report the minimum distance? Seems like yes.

Certainly where possible. That’s on the long-term agenda (i.e., likely post-2.0 release). I think we’ve discussed this if not on the forum then on GitHub.

The “trick” is handling the assortment of CIF. Some small molecules are already served by the current code in Open Babel. But some are not because the molecular unit is split across unit boundaries and symmetry. When I looked into this last, it seemed like there weren’t reliable heuristics – only that CCDC Mercury did a better job at reconstructing the molecular unit.