bloqade.gemini.common.dialects.arrange.permute
← Module overview
function
source
functionpermute¶source
bloqade.gemini.common.dialects.arrange.permute
def permute(qubits, perm, insert_moves=False) -> NonePermute qubits — a logical relabel where qubits[i] ends up referring
to what was qubits[perm[i]].
perm must be a compile-time-constant permutation of range(len(qubits)).
insert_moves (compile-time constant) selects how the permutation is
realized:
False(default): relabel only — no atoms move; the qubit references are permuted (the quantum information is permuted for free). A later transversal move absorbs the physical permutation (a “lazy” permutation). Valid under any strategy, including palindrome.True: also commit the moves — physically route the atoms so the permutation is realized in place now (e.g. to keep a QEC code block physically arranged to match the new labels). Only valid under a non-palindrome (no-return) strategy;PalindromePlacementStrategyrejects it, since it would return the committed moves home.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
qubits | — | required | |
perm | — | required | |
insert_moves | — | False |