Skip to content

Conversation

@albi3ro
Copy link
Contributor

@albi3ro albi3ro commented Aug 27, 2025

Context:

There was confusion around code like:

with allocate(1) as reg:
    qml.CNOT((0, reg))

which lead to a wire being a DynamicRegister, rather than the DynamicWire inside it.

Description of the Change:

Makes DynamicRegister unhashable so that scenario cannot occur.

Benefits:

Reduced confusion.

Possible Drawbacks:

Related GitHub Issues:

[sc-98352]

@codecov
Copy link

codecov bot commented Aug 27, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.68%. Comparing base (71763f7) to head (5cf2aed).
⚠️ Report is 4 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #8151   +/-   ##
=======================================
  Coverage   99.68%   99.68%           
=======================================
  Files         548      548           
  Lines       56749    56751    +2     
=======================================
+ Hits        56573    56575    +2     
  Misses        176      176           

☔ 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.

Copy link
Contributor

@dwierichs dwierichs left a comment

Choose a reason for hiding this comment

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

Nice QoL improvement, thanks @albi3ro :)

@albi3ro albi3ro enabled auto-merge August 28, 2025 19:35
@albi3ro albi3ro added this pull request to the merge queue Aug 28, 2025
Merged via the queue into master with commit 10596bb Aug 28, 2025
52 checks passed
@albi3ro albi3ro deleted the dynamic-reg-not-wire branch August 28, 2025 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants