Skip to main content

berry


Berry extracts the Bloch wavefunctions from DFT calculations in an ordered way so they can be directly used to make calculations.

It retrieves the wavefunctions and their gradients in reciprocal space totally ordered by unentangled bands, where continuity applies.

In particular, it calculates the Berry connections and curvatures from DFT calculations.

Then the Berry connections can be used to calculate the first order optical conductivity and the second order optical conductivity for second harmonic generation (SHG).

Therefore, this suite of programs can be used in calculations other than Berry connections and related topics, with small adaptations.

Version 2 can be used with 1D, 2D and 3D materials, with either no spin or noncollinear DFT calculations. It uses DFT suite Quantum Espresso.

It is expected that this software will evolve with many more possibilities in the near future. The list of TODOs is already large.

  • Source code: https://github.com/ricardoribeiro-2020/berry

  • Aknowledgement: We aknowledge the Fundação para a Ciência e a Tecnologia (FCT) under project QUEST2D - Excitations in quantum 2D materials PTDC/FIS-MAC/2045/2021 and in the framework of the Strategic Funding UIDB/04650/2020.

Installation

pip install berry-suite

or, from a source checkout:

pip install -e .

A working Quantum ESPRESSO installation (version 7.5 or higher) must be present and on your $PATH. Noncollinear calculations additionally require a patched wfck2rFR.x. See docs/INSTALL for details.

Usage

Installing puts two commands on your $PATH: berry, which runs the calculation pipeline, and berry-vis, which draws the results.

berry [package options] script parameter [script options]

The scripts must be run in this order, because each one uses the results of the previous ones:

Command What it does
preprocess Run and extract data from DFT calculations. This should be the first script to run.
wfcgen Extracts wavefunctions from DFT calculations.
degenrot Finds degenerate subspaces and rotates wavefunctions into a smooth basis.
dot Calculates the dot product of Bloch factors of nearby wavefunctions.
cluster Classifies the eigenstates in bands. (cluster0 is a backwards-compatible alias.)
basis Rotates degenerate wavefunctions flagged by the clustering into a smooth basis.
r2k Converts wavefunctions from r-space to k-space.
geometry Calculates the Berry connections and curvatures.
conductivity Calculates the optical linear conductivity of the system.
shg Calculates the second harmonic generation conductivity of the system.

berry-vis provides debug, geometry and bands for inspecting the data, drawing the Berry connection and curvature vectors, and showing the electronic band structure.

Run berry --help or berry <script> --help for the options of each script, and see docs/documentation.pdf for the full manual.

Copyright (c) 2022 - 2026

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Metadata

Release files for berry-suite 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for berry-suite 2.0.0
File Size Uploaded Provenance Actions
berry_suite-2.0.0.tar.gz 589.0 kB Without provenance Details for berry_suite-2.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for berry-suite 2.0.0
File Interpreter ABI Platform Actions
berry_suite-2.0.0-py3-none-any.whl Python 3 none any Details for berry_suite-2.0.0-py3-none-any.whl

Total release size: 785.7 kB

Release files / berry_suite-2.0.0.tar.gz

Download URL berry_suite-2.0.0.tar.gz
Size 589.0 kB
Tags Source
SHA-256 checksum
How to use checksums
5242bb680c151c4c849aa9deee65de5ac37d4590d31daee7a3b6cfb53d78e411
BLAKE2b-256 checksum
How to use checksums
4bf4033b1fc70bfb77f1cf892daab43d7947a3ebe61836eee5ec24e6c2c988e4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / berry_suite-2.0.0-py3-none-any.whl

Download URL berry_suite-2.0.0-py3-none-any.whl
Size 196.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
174f6370594696fd53b082671caaec75b4dd9277d41a0bc2452eced8e6f3e441
BLAKE2b-256 checksum
How to use checksums
38123d32fb099f2fcffaffb59276ebc639803ebbe485ab98af20253e8c24e9c3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Security for berry-suite 2.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2.0.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page