Avogadro and c2x

Avogadro is a molecule builder / editor which is available for Linux, MacOS and Windows. At the time of writing (June 2020) the latest release was in late 2016 and described as 1.90.0. But the source there, and the version shipping with Ubuntu 18.04, are both 1.2.0, released in June 2016 with the comment "we anticipate several more new releases of Avogadro v1 before we finish Avogadro 2.0 by the end of 2016." If one wishes to experiment with the (still beta) Avogadro 2.0, then one must find and go to the Open Chemistry website instead.

Avogadro 1.2.0 is widely distributed, and, being linked against both OpenBabel and including spglib (1.5.1) has much code support and functionality. It is the version described in this page.

It can produce isosurfaces, but I have always found it a struggle to get input into a form it accepts. In particular, I have failed to get it to read data from a cube file containing a single dataset, but have found that it will read a cube file containing multiple datasets, a format intended for plotting molecular orbits. As c2x will write a multiple dataset cube file which contains just a single dataset (which is subtly different in format from a cube file containing a single dataset), all is well.

So the cube file can be prepared with

$ c2x -b=6 --mocube ethene.check ethene.cube

Avogadro will read gzipped cube files directly, so one can experiment with ethene.mo.cube.gz.

First one must select File, Import, Molecule File, and load the cube file. Avogadro will initially display just a ball and stick representation of the molecule. Then one can select Extensions, Create Surfaces, change the "Surface Type" to "MO 1", and press "Calculate". After a little rotating and zooming, and turning on of toolbars (Settings, Toolbars), it should be possible to achieve

Ethene pi bond in Avogadro

It is unclear whether the resolution / interpolation can be improved (the bottom right of the red part of the orbital has some worrying straight lines and corners).

(If one needs to convert a cube file to a mocube file by hand, the changes can easily be made in an editor. The third line, probably the first line containing just numbers, starts with the number of atoms. This needs to be multiplied by -1 to make it negative. There follows three lines defining the unit cell, and the lines defining each atom. After the last atom line, and before the grid data lines, a single line reading "1 1" should be inserted.)

I failed to produce a crystalline example, as I failed to get Avogadro to read 3D data from anything but a cube file, from which it fails to read the unit cell. It will read a unit cell from a PDB file, but PDB files cannot contain 3D data. It will also read a unit cell from an XSF file, but I failed to get it to read 3D data from one.