Metadata-Version: 2.5
Name: aiida-nanotech-empa
Version: 2.0.0
Summary: AiiDA plugins and workflows developed at nanotech@surfaces group from Empa.
Author: nanotech@surfaces
Requires-Python: >=3.12
Description-Content-Type: text/markdown
Classifier: Development Status :: 5 - Production/Stable
Classifier: Framework :: AiiDA
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering
License-File: LICENSE
Requires-Dist: aiida-core>=2.9.4,<3.0.0
Requires-Dist: aiida-quantumespresso>=5,<6
Requires-Dist: aiida-pseudo~=1.7
Requires-Dist: aiida-cp2k>=2.2.1,<3.0.0
Requires-Dist: ase~=3.21
Requires-Dist: aiida-gaussian~=2.0
Requires-Dist: aiida-shell
Requires-Dist: banduppy>=1,<2
Requires-Dist: pillow>=8.0.0
Requires-Dist: more-itertools
Requires-Dist: pgtest~=1.3.1 ; extra == "dev"
Requires-Dist: pytest>=8 ; extra == "dev"
Requires-Dist: pytest-cov ; extra == "dev"
Requires-Dist: pre-commit>=2.19 ; extra == "dev"
Requires-Dist: bumpver==2022.1119 ; extra == "dev"
Requires-Dist: coverage ; extra == "dev"
Requires-Dist: mypy ; extra == "dev"
Requires-Dist: types-pyyaml ; extra == "dev"
Project-URL: Homepage, https://github.com/nanotech-empa/aiida-nanotech-empa
Provides-Extra: dev
Import-Name: aiida_nanotech_empa

