wip(qsystem): multiple platform extensions#1567
Draft
ss2165 wants to merge 21 commits into
Draft
Conversation
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.
Collaborator
|
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:
If the PR contains a breaking change, use You may also include a Expand this message for the full list of tags.
|
65b0cdd to
24f9794
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.