Skip to content

Conversation

@DSGuala
Copy link
Contributor

@DSGuala DSGuala commented Dec 11, 2025

Context:
The current circuit conversion inserts a barrier between the tape.operations and the terminal measurements when converting a PL circuit to a Qiskit circuit. Some devices don't support barrier, and as far as we can see, it isn't technically necessary.

Description of the Change:
This PR removes a line in circuit_to_qiskit that added a barrier between a circuit's gates and measurements.

Also the new version of black has added some extra whitespace etc. There are only 4 lines of actual changes.

Benefits:
Allows devices like Azure that don't include barrier support to work with the Remote device.

Possible Drawbacks:
We aren't aware of anything that was dependent on the barrier, and removing it doesn't cause any tests to fail, but it's not impossible that some device somewhere was expecting it to be there. We can cross that bridge if we come to it.

Related GitHub Issues:
PennyLaneAI/pennylane#8657

[sc-104090]

@DSGuala DSGuala added the bug Something isn't working label Dec 11, 2025
@DSGuala DSGuala requested a review from lillian542 January 15, 2026 18:03
@lillian542 lillian542 removed their request for review January 22, 2026 15:21
@codecov
Copy link

codecov bot commented Jan 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (22c6d16) to head (0f2ee7f).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #677   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            9         9           
  Lines          862       861    -1     
=========================================
- Hits           862       861    -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.

@JerryChen97
Copy link
Contributor

JerryChen97 commented Jan 22, 2026

Probably need to explicitly fmt the tests by black -t py311 -t py312 -t py313 -l 100 tests/

Comment on lines -715 to -716
# barrier ensures we first do all operations, then do all measurements
qc.barrier(reg)
Copy link
Contributor

@lillian542 lillian542 Jan 22, 2026

Choose a reason for hiding this comment

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

This and the related changes in tests/test_converter.py is the actual change. Everything else is black formatting.

Copy link
Contributor

@JerryChen97 JerryChen97 left a comment

Choose a reason for hiding this comment

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

Actually, mind adding a changelog? @DSGuala @lillian542

Copy link
Contributor

@JerryChen97 JerryChen97 left a comment

Choose a reason for hiding this comment

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

LGTM!

@lillian542 lillian542 merged commit 4076063 into master Jan 22, 2026
11 checks passed
@lillian542 lillian542 deleted the skip-barrier branch January 22, 2026 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants