A basis that contains exactly the given qubits in the given order.
Args
fixed_qubits
The qubits in basis order.
fallback
A fallback order to use for extra qubits not in the
fixed_qubits list. Extra qubits will always come after the
fixed_qubits, but will be ordered based on the fallback. If no
fallback is specified, a ValueError is raised when extra qubits
are specified.
Returns
A Basis instance that forces the given qubits in the given order.
Raises
ValueError
If a qubit appears twice in fixed_qubits, or there were is no fallback
specified but there are extra qubits.
Transforms the Basis so that it applies to wrapped qubits.
Args
externalize
Converts an internal qubit understood by the underlying
basis into an external qubit understood by the caller.
internalize
Converts an external qubit understood by the caller
into an internal qubit understood by the underlying basis.
Returns
A basis that transforms qubits understood by the caller into qubits
understood by an underlying basis, uses that to order the qubits,
then wraps the ordered qubits back up for the caller.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-10-08 UTC."],[],[]]