Skip to content

[Review before IBM] HI-VQE docs for the 4.0.0 function - #6

Closed
seihyun-jeong wants to merge 3 commits into
upstream-mainfrom
hivqe-4.0.0
Closed

seihyun-jeong wants to merge 3 commits into
upstream-mainfrom
hivqe-4.0.0

Conversation

@seihyun-jeong

@seihyun-jeong seihyun-jeong commented Oct 7, 2026 •

Copy link
Copy Markdown
Collaborator

Important

Do not merge. This PR is the review copy of what we will send to IBM (Qiskit/documentation). Its base, upstream-main, is a copy of IBM's main, so Files changed shows exactly what IBM will receive. Once it is approved, this same branch goes to IBM as the upstream PR.

What changes for users in 4.0.0

From the Changelog this PR adds to the guide:

  • The result no longer includes "states" or "eigenvector". They are now saved in an HDF5 results file, together with "final_energy", "final_energy_variance", and "energy_history".
  • Added "results_file_name" to the result. It gives the name of the results file, which you can download with serverless.file_download(). Reading the file requires the h5py package.

Three pages change: the API reference, the guide, and the tutorial. Nothing else (for example the ./start fix from #4) is included.

Before and after

Screenshots come from the local docs preview (./start), which uses the same renderer as the IBM docs site. Before is IBM's current main; after is this branch.

API reference: result table

The table drops "states" and "eigenvector" and adds "results_file_name".

Before After

Guide: reading the result

The printed result shows the 4.0.0 response. The guide lists what the results file holds and adds two examples: creating a QiskitServerless client, then downloading the file and reading it with h5py. The download passes target_name so the file is saved under the name the next line opens (see Changes after review).

Before After

Guide: new Changelog section

Added between "Fetch error messages" and "Get support".

Tutorial: setup

h5py is added to the install line, and a QiskitServerless client is created next to the catalog.

Before After

Tutorial: results files

Each calculation's results file is downloaded and read with h5py.

Before After

Where these changes came from

Change Route Review
4.0.0 result structure and h5 results file (API reference, guide, tutorial) #2 Approved by 5 reviewers
Licensing section duplicated by the #2 merge, removed again 3bad603bb0, pushed to main None. The result matches IBM's version, so this PR does not show it
4.0.0 Changelog #5 Merged after self-review

This branch was cut from IBM's main and holds those three files as they are on our main, in a single commit.

Changes after review

  • e20928a: the guide's download example now works as written. It called serverless.file_download(results_file_name, function) and then opened results_file_name. Without target_name, qiskit-serverless saves the file as downloaded_<8 hex>_<name> (qiskit_serverless/core/files.py, 0.36.0), so the open failed with FileNotFoundError. It now passes target_name=results_file_name. The screenshot above shows the fixed version.
  • de8f74b: the licensing example runs on the reader's own backend. It hardcoded backend_name="ibm_torino". Current qiskit-ibm-catalog checks backend access before it submits, so without ibm_torino the example stops with "Backend 'ibm_torino' is not available or you do not have access to it". It now passes backend_name=backend_name, # can use any device with at least 14 qubits like the rest of the guide (H2O in STO-3G: 7 orbitals, 14 qubits). Its catalog now uses the saved account (QiskitFunctionsCatalog(channel="ibm_quantum_platform")), as "Get started" does, instead of token=/instance= placeholders.

Run against production 4.0.0

The guide was run cell by cell against qunova/hivqe-chemistry (reported version 4.0.0) from a test instance on test_eagle_us-east:

  • NH3 example: finished. 1936 states and energy -55.52114653, the same state count as the guide's output.
  • Licensing example: with a placeholder licence token, the job reaches the function and is refused with TokenNotFoundError (1201), as expected. No real licence was used.

Please confirm

  1. The guide's printed result was edited by hand, not re-run (6f12d716e1). IBM's CI excludes both Qunova notebooks from execution, so nobody runs them on IBM's side either. Should we re-run against the 4.0.0 function before sending?
  2. The guide and the tutorial read the file differently. The guide was the one that was wrong and is fixed above. The tutorial still asks the reader to fill in "PATH_TO_DOWNLOADED_RESULTS_FILE", which works. It is left as is for now.
  3. The Changelog has no release date. Add one as ### 4.0.0 (YYYY-MM-DD)?

Checks

  • npm run check:spelling, check:markdown, check:internal-links pass on this branch.
  • squeaky --check and qiskit-docs-notebook-normalizer --check pass (the tox lint tools).
  • git diff upstream-main hivqe-4.0.0 touches only the three Qunova doc files.

After approval

  1. Open the upstream PR from this branch: compare on Qiskit/documentation, then sign the CLA.
  2. Close this PR once IBM merges.
  3. Continue with 5.0.x (Document usage-based billing and the 5.0.x function #3).

🤖 Generated with Claude Code

In 4.0.0 the result no longer carries "states" or "eigenvector". They
are written to an HDF5 results file instead, alongside "final_energy",
"final_energy_variance" and "energy_history". The result names that
file in "results_file_name".

- API reference: drop "states" and "eigenvector" from the result table,
  add "results_file_name", and point "energy_variance" at the states in
  the results file.
- Guide: show the 4.0.0 result, list what the results file holds, and
  add examples that create a QiskitServerless client, download the file
  and read it with h5py. Add a Changelog section that starts at 4.0.0.
- Tutorial: install h5py, and download and read the results file for
  each calculation.

Co-authored-by: Shane McFarthing <shane.mcfarthing@gmail.com>
Co-authored-by: Rowan Pellow-Jarman <rowanpellow@gmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The guide downloaded the results file with
serverless.file_download(results_file_name, function) and then opened
results_file_name. That fails with FileNotFoundError: without
target_name, qiskit-serverless saves the file as
downloaded_<8 hex>_<name> (qiskit_serverless/core/files.py, 0.36.0).
The comment above the call, "saved ... under the same name", was wrong
for the same reason.

Pass target_name=results_file_name so the file lands under the name the
next line opens, and make the comment say what the call does.

The tutorial still asks for the path by hand and is left alone for now.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The licensed-use example passed backend_name="ibm_torino". Current
qiskit-ibm-catalog checks backend access before it submits a job, so on
an instance without ibm_torino the example stops with "Backend
'ibm_torino' is not available or you do not have access to it". It now
passes backend_name, as the rest of the guide does, with a comment
giving the 14 qubits that H2O in STO-3G needs (7 orbitals).

The example also built its catalog from token and instance
placeholders, unlike "Get started", which uses the saved account. It
now does the same: QiskitFunctionsCatalog(channel="ibm_quantum_platform").

Checked against production 4.0.0 from a test instance. With a placeholder
licence token, the job reaches the function and is refused with
TokenNotFoundError (1201), as expected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@supalert-qunova supalert-qunova left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

After testing with the Fake-backend(test_eagle_us-east), the printed job.result() and file downloads work perfectly after modifying

serverless.file_download(
    results_file_name, function)

to

serverless.file_download(
    results_file_name, function, target_name=results_file_name)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants