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

[fix] Update AutoQASM to consume qubit types from braket.registers module #771

Merged
merged 1 commit into from
Oct 31, 2023

Conversation

rmshaffer
Copy link
Contributor

@rmshaffer rmshaffer commented Oct 30, 2023

Issue #, if available:

Description of changes:

  • Support the Qubit and QubitSet types from the braket.registers module.
  • Additional minor cleanup.

Testing done:

  • tox passes.

Merge Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your pull request.

General

Tests

  • I have added tests that prove my fix is effective or that my feature works (if appropriate)
  • I have checked that my tests are not configured for a specific region or account (if appropriate)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@rmshaffer rmshaffer changed the title Use qubit types from braket.registers module [fix] Update AutoQASM to consume qubit types from braket.registers module Oct 30, 2023
@rmshaffer rmshaffer self-assigned this Oct 30, 2023
@codecov
Copy link

codecov bot commented Oct 30, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (5459174) 100.00% compared to head (517216c) 100.00%.

Additional details and impacted files
@@                Coverage Diff                 @@
##           feature/autoqasm      #771   +/-   ##
==================================================
  Coverage            100.00%   100.00%           
==================================================
  Files                   163       163           
  Lines                  9758      9759    +1     
  Branches               2080      2080           
==================================================
+ Hits                   9758      9759    +1     
Files Coverage Δ
...raket/experimental/autoqasm/instructions/qubits.py 100.00% <100.00%> (ø)
src/braket/experimental/autoqasm/pulse/pulse.py 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

# a hard-coded global qubit register.
return f"{constants.QUBIT_REGISTER}[{qubit_idx_expr}]"
def _global_qubit_register(qubit_idx_expr: Union[int, str]) -> oqpy.Qubit:
return oqpy.Qubit(f"{constants.QUBIT_REGISTER}[{qubit_idx_expr}]", needs_declaration=False)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed the "TODO" comment because the oqpy qubit register is not actually created/declared at this point (that happens near the end of the program creation process), and I don't think there's a better way to index into it than what we're doing here.

@rmshaffer rmshaffer marked this pull request as ready for review October 31, 2023 15:07
@rmshaffer rmshaffer requested a review from a team as a code owner October 31, 2023 15:07
@rmshaffer rmshaffer merged commit 53ea006 into feature/autoqasm Oct 31, 2023
22 checks passed
@rmshaffer rmshaffer deleted the rmshaffer/autoqasm-qubit-type-import branch October 31, 2023 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants