Skip to content

Comments

qBraid SDK migration#49

Merged
TheGupta2012 merged 11 commits intomainfrom
qbraid-sdk-integration
Oct 30, 2024
Merged

qBraid SDK migration#49
TheGupta2012 merged 11 commits intomainfrom
qbraid-sdk-integration

Conversation

@TheGupta2012
Copy link
Member

@TheGupta2012 TheGupta2012 commented Oct 24, 2024

Fixes #12
Fixes #50

Summary of changes

This PR is a WIP and part of a larger integration with qBraid-sdk. Commits and changes are done as and when new requirements are discovered when adding pyqasm to the sdk

  • transpiler/conversions/qasm2/qasm2_to_cirq.py: Cirq expects qasm version strings as x.0 and string literals as ' instead of ". Thus, need to update that in module initialization
  • tests/passes/test_qasm2_compat.py: Migrate to pyqasm/tests/qasm2/test_rotation_gates.py
  • Change module structure according to [FEATURE] pyqasm.Module: loads, dumps, and in-place operations for improved UX #50
  • passes/qasm/analyze.py::has_measurements: Migrate to QasmModule.has_measurements
  • passes/qasm/compat.py::remove_measurements: Migrate as QasmModule.remove_measurements()
  • Add remove_barriers() method to the QasmModule
  • passes/qasm/analyse::depth: Replace with the QasmModule.depth() method. Since the visitor object was already doing the unrolling, calculation of depth was coupled with its analysis.
  • Migrated depth tests from qbraid-sdk to pyqasm

Details of Tests migrated

  1. remove_measurements : [1]
  2. depth : [1] [2] [3] [4] [5]
  3. To remove tests/passes/test_qasm2_compat.py by replacing with unroll

@TheGupta2012 TheGupta2012 changed the title qBraid SDK integration qBraid SDK migration Oct 24, 2024
@TheGupta2012 TheGupta2012 marked this pull request as ready for review October 25, 2024 09:25
@codecov-commenter
Copy link

codecov-commenter commented Oct 25, 2024

Codecov Report

Attention: Patch coverage is 93.85113% with 19 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
pyqasm/modules.py 91.89% 15 Missing ⚠️
pyqasm/elements.py 88.23% 4 Missing ⚠️

📢 Thoughts on this report? Let us know!

@TheGupta2012
Copy link
Member Author

Closing this PR with current changes, have opened issues #53 - #57 for continuing work on the migration

@TheGupta2012 TheGupta2012 merged commit 9ff996f into main Oct 30, 2024
@TheGupta2012 TheGupta2012 deleted the qbraid-sdk-integration branch April 15, 2025 14:37
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.

[FEATURE] pyqasm.Module: loads, dumps, and in-place operations for improved UX qBraid-SDK migrations

2 participants