# CP2K is one code that spans DFT, tight binding, semi empirical and force fields

> CP2K is a Fortran 2008 quantum chemistry and solid state physics package that performs atomistic simulations with a single input language, from plane wave DFT down to classical force fields. Its strength is breadth and parallel scaling across MPI, threads and GPUs, and its cost is an input file where the method, basis set and pseudopotential have to be chosen carefully.

**cp2k/cp2k** — Quantum chemistry and solid state physics software package

- Repository: https://github.com/cp2k/cp2k
- Website: https://www.cp2k.org
- Stars: 1,230 · Forks: 515
- Language: Fortran
- License: GPL-2.0
- Published: 2026-10-19 · Updated: 2026-10-19 · Language: en
- Canonical page: https://hysenlabs.com/projects/cp2k-cp2k

## One input language across a wide slice of computational chemistry

CP2K is described as a quantum chemistry and solid state physics software package that performs atomistic simulations of solid state, liquid, molecular, periodic, material, crystal and biological systems. The interesting part is the second sentence of that description, which is that CP2K provides a general framework for different modeling methods rather than one method done well.

The supported theory levels are listed in the README. There is DFT, using the mixed Gaussian and plane waves approaches GPW and GAPW. There is MP2, RPA and GW. There is tight binding with xTB and DFTB. There are semi empirical methods including AM1, PM3, PM6, RM1 and MNDO. And there are classical force fields such as AMBER and CHARMM.

That range is the reason to pick CP2K over a narrower code. A project that starts with a semi empirical scan and ends with a periodic DFT calculation can stay in one package, one build and one input syntax, rather than translating structures and parameters between programs. The same reasoning explains the support for biological systems through the classic force field route: CP2K is used in fields where the same system has to be described at two very different levels of theory.

The cost is the input file. Every method needs a basis set or pseudopotential choice, a functional or parameter set, and settings that interact in ways the manual has to explain. The README points at the manual for descriptions of all the keywords for the CP2K input file, and that keyword reference is the real documentation of this project.

## The simulation types, not just the energy

Beyond static energies, CP2K covers the kinds of run that a dynamics code needs. The list in the README includes molecular dynamics, metadynamics, Monte Carlo, Ehrenfest dynamics, vibrational analysis, core level spectroscopy, energy minimization, and transition state optimization using NEB or the dimer method.

Several of these are worth pausing on, because they change what the code is for. Metadynamics is the free energy method, and it is the reason CP2K appears in catalysis and electrochemistry work rather than only in equilibrium geometry papers. Core level spectroscopy is a spectroscopy specific module rather than a general post processing step. The dimer method and NEB are two different routes to a transition state, and having both in one code lets you cross check a barrier with two techniques that fail in different ways.

Ehrenfest dynamics is the non adiabatic variant, where the nuclei move on a potential surface and the electronic degrees of freedom follow, which is a niche capability that most general purpose codes leave out.

The repository layout supports this breadth. The src directory holds the source, data holds simulation parameters such as basis sets and pseudopotentials, tests holds inputs for tests and regression tests, benchmarks holds benchmark inputs, and tools is a mixed collection of useful scripts. The regression tests and benchmark inputs are worth knowing about, because they are the closest thing the project has to a definition of what a correct run looks like.

## Fortran 2008, and three ways to use your hardware

CP2K is written in Fortran 2008, and the README says it can be run efficiently in parallel using a combination of multi threading, MPI and GPU acceleration, with CUDA for NVIDIA GPUs, HIP/ROCm for AMD GPUs and OpenCL.

Three parallelisation strategies in one code is a deliberate choice rather than an accident of history, and it maps onto how the work divides. Multi threading helps when a single calculation can be split within a node, MPI across nodes, and the GPU offload sits on top of either for the parts of the calculation that suit a data parallel formulation. The cost is that a serious run has to be configured deliberately, and the combinations interact with each other in ways the manual has to document.

For people deciding whether the code will run on their machine, the dashboard at dashboard.cp2k.org is the resource the README points to, described as an overview of the currently tested architectures. That is a more honest signal than a generic list of supported platforms, because it reflects what is actually exercised in continuous integration.

The repository carries a CMakeLists.txt, a CMakePresets.json, a cmake/ directory and a make_cp2k.sh script, so the build system is CMake with a convenience wrapper. The presence of CMakePresets.json is what lets a site reproduce a working configuration rather than re-deriving the flag combination from scratch, which is the difference between a reproducible build and a lucky one.

## Getting the source, and which branch you actually want

The README splits the answer by audience. For end users, the preferred method is to go to the Releases page and download one of the versioned tarballs named cp2k-X.Y.tar.bz2. For developers, the preferred method is to fork the cp2k/cp2k repository and clone it, and the current master is the development version.

```bash
git clone https://github.com/cp2k/cp2k.git cp2k
```

Release versions live on their own support branches, and those clones need the recursive flag because of the submodules.

```bash
git clone -b support/vx.y --recursive https://github.com/cp2k/cp2k.git cp2k
```

