2.7: Migrate swapup_linear_qubit, swapup_linear_register, swapup_linear to the modifier API
Maintainers usually reply within 2 days
Assessment
This issue has not been assessed yet.
Description
Goal
Migrate swap networks to the public control/dagger API. Target swapup_linear_qubit, swapup_linear_register, swapup_linear, including their existing inverse/controlled variants, nested generated circuits and affected callers.
Part of Functions: Control and dagger migration plan — item 2.7. Milestone: Modifier Refactor.
Dependencies
- 1.6 — Swap and phase primitives: #166 (phase/cphase portion); swap work is in PR #138, which has no linked closing issue. Verify the swap capabilities needed here independently.
Plan dependency details: 1.6. Earlier-layer prerequisites must supply the capabilities this package uses. A linked issue or PR alone does not establish that its implementation is ready; check merged behavior and recorded blockers first.
Expected behavior
Callers use the forward public operation normally, with dagger for its adjoint, with control(external_controls) for additional controls, and both modifiers for controlled dagger wherever those capabilities are valid. Preserve natural signatures, register ownership, optimized decompositions and coherent relative phases.
Preserve swap-network direction, register positions and optimized decomposition. A dagger must reverse operation order, not simply repeat the same traversal.
Implementation guidance
Start by inspecting:
guppyalgos/primitives/subroutines/swap/swapup.py
- Read the repository instructions, related tests and examples. Search all target names across
guppyalgos,tests,examplesanddocs; recheck paths and renamed APIs on the implementation branch. - Inventory domains, variants, loops, measurements and callbacks. Prefer automatic modifier generation where supported. Preserve useful optimized kernels privately; supply validated custom paths where generation is unavailable.
- Reuse
MultiCntrlFunctionorMultiCntrlFunctionParamswhen appropriate, with an exact CNX kernel. Preserve and restore packed targets and borrowed controls. Avoid duplicated conjunction logic and dependency cycles. - Migrate callers, imports/exports, callback annotations, factory return types, tests and documentation together. Replace explicit inverse/control variants with public modifiers where their contracts match; preserve meaningful operations and promised cleanup.
Acceptance criteria
- All valid advertised public modes compile; unsupported compiler or semantic combinations have explicit recorded blockers.
- Existing circuit behavior, relative phases, input domains and register ownership are preserved.
- Affected callers and generated circuits use public modifiers, with no unintended private-kernel bypass or stale inverse/control alias.
- Existing correctness coverage runs through the public API.
- Small custom modifier paths use
assert_unitary_modifierswith an independent expected unitary and its adjoint. Round trips alone are insufficient. - Custom control covers active, inactive and coherent branches with a single overall phase alignment; custom multi-control/packing paths have representative integration coverage and restore workspace.
- Promised-input or measurement routines have specialized domain/coherence/cleanup tests where applicable.
- Changes to gate count, depth or ancilla use are explained; unresolved contracts are documented.
Validation
Run uv run pytest <affected test paths> -q for the relevant modules and consumers, then prek. Execute affected notebooks sequentially and build documentation if changed. Record the exact commands and results in the PR.
Use existing shared testing helpers from public main. Do not duplicate compiler coverage for wholly generated modifiers or repeat the full adapter suite for every circuit. Public struct modifier migration and classical/container utilities remain outside this package, except for required circuit-caller updates.
- Dominant language
- Python
- Stars
- 12
- Forks
- 1
- Avg merge
- 3d 1h
- Merged PRs (30d)
- 19
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Quantinuum/guppyalgos
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Quantinuum/guppyalgos#233 ·
Maintainers usually reply within 2 days
-
Add lint rules for importsPossibly taken @Walden-Killick claimed this 11 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Quantinuum/guppyalgos#224 ·
Maintainers usually reply within 2 days
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
Quantinuum/guppyalgos#239 · 1 comment ·
Maintainers usually reply within 2 days
-
Add unitary modifiers to `Ladder` protocol and implementorsPossibly taken @GBoydQ claimed this 4 days ago. Open
Difficulty 4/5 3-5 days Newbie friendliness 20/100
Quantinuum/guppyalgos#237 ·
Maintainers usually reply within 2 days
-
Difficulty 3/5 Half a day Newbie friendliness 35/100
Quantinuum/guppyalgos#223 ·
Maintainers usually reply within 2 days
All issues in Quantinuum/guppyalgos
Similar issues
-
soup prune-prompt exits 1 after writing its output on a file over 100,000 rows, and reports a capped row count otherwisePossibly taken @abdulwaarith0 claimed this today. Openneeds-triage
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
MakazhanAlpamys/Soup#3690 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug data-types native-format
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
ClickHouse/clickhouse-connect#1320 ·
Maintainers usually reply within 1 day
-
accepted
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
future-agi/future-agi#6392 ·
Maintainers usually reply within 1 day