Skip to content

feat: Mark unitary qsystem gates with unitary=True - #2152

Draft
nicolaassolini-qntm wants to merge 1 commit into
mainfrom
na/qsystem-unitary-gates
Draft

nicolaassolini-qntm wants to merge 1 commit into
mainfrom
na/qsystem-unitary-gates

Conversation

@nicolaassolini-qntm

@nicolaassolini-qntm nicolaassolini-qntm commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Flags the unitary gate operations in both platform modules as unitary:

  • Helios (helios/__init__.py): phased_x, zz_phase, zz_max, rz
  • Sol (sol/__init__.py): phased_x, phased_xx, phased_xx_max, xx_max, yy_max, rz

Flag the Helios and Sol single- and two-qubit gate primitives as unitary so
they can be used inside `control` and `dagger` modifier blocks. The internal
hugr ops backing them are given `unitary_flags=UnitaryFlags.Unitary` so the
public guppy wrappers pass unitary checking.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Projectguppylang
Branchna/qsystem-unitary-gates
TestbedLinux
Click to view all benchmark results
Benchmarkhugr_bytesBenchmark Result
bytes x 1e3
(Result Δ%)
Upper Boundary
bytes x 1e3
(Limit %)
hugr_nodesBenchmark Result
nodes
(Result Δ%)
Upper Boundary
nodes
(Limit %)
tests/benchmarks/test_big_array.py::test_big_array_compile📈 view plot
🚷 view threshold
62.10 x 1e3
(0.00%)Baseline: 62.10 x 1e3
62.72 x 1e3
(99.01%)
📈 view plot
🚷 view threshold
4,585.00
(0.00%)Baseline: 4,585.00
4,630.85
(99.01%)
tests/benchmarks/test_ctrl_flow.py::test_many_ctrl_flow_compile📈 view plot
🚷 view threshold
27.83 x 1e3
(0.00%)Baseline: 27.83 x 1e3
28.11 x 1e3
(99.01%)
📈 view plot
🚷 view threshold
1,301.00
(0.00%)Baseline: 1,301.00
1,314.01
(99.01%)
tests/benchmarks/test_queue_push_pop.py::test_queue_push_benchmark_compile📈 view plot
🚷 view threshold
7.25 x 1e3
(0.00%)Baseline: 7.25 x 1e3
7.32 x 1e3
(99.01%)
📈 view plot
🚷 view threshold
310.00
(0.00%)Baseline: 310.00
313.10
(99.01%)
tests/benchmarks/test_queue_push_pop.py::test_queue_push_pop_benchmark_compile📈 view plot
🚷 view threshold
9.91 x 1e3
(0.00%)Baseline: 9.91 x 1e3
10.01 x 1e3
(99.01%)
📈 view plot
🚷 view threshold
411.00
(0.00%)Baseline: 411.00
415.11
(99.01%)
🐰 View full continuous benchmarking report in Bencher

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.30%. Comparing base (cebd1af) to head (8644326).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2152   +/-   ##
=======================================
  Coverage   93.30%   93.30%           
=======================================
  Files         154      154           
  Lines       14866    14868    +2     
=======================================
+ Hits        13871    13873    +2     
  Misses        995      995           

☔ View full report in Codecov by Harness.
📢 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.

@codspeed-hq

codspeed-hq Bot commented Aug 3, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 11 untouched benchmarks


Comparing na/qsystem-unitary-gates (8644326) with main (cebd1af)

Open in CodSpeed

@nicolaassolini-qntm

Copy link
Copy Markdown
Contributor Author

We should wait for Quantinuum/tket2#1905 before completing this PR

zz_phase(q1, q2, a)
zz_max(q1, q2)

use_dagger.check()

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

change this when the tket2 passes are ready

@nicolaassolini-qntm nicolaassolini-qntm added this to the guppylang v1.x milestone Aug 3, 2026
@maximilianruesch maximilianruesch removed this from the guppylang v1.1 milestone Aug 27, 2026
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.

3 participants