workbench_algorithms.subroutines.select
Various implementations of SELECT.
SelectNaive
Bases: Qubrick
Most naïve version of \(\text{SELECT}\) possible.
If the data to be loaded is given as a list of Hamiltonian terms, performs the transformation
If the data to be loaded as given as a list of bit values \(data\), performs the transformation
compute
compute(
index_reg: Qubits,
target_reg: Qubits,
data: PauliSum | list[int],
ctrl: Qubits | int = 0,
)
Compute Select circuit.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
index_reg
|
Qubits
|
Qubit register determining which op in data to apply. |
required |
target_reg
|
Qubits
|
Qubit register to apply the data to. |
required |
data
|
PauliSum | list[int]
|
Hamiltonian terms expressed as a |
required |
ctrl
|
Qubits | int
|
Control register. Defaults to 0. |
0
|
SelectOneAnc
Bases: Qubrick
\(\text{SELECT}\) operator using a single, clean auxiliary qubit.
Circuit shown in Fig. 1A in "Trading T gates for dirty qubits in state preparation and unitary synthesis" (arXiv:1812.00954).
compute
compute(
index_reg: Qubits,
target_reg: Qubits,
data: PauliSum | list[int],
ctrl: Qubits | int = 0,
)
Compute Select circuit.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
index_reg
|
Qubits
|
Qubit register determining which op in data to apply. |
required |
target_reg
|
Qubits
|
Qubit register to apply the data to. |
required |
data
|
PauliSum | list[int]
|
Hamiltonian terms expressed as a |
required |
ctrl
|
Qubits | int
|
Control register. Defaults to 0. |
0
|
SawtoothSelect
Bases: Qubrick
Unoptimized select from Fig. 5 in "Encoding Electronic Spectra in Quantum Circuits with Linear T Complexity" (arXiv:1805.03662).
compute
compute(
index_reg: Qubits,
target_reg: Qubits,
data: PauliSum | list[int],
ctrl: Qubits | int = 0,
)
Compute Select circuit.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
index_reg
|
Qubits
|
Qubit register determining which op in data to apply. |
required |
target_reg
|
Qubits
|
Qubit register to apply the data to. |
required |
data
|
PauliSum | list[int]
|
Hamiltonian terms expressed as a |
required |
ctrl
|
Qubits | int
|
Control register. Defaults to 0. |
0
|
BinaryTreeSelect
Bases: Qubrick
Optimized select from Fig. 7 in "Encoding Electronic Spectra in Quantum Circuits with Linear T Complexity" (arXiv:1805.03662).
compute
compute(
index_reg: Qubits,
target_reg: Qubits,
data: PauliSum | list[int],
ctrl: Qubits | int = 0,
)
Compute Select circuit.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
index_reg
|
Qubits
|
Qubit register determining which op in data to apply. |
required |
target_reg
|
Qubits
|
Qubit register to apply the data to. |
required |
data
|
PauliSum | list[int]
|
Hamiltonian terms expressed as a |
required |
ctrl
|
Qubits | int
|
Control register. Defaults to 0. |
0
|
ConditionallyClean
Bases: Qubrick
Select utilizing conditionally clean construction as presented in arxiv:2407.17966.
Notes
This should be called with the filter '>>toffoli-window-filter>>' to take advantage of the cancellations that occur when you replace one condition with the next. This does the minimal work before calling the filter without hardcoding the cancellations with a maximum filter window required that is linear in the number of qubits in index register.
compute
compute(
index_reg: Qubits,
target_reg: Qubits,
data: PauliSum | list[int],
ctrl: Qubits | int = 0,
)
Compute Select circuit.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
index_reg
|
Qubits
|
Qubit register determining which op in data to apply. |
required |
target_reg
|
Qubits
|
Qubit register to apply the data to. |
required |
data
|
(PauliSum, List[int])
|
Hamiltonian terms expressed as a
|
required |
ctrl
|
(int, Qubits)
|
Control register. Defaults to 0. |
0
|