fhelium.experimental.bootstrap.polynomial.blocked
Block-factorized Chebyshev evaluation with a shared binary basis.
ChebyshevBlockPlan
class View source
ChebyshevBlockPlan(polynomial: PolynomialApproximation, baby_step: int, coefficients: tuple[tuple[complex, ...], ...], basis_depths: tuple[tuple[int, int], ...], required_depths: int, inventory: tuple[tuple[str, int], ...])Coefficient blocks, shared binary nodes and their depth schedule.
coefficients[j][i] multiplies T_i(x) T_(j*m)(x). A baby step of zero denotes the direct low-degree schedule. basis_depths records each node's depth relative to the input, in dependency order.
Attributes
| Name | Type | Default/value |
|---|---|---|
polynomial | PolynomialApproximation | |
baby_step | int | |
coefficients | tuple[tuple[complex, ...], ...] | |
basis_depths | tuple[tuple[int, int], ...] | |
required_depths | int | |
inventory | tuple[tuple[str, int], ...] |
BlockedChebyshevEvaluator
class View source
BlockedChebyshevEvaluator(baby_step: int | None = None, skip_near_zero: float = 0.0)Evaluate
Descending elimination uses baby_step=None,
At final depth
Input and output are CT2 over Q with the same batch axes. The input domain is preserved when retaining NTT; otherwise output is coefficient form. NTT intermediates follow BootstrapArithmetic.retain_ntt. The approximation's domain remains caller-owned; complex inputs are evaluated as
Attributes
| Name | Type | Default/value |
|---|---|---|
baby_step | int | None | None |
skip_near_zero | float | 0.0 |
plan
method
def plan(polynomial: PolynomialApproximation) -> ChebyshevBlockPlan: ...Return the shared coefficient, basis, depth and operation plan.
required_depths
method
def required_depths(polynomial: PolynomialApproximation) -> int: ...Return the depth consumed by this polynomial's selected plan.
operation_inventory
method
def operation_inventory(polynomial: PolynomialApproximation) -> dict[str, int]: ...Count products, relinearizations and group rescales in the plan.
relinearization_depths
method
def relinearization_depths(polynomial: PolynomialApproximation, *, input_depth: int=0) -> tuple[int, ...]: ...Return basis-product depths and the single delayed giant-sum depth.
evaluate
method
def evaluate(arithmetic: BootstrapArithmetic, ciphertext: Ciphertext, polynomial: PolynomialApproximation, *, relinearization_key: RelinearizationKey | EvaluationKeySet | Mapping[int, RelinearizationKey] | None=None) -> Ciphertext: ...Execute the plan, retaining actual scales and the input domain.