Skip to content

workbench_algorithms.subroutines.multiplexing.one_anc

Qubrick for multiplexing with a single ancilla per Fig. (1.a) in arXiv:1812.00954.

OneAncMultiplexor

OneAncMultiplexor(**kwargs)

Bases: Qubrick

\(\text{SELECT}\) operator using a single, clean ancilla.

Circuit shown in Fig. (1.a) in arXiv:1812.00954.

compute

compute(
    index_reg: Qubits,
    multiplex_function: Callable,
    used_indices: list[int] | None = None,
    ctrl: Qubits | int = 0,
)

Compute a multiplexing circuit using a single, clean ancilla.

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