c2x and Abinit

Abinit is a GPLed DFT code.

From version 2.12 c2x can read its DEN files, extracting charge densities and collinear spin densities. It can write a basic system description to a .in file, and can read a subset of .in files too. It cannot read .in files which specify multiple datasets, nor does it support any use of spinors.


Reading of DEN and POT files has been tested with Abinit 8.6.3. It is unclear which other versions it will work with.

Reading of .in files does not support the full syntax of Abinit's input files. However, it can read the cell description and atomic positions from files containing a single dataset and which specify all atoms, or which specify the minimum distinct set and symmetry operations. (This describes c2x 2.14. Reading of .in files was introduced in 2.12.)


There follows an example of using c2x to construct a .in file.

This site contains an example on the use of c2x with spin in FeO. If c2x is run on the .cell file as

  $ c2x --abinit FeO.cell FeO.in

then an Abinit input file is produced containing

acell 16.3725871682 8.18629358411 8.18629358411
      0.00000000000  0.50000000000  0.50000000000
      0.50000000000  0.00000000000  0.50000000000
      0.50000000000  0.50000000000  0.00000000000

ntypat 2
znucl  8 26

natom 4
typat  1  1  2  2
  0.25  0.5  0.5
  0.75  0.5  0.5
  0  0  0
  0.5  0  0

# antiferromagnetic system assumed
nsppol 1
nspden 2
spinat  0 0 0.000000  0 0 0.000000  0 0 2.000000  0 0 -2.000000
kptopt 1
ngkpt 1 3 3
nshiftk 1
shiftk 0.25000000000 0.00000000000 0.00000000000

#ecut 100 eV
toldfe 4e-05 eV

chksymbreak 0
chkprim 0

This can be joined with a .files file containing


(the two pseudopotentials can be found from Abinit's tutorials), and this is nearly sufficient to run Abinit and reproduce the spin density plot shown. All that needs to be done is the ecut line needs uncommenting and set to about 520 eV. If c2x was run on the .castep file, it would have read the cut-off used and filled it in, so the .in file could have been used unmodified.

The command equivalent to

  $ check2xsf -s FeO.check FeO.spin.xsf
is simply
  $ check2xsf -s FeO_o.DEN FeO.spin.xsf