Menu

#265 Display of half-bonds in a periodic lattices

v14
open
nobody
bonds (1)
Normal
2024-08-09
2024-08-04
bolin
No

Purpose: It would be very convenient for the user to view the bonding of all atoms in a periodic cell, if the atoms of neighboring cells were taken into account when calculating the bonds, and then these neighboring-cell bonds were displayed in the form of half-bonds.

Seeing Attachments

1 Attachments

Discussion

  • Bob Hanson

    Bob Hanson - 2024-08-04
     
  • Bob Hanson

    Bob Hanson - 2024-08-04

    This is a great idea -- basically a VESTA-like representation of periodic bonding.

    It actually has nothing specifically to do with periodic structures, other than that the unit cell boundary is often a place where we see such a representation.

    In fact, it is an error of the documentation, which reads:

    Currently implemented transclucencies are 0 (opaque), 0.125 (1, 32), 0.25 (2, 64), 0.375 (3, 96), 0.5 (4, 128), 0.625 (5, 160), 0.75 (6, 192), 0.875 (7, 224).

    This should read:

    Currently implemented transclucencies are 0 (opaque), 0.125 (1, 32), 0.25 (2, 64), 0.375 (3, 96), 0.5 (4, 128), 0.625 (5, 160), 0.75 (6, 192), 0.875 (7, 224), and 1.0 (8, 256).

    That is, an atom can be rendered fully transparent, and, when it is, the desired effect is produced. That atom's half of the bond is not displayed. In the case of periodicity, this idea of the half-bond can be implemented as follows:

    color {!cell=555} translucent 1.0

    This removes the atoms outside of the unit cell from visibility but does not remove the atoms themselves. Only their half of the bond is hidden.

    Note that this requires that the atoms just outside the unit cell be present when loaded. The simplest way to do that is to use the PACKED option when loading:

    load ... packed 1.0

    where 1.0 here is the fractional extent beyond the unit cell that encompasses the desired atoms. (This could be less.)

    Thus, for example:

    load =aflowlib/10 packed 1.0
    color {!cell=555} translucent 1.0

    gives the desired effect.

    I have modified the Jmol/JSmol interactive scripting documentation to read:

    The color command allows an optional color modifier of TRANSLUCENT or OPAQUE, which can be used with any object, either alone or with a color. TRANSLUCENT can take an integer in the range 0-8 (indicating eighths -- 0, 1/8, 2/8, etc.), 32-255 (indicating fraction of 256), or a decimal in the range 0.0 to 1.0. Larger numbers are more translucent -- dimmer. Currently implemented transclucencies are 0 (opaque), 0.125 (1, 32), 0.25 (2, 64), 0.375 (3, 96), 0.5 (4, 128), 0.625 (5, 160), 0.75 (6, 192), 0.875 (7, 224), and 1.0 (8, 256). Note that this last "fully transparent" option can be used to show "half" bonds to the selected atom, which are not visible themselves. (This is a common rendering for periodic structures to show bonding beyond the unit cell. In that case, we would make sure we had loaded the atoms near the unit cell, using something like load aflowlib/10 packed 1.0 followed by color {!cell=555} transparent 1.0). The default, if no number is given, is TRANSLUCENT 0.5, which can be set using "defaultTranslucent = x.xx", where x.xx is a decimal number. For example:

    color atoms TRANSLUCENT orange
    color ribbons TRANSLUCENT 0.5 [255, 165, 0]
    select oxygen; color opaque.

    If neither TRANSLUCENT nor OPAQUE is specified, OPAQUE is assumed. Thus, color atoms red and color atoms OPAQUE red are synonymous.

     
  • Bob Hanson

    Bob Hanson - 2024-08-04

    This is a great idea -- basically a VESTA-like representation of periodic
    bonding. It actually has nothing specifically to do with periodic
    structures, other than that the unit cell boundary is often a place where
    we see such a representation.

    In fact, it is an error of the documentation, which reads:

    • Currently implemented transclucencies are 0 (opaque), 0.125 (1, 32), 0.25
      (2, 64), 0.375 (3, 96), 0.5 (4, 128), 0.625 (5, 160), 0.75 (6, 192), 0.875
      (7, 224). *

    This should read:

    Currently implemented transclucencies are 0 (opaque), 0.125 (1, 32), 0.25
    (2, 64), 0.375 (3, 96), 0.5 (4, 128), 0.625 (5, 160), 0.75 (6, 192), 0.875
    (7, 224), and 1.0 (8, 256).

    That is, an atom can be rendered fully transparent, and, when it is, the
    desired effect is produced. That atom's half of the bond is not displayed.

    In the case of periodicity, this idea of the half-bond can be implemented
    as follows:

    color {!cell=555} translucent 1.0

    This removes the atoms outside of the unit cell from visibility but does
    not remove the atoms themselves.

    Note that this requires that the atoms just outside the unit cell be
    present when loaded. The simplest way to do that is to use the PACKED
    option when loading:

    load ... packed 1.0

    where 1.0 here is the fractional extent beyond the unit cell that
    encompasses the desired atoms. (This could be less.)

    Thus, for example:

    load =aflowlib/10 packed 1.0color {!cell=555} translucent 1.0

    gives the desired effect.

    Bob Hanson

     
  • bolin

    bolin - 2024-08-05
    color {!cell=555} translucent 1.0
    

    it may not a good idea.

    When there is an atom (or atoms) whose fractional coordinate has a value of 0 or 1, the copy of it (or them) will be displayed.
    (1) This is different from the way Jmol consistently displays the number of atoms in the cell.
    (2) Alternatively, whenever the coordinates change slightly and are not equal to 0 or 1, the replica of the atom will not be displayed, which will cause serious misunderstanding and annoyance to the user.

     

    Last edit: bolin 2024-08-05
    • bolin

      bolin - 2024-08-05

      (3) In addition, operations such as selecting atoms and measuring their distances are also affected by transparent atoms, which will most likely lead to measurement errors.

       
  • bolin

    bolin - 2024-08-05

    I suggest modifying the source code to make it natively support half-bonds in a single cell, rather than through transparent extra atoms.

     
  • Bob Hanson

    Bob Hanson - 2024-08-06

    (1) This is not inconsistent. Indicating any sort of bond to an atom requires the presence of the atom. Whether the atom is made opaque, translucent, or transparent is not relevant to that concept. This does not change the number of atoms in a cell.

    (2) Jmol provides numerous ways to adjust for slight coordinate differences from ideality. All programs have this issue, particularly with file formats that do not deliver fractional coordinates in the form "1/3" or "1/2". Is "0.9999" on a face or not? As the Jmol user, you decide.

    (3) Hovering, selecting, and measuring are still appropriate to "transparent' atoms. This gives the advantage of allowing the user to check what the connected atom is, even where it is, despite its transparency.

    (4) I could equally argue that creating a special "half bond" object that fails to identify one of its connected atoms is just as inappropriate. There is an atom there. One could argue that one should be able to still measure this bond distance or angle or dihedral. This is particularly valuable since those measurements cannot be made using just the atoms in the unit cell itself.

    (5) Not showing an atom is simply a rendering option. This is consistent with Jmol's design. True, one could declare a transparent atom to be "not visible" -- which sounds at first quite reasonable -- but this is far more complicated than one might think. I have explored modifying the "visible" property to exclude transparent atoms. There are all sorts of property inheritance issues. My conclusion is that it would not be wise to change the definition. So we are left with "visible" including these atoms. And "translucent < 1" to exclude them.

    (6) What we see as periodicity is actually simply a repeating subset of space, of course. The atoms "are there" even if we do not show them. The choice of showing just the atoms in asymmetric unit, just the atoms in the repeating unit [0, 1), all the atoms "of" the unit cell [0,1], just atoms in molecules for which their centroid is in the unit cell, or this idea of providing some indication of what is outside this subspace using half-bonds -- these are all just stylistic preferences. Jmol can create all of these representations. Each has its place, and each has the potential for misunderstanding.

    (7) At least in JavaScript, as the page designer, you are free to use or not use this VESTA-like representation and to indicate whatever you wish in the form of additional information for your user.

    (8) An additional problem relates to what is a "bond". Bonding models vary. Are we considering ionic radii? covalent radii? Radii from Babel? Which version of Babel? Jmol? A user-defined set? It is not as simple as one might imagine to "show bonds to atoms that are not visible"

    So I think the simplest solution is still the one that is already present in Jmol -- indicate "half bonds to hidden atoms" by setting the atoms' translucency to 1.0.

    Respectfully,

    Bob Hanson

     
  • bolin

    bolin - 2024-08-09

    (1) I understand that Jmol was originally designed for molecules. In a single molecule, it is true that a half-bond is not possible, so the presence of a half-bond is hard to understand.

    (2) But in periodic crystals, atoms at the edge of each cell may bond with atoms in neighboring cells, so it is common for half-bonds to occur.

    (3) In fact, this current state of not displaying half-bond is a mistake, not just a display style issue.
    As shown in the figure, this cell should contain 3 bonds, not just one.

    Note:
    (a) Both B1 and B2 bonds in this figure are composed of two half-bonds each.
    (b) We say that there are 2 atoms in this crystal cell. But how many bonds should there be in this cell? Is there only one? It is better to understand why there are three bonds from the point of view of cutting a region of space.
    (c) When choosing bond b1, one should choose both b1' and b1'' half bonds.
    (d) There should be three bonds between these two atoms, not just one.

    (4)Such a change would not affect the non-periodic molecular system at all. And the periodic system, itself, should be changed to such a form containing half-bonds.

     

    Last edit: bolin 2024-08-13

Log in to post a comment.