Skip to content

Add Hamiltonian energy optimization example#74

Closed
CrewRiz wants to merge 1 commit into
ionq:mainfrom
CrewRiz:codex/unitaryhack-quantum-function-example
Closed

Add Hamiltonian energy optimization example#74
CrewRiz wants to merge 1 commit into
ionq:mainfrom
CrewRiz:codex/unitaryhack-quantum-function-example

Conversation

@CrewRiz

@CrewRiz CrewRiz commented Jun 12, 2026

Copy link
Copy Markdown

Summary

  • Add an examples/ directory with a Hamiltonian-energy Quantum Function optimization script.
  • Build the workload using typed ionq_core.models, submit with create_job.sync, and poll with wait_for_job.
  • Document setup/run steps in examples/README.md and link it from the top-level README.

Closes #58.

Verification

  • uv run pytest tests/test_examples.py --no-cov
  • uv run pytest
  • uv run ruff check
  • uv run ruff format --check
  • uv run ty check examples/
  • uv run ty check ionq_core/ examples/
  • uv run python examples/hamiltonian_energy_optimization.py --help

All commands pass locally; pytest reports 100% coverage.

Notes

The example uses a dependency-free coordinate search optimizer to avoid adding runtime dependencies to ionq-core.

Disclosure

Implemented with assistance from OpenAI Codex at my direction.

@CrewRiz CrewRiz requested a review from a team as a code owner June 12, 2026 00:13
@splch

splch commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

Thanks - the best engineering of the field. But the energy lives in results.value, not output (empty on the live API), and the unit test mocks that wrong shape. 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

2 participants