classical-shadow-vqe

Qiskit implementation of classical shadow formalism with VQE for calculating ground state energies of molecules

https://github.com/renatawong/classical-shadow-vqe

Science Score: 67.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 1 DOI reference(s) in README
  • Academic publication links
    Links to: aps.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (9.1%) to scientific vocabulary

Keywords

classical-shadow electronic-structure-problem ground-state-energy qiskit quantum-algorithms quantum-computing quantum-machine-learning variational-quantum-circuits variational-quantum-eigensolver vqe
Last synced: 6 months ago · JSON representation ·

Repository

Qiskit implementation of classical shadow formalism with VQE for calculating ground state energies of molecules

Basic Info
  • Host: GitHub
  • Owner: renatawong
  • License: apache-2.0
  • Language: Jupyter Notebook
  • Default Branch: main
  • Homepage:
  • Size: 4.01 MB
Statistics
  • Stars: 13
  • Watchers: 2
  • Forks: 1
  • Open Issues: 0
  • Releases: 0
Topics
classical-shadow electronic-structure-problem ground-state-energy qiskit quantum-algorithms quantum-computing quantum-machine-learning variational-quantum-circuits variational-quantum-eigensolver vqe
Created almost 3 years ago · Last pushed over 2 years ago
Metadata Files
Readme License Citation

README.md

Electronic structure problem (estimating ground state energy) with VQE and classical shadows

The notebooks implement the idea in 1 and extend the application of classical shadows to each iteration of VQE.

Status

The notebooks are complete.

How to use the notebooks

Requires the package predicting-quantum-properties from [2].

There are a total of six files that calculate the electronic structure problem: 1. electronicstructureproblem_dcs.ipynb : Electronic structure problem with shadow (derandomized) applied on the optimal set of angles only. This is the original idea in [1]. 2. electronicstructureproblem_rcs.ipynb : Electronic structure problem with shadow (randomized) applied on the optimal set of angles only.

The below files on the other hand apply classical shadow in each cost function evaluation of VQE:

  1. vqercsqiskit.ipynb : Electronic structure problem using VQE with the vanilla classical shadow (i.e. randomised basis change).
  2. vqercsqiskit_optimized.ipynb: As above but with optimization.
  3. vqedcsqiskit.ipynb : Electronic structure problem using VQE with ``derandomised'' classical shadow (i.e. derandomised Hamiltonian used for basis change).
  4. vqedcsqiskit_optimized.ipynb : As above but with time optimization.

Calculations using the optimized versions take significantly less time than with the non-optimised versions.

File modified_derandomization.py contains a modified version of the file 'dataacquisitionshadow.py' in the package 'predicting-quantum-properties' [2]. This modification allows the user to specify the number of derandomised operators to be generated. In the original version [2], the user had to specify the number of evaluations per observable, which did not allow for control over the total number of generated operators.

The folder experimental-results contains the experimental results for the molecules $H2$, $LiH$, $BeH2$, $H2O$, and $NH3$. Note that [1] doesn't specify how to obtain a required number of derandomized operators, instead it one must pass a number of evaluations per observable. This results in the number of required operators being either unergenerated or overgenerated. Hence, in order to be able to verify the results of [1], we do a postprocessing on the method for generating derandomized operators from [2]. Essentially, we pass the parameter '50' to 'derandomizedclassicalshadow.py' as the number of evaluations per observable, and then we either add operators to the output or decrease the number of operators in the output, depending on how many operators are needed for each test. Our method works for the tested molecules, but no guarantee is given for the general case.

Acknowledgements

The notebooks are based on the theory described in [1].

The code was written by Renata Wong (https://renatawong.github.io/).

This work benefited greatly from discussions with Prof. Hsi-Sheng Goan (National Taiwan University), Prof. Hao-Chung Cheng (National Taiwan University), Prof. Jyh-Pin Chou (National Changhua University of Education), Michał Stęchły (PsiQuantum), and Hsin Yuan (Robert) Huang (California Institute of Technology). All remaining deficiencies are my own.

References

[1] Hsin-Yuan Huang, Richard Kueng, and John Preskill, Efficient estimation of Pauli observables by derandomization, https://journals.aps.org/prl/abstract/10.1103/PhysRevLett.127.030503

[2] Hsin-Yuan Huang, Predicting quantum properties, https://github.com/hsinyuan-huang/predicting-quantum-properties

License Apache License 2.0

Owner

  • Name: Renata Wong
  • Login: renatawong
  • Kind: user
  • Location: Poland / Taiwan
  • Company: National Center for Theoretical Sciences, Taipei, Taiwan, R.O.C.

Researcher in Quantum Information Science. IBM Certified Associate Developer (Quantum Computing). IBM Qiskit Advocate.

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
  - family-names: Wong
    given-names: Renata
    orcid: https://orcid.org/0000-0001-5468-0716
title: VQE with classical shadows
version: v2.0.2
#doi: 
date-released: 2023-08-11
url: "https://github.com/github/renatawong"

GitHub Events

Total
  • Watch event: 3
  • Fork event: 1
Last Year
  • Watch event: 3
  • Fork event: 1

Dependencies

requirements.txt pypi
  • matplotlib *
  • numpy *
  • pyscf *
  • qiskit *