Skip to content

wip(qsystem): multiple platform extensions#1567

Draft
ss2165 wants to merge 21 commits into
mainfrom
ss/push-xxonxqrlptsq
Draft

wip(qsystem): multiple platform extensions#1567
ss2165 wants to merge 21 commits into
mainfrom
ss/push-xxonxqrlptsq

Conversation

@ss2165
Copy link
Copy Markdown
Member

@ss2165 ss2165 commented May 5, 2026

No description provided.

jake-arkinstall and others added 19 commits April 15, 2026 13:32
Disambiguate helios and sol during rebasing, rename N2PhasedX -> TwinPhasedX

Correct descriptions after the reintroduction of the rz gate

Format + rust test fixups

Rebase + document QSystemCodegenExtension::new

Rename python testing of unimplemented sol features and change from pytest.raises to xfail

Ruff format

Remove redundant variable setting in xfail test

Add unimplemented two-qubit operations for sol gateset (#1377)

[decompositions.py](https://github.com/user-attachments/files/24907896/decompositions.py)
Constructions should be as in attached python.

---------

Co-authored-by: Jake Arkinstall <65358059+jake-arkinstall@users.noreply.github.com>

Add missing maximally entangling XXPhase

Update ZZPhase and ZZMax

Correct output wire indexing for 2q sol gates, correct some typos in gate rebasing, add QFT test

Correct add_phased_xx

Apply requested changes, add addition test
- include deprecated tket.qsystem alias for helios
- regenerate extensions
- comment out sol ops in pytket and llvm for now
Parametrise qis-compiler snapshot tests over both 'helios' and 'sol' platforms
(previously only helios was exercised).

Changes:
- Expose 'platform' and 'target_triple' kwargs in the Python .pyi stubs for
  compile_to_llvm_ir / compile_to_bitcode (the Rust signatures already had them).
- Add 'platforms = ["helios", "sol"]' and @parametrize("platform", platforms)
  to test_basic_generation.py::test_llvm; snapshot keys gain a platform suffix
  ({hugr_file}_{target_triple}_{platform}).
- Old platform-less snapshot files deleted.
- Remove residual '# type: ignore[call-arg]' comments from both test files now
  that the stubs are correct.

Expected diff between helios and sol snapshots
-----------------------------------------------
All differences are mechanical consequences of each platform's native gate set:

1. Single-qubit gate name: PhasedX maps to ___rxy on Helios and ___rp on Sol.

2. Two-qubit gate rewriting (rus.hugr, postselect_*.hugr, measure_qb_array.hugr):
   The QSystemPass rewrites tket.quantum gates (cx, h, t, ...) into platform-native
   qsystem gates before LLVM codegen.
   - Helios: cx -> ZZPhase + PhasedX  ->  calls to @___rzz + @___rxy
   - Sol:    cx -> PhasedXX           ->  calls to @___rpp + @___rp
   The control-flow structure is identical; only the runtime-function names and
   the platform string embedded in hugr-llvm's mangled inner-function labels
   ('__tk2_helios_' vs '__tk2_sol_') differ.

3. No differences in discard_qb_array, print_current_shot, rng — these circuits
   contain no 2Q gates and no PhasedX, so codegen is platform-independent.
@hugrbot
Copy link
Copy Markdown
Collaborator

hugrbot commented May 5, 2026

Hey there and thank you for opening this pull request! 👋

We follow the Conventional Commits convention for PR titles. It looks like your title needs some adjustment.

The title should have a type prefix, followed by a colon. The most important ones are:

  • feat: for new features
  • fix: for bug fixes

If the PR contains a breaking change, use feat!: or fix!: instead and include a "BREAKING CHANGE:" footer in the description of the pull request.

You may also include a (scope) after the type prefix.

Expand this message for the full list of tags.
  • feat: New feature
  • fix: Bug fix
  • docs: Documentation-only changes
  • style: Changes that do not affect the meaning of the code (white-space, formatting, missing semicolons, etc)
  • refactor: A code change that neither fixes a bug nor adds a feature
  • perf: Performance improvements
  • test: Adding missing or correcting existing tests
  • ci: Changes to our CI configuration files and scripts
  • chore: Other changes that do not alter public APIs or code behaviour
  • revert: Reverts a previous commit

@ss2165 ss2165 force-pushed the ss/push-xxonxqrlptsq branch from 65b0cdd to 24f9794 Compare May 8, 2026 18:05
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