The interface to Qiskit is not working❗ Since qiskit_nature does indirectly not support complex expansion coefficients (see this issue) the provided code does currently not work with qiskit_nature. Since the Kohn-Sham orbitals are expanded in plane-waves with complex expansion coeffiecients, the overlap matrix is complex. As described in this issue, the overlap matrix is calculated the wrong way and needs to be casted to a real matrix. This is especially relavant if the qiskit_algorithm NumPyMinimumEigensolver in combination with the default filter criterion is used. The default filter criterion enforces that the ground state has the correct number of particles, a magnetization of zero and an angular momentum of zero. The angular momentum operator is defined by the overlap matrix between spin-up and spin-down molecular orbitals, i.e. Kohn-Sham orbitals in our case.
Besides that, spin-polarized DFT calculations result in a non-zero (
This repository provides an interface between the QuantumEspresso DFT software and Qiskit. QuantumEspresso uses a plane-wave basis to express the Kohn-Sham orbitals. We extract the Kohn-Sham orbitals from a QuantumEspresso calculation to construct a many-body hamiltonian in Qiskit by calculating the necessary matrix elements.
We start from a DFT calculation done with QuantumEspresso and extract the Kohn-Sham orbitals expressed in the momentum basis. Then, we select a set of orbitals around the. We formulate the electronic structure problem in second quantization with the selected Kohn-Sham orbitals. For this we need to calculate one-electron and two-electron matrix elements
- Tested Python version:
3.11.5
- See requirements.txt for Python packages.
- Tested QuantumEspresso version:
7.1
compiled with HDF51.14.0
(HDF5 support is not needed) - Only normconserving pseudopotentials can be currently used because then the Kohn-Sham orbitals are orthonormal. For ultrasoft pseudopotentials a generalized eigenvalue problem is solved in DFT and the wavefunctions are only orthonormal w.r.t. to an overlap matrix.
- Run a QuantumEspresso SCF DFT calculation with the H2.scf.in:
pw.x -i H2.scf.in > H2.scf.out
. - The demo_nospin.py and demo_spin.py scripts created a qiskit
ElectronicStructureProblem
(see qe_driver.py) by calculating the electron repulsion integrals via pair densities (see eri_pair_densities.py) and by calculating the one-electron part of the Hamiltonian (see calc_matrix_elements.py and wfc.py) using the QuantumEspresso DFT output. The ground state of the problem is then found with the numpy ground-state solver in qiskit.
Note that the QE_Driver
class in qe_driver.py also provides a function solve_fci
which uses PySCF to perform exact diagonalization of the electronic structure Hamiltonian.
We calculate the electron repulsion integrals (ERIs) given as
In the following we present a derivation of the pair density representation of the ERIs. We start from the real space representation:
The one-electron integrals
Notes:
- The calculations of ERIs treat the singularity in the sum of momenta arising from the zero-momentum term by removing this term from the sum. For charge neutral systems this zero-momentum terms cancels with the zero-momentum term of the interaction between electrons and nuclei, and only contributes a constant term. See Babbush, R. et al. (2018) ‘Low-Depth Quantum Simulation of Materials’, Physical Review X, 8(1). and Martin, R.M. (2020) Electronic Structure. Cambridge University Press. for further information.
- We perform a spin-less DFT calculation. Therefore, the Kohn-Sham orbitals we use from the DFT calculation do not include spin. For the VQE and FCI calculation we use each Kohn-Sham orbital as a spin orbital which can hold two electrons, one with spin-up one with spin-down. Therefore 2 occupied Kohn-Sham orbitals correspond to 4 electrons, each occupying one spin orbital.
- The calculation of ERIs via pair densities is currently only implemented for
$\Gamma$ -point calculations. - The implementation of calculating the ERIs via pair densities is inspired by WEST and its implementation on GitHub, especially the code in the compute_eri_vc function. Publications related when citing WEST: Large Scale GW Calculations, M. Govoni and G. Galli, J. Chem. Theory Comput. 11, 2680 (2015) and GPU Acceleration of Large-Scale Full-Frequency GW Calculations, V. Yu and M. Govoni, J. Chem. Theory Comput. 18, 4690 (2022). We note that, although inspiration was taken from the WEST implementation, no code from WEST was used.
This software was developed within the QuantiCoM project which is part of the DLR Quantum Computing Initiative (QCI). We acknowledge the support of the DLR Quantum Computing Initiative (QCI).