Skip to content

Add Hamiltonian energy optimization example#72

Closed
yanziwei wants to merge 1 commit into
ionq:mainfrom
yanziwei:quantum-function-example
Closed

Add Hamiltonian energy optimization example#72
yanziwei wants to merge 1 commit into
ionq:mainfrom
yanziwei:quantum-function-example

Conversation

@yanziwei

Copy link
Copy Markdown

Summary

  • Add an examples README with setup for ionq-core and IONQ_API_KEY
  • Add a Hamiltonian Energy quantum-function example that builds typed model payloads, submits with create_job, waits with wait_for_job, and drives a dependency-free coordinate-search optimizer
  • Link the examples directory from the top-level README and update the changelog

Fixes #58

Testing

  • .venv/bin/ruff check
  • .venv/bin/ruff format --check
  • .venv/bin/ty check examples/
  • .venv/bin/python -m compileall -q examples
  • .venv/bin/pytest -q (242 passed, 28 deselected, 100% coverage)

Note: uv is not available in this local shell, so I ran the equivalent commands through the repository virtualenv.

@yanziwei yanziwei requested a review from a team as a code owner June 11, 2026 11:46
@veena-vee989

Copy link
Copy Markdown

@yanziwei (cc @splch)

Hello - you are currently over the PR limit for unitaryHACK, so your PRs will be disregarded until you align with the rules. Reach out to hack@unitary.foundation to be reinstated. (PR 7 of 7)

@splch

splch commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

Thanks. Two blockers: the ansatz must be OpenQASM 3.0 with input float declarations (not an IonQ JSON circuit string), and the energy lives in results.value, not output. Closing in favor of another submission.

@splch splch closed this Jul 2, 2026
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.

Add an examples/ quantum-function workload (Hamiltonian energy) with parameter optimization

3 participants