Skip to content

Dataset for Benchmarking Variational Fast Forward Pipielines based on Hydrogen Molecule Simulation #916

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 18 commits into
base: main
Choose a base branch
from

Conversation

RishiNandha
Copy link
Contributor

Summary

Benchmarking dataset for variational fast-forwarding (VFF) pipelines using the time evolution of quantum states from hydrogen-based molecules. The dataset is structured to support learning-based extrapolation of quantum dynamics: short-term, potentially noisy training states are provided alongside long-term, exact reference evolutions.

The data generator gives us the following:

  • ⎢ѱHK〉: The Hartree Fock State of the system
  • X_train: [Δt, 2Δtm …NΔt] which are uniform timestamps at which short-term evolutions are recorded
  • Y_train: U(Δt)⎢ѱHK〉...U(NΔt)⎢ѱHK〉 which are the short-term evolutions but with noise
  • X_test: [PΔt…QΔt] which are the long-term timestamps
  • Y_test: U(PΔt)⎢ѱHK〉…U(QΔt)⎢ѱHK〉 which are the long-term noiseless evolutions

Details and comments

  • This PR adds qiskit_aer and qiskit_ibm_runtime as user dependencies too and not just dev dependencies
  • Generating the Hamiltonians from scratch needs PySCF, but to keep it simple I've saved the hamiltonians and included the generation code as an optional dev-only module. PySCF has not been included as a dev-requirement
  • Unittests are taking about half a minute to run. I can try any suggestions on how I can make them faster
  • Usage of Noise Models from a runtime has been included as an optional feature
  • When running unittests I'm getting deprecation warnings saying the transpiler I'm using to take a hamiltonians to realistic ciruits will not be in 2.0.0 anymore. Any suggestions on keeping the generator 2.0.0-friendly would be helpful too

Literature that uses a similar training procedure for VFFs: https://quantum-journal.org/papers/q-2024-03-13-1278/pdf/

@RishiNandha
Copy link
Contributor Author

There seem to be lint and mypy problems I missed to address. I'll fix and re-commit. Meanwhile, any thoughts on making unittests faster and making the transpilation step qiskit 2.0.0 friendly would be very helpful!

@woodsp-ibm
Copy link
Member

The CI issues have been fixed so I updated the branch (via the update button that was here) so any issues now would be just down to this PR - unless it has a random failure for which there is an issue #903 around that,

@woodsp-ibm
Copy link
Member

The failure in MacOS 3.12 in this test.gradients.test_estimator_gradient.TestEstimatorGradientV2.test_gradient_u_2_LinCombEstimatorGradient is indeed one of the random failures so you do not need to worry about this.

@edoaltamura
Copy link
Collaborator

Just merged the latest updates in this branch

@RishiNandha
Copy link
Contributor Author

I'm not able to fix that docstring :(
Requesting for help with that

@woodsp-ibm
Copy link
Member

woodsp-ibm commented May 18, 2025

If I look at the Checks log here the style check is also complaining i.e the black check that says it would reformat the files,as below. This is done from the makefile using make style you can run that locally to see the same in the root of the project (or run the same command that the makefile has if you cannot run the make - where the black command is actually shown in the log excerpt copied below too). The style can be fixed by running make black (or again what that has in the makefile if you cannot run make). Maybe that will fix things up enough - give it a try first and lets see

make[1]: Leaving directory '/home/runner/work/qiskit-machine-learning/qiskit-machine-learning/docs'
black --check qiskit_machine_learning test tools docs
would reformat /home/runner/work/qiskit-machine-learning/qiskit-machine-learning/qiskit_machine_learning/datasets/h_molecule_evolution.py
would reformat /home/runner/work/qiskit-machine-learning/qiskit-machine-learning/test/datasets/test_h_molecule_evolution_data.py

Copy link
Member

@woodsp-ibm woodsp-ibm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I cloned your repo locally and running make html in the root of the project on this updated branch it gave me the same errors. Basically I started at the line it failed and commented things to remove the text afterwards. It worked I added more and more until I saw the failure. What seemed to cause things for me was that text I have deleted below, which is basically the list of parameters - that, I think, was getting wrapped up into the Parameters keyword and causing the failure. At least for me removing it works. Then the only thing I saw in the resultant output was a formatting issue around those inline math statements that need adjusting also as further below.

@woodsp-ibm
Copy link
Member

woodsp-ibm commented May 20, 2025

I committed the changes - lets see how it goes here in CI. Locally it made the html fine so it should here too! If you look in the log - I think the tutorial ones - it builds the html and uploads where there is a link for the uploaded zipped result that you can download and unpack to see how it all looks.

@coveralls
Copy link

coveralls commented May 20, 2025

Pull Request Test Coverage Report for Build 15622600013

Details

  • 108 of 116 (93.1%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.05%) to 90.85%

Changes Missing Coverage Covered Lines Changed/Added Lines %
qiskit_machine_learning/datasets/h_molecule_evolution.py 106 114 92.98%
Totals Coverage Status
Change from base Build 15622557464: 0.05%
Covered Lines: 4637
Relevant Lines: 5104

💛 - Coveralls

@edoaltamura edoaltamura added type: enhancement ✨ Features or aspects to improve short project A task amounting to a small project (but larger than a "good first issue") labels Jun 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
short project A task amounting to a small project (but larger than a "good first issue") type: enhancement ✨ Features or aspects to improve
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants