Skip to content

deprecation: change Circuit.to_ir default to OpenQASM, warn on JAQCD#1266

Open
jacofeld wants to merge 2 commits into
mainfrom
deprecation/jaqcd
Open

deprecation: change Circuit.to_ir default to OpenQASM, warn on JAQCD#1266
jacofeld wants to merge 2 commits into
mainfrom
deprecation/jaqcd

Conversation

@jacofeld
Copy link
Copy Markdown
Contributor

@jacofeld jacofeld commented Jun 2, 2026

JAQCD is being deprecated in favor of OpenQASM 3.

Issue #, if available:

Description of changes:

Changed default for Circuit.to_ir to OpenQASM instead of JAQCD. Added a deprecation warning on the local sim for jaqcd programs

Testing done:

Unit tests passing.

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.

@jacofeld jacofeld requested a review from a team as a code owner June 2, 2026 22:52
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (ea3ebb4) to head (36f13f6).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.
@jacofeld jacofeld force-pushed the deprecation/jaqcd branch from 567d23e to a8ef867 Compare June 3, 2026 00:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants