amazon-braket / amazon-braket-sdk-python

A Python SDK for interacting with quantum devices on Amazon Braket
https://aws.amazon.com/braket/
Apache License 2.0
294 stars 118 forks source link

feature: Add delay and barrier for circuits #993

Closed Manvi-Agrawal closed 2 weeks ago

Manvi-Agrawal commented 1 month ago

Issue , if available:

Fixes https://github.com/amazon-braket/amazon-braket-sdk-python/issues/974

Testing done:

OUTPUT

OPENQASM 3.0;
bit[3] b;
qubit[3] q;
barrier q[0], q[1], q[2];
b[0] = measure q[0];
b[1] = measure q[1];
b[2] = measure q[2];
from braket.circuits import Circuit

circ = Circuit().delay([0, 1, 2], 30)

print(circ.to_ir("OPENQASM").source)

OUTPUT

OPENQASM 3.0;
bit[3] b;
qubit[3] q;
delay[30 s] q[0], q[1], q[2];
b[0] = measure q[0];
b[1] = measure q[1];
b[2] = measure q[2];

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

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

Manvi-Agrawal commented 1 month ago

unit tests are currently failing in CI,

Fixed. that was because I renamed a class using refactor->rename but in test framework we need to provide value as strings too.

codecov[bot] commented 3 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 100.00%. Comparing base (90f9395) to head (ebc96f0).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #993 +/- ## ========================================= Coverage 100.00% 100.00% ========================================= Files 135 136 +1 Lines 8949 9038 +89 Branches 2011 2029 +18 ========================================= + Hits 8949 9038 +89 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

rmshaffer commented 2 weeks ago

Hi @Manvi-Agrawal - we still have 2 days to wrap up unitaryHACK PRs and get them merged. Are you going to be able to address the open comments on this PR? Please let us know so that we know how to proceed with this. Thank you!

Manvi-Agrawal commented 2 weeks ago

Hi @rmshaffer , actually I wouldnt be able to get to this issue until a couple of weeks due to personal commitments. I am happy to take a look at the open comments after that, even if it doesn't count as progress towards Unitary Hack, if it's not a time pressing issue.

Thank you for all your help with this issue and review so far. Past week had been a bit crazy due to finals and other stuff for quarter wrap up.

rmshaffer commented 2 weeks ago

@Manvi-Agrawal thank you for all of your work on this PR! We are going to merge the PR into a feature branch and close the unitaryHACK issue to ensure that you get credit for your work. We will then open a new PR to finish the remaining work for merging to main.