化学低秩分解块编码

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)[源代码]

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_r is diagonalized, the eigenvector matrix is folded into the rotation U_r by from_symmetric. The columns of the eigenvector matrix are the eigenvectors.

参数:
  • 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.

返回:

(eigenvalue tuple, matrix whose columns are the eigenvectors), satisfying G = V diag(λ) Vᵀ.

返回类型:

tuple[tuple[float, ...], tuple[tuple[float, ...], ...]]

class oracq.algorithms.input_model.lowrank.DoubleFactorization(scalar, rotations, spectra)[源代码]

基类:object

DF 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 the G_r are received by from_symmetric and 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)[源代码]

Construct from explicit unitaries U_r and real symmetric G_r: G_r = V_r diag(g_r) V_rᵀ is folded into U_r V_r.

参数:
  • scalar -- Coefficient of the identity term.

  • rotations -- Explicit unitary matrices U_r of each rank.

  • factors -- Real symmetric matrices G_r paired one-to-one with the rotations, of matching dimension.

返回:

DF input model with the spectrum unchanged after folding U_r V_r.

返回类型:

DoubleFactorization

property width

Number of target qubits.

property rank

Number of DF rank terms.

class oracq.algorithms.input_model.lowrank.THCDecomposition(coefficients, leaves)[源代码]

基类:object

THC input model: H = Σ_{μν} ζ_{μν} L_μ L_ν† where L_μ 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 product L_μ 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)[源代码]

LCU block encoding of a DF Hamiltonian: the outer PREPARE runs over the rank index r with weights ∝ ‖g_r‖₁.

SELECT applies the term block encoding of U_r diag(g_r)/‖g_r‖₁ U_r† under control, where the diagonal G_r evolution uses an explicit PREPARE–SELECT and U_r is synthesized by two-level decomposition; the scalar term joins the same outer LCU. alpha is |scalar| + Σ_r ‖g_r‖₁ and is reported in the df_lambda attribute. The result can be fed directly to transforms.qubitization_walk.

参数:
  • df -- DF input model instance.

  • name -- Unused by the current implementation; kept only for interface compatibility.

返回:

LCU block encoding of H = scalar·I + Σ_r U_r diag(g_r) U_r†.

返回类型:

BlockEncoding

oracq.algorithms.input_model.lowrank.thc_encoding(thc)[源代码]

LCU block encoding of a THC Hamiltonian: the outer PREPARE runs over (μ, ν) pairs with weights ∝ |ζ_{μν}|·α_μ α_ν.

Each (μ, ν) term is a block-encoding product of L_μ L_ν† (leaf operators encoded via matrix_pauli_encoding, with α_μ their Pauli l1 bound). alpha is Σ_{μν} |ζ_{μν}| α_μ α_ν and is reported in the thc_lambda attribute. The result can be fed directly to transforms.qubitization_walk.

参数:

thc -- THC input model instance.

返回:

LCU block encoding of Σ_{μν} ζ_{μν} L_μ L_ν†.

返回类型:

BlockEncoding