[![Build Status](https://github.com/nanotech-empa/aiida-nanotech-empa/workflows/ci/badge.svg?branch=master)](https://github.com/nanotech-empa/aiida-nanotech-empa/actions)
[![codecov](https://codecov.io/gh/nanotech-empa/aiida-nanotech-empa/branch/develop/graph/badge.svg?token=52ACMY55UQ)](https://codecov.io/gh/nanotech-empa/aiida-nanotech-empa)
[![PyPI version](https://badge.fury.io/py/aiida-nanotech-empa.svg)](https://badge.fury.io/py/aiida-nanotech-empa)
[![DOI](https://zenodo.org/badge/275159349.svg)](https://zenodo.org/badge/latestdoi/275159349)

# aiida-nanotech-empa

> **Legacy Python 3.9 / AiiDA 2.6.3:** use [v1.0.0](https://github.com/nanotech-empa/aiida-nanotech-empa/releases/tag/v1.0.0). See the [Empa legacy compatibility guide](https://github.com/nanotech-empa/aiida-nanotech-empa/blob/master/docs/legacy-python39-aiida263.md) for the matching package versions and installation constraints. Use a tagged version to preserve this runtime.

AiiDA library containing plugins, parsers, and workflows developed by the nanotech@surfaces group at Empa.

The package focuses on automation around CP2K, Gaussian, Quantum ESPRESSO, and post-processing tools used in surface-science workflows. It is also used by the `aiidalab-empa-surfaces` app.

## Contents

### CP2K workflows

* `nanotech_empa.cp2k.geo_opt`: CP2K geometry and cell optimization workflows with restart handling and optional cube post-processing.
* `nanotech_empa.cp2k.scf`: single-point CP2K SCF workflow. It can run an OT-only energy calculation, an optional diagonalization step for empty states and AO overlap matrices, sparse AO-overlap retrieval, or Bader charge analysis from a fine charge-density cube.
* `nanotech_empa.cp2k.diag`: OT plus diagonalization SCF workflow used by STM/PDOS-style workflows and by the SCF workflow.
* `nanotech_empa.cp2k.stm`, `nanotech_empa.cp2k.afm`, `nanotech_empa.cp2k.hrstm`, `nanotech_empa.cp2k.orbitals`, `nanotech_empa.cp2k.pdos`: workflows for scanning-probe simulations, orbital cubes, and projected density of states.
* `nanotech_empa.cp2k.fragment_separation`, `nanotech_empa.cp2k.replica`, `nanotech_empa.cp2k.neb`, `nanotech_empa.cp2k.phonons`: workflows for adsorption energies, replica chains, nudged elastic band calculations, and phonons.
* `nanotech_empa.cp2k.ads_gw_ic`, `nanotech_empa.cp2k.molecule_gw`, `nanotech_empa.cp2k.mol_opt_gw`: CP2K/GW-oriented workflows.
* `nanotech_empa.cp2k.reftraj`: batched calculations along a reference trajectory.
* `nanotech_empa.cp2k.benchmark`: benchmark CP2K resource configurations on selected structures.

### Calculation plugins

* `nanotech_empa.bader`: runs Bader charge analysis and retrieves `ACF.dat`, `AVF.dat`, and `BCF.dat`.
* `nanotech_empa.sparse_overlap`: converts CP2K AO overlap matrix logs to sparse `.npz` files using an external converter executable.
* `nanotech_empa.stm`, `nanotech_empa.overlap`, `nanotech_empa.afm`, `nanotech_empa.hrstm`, `nanotech_empa.cubehandler`: post-processing plugins used by the CP2K workflows.

### Gaussian and Quantum ESPRESSO workflows

* `nanotech_empa.gaussian.*`: Gaussian workflows for SCF, relaxations, spin-state analysis, constrained optimization, CASSCF, NICS, and related post-processing.
* `nanotech_empa.nanoribbon`: workflow to characterize 1D periodic systems with Quantum ESPRESSO.
* `nanotech_empa.qe.banduppy_unfolding`: unfold supercell bands with BandUPpy, with optional neutral primitive-reference SCF and bands.

For a spin-polarized source, primitive-reference bands require an explicit
`reference_spin_parameters` input: `{"nspin": 1}` confirms a nonmagnetic
reference; `{"nspin": 2, "starting_magnetization": {"Fe": 0.5}}` specifies
collinear starting moments by primitive-cell kind. Alternatively provide an
explicit primitive-cell `tot_magnetization`, or disable reference calculations
with `run_reference_bands=False`. The primitive cell must accommodate the chosen
magnetic order. Supercell charge and total magnetization are not copied into
the primitive reference. Folded supercell calculations preserve the source spin
settings. Noncollinear/SOC reference calculations are not supported.

The Gaussian spin workflow supports wavefunction-stability checks and optimizes the requested multiplicities, selects the lowest-energy state, and runs Δ-SCF ionization-potential/electron-affinity and vertical-excitation calculations. Natural-orbital analysis is available for an open-shell singlet ground state. Orbital image rendering requires the [PyMOL Python module](https://github.com/schrodinger/pymol-open-source), installed separately in the rendering environment.

## Installation

Install the latest published package with:

```shell
pip install aiida-nanotech-empa
```

The overview above follows the development branch. Check the [release notes](https://github.com/nanotech-empa/aiida-nanotech-empa/releases) for the features included in a published version.

## For maintainers

To create a new release, clone the repository, install development dependencies with `pip install '.[dev]'`, and then execute `bumpver update --dry --major (--minor/--patch)`.
This will display the changes that will be made to the repository - check them carefully.

Once you are happy with the changes, remove the `--dry` option and re-execute the command.
This will:

  1. Create a tagged release with bumped version and push it to the repository.
  2. Trigger a GitHub actions workflow that creates a GitHub release.



Additional notes:

  - The release tag (e.g. a/b/rc) is determined from the last release.
    Use the `--tag beta (alpha/gamma)`  option to switch the release tag.

## Acknowledgements
We acknowledge support from:
* the [NCCR MARVEL](http://nccr-marvel.ch/) funded by the Swiss National Science Foundation;
* the [swissuniversities P-5 project "Materials Cloud"](https://www.materialscloud.org/swissuniversities).
<img src="https://github.com/nanotech-empa/aiida-nanotech-empa/blob/master/images/MARVEL.png" width="250px" height="131px"/>
<img src="https://github.com/nanotech-empa/aiida-nanotech-empa/blob/master/images/swissuniversities.png" width="300px" height="35px"/>

## Software attribution and scientific acknowledgements

Please credit [aiida-nanotech-empa](https://github.com/nanotech-empa/aiida-nanotech-empa) and its
[contributors](https://github.com/nanotech-empa/aiida-nanotech-empa/graphs/contributors),
and identify the release or immutable commit used. Existing author,
contributor and funding acknowledgements remain authoritative.

See [CITATION.cff](CITATION.cff) for the software citation. A project DOI
covers archived releases; identify the exact version or commit separately.
Use a release DOI only for the release it identifies.

Preserve the copyright and permission notices in [LICENSE](LICENSE)
when copying or distributing copies or substantial portions of MIT-licensed
code. Separately licensed components retain their own notices. A name or
repository link does not replace the applicable licence notices.

The bundled CP2K UZH parameter files retain their upstream authorship and licence.
Their [source snapshot and licence notice](aiida_nanotech_empa/workflows/cp2k/data/README.UZH.md)
are recorded alongside the data.

When this software's AiiDA workflows or provenance helped the research,
acknowledge the [AiiDA team and cite its three papers](https://github.com/nanotech-empa/.github/blob/main/CITATION_GUIDANCE.md#aiida).
Also acknowledge [AiiDAlab and its two platform papers](https://github.com/nanotech-empa/.github/blob/main/CITATION_GUIDANCE.md#aiidalab)
when AiiDAlab was used to access those workflows.

Also cite the calculation plugins, simulation codes and post-processing tools actually used, including cp2k-spm-tools for its unfolding or microscopy implementations.

The [shared credit guide](https://github.com/nanotech-empa/.github/blob/main/CITATION_GUIDANCE.md) keeps software attribution, licence
compliance and scientific citation requests separate. Scientific citation
requests are not additional MIT licence conditions.

