feature: add barrier instruction support#108
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #108 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 52 52
Lines 2279 2289 +10
Branches 266 265 -1
=========================================
+ Hits 2279 2289 +10 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| def _as_qubit_iterable( | ||
| qubits: aq_types.QubitIdentifierType | Iterable[aq_types.QubitIdentifierType] | None, | ||
| default: Iterable[aq_types.QubitIdentifierType] | None = None, | ||
| ) -> Iterable[aq_types.QubitIdentifierType]: |
There was a problem hiding this comment.
Nit: Since _as_qubit_iterable
can return a list or a GlobalQubitRegister, the return type is correct but could be more precise with Iterable[...] | GlobalQubitRegister
There was a problem hiding this comment.
GlobalQubitRegister is already a Iterable[aq_types.QubitIdentifierType], and the caller should only care that what comes back is an Iterable[aq_types.QubitIdentifierType]. I think the extra type hint would be redundant here.
However in general it's confusing that GlobalQubitRegister is both an oqpy.Qubit and an Iterable of qubits - leaking a bit of oqpy abstractions through here, will look for a way to clean this up.
There was a problem hiding this comment.
opened #110 to clean up the qubit-related types.
Issue #, if available:
Description of changes:
Adds a
barrier()instruction so that AutoQASM programs can emit OpenQASMbarriercompiler directives, matching the Braket SDK'sCircuit.barrier()instruction.Testing done:
Merge Checklist
Put an
xin 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.