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: HamiltonianUnitaryBuilder

LCU (Linear Combination of Unitaries) block encoding builder.

Parameters:
__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.

Parameters:
  • power (int) – The power to raise the unitary to. Defaults to 1.

  • quantum_walk (bool) – If True, the circuit mapper wraps the block encoding with a quantum walk operator (use with QPE). If False, use the plain block encoding (use with Hadamard test). Defaults to False.

name()[source]

Return the algorithm name.

Return type:

str

Returns:

The name "lcu".

Return type:

str

type_name()[source]

Return the algorithm type name.

Return type:

str

Returns:

The type name "hamiltonian_unitary_builder".

Return type:

str

class qdk_chemistry.algorithms.hamiltonian_unitary_builder.block_encoding.lcu.LCUSettings[source]

Bases: HamiltonianUnitaryBuilderSettings

Settings 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.