Open S-Erik opened 6 months ago
Hi @S-Erik , thank you for your suggestion! I've shared it with our team. I'll let you know their comments in the next few days.
Hi @S-Erik, thanks for this detailed feature request. Having better PennyLane integration with Quantum ESPRESSO, and in general offering easier ways to create Hamiltonians/observables describing materials is definitely something we'd like to build out in PennyLane.
It's not yet on our near-term roadmap, but it would be valuable to keep discussing to understand better what would be useful to you and most impactful overall. If you're interested in developing something already it might make sense to make a standalone repo with the functionality, allowing us to then think more about how it could fit into PennyLane.
Feature details
Creating a Hamiltonian and performing VQE calculations starting from a DFT calculation using the Quantum ESPRESSO package. This would also include calculating observables of interest like
spin2
,spinz
or thedipole_moment
. Further, active space calculations, like with active_space, would also be very useful, e.g. by using the frozen core approximation.Implementation
Similar to the
molecular_hamiltonian
function I suggest aqe_hamiltonian
function that loads the output of a DFT calculation done with Quantum ESPRESSO and returns aHamiltonian
object. The Quantum ESPRESSO output is, in its most basic form, just an XML-file that stores general information and a binary file that stores the wavefunction information as complex expansion coefficients. For the implementation, it sould be noted that Quantum ESPRESSO uses plane-waves to describe the Kohn-Sham orbitals instead of Gaussian functions like PySCF. Therefore, methods in PennyLane that rely on contracted Gaussians cannot be used in combination with aqe_hamiltonian
. An example would be thedipole_moment
which uses themoment_integral
function which uses contracted Gaussian function for its calculations. Concrete implementations should be very similar to a related project involving qiskit-nature: Qiskit-Quantum-Espresso-Driver. There, the loading of the Quantum ESPRESSO output files (wfc.py
) and the calculation of all relevant Hamiltonian matrix elements (calc_matrix_elements.py
for one-electron matrix elments anderi_pair_densities.py
for two-electron matrix elements) is already implemented. Defining an active space with the frozen core approximation can be implemented from that in a straightforward manner. For adapting observables like thedipole_moment
to the plane-wave basis set, I am eager to hear your suggestions.Now I present a first draft for the
qe_hamiltonian
function which loads the Quantum ESPRESSO output and generates a PennyLane Hamiltonian. The following code is based on the Qiskit-Quantum-Espresso-Driver.How important would you say this feature is?
1: Not important. Would be nice to have.
Additional information
In general, I would be interested if in the future PennyLane aims to support classical ab-initio DFT codes like Quantum ESPRESSO or VASP, which use plane-wave basis sets, besides PySCF and Psi4, which use Gaussian basis sets. Further it would be interesting to know which observables, that are implemented in Pennylane, depend on the used basis set, e.g. the
dipole_moment
seems to rely on the usage of Gaussian basis functions.