<no title> — ASE documentation

### Navigation

- index
- modules |
- Documentation for modules in ASE »
- Calculators »

class `ase.calculators.cp2k.` `CP2K`(restart=None, ignore_bad_restart_file=False, label='cp2k', atoms=None, command=None, debug=False, **kwargs)

  ASE-Calculator for CP2K.

  CP2K is a program to perform atomistic and molecular simulations of solid state, liquid, molecular, and biological systems. It provides a general framework for different methods such as e.g., density functional theory (DFT) using a mixed Gaussian and plane waves approach (GPW) and classical pair and many-body potentials.

  CP2K is freely available under the GPL license. It is written in Fortran 2003 and can be run efficiently in parallel.

  Check http://www.cp2k.org about how to obtain and install CP2K. Make sure that you also have the CP2K-shell available, since it is required by the CP2K-calulator.

  The CP2K-calculator relies on the CP2K-shell. The CP2K-shell was originally designed for interactive sessions. When a calculator object is instantiated, it launches a CP2K-shell as a subprocess in the background and communications with it through stdin/stdout pipes. This has the advantage that the CP2K process is kept alive for the whole lifetime of the calculator object, i.e. there is no startup overhead for a sequence of energy evaluations. Furthermore, the usage of pipes avoids slow file- system I/O. This mechanism even works for MPI-parallelized runs, because stdin/stdout of the first rank are forwarded by the MPI-environment to the mpiexec-process.

  The command used by the calculator to launch the CP2K-shell is `cp2k_shell`. To run a parallelized simulation use something like this:

      >>> CP2K.command="env OMP_NUM_THREADS=2 mpiexec -np 4 cp2k_shell.psmp"

  Arguments:

  auto_write: bool
    Flag to enable the auto-write mode. If enabled the `write()` routine is called after every calculation, which mimics the behavior of the `FileIOCalculator`. Default is `False`.
  basis_set: str
    Name of the basis set to be use. The default is `DZVP-MOLOPT-SR-GTH`.
  basis_set_file: str
    Filename of the basis set file. Default is `BASIS_MOLOPT`. Set the environment variable $CP2K_DATA_DIR to enabled automatic file discovered.
  charge: float
    The total charge of the system. Default is `0`.
  command: str
    The command used to launch the CP2K-shell. If `command` is not passed as an argument to the constructor, the class-variable `CP2K.command`, and then the environment variabel `$ASE_CP2K_COMMAND` are checked. Eventually, `cp2k_shell` is used as default.
  cutoff: float
    The cutoff of the finest grid level. Default is `400 * Rydberg`.
  debug: bool
    Flag to enable debug mode. This will print all communication between the CP2K-shell and the CP2K-calculator. Default is `False`.
  force_eval_method: str
    The method CP2K uses to evaluate energies and forces. The default is `Quickstep`, which is CP2K’s module for electronic structure methods like DFT.
  inp: str
    CP2K input template. If present, the calculator will augment the template, e.g. with coordinates, and use it to launch CP2K. Hence, this generic mechanism gives access to all features of CP2K.
  max_scf: int
    Maximum number of SCF iteration to be performed for one optimization. Default is `50`.
  potential_file: str
    Filename of the pseudo-potential file. Default is `POTENTIAL`. Set the environment variable $CP2K_DATA_DIR to enabled automatic file discovered.
  pseudo_potential: str
    Name of the pseudo-potential to be use. Default is `auto`. This tries to infer the potential from the employed XC-functional, otherwise it falls back to `GTH-PBE`.
  uks: bool
    Requests an unrestricted Kohn-Sham calculations. This is need for spin-polarized systems, ie. with an odd number of electrons. Default is `False`.

  Construct CP2K-calculator object.

### Navigation

- index
- modules |
- Documentation for modules in ASE »
- Calculators »