The CRYSTAL simulation package is a Hartree-Fock and density functional theory code using Gaussian localized basis functions. CRYSTAL can handle systems periodic in 0 (molecules, 0D), 1 (polymers, 1D), 2 (slabs, 2D), and 3 dimensions (crystals, 3D). This interface makes possible to use CRYSTAL as a calculator in ASE.

Environment variables

Set environment variables in your configuration file (what is the name of the command to be run). It is mandatory to set the input file as “INPUT” and the standard output as “OUTPUT”.

  • bash:

    $ export ASE_CRYSTAL_COMMAND="/bin/CRY14/crystal < INPUT > OUTPUT 2>&1"  (an example)
  • csh/tcsh:

    $ setenv ASE_CRYSTAL_COMMAND "/my_disk/my_name/bin/crystal < INPUT > OUTPUT 2>&1"  (an example)

CRYSTAL Calculator (a FileIOCalculator)

The calculator calls the CRYSTAL code only to perform single point and gradient calculations. The file ‘fort.34’ contains the input geometry and the ‘fort.20’ contains the wave function in a binary format.

Below follows a list with a selection of parameters.



default value





Restart old calculation




Hamiltonian. HF, MP2 or DFT methods available




Spin polarization




Read wf from fort.20 file when present




Read basis set from basis file



None or (1,1,1)

k-point sampling if calculation is periodic




Density of the Gilat net with respect to Monkhorst- Pack




Smearing. Only Fermi-Dirac available




All other CRYSTAL keywords

For parameters not set in otherkeys CRYSTAL will set the default value. See the official CRYSTAL manual for more details.

Exchange-correlation functionals

The xc parameter is used to define the method used for the calculation. Available options are Hartree-Fock (‘HF’), second order perturbation theory (‘MP2’) and the density-functional theory where xc defines the exchange and correlation functional. In the latter case a single string defines a standalone functional (see CRYSTAL manual), a tuple of strings set the first string as EXCHANGE and the second string as ‘CORRELAT’ (see CRYSTAL manual for more details).

calc = CRYSTAL(xc=('PBE','LYP'))


The CRYSTAL simulation package has few built-in basis sets, which can be set in the calculation using the basis parameter, e. g.:

calc = CRYSTAL(xc='PBE', basis='sto-3g')

The default is to read from an external basis set. A library of basis sets in CRYSTAL format can be found on the website CRYSTAL basis sets.

In this case a file named ‘basis’ must be present in the working directory and must contain the basis sets for all the atom species.


The CRYSTAL simulation package allows to set up to three different all electron basis sets and/or two valence electron basis sets for the same atomic species (see CRYSTAL manual page 21 for more details).

The number to be added to the atomic number reported in the ‘basis’ file must be specified as an Atoms() class tag:

>>> geom[0].tag = 100

In this case ‘100’ will be summed to the atomic number of the first atom in the ‘fort.34’ geometry file (e. g. ‘6’, Carbon, becomes ‘106’).

Spin-polarized calculation

If the atoms object has non-zero magnetic moments, a spin-polarized calculation will be performed by default. It is also possible to manually tell the calculator to perform a spin-polarized calculation through the parameter spinpol:

calc = CRYSTAL(xc='PBE', spinpol=True)

Brillouin-zone sampling

Brillouin-zone sampling is controlled by kpts. This parameter can be set to a sequence of three int values, e.g. (2, 2, 3), which define a regular Monkhorst-Pack grid. If it is not defined a gamma calculation will be performed. For 2D calculations kpts[2] will be to set to one, for 1D ones also kpts[1] will be set to unity. For molecular calculations (0D) any definition of the kpts parameter will be ignored.

The isp parameter can be used to define the relative density of the auxiliary Gilat net (see CRYSTAL manual):

calc = CRYSTAL(xc='PBE', kpts=(2, 2, 2), isp=2)

In this example the resulting Gilat net would be (4, 4, 4).

Reading an external wave function

The calculator reads by default the wave function stored in the ‘fort.20’ file if present (guess=True). If this parameter is set to False the code will calculate the wave function from scratch at any step, slowing down the performances.