Skip to content

Refactoring API structure #19

New issue

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

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

Already on GitHub? # to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Refactoring API structure #19

wants to merge 2 commits into from

Conversation

d1ssk
Copy link
Contributor

@d1ssk d1ssk commented Mar 31, 2025

Before submitting, please check the following:

  • Make sure you have tests for the new code and that test passes (run tox)
  • format added code by black -l 120 <filename>
  • If applicable, add a line to the [unreleased] part of CHANGELOG.md, following keep-a-changelog.

Then, please fill in below:

Context (if applicable):
This PR aligns with the refactored backend interface structure introduced in graphix PR /#261

Description of the change:

  • Implemented IBMQBackend, a concrete subclass of graphix.interface.MBQCBackend
  • Implemented IBMQJobHandler as a subclass of graphix.interface.JobHandler
  • Refactored and separated concerns:
    • compiler.py: converts Pattern to QuantumCircuit
    • executor.py: handles both real hardware execution and Aer simulation
    • job_handler.py: manages job status and ID
    • result_utils.py: extracts and formats output from raw IBMQ results
    • compile_options.py: defines IBMQCompileOptions dataclass for type-safe parameter handling
  • backend.py: orchestrates the entire workflow from compile → submit → retrieve

Related issue:

also see that checks (github actions) pass.
If lint check keeps failing, try installing black==22.8.0 as behavior seems to vary across versions.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant