c2x

ethene pi bond

C2x, or check2xsf as it was first known, was developed in the TCM Group in Cambridge. It reads and writes a selection of file formats which relate to DFT electronic structure codes. It is not simply a conversion utility, but it can also perform manipulations and some analysis. It can form supercells and find primitive cells. If linked with the excellent spglib symmetry finder, it provides access to functionality from that package. It can interpolate densities via a combination of trilinear and Fourier interpolation, integrate densities and calculate their dipole moments, analyse bands for inversion symmetry, and symmetry-expand eigenvalues for use with Fermi surface plotting.

Originally supporting just Castep, c2x now supports Abinit, Onetep, Quantum Espresso, Siesta and VASP as well. It thus can be considered to be a little like OpenBabel, but with an emphasis on different codes, and support for volumetric data.

One use of c2x is extracting volumetric data (charge density, colinear spin density, or charge density from a given band) for visualisation. It supports output formats compatible with XCrysDen, VESTA, VMD and Jmol amongst others, and can also produce 1D data in a format suitable for gnuplot. The ethene π bond above is from the 2016 version of XCrysDen.

Another use of c2x is to use one package's post-processing tools with another's. It can, for instance, convert a Castep .check file into a .chgcar file readable by VASP post-processors.

It can perform many cell manipulations, forming supercells or primitive cells, adding or removing vacuum, and rolling sheets into nanotubes. It can calculate electrostatic potentials from charge densities, and also calculate post hoc dipole correction energies for some geometries.

Getting c2x

C2x can be downloaded from its downloads page, as source or MacOS or Linux binaries.

News

Version 2.41b released, 30th January 2024. Fixes to support XML output from Quantum Espresso versions >=7.0.

Version 2.41a released, 28th December 2023. Fixes long-standing bug in reading angdeg in Abinit input. MacOS ARM binary provided for the first time.

Version 2.41 released, 22nd September 2023. Major new features are the support for vector fields, most notably spinors, and support for calculating first and irreducible Brillouin zones. The accumlation and integration routines have been rewritten to provide greater accuracy, cylindrical weighted and accumulated plots now multiply by the c axis length (an incompatible change), FFT interpolation for points added, and miscellaneous small improvements and fixes.

Version 2.40e released, 9th February 2023. This adds tricubic interpolation as an alternative to trilinear (--tricubic), and has some basic support for .mol/.mdl files. It also marks the first attempt to use Homebrew for distribution.

Version 2.40d released, 23rd December 2022. This adds spherical averaging, is better at retaining symmetry operations after a basis change (use -n for the old behaviour), and has some I/O improvements. Other minor changes listed in the change log.

Version 2.40c released, 19th February 2022. The only advertised changes are some bug fixes, particularly to PDBx output, and to Elk input.

Version 2.40b released, 27th January 2022. A collection of relatively minor bugfixes and added features. Most notably improved Siesta support, and -2 symmetry axes are now described as mirror and glide planes. More details in the change log.

Debian 11 "Bullseye" released, 14th August 2021, including the first "stable" Debian c2x package.

Ubuntu 21.04 released, 22nd April 2021, and it includes a c2x package in its universe repository. I believe that this is the first major stable Linux distribution to include c2x. (There is also a Debian package in bullseye, which is currently "testing", not "stable".)

Version 2.40 released, 26th March 2021. The most significant change is that c2x can now work with multiple input files, and thus add or subtract densities etc. Other new features include being able to read .npy files, being able to extract individual frames from time series, and several other minor changes and bugfixes.

Version 2.35a released, 23rd December 2020. Two minor bugs fixed: a missing "_" when writing a cell file's SPECIES_POT, and the .npy output now works with Numpy on Ubuntu 18.04 and 20.04.

Version 2.35 released, 7th December 2020. Adds support for Castep's Electron Localisation Function, for writing a single dataset to a NumPy .npy file, for reading Abinit's _EIG files, and for calculating bandgaps. Also many other minor improvements, features and bugfixes.

Version 2.34d released, 17th July 2020. Adds support for Vasp LOCPOT files, and can read charges from Vasp POTCAR files. Also adds elements with atomic numbers 104 to 118, and extends the arithmetic parser.

Version 2.34c released, 18th June 2020. Adds basic support for Elk, recognises .pdbx as a form of CIF file, will read and write Castep .geom files, and various minor improvements.

Version 2.34b released, 9th April 2020. Previous versions failed to read Castep .bands files from parallel runs. Also adds support for Abinit 9.0, and tries to avoid re-ordering species when writing Vasp or Abinit input files.

Version 2.34a released, 27th March 2020. Adds ability to read Siesta's .bands files, and has a bunch of miscellaneous bug fixes. It should work better on MacOS, as it no longer assumes "%ms" is valid in a scanf format string.

Version 2.34 released, 9th March 2020. Adds ability to write .bxsf files for plotting Fermi surfaces. Also supports GCOEFF.txt, an ASCII wavefunction format, and (some) extended XYZ cell formats, particularly that from ASE.

Older News

Citing c2x

If you find it useful in your published research, the traditional academic acknowledgement of a citation would be appreciated. C2x: a tool for visualisation and input preparation for Castep and other electronic structure codes, MJ Rutter, Computer Physics Communications, 225 174-179 (2018). Once such papers are noticed, they are added to this list.