cp2k/docs
Dynamics of Condensed Matter c7270bbdb5
Diagonalization: add opt-in direct generalized eigensolvers (#5108)
Co-authored-by: DCM-Uni-Paderborn <DCM-Uni-Paderborn@users.noreply.github.com>
Co-authored-by: Thomas D. Kuehne <tkuehne@cp2k.org>
2026-05-05 16:26:45 +02:00
..
_static Docs: Remove XSLT-based manual 2023-08-02 17:18:01 +02:00
getting-started Toolchain: Replace "scripts/generate_cmake_options.sh" with "build_cp2k.sh" (#5080) 2026-04-26 12:40:37 +02:00
methods docs: add Quickstep getting-started material (#5100) 2026-04-26 12:02:00 +02:00
technologies Diagonalization: add opt-in direct generalized eigensolvers (#5108) 2026-05-05 16:26:45 +02:00
acronyms.md Atomic polarization tensors via numerical differentiation 2025-07-21 19:40:43 +02:00
conf.py Update documentation of building from source (#4881) 2026-02-28 17:38:26 +01:00
fix_github_links.py Docs: Add Github links 2023-09-11 14:11:03 +02:00
generate_input_reference.py precommit: Update Python packages and re-format 2026-02-24 17:11:52 +01:00
index.md Increase development version after 2026.1 release 2026-01-06 11:04:01 +01:00
Makefile Docs: Add Github links 2023-09-11 14:11:03 +02:00
README.md precommit: Update Python packages and re-format 2026-02-24 17:11:52 +01:00
requirements.txt Docs: Reorganize getting started section 2024-12-22 19:00:37 +01:00
versions.md Increase development version after 2026.1 release 2026-01-06 11:04:01 +01:00

CP2K Documentation

These are the source of the CP2K manual. They are published daily by this script.

To build a local version of the manual perform the following steps:

  1. Create and activate a virtual Python environment:

    python3 -m venv ../docs_venv
    source ../docs_venv/bin/activate
    
  2. Install the required Python packages:

    pip3 install -r ./requirements.txt
    
  3. (optional) Build a CP2K binary and use it to generate the cp2k_input.xml file:

    ../exe/local/cp2k.psmp --xml
    
  4. (optional) Generate Markdown pages from the cp2k_input.xml file:

    ./generate_input_reference.py ./cp2k_input.xml
    
  5. Run Sphinx:

    make html
    
  6. Browse the HTML output in the _build/html directory.

Tip

While the first invocation of Sphinx can be quite slow, subsequent builds are significantly faster thanks to its doctree cache. Nevertheless, a build with the full input reference can take several minutes and requires a lot of memory. So for development it's advisable to build without the input reference. To check cross-references one can generate the input reference and then remove all pages except the relevant ones.


Syntax Cheat Sheet

The CP2K manual uses Sphinx with the MyST parser for Markdown support. The following gives a quick overview of the syntax:

Headings

# A first-level heading

## A second-level heading

### A third-level heading

Basic Text Formatting

**bold text**

_italic text_

~~strikethrough text~~

`inline code`

For a all typography options see the MyST documentation.

  • Acronym: {term}`ADMM`
  • Publication: [](#Wilhelm2018)
  • Other page: [](../properties/optical/tddft)
  • Input section: [FORCE_EVAL](#CP2K_INPUT.FORCE_EVAL)
  • Input keyword: [STRESS_TENSOR](#CP2K_INPUT.FORCE_EVAL.STRESS_TENSOR)
  • External URL: <https://www.gromacs.org>
  • External URL with label: [click here](https://github.com/cp2k/cp2k-examples/blob/master/qm_mm/Protein.pdb)

Lists

1. First enumerated item
1. Second enumerated item


- A bullet point
- Another bullet point

Tables

| foo | bar |
| --- | --- |
| baz | bim |

For a all table options see the MyST documentation.

Math

Inline math: $A_{ia,jb}$.

Math block:
$$ \begin{align}
    A_{ia,jb} &= (\varepsilon_a^{GW}-\varepsilon_i^{GW})\delta_{ij}\delta_{ab}
    B_{ia,jb} &= 2 v_{ia,bj} - W_{ib,aj} \quad .
\end{align} $$

See also the MyST and MathJax documentation.

Notes and Warnings

```{note}
A note box.
```

```{warning}
A warning box.
```

For all available admonitions see the MyST documentation.

Code Blocks

```python
for i in range(10):
  print("Hello World")
```

Diagrams

```mermaid
block-beta
a b
a --> b
```

For details see the Mermaid documentation and also check out their great live editor.

Videos

```{youtube} teHVWKwBOTU
---
url_parameters: ?start=1500
align: center
privacy_mode:
---
```

The above example links to https://www.youtube.com/watch?v=teHVWKwBOTU at the 1500 seconds time mark.