workbench_algorithms.subroutines.multiplexing.zero_anc
Qubrick for serial multiplexing (AKA SelectNaive).
ZeroAncMultiplexor
Bases: Qubrick
Most naïve version of multiplexing possible.
For some function, f, which returns an operator associated with an integer index performs: \(\text{SELECT}|l\rangle|\psi\rangle \rightarrow |l\rangle f(l)|\psi\rangle\).
compute
compute(
index_reg: Qubits,
multiplex_function: Callable,
used_indices: list[int] | None = None,
ctrl: Qubits | int = 0,
)
Compute the serial multiplexing circuit.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
index_reg
|
Qubits
|
Qubit register storing the values over which the multiplexing is performed. |
required |
multiplex_function
|
callable
|
A function which takes an index and then index register and performs the operation associated with that index. |
required |
used_indices
|
list
|
List of indices corresponding to terms where the operators are actually being applied. |
None
|
ctrl
|
(int, Qubits)
|
Control for \(\text{SELECT}\). Defaults to 0. |
0
|