Chemistry low-rank decomposition block encodings¶
oracq.algorithms.input_model.lowrank
LCU/block-encoding assembly for quantum-chemistry low-rank decomposition (DF/THC) Hamiltonians.
Implements the “low-rank tensor -> LCU -> BE” pipeline of the double factorization (DF)
of Berry et al. 2019 and von Burg et al. 2021, and of the tensor hypercontraction
(THC) of Lee et al. 2021, corresponding to item C1 of the algorithm coverage board.
Integral tensors are given as classical input data; this module performs no real
chemical integral computation. The explicit small-matrix path targets small
validation instances; at large scale the spectra and rotation angle tables of
U_r/G_r should instead go through QRAM data binding (see the three-layer
qram_prepare/alias_prepare paradigm of prepare_select).
- oracq.algorithms.input_model.lowrank.diagonalize_symmetric(matrix, *, tolerance=1e-12, max_sweeps=100)[source]¶
Jacobi eigendecomposition of a real symmetric matrix: returns eigenvalues and the eigenvector matrix satisfying
G = V diag(λ) Vᵀ.This is the classical preprocessing of the DF input model: after the symmetric matrix
G_ris diagonalized, the eigenvector matrix is folded into the rotationU_rbyfrom_symmetric. The columns of the eigenvector matrix are the eigenvectors.- Parameters:
matrix – Real symmetric square matrix with finite real entries.
tolerance – Tolerance shared by the symmetry check and the convergence test.
max_sweeps – Maximum number of Jacobi sweeps; an error is raised if convergence is not reached in time.
- Returns:
(eigenvalue tuple, matrix whose columns are the eigenvectors), satisfyingG = V diag(λ) Vᵀ.- Return type:
tuple[tuple[float, …], tuple[tuple[float, …], …]]
- class oracq.algorithms.input_model.lowrank.DoubleFactorization(scalar, rotations, spectra)[source]¶
Bases:
objectDF input model (CP input model): small-instance representation of
H = scalar·I + Σ_r U_r diag(g_r) U_r†.rotations holds explicit small unitary matrices and spectra holds the real eigenvalues obtained by classically diagonalizing the symmetric matrices
G_r; in physical DF theG_rare received byfrom_symmetricand folded into the rotations. The explicit-matrix path targets small validation instances only; at large scale the spectral norm tables and rotation angles go through QRAM data binding.- scalar¶
- rotations¶
- spectra¶
- classmethod from_symmetric(scalar, rotations, factors)[source]¶
Construct from explicit unitaries
U_rand real symmetricG_r:G_r = V_r diag(g_r) V_rᵀis folded intoU_r V_r.- Parameters:
scalar – Coefficient of the identity term.
rotations – Explicit unitary matrices
U_rof each rank.factors – Real symmetric matrices
G_rpaired one-to-one with the rotations, of matching dimension.
- Returns:
DF input model with the spectrum unchanged after folding
U_r V_r.- Return type:
- property width¶
Number of target qubits.
- property rank¶
Number of DF rank terms.
- class oracq.algorithms.input_model.lowrank.THCDecomposition(coefficients, leaves)[source]¶
Bases:
objectTHC input model:
H = Σ_{μν} ζ_{μν} L_μ L_ν†whereL_μare explicit small-matrix leaf operators.coefficients is the real symmetric
ζmatrix and leaves holds explicit small matrices of matching dimension; the leaf operators need not be unitary or Hermitian, and the block encoding of the productL_μ L_ν†is assembled from matrix_pauli_encoding and BE products.- coefficients¶
- leaves¶
- property width¶
Number of target qubits.
- property leaf_count¶
Number of THC leaf operators.
- oracq.algorithms.input_model.lowrank.double_factorized_encoding(df, *, name=None)[source]¶
LCU block encoding of a DF Hamiltonian: the outer PREPARE runs over the rank index
rwith weights∝ ‖g_r‖₁.SELECT applies the term block encoding of
U_r diag(g_r)/‖g_r‖₁ U_r†under control, where the diagonalG_revolution uses an explicit PREPARE–SELECT andU_ris synthesized by two-level decomposition; thescalarterm joins the same outer LCU. alpha is|scalar| + Σ_r ‖g_r‖₁and is reported in thedf_lambdaattribute. The result can be fed directly to transforms.qubitization_walk.- Parameters:
df – DF input model instance.
name – Unused by the current implementation; kept only for interface compatibility.
- Returns:
LCU block encoding of
H = scalar·I + Σ_r U_r diag(g_r) U_r†.- Return type:
- oracq.algorithms.input_model.lowrank.thc_encoding(thc)[source]¶
LCU block encoding of a THC Hamiltonian: the outer PREPARE runs over
(μ, ν)pairs with weights∝ |ζ_{μν}|·α_μ α_ν.Each
(μ, ν)term is a block-encoding product ofL_μ L_ν†(leaf operators encoded via matrix_pauli_encoding, withα_μtheir Pauli l1 bound). alpha isΣ_{μν} |ζ_{μν}| α_μ α_νand is reported in thethc_lambdaattribute. The result can be fed directly to transforms.qubitization_walk.- Parameters:
thc – THC input model instance.
- Returns:
LCU block encoding of
Σ_{μν} ζ_{μν} L_μ L_ν†.- Return type: