Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

switch implementation for qasm3-qir #126

Merged
merged 5 commits into from
Jul 31, 2024
Merged

switch implementation for qasm3-qir #126

merged 5 commits into from
Jul 31, 2024

Conversation

TheGupta2012
Copy link
Member

@TheGupta2012 TheGupta2012 commented Jul 29, 2024

Fixes #80

Changes

  • Added handler for switch case in openqasm according to the official reference.
  • Also made some tweaks to the handling of array indexing
  • Still a WIP , following tasks are left -
    • Handle type checking for target
    • Check for unsupported statements
    • Ensure expressions are const int expressions
    • Add more unit tests

Copy link

codecov bot commented Jul 29, 2024

Codecov Report

Attention: Patch coverage is 95.19231% with 5 lines in your changes missing coverage. Please review.

Files Patch % Lines
qbraid_qir/qasm3/visitor.py 95.14% 5 Missing ⚠️

📢 Thoughts on this report? Let us know!

@TheGupta2012 TheGupta2012 changed the title Initial switch implementation switch implementation for qasm3-qir Jul 30, 2024
@TheGupta2012
Copy link
Member Author

Hi @ryanhill1 , the code coverage is tracking some lines which do not yet have active use.

I added the functionality for reqd_type in expression just for the IntType check in switch. I thought we should have the check for all types for any future updates. Since other constructs don't yet require this, we don't have examples to test against.

@TheGupta2012 TheGupta2012 requested a review from ryanhill1 July 31, 2024 08:22
@ryanhill1 ryanhill1 merged commit 20479db into main Jul 31, 2024
7 of 8 checks passed
@ryanhill1 ryanhill1 deleted the develop-switch branch October 18, 2024 23:42
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 support for switch statements in qasm3_to_qir converter
2 participants