Skip to content

Conversation

velocityraptor7085
Copy link
Contributor

@velocityraptor7085 velocityraptor7085 commented Jun 11, 2025

Summary

Details and comments

The approach used includes the following changes:

  • Defining a CIRCUIT_TABLE_ENTRY_PACK and CIRCUIT_TABLE_ENTRY_SIZE to represent an uint64_t (in the formats.py file).
  • Bumping the QPY_VERSION to 16 (in common.py).
  • Modifying the dump function to do the following (if the version is >= 16):
    1. Skip past number_of_circuits * CIRCUIT_TABLE_ENTRY_SIZE bytes initially.
    2. Append the byte_offsets for each circuit before serializing them (via binary_io.write_circuit()).
    3. Seek back and write the byte_offsets for each circuit after serializing every circuit.
  • Modifying the load function to do the following (if the version is >= 16):
    1. Obtain the program_offsets after reading the header.
    2. Seek to the start of each circuit in a sequential manner (this would happen in a multithreaded manner in the future) and deserialize them (via binary_io.read_circuit()).

@velocityraptor7085 velocityraptor7085 requested a review from a team as a code owner June 11, 2025 06:53
@qiskit-bot qiskit-bot added the Community PR PRs from contributors that are not 'members' of the Qiskit repo label Jun 11, 2025
@qiskit-bot
Copy link
Collaborator

Thank you for opening a new pull request.

Before your PR can be merged it will first need to pass continuous integration tests and be reviewed. Sometimes the review process can be slow, so please be patient.

While you're waiting, please feel free to review other open PRs. While only a subset of people are authorized to approve pull requests for merging, everyone is encouraged to review open pull requests. Doing reviews helps reduce the burden on the core team and helps make the project's code better for everyone.

One or more of the following people are relevant to this code:

  • @Qiskit/terra-core
  • @mtreinish
  • @nkanazawa1989

@coveralls
Copy link

coveralls commented Jun 11, 2025

Pull Request Test Coverage Report for Build 15735763409

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 23 of 23 (100.0%) changed or added relevant lines in 3 files are covered.
  • 957 unchanged lines in 25 files lost coverage.
  • Overall coverage increased (+0.02%) to 88.009%

Files with Coverage Reduction New Missed Lines %
crates/qasm2/src/expr.rs 1 94.23%
qiskit/circuit/_classical_resource_map.py 1 75.0%
crates/transpiler/src/passes/elide_permutations.rs 2 96.88%
qiskit/circuit/annotation.py 2 95.56%
qiskit/circuit/library/pauli_evolution.py 2 96.88%
qiskit/circuit/library/quantum_volume.py 2 95.74%
qiskit/circuit/library/phase_oracle.py 4 86.67%
crates/circuit/src/lib.rs 6 95.0%
qiskit/circuit/library/arithmetic/linear_amplitude_function.py 6 92.45%
qiskit/providers/backend.py 6 91.43%
Totals Coverage Status
Change from base Build 15535109536: 0.02%
Covered Lines: 83688
Relevant Lines: 95090

💛 - Coveralls

Copy link
Contributor

@kevinhartman kevinhartman left a comment

Choose a reason for hiding this comment

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

Looks good, thanks for doing this work!

Can you also update the format description in qiskit/qpy/__init__.py?

@velocityraptor7085
Copy link
Contributor Author

Thank you @kevinhartman for the suggestions.
Please let me know if the changes are good to go.

Copy link
Contributor

@kevinhartman kevinhartman left a comment

Choose a reason for hiding this comment

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

Looks good, just a few more small comments.

velocityraptor7085 and others added 4 commits June 13, 2025 11:03
Co-authored-by: Kevin Hartman <kevin@hart.mn>
Co-authored-by: Kevin Hartman <kevin@hart.mn>
@velocityraptor7085
Copy link
Contributor Author

Thanks a lot @kevinhartman. Please let me know if any other changes are required from my end 🙂.

Copy link
Contributor

@kevinhartman kevinhartman left a comment

Choose a reason for hiding this comment

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

Just a few minor suggestions/tweaks.

velocityraptor7085 and others added 3 commits June 17, 2025 08:35
Co-authored-by: Kevin Hartman <kevin@hart.mn>
Co-authored-by: Kevin Hartman <kevin@hart.mn>
Co-authored-by: Kevin Hartman <kevin@hart.mn>
@velocityraptor7085
Copy link
Contributor Author

Thank you so much @kevinhartman for all of your suggestions.

@raynelfss raynelfss added Intern PR PR submitted by IBM Quantum interns and removed Community PR PRs from contributors that are not 'members' of the Qiskit repo labels Jun 17, 2025
Copy link
Contributor

@kevinhartman kevinhartman left a comment

Choose a reason for hiding this comment

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

This looks good to me.

Thanks for working on this and for the updates, @velocityraptor7085!

@kevinhartman kevinhartman added this pull request to the merge queue Jun 24, 2025
Merged via the queue into Qiskit:main with commit f59779d Jun 24, 2025
26 checks passed
@1ucian0 1ucian0 added the Changelog: New Feature Include in the "Added" section of the changelog label Jul 7, 2025
@jakelishman jakelishman added this to the 2.2.0 milestone Jul 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: New Feature Include in the "Added" section of the changelog Intern PR PR submitted by IBM Quantum interns
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Add circuit start table to QPY file header
7 participants