Skip to main content

DOI

oooooooooo.                                                         
`888'   `Y8b                                                        
 888      888  .ooooo.  oo.ooooo.  oooo    ooo  .ooooo oo  .ooooo.  
 888      888 d88' `88b  888' `88b  `88.  .8'  d88' `888  d88' `88b 
 888      888 888   888  888   888   `88..8'   888   888  888   888 
 888     d88' 888   888  888   888    `888'    888   888  888   888 
o888bood8P'   `Y8bod8P'  888bod8P'     .8'     `V8bod888  `Y8bod8P' 
                         888       .o..P'            888.           
                        o888o      `Y8P'             8P'            
                                                     "              
 
   Many-body analysis on top of Quantum ESPRESSO calculations   

Introduction

This python package provides an interface between the Quantum ESPRESSO (QE) DFT software and many-body calculations. We extract the Kohn-Sham orbitals from a QE calculation to construct a many-body Hamiltonian and solve it using classical and quantum algorithms. Classical solvers are implemented using the PySCF package. Quantum solvers are implemented using the TenCirChem and Qiskit packages. After this we can calculate Bader charges on all atoms in the computational cell using the charge density and the Bader charge analysis code.

Dopyqo reads the output files of a QE calculation to build the Hamiltonian. The needed files are located in the .save folder that QE outputs and are the data-file-schema.xml and the wfc.dat or wfc.hdf5 files.

Documentation

The documentation can be found here.

Installation

Install via pip using

pip install dopyqo

To use a more performant rust implementation for some matrix element calculations you can install

pip install dopyqo-rs

or

pip install dopyqo[rs]

For this you need the following installed on your machine:

If dopyqo-rs is not installed, a slower python implementation using numpy and scipy is used.

Further, Dopyqo can utilize GPUs for performing FFTs using the cupy package to calculate matrix elements related to the electron repulsion integrals (ERIs):

pip install cupy

or

pip install dopyqo[cupy]

For this make sure to install the correct cupy version matching your installed CUDA version. If cupy is not installed, a python implementation using numpy is used. If cupy is installed, the python implementation can still be used by setting use_gpu=False in the dopyqo.DopyqoConfig.

Usage

Dopyqo can be used via a python interface:

import os
import dopyqo

config = dopyqo.DopyqoConfig(
    base_folder=os.path.join("path/to/your/qe/calculation"),
    prefix="PrefixUsedInYourQECalculiaton",
    active_electrons=2,
    active_orbitals=4,
    run_fci=True, # Solve ground state with PySCF FCI solver
    run_vqe=True, # Solve ground state with VQE solver
    use_qiskit=False, # If False use TenCirChem to simulate the VQE, if True use Qiskit
    vqe_optimizer=dopyqo.VQEOptimizers.L_BFGS_B,
    vqe_excitations=dopyqo.ExcitationPools.SINGLES_DOUBLES,
    n_threads=10,
)
energy_dict, wfc_obj, h_ks, mats = dopyqo.run(config)

This reads the output of the specified QE calculation (base_folder and prefix), computes the many-body Hamiltonian, and solves for the ground-state using a FCI and VQE calculation in an active space of two electrons in four orbitals.

Alternatively, you can use the providend script called dopyqo and provide an input file in the toml format:

dopyqo -i your_input_file.toml

For information about the input file see INPUT.md. The latter currently provides only part of the functionality. Therefore, we encourage the use of the python interface.

See the examples folder for example scripts and an example input toml-file.

Requirements

  • Tested Python version: 3.11
  • Tested QE version: 7.1 compiled with and without HDF5 1.14.0
  • Tested with QE SCF calculations. General k-point calculations only work when using Qiskit or PySCF. Gamma-only calculations also work with TenCirChem.
  • Only norm-conserving pseudopotentials are currently supported.
  • Only spin-restricted QE calculations are currently supported.
  • To calculate Bader charges, the Bader charge analysis code needs to be installed.
  • See pyproject.toml for required Python packages.

Issues

VQE calculation takes a lot of CPU resources

If using Linux set the environment variable OMP_NUM_THREADS to limit the number of used CPU threads.

Authors

  • Gabriel Breuil
  • Erik Hansen
  • Jasper Nickelsen
  • Alexander Rehn
  • Erik Schultheis

Contact

Feel free to contact David Melching if you have any questions.

Citation

If you use portions of this code please cite our paper:

@article{Schultheis2025ManyBody,
      title={Many-body post-processing of density functional calculations using the variational quantum eigensolver for Bader charge analysis},
      url={https://arxiv.org/abs/2510.12887},
      DOI={10.48550/ARXIV.2510.12887},
      publisher={arXiv},
      author={Schultheis, Erik and Rehn, Alexander and Breuil, Gabriel},
      year={2025}
}

Acknowledgment

This project was made possible by the DLR Quantum Computing Initiative and the Federal Ministry for Economic Affairs and Climate Action; https://qci.dlr.de/quanticom.

Metadata

Release files for dopyqo 0.2.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 dopyqo 0.2.0
File Size Uploaded
dopyqo-0.2.0.tar.gz 858.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dopyqo 0.2.0
File Interpreter ABI Platform
dopyqo-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 975.5 kB

Release files / dopyqo-0.2.0.tar.gz

Download URL dopyqo-0.2.0.tar.gz
Size 858.6 kB
Tags Source
SHA-256 checksum
How to use checksums
4893798d69934a6fb2a445d8b04dc35e6a0e57c3cfec38d38bbef2f51c05d95c
BLAKE2b-256 checksum
How to use checksums
b2254771d2da63b787771929f5b5c67873b4545544d67c9032ba651ffa157c17
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.0rc1

Release files / dopyqo-0.2.0-py3-none-any.whl

Download URL dopyqo-0.2.0-py3-none-any.whl
Size 116.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6da04f96b4b809e93e9f69fa573960a296155fee598772058be34d1eaadfcba8
BLAKE2b-256 checksum
How to use checksums
60311fd576bc105b35415f54ebe25da2929952717183e8197a8acf6d541602b3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.0rc1

Release history Release notifications | RSS feed

0.4.0

2 release files

0.3.0

2 release files

0.2.2

2 release files

0.2.1

2 release files

This release

0.2.0 This release

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

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