workbench_algorithms.experimental.subroutines.state_preparation.alias_sampling
Class and functions for the alias sampling state preparation method (PREP with garbage).
AliasSampling
Bases: Qubrick
Qubrick for implementing alias sampling.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
qrom
|
QROM
|
Data lookup instance. |
required |
usp
|
UniformStatePreparation
|
Uniform state preparation instance. |
required |
lambda_val
|
int
|
SEL-SWAP tunable parameter for QROM, default to None where optimal lambda (based on Toffoli counts) is calculated |
None
|
**kwargs
|
dict[str, Any]
|
Other arguments to pass to the init. |
{}
|
compute
compute(
psi: Qubits,
data: StatePrepDataInterface,
ctrl: Qubits | int = 0,
*,
usp_rotator: Qubits | None = None,
coin_toss_reg: Qubits | None = None,
)
State preparation by alias sampling.
Note
Uses the circuit in Fig. 11 of arXiv:1805.03662 <https://arxiv.org/abs/1805.03662>_.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
psi
|
Qubits
|
Register to prepare coefficients onto. |
required |
data
|
StatePrepDataInterface
|
a data storage interface that hold all the classical precomputation numbers |
required |
ctrl
|
Qubits | int
|
Control register. |
0
|
usp_rotator
|
Qubits | None
|
Qubit to rotate as part of USP. Needs to be supplied if this Qubrick is used with a coherent uncomputation (such as in LCU), but will be allocated on the fly if not supplied. |
None
|
coin_toss_reg
|
Qubits | None
|
Qubits register used to load the coin toss state (uniform state) in for the alias sampling protocol. Needs to be supplied if this Qubrick is used with a coherent uncomputation (such as in LCU), but will be allocated on the fly if not supplied. |
None
|