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.
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”.
$ export ASE_CRYSTAL_COMMAND="/bin/CRY14/crystal < INPUT > OUTPUT 2>&1" (an example)
$ 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.
||None||Restart old calculation|
||various||‘HF’||Hamiltonian. HF, MP2 or DFT methods available|
||True||Read wf from fort.20 file when present|
||‘custom’||Read basis set from basis file|
||various||None or (1,1,1)||k-point sampling if calculation is periodic|
||1||Density of the Gilat net with respect to Monkhorst- Pack|
||None||Smearing. Only Fermi-Dirac available|
||||All other CRYSTAL keywords|
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
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')
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.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’).
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
calc = CRYSTAL(xc='PBE', spinpol=True)
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 will be to set to one, for 1D ones
kpts will be set to unity.
For molecular calculations (0D) any definition of the
parameter will be ignored.
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 (
If this parameter is set to False the code will calculate the
wave function from scratch at any step, slowing down the perfromances.