# Moving from VASP to CASTEP for bulk crystal and surface calculations

Can someone that works with CASTEP and VASP explain to me how a workflow might change between the two programs? I am very familiar with VASP but have not used CASTEP before.

As an example, assuming we have an atomic model that is well defined (from a tool such as ASE) we can make a POSCAR file. Likewise, the calculation parameters are largely set in the INCAR file. How does CASTEP work in comparison?

• I don't think there's much more to add to @benshi97's answer, except to say that ASE can write CASTEP input files too. CASTEP also comes with some scripts and tools for file conversion, including "vasp2cell". – Phil Hasnip Aug 6 at 2:03

The workflow transferring from VASP to CASTEP is quite similar. Within VASP, there are four main files that you need for a calculation:

1. POSCAR – gives the positions of the atoms within the unit cell and its lattice vectors.
2. KPOINTS – sets the k-point mesh to be used.
3. POTCAR – determines the type of pseudopotential to be used.
4. INCAR – controls most of the main calculation parameters.

On the other hand, within CASTEP, there are two files, the seed.cell and the seed.param files, where seed is an arbitrary name you give to the system. The seed.cell essentially contains all of the POSCAR and KPOINT parameters at once. In CASTEP, the pseudopotential is automatically generated by the programme, so you do not need to procure a POTCAR file of any sort. The specific pseudopotential which you would like to use (i.e. NCP or USP) can be set within seed.cell file as well. The seed.param file is essentially the equivalent to the INCAR file in VASP and it controls the same types of calculation parameters (e.g. cutoff, XC functional, etc.).

ASE supports CASTEP input and output formats, so atomic models can be written out into a seed.cell file the same way a POSCAR is written out with ase.io.write using the keyword format=castep-cell. Additionally, if you are already using the VASP calculator (ase.calculators.vasp) within ASE to prepare your input parameters/files, there is also one for CASTEP (ase.calculators.castep) as well.

• Thanks for the constructive comments! I have now added a paragraph on using CASTEP in ASE, as pointed out by @PhilHasnip. – benshi97 Aug 6 at 22:19

As the answer above mentioned, the biggest difference is perhaps CASTEP takes two input files with suffix "cell" and "param", other things are very similar. After all, both programs do plane-wave pseudopotential calculations.

Below are a few other subtle differences (or tips?) - I am a CASTEP user recently started using VASP!

• In CASTEP the calculation job is selected by a single task keyword in the param file, rather than multiple tags as in VASP.

• Bandstructure/DOS calculation in VASP typically take two steps, but in CASTEP the program itself can do a self-consistent calculation followed by a non self-consistent calculation in one go - you just need to supply two sets of kpoints paths/meshes.

• Variable cell geometry optimisations in CASTEP default to "constant cut-off" so typically there is no need to redo a single point calculation for the optimised geometry. But still, mind the Pauly stress!

• Parallelisation in CASTEP is fully automatic and there is no need to set NCORE KPAR explicitly like in VASP. It tends to maximise kpoints parallelisation which is most efficient, but sometimes this can lead to high memory usage.

• CASTEP has a --dryrun options - you can make use it for check memory requirements and a number of kpoints to decide the number of MPI processes.

• The cell file also takes a few keyword options such as SYMMETRY_GENERATE and SNAP_TO_SYMMEYRY. The former turns on the symmetry and the latter snap the atoms to their high symmetry positions in case the input coordinates does not high floating-point precision. You almost always want those two in the cell file.

ASE can be very useful for generating CASTEP inputs. I have also made another simpler package for just writing simple input files in python called castepinput. It is used by a more complex package for interfacing CASTEP with a workflow/data management engine called AiiDA (aiida-castep). It also has interfaces to VASP and Quantum-Espresso.

• +10. Nice first answer! Welcome to the site, and we hope to see much more of you!! – Nike Dattani Aug 10 at 23:15