Skip to main content
Functions:

unary_select

unary_select(
unitaries: QCallableList,
selector: Const[QNum]
) -> None
[Qmod Classiq-library function] Implements an unconditional SELECT oracle using unary iteration (Babbush et al., arXiv:1805.03662, Section III.A). The operation maps: ∣ℓ⟩∣ψ⟩→∣ℓ⟩ Uℓ ∣ψ⟩|\ell\rangle|\psi\rangle \to |\ell\rangle\, U_\ell\,|\psi\rangle Uses the MSB of the selector as the root branch indicator, requiring one fewer auxiliary qubit than a controlled variant would. The mapping holds only for ℓ<L\ell < L, where LL = len(unitaries). When the selector can hold more values (L<2nL < 2^n for an nn-qubit selector), selector values ℓ≥L\ell \geq L are not handled: the oracle may apply one of the unitaries for them instead of the identity. Use it only when the selector has no amplitude on such values (as in LCU, where PREPARE puts amplitude only on ℓ<L\ell < L), or pad the list to 2n2^n unitaries. Parameters: