Skip to content

docs: add Qiskit code validation IVR example#576

Draft
ajbozarth wants to merge 2 commits intogenerative-computing:mainfrom
ajbozarth:feat/qiskit-code-validation-example
Draft

docs: add Qiskit code validation IVR example#576
ajbozarth wants to merge 2 commits intogenerative-computing:mainfrom
ajbozarth:feat/qiskit-code-validation-example

Conversation

@ajbozarth
Copy link
Contributor

@ajbozarth ajbozarth commented Mar 4, 2026

Misc PR

Type of PR

  • Bug Fix
  • New Feature
  • Documentation
  • Other

Description

Add comprehensive example demonstrating Instruct-Validate-Repair patternfor Qiskit quantum computing code generation with external validation.

Features:

  • Pre-condition validation (prompt and input code)
  • Post-condition validation using flake8-qiskit-migration
  • Automatic repair loop with detailed error feedback
  • Code extraction from markdown blocks
  • Real-world use case: fixing deprecated Qiskit APIs

Updated README with example description and requirements.

Testing

  • Tests added to the respective file if code was changed
  • New code has 100% coverage if code as added
  • Ensure existing tests and github automation passes (a maintainer will kick off the github automation when the rest of the PR is populated)

@ajbozarth ajbozarth self-assigned this Mar 4, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 4, 2026

The PR description has been updated. Please fill out the template for your PR to be reviewed.

@mergify
Copy link

mergify bot commented Mar 4, 2026

Merge Protections

Your pull request matches the following merge protections and will not be merged until they are valid.

🟢 Enforce conventional commit

Wonderful, this rule succeeded.

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert|release)(?:\(.+\))?:

@ajbozarth
Copy link
Contributor Author

This is a work in progress example that I adapted from a notebook by @vabarbosa

We are still in the process of optimizing it, currently all the example prompts succeed on the two larger models, but when run on the small model they only success occasionally with a higher loop budget.

@ajbozarth ajbozarth requested a review from psschwei March 5, 2026 01:00
ajbozarth and others added 2 commits March 4, 2026 19:19
Add comprehensive example demonstrating Instruct-Validate-Repair pattern
for Qiskit quantum computing code generation with external validation.

Features:
- Pre-condition validation (prompt and input code)
- Post-condition validation using flake8-qiskit-migration
- Automatic repair loop with detailed error feedback
- Code extraction from markdown blocks
- Real-world use case: fixing deprecated Qiskit APIs

Updated README with example description and requirements.

Co-authored-by: va <va@us.ibm.com>
Signed-off-by: Alex Bozarth <ajbozart@us.ibm.com>
Signed-off-by: Alex Bozarth <ajbozart@us.ibm.com>
@ajbozarth ajbozarth force-pushed the feat/qiskit-code-validation-example branch from 222c2bb to 44e7b5a Compare March 5, 2026 01:20
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.

1 participant