That distinction matters more than it looks. A user who clones master gets a development version that may not build cleanly, and a developer who wants to reproduce a published paper's numbers wants the support branch matching the release, not master. The support/vx.y naming also means fixes land on the release branch, which is how you get a patch without moving to a newer version.

The release cadence visible in the tags is twice a year, with v2026.2 on 2026-07-15, v2026.1 on 2026-01-06 and v2025.2 on 2025-07-23. The version scheme carries the year in the number, so a branch and a publication are easy to match up later.

## Spack, distributions and containers are the alternatives to a source build

The installation instructions in the manual offer several methods, and the choice is really about who compiles the code. Building from source puts you in control of the compiler, the maths libraries and the parallel configuration. Building with Spack automates dependency resolution and the build itself, at the cost of letting the package manager pick versions. Installing from a distribution hands you a binary that someone else compiled and tested.

The distribution route is broad. The badges at the top of the README point at Debian, Fedora, Ubuntu, Homebrew, Docker Hub, Spack and conda-forge, and the home page for the project is cp2k.org. The Docker image is published as cp2k/cp2k, and conda-forge carries it as cp2k, which is often the fastest route for a researcher who already manages environments that way.

The practical difference is the one that bites in practice. A packaged build gives you a working binary quickly, and it is the right choice for teaching, for a reproducible workflow where the version is pinned, or for a user who does not want a compiler. A source build is the right choice when you need a specific compiler and maths library combination, when you need the GPU paths configured for your hardware, or when you are chasing a regression and need to instrument the build.

The trade-off is reproducibility in both directions. A packaged build is reproducible for other people only while the distribution keeps that version, and a source build is reproducible only if you record the configuration, which is what the CMake presets and the dashboard's tested architecture list exist to support.

## A GPL project with a support and contribution policy written down

CP2K is licensed under GPL 2.0, with the text in the LICENSE file at the repository root. For a scientific code that is distributed free and used in universities and national laboratories, that is the expected arrangement, and it means a derived or distributed version carries the same obligation.

The repository is more organised around governance than most codebases of this size. There is a CODEOWNERS file, a CONTRIBUTING.md, an INSTALL.md and a separate SUPPORT.md, plus a ci/ directory and a.packit.yaml, which is the configuration used for building distribution packages in the Fedora ecosystem. The.fmf/ directory and the tests directory hold the metadata and inputs for the test suite, and there is a.git-blame-ignore-revs file, which tells you the project has done history rewriting for formatting changes.

Maintenance is the reassuring part. The project is not archived, the last push was in October 2026, and the release history shows a steady twice yearly cadence with 2026.1, 2026.2 and 2025.2. For a scientific code that is decades old, the rate of releases is a better indicator of health than the age of the code.

The funding note is also worth reading. The README links an acknowledgements page for the list of institutions and grants that help to fund the development of CP2K, which is the sort of transparency that tells you where the maintainer capacity comes from.

## Conclusion

CP2K fits a computational chemistry or materials group that wants one code covering several theory levels and needs hybrid CPU and GPU runs, with the same input language across all of them. It is a poor fit for a small molecule study that a lighter specialist package would finish in an afternoon, because the breadth is paid for in setup complexity. Verify first that the release you pick is listed on the CP2K dashboard for your architecture, and read the manual's keyword documentation for your chosen method before trusting a result.

## FAQ

### How do I get the CP2K source code?

End users are pointed to the Releases page for a versioned tarball such as cp2k-X.Y.tar.bz2. Developers should fork cp2k/cp2k and clone it, using git clone -b support/vx.y --recursive for a release branch, since release versions live on their own support branches.

### Which methods does CP2K support?

The supported theory levels include DFT with the GPW and GAPW approaches, MP2, RPA, GW, tight binding with xTB and DFTB, semi empirical methods such as AM1, PM3, PM6, RM1 and MNDO, and classical force fields including AMBER and CHARMM.

### How is CP2K parallelised?

It is written in Fortran 2008 and can run in parallel using a combination of multi threading, MPI and GPU acceleration, with CUDA for NVIDIA GPUs, HIP/ROCm for AMD GPUs and OpenCL. The dashboard at dashboard.cp2k.org lists the currently tested architectures.

### Can I install CP2K from a package manager instead of building it?

Yes. The manual lists build from source, build with Spack and install from distribution as the installation methods, and the repository carries badges for Debian, Fedora, Ubuntu, Homebrew, Docker Hub, Spack and conda-forge.

### Which simulations can CP2K run besides energy calculations?

Molecular dynamics, metadynamics, Monte Carlo, Ehrenfest dynamics, vibrational analysis, core level spectroscopy, energy minimization, and transition state optimization with either the NEB or the dimer method.

## Sources

- [cp2k/cp2k on GitHub](https://github.com/cp2k/cp2k)
- [License: GPL-2.0](https://github.com/cp2k/cp2k/blob/master/LICENSE)
- [Project website](https://www.cp2k.org)
- [README](https://github.com/cp2k/cp2k/blob/master/README.md)
- [Releases](https://github.com/cp2k/cp2k/releases)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/cp2k-cp2k
