deprecation: change Circuit.to_ir default to OpenQASM, warn on JAQCD#1266
Open
jacofeld wants to merge 2 commits into
Open
deprecation: change Circuit.to_ir default to OpenQASM, warn on JAQCD#1266jacofeld wants to merge 2 commits into
jacofeld wants to merge 2 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1266 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 169 169
Lines 10963 10962 -1
Branches 1412 1411 -1
=========================================
- Hits 10963 10962 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
JAQCD is being retired in favor of OpenQASM 3.
Changes:
* src/braket/circuits/circuit.py: change Circuit.to_ir default ir_type
from IRType.JAQCD to IRType.OPENQASM. When ir_type=IRType.JAQCD is
passed explicitly, emit a UserWarning ("The JAQCD action type is
deprecated. Please use OpenQASM 3 programs instead.").
* src/braket/devices/local_simulator.py: remove the JAQCD-fallback
branch in LocalSimulator._construct_payload. Customers running a
Circuit on a local simulator that advertises only JAQCD now get the
same NotImplementedError as any other unsupported simulator.
The default flip is safe for internal callers: aws_quantum_task.py and
local_simulator.py already pass ir_type explicitly. AwsDevice has no
JAQCD code path — aws_quantum_task.py always submits OpenQASM, and
JaqcdProgram is not in the TaskSpecification union.
Test changes:
* test/unit_tests/braket/circuits/test_circuit.py: existing
test_ir_*_instructions_result_types tests and the
test_barrier_jaqcd_export_fails test now wrap
pytest.warns(UserWarning, match="JAQCD") since they exercise the
JAQCD conversion path. Added test_to_ir_default_is_openqasm to
assert the new default.
* test/unit_tests/braket/devices/test_local_simulator.py:
test_run_jaqcd_only renamed to test_run_jaqcd_only_raises and now
asserts NotImplementedError, since the JAQCD-only fallback branch
has been removed.
UserWarning (not DeprecationWarning) is used deliberately: PEP 565's
default filter hides DeprecationWarning from any code attributed
outside __main__, which would silently hide the warning from
customer code that calls Braket from a helper function or library.
UserWarning is visible by default, and matches every existing
warnings.warn call site in this package.
567d23e to
a8ef867
Compare
speller26
approved these changes
Jun 3, 2026
Open
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
JAQCD is being deprecated in favor of OpenQASM 3.
Issue #, if available:
Description of changes:
Changed default for
Circuit.to_irto OpenQASM instead of JAQCD. Added a deprecation warning on the local sim for jaqcd programsTesting done:
Unit tests passing.
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.