qdk_chemistry.algorithms.hamiltonian_unitary_builder.block_encoding.lcu module
QDK/Chemistry implementation of the LCU (Linear Combination of Unitaries).
References
Childs, A. M. and Wiebe, N. “Hamiltonian simulation using linear combinations of unitary operations.” Quantum Information & Computation 12.11-12 (2012): 901-924.
- class qdk_chemistry.algorithms.hamiltonian_unitary_builder.block_encoding.lcu.LCUBuilder(power=1, quantum_walk=False)[source]
Bases:
HamiltonianUnitaryBuilderLCU (Linear Combination of Unitaries) block encoding builder.
- __init__(power=1, quantum_walk=False)[source]
Initialize the LCU builder.
Given a Hamiltonian \(H = \sum_{j=1}^{L} \alpha_j P_j\) expressed as a linear combination of Pauli strings \(P_j\) with scalar coefficients \(\alpha_j\), this builder constructs an LCU representation that block-encodes \(H / \lambda\), where \(\lambda\) is the L1 norm of the Hamiltonian. The LCU representation follows the PREPARE-SELECT-PREPARE† pattern.
The PREPARE oracle encodes amplitudes \(\sqrt{|\alpha_j| / \lambda}\) into an ancilla register of \(\lceil \log_2 L \rceil\) qubits. The SELECT oracle applies the corresponding Pauli string \(P_j\) (with sign correction) controlled on the ancilla index. The \(\alpha_j\) is positive by absorbing the sign into phases of the SELECT operation.
- class qdk_chemistry.algorithms.hamiltonian_unitary_builder.block_encoding.lcu.LCUSettings[source]
Bases:
HamiltonianUnitaryBuilderSettingsSettings for the LCU block encoding builder.
- __init__()[source]
Initialize LCUSettings with default values.
- power
The power to which the unitary is raised.
- quantum_walk
If True, wrap block encoding with quantum walk operator (use with QPE). If False, use plain block encoding (use with Hadamard test).
- tolerance
Minimum L1 norm below which the LCU decomposition is numerically ill-defined.