fhelium.experimental.bootstrap.full_slot
Full-slot CKKS bootstrap composition configured for one Engine.
The composition accepts and returns two-component, coefficient-domain, standard-residue Q RNS values. Temporary NTT/Montgomery values are confined to ordinary engine arithmetic. Ciphertext payload axes are [component, *batch, limb, coefficient]; linear-map diagonal payloads use [slot] with
FullSlotBootstrap
class View source
FullSlotBootstrap(engine: Engine, *, coeffs_to_slots_compiler: Any, coeffs_to_slots_evaluator: Any, modular_reduction: Any, slots_to_coeffs_compiler: Any, slots_to_coeffs_evaluator: Any, modulus_raise_target_depth: int=0, retain_diagonals: bool=False, retain_constants: bool=False, batch_modular_branches: bool=False)Full-slot refresh callable with prepared transforms and replaceable components.
Construction configures transform compilers/evaluators and modular reduction for one engine. Calling the object executes the visible full-slot algorithm with one validated evaluator-only key inventory.
retain_diagonals keeps operation-ready transform plaintexts between calls. retain_constants similarly keeps the scalar, entry, and monomial constants used by the circuit between calls. If batch_modular_branches is true, the real and imaginary periodic reductions share one dense branch-batch execution before being unpacked.
input_depth selects the penultimate Q group. The entry rescale reaches the ordinary terminal basis, which this composition uses for centered ModRaise. It reserves no private CKKS depth.
Let engine.config.default_scale, input_bound and let fused_input_divisor, equal to
If
The encrypted transform and explicit
the idealized nonlinear and inverse-transform portion is
Polynomial approximation, CKKS arithmetic, and key switching perturb this idealized map. The caller must establish the reducer's raw-coordinate precondition
required_rotations
property
required_rotations: tuple[int, ...]Return normalized signed
key_steps
method
def key_steps(strategy: str='direct') -> tuple[int, ...]: ...Return the rotation-key inventory for one composition strategy.
direct returns every logical transform step as a direct key. power_of_two returns the deduplicated signed-power steps whose compositions cover those transforms. The latter therefore describes actual inventory entries, not the original transform offsets.
Raises
ValueError: Ifstrategyis notdirectorpower_of_two.
evaluation_key_requirements
method
def evaluation_key_requirements(rotation_strategy: str='power_of_two') -> EvaluationKeyRequirements: ...Return all evaluator capabilities for one rotation strategy.
Rotation steps come from key_steps. Conjugation is always required by full-slot reconstruction; relinearization is required only when the selected modular reduction declares ciphertext products. The result contains no key tensors or key-generation policy.
create_rotation_keys
method
def create_rotation_keys(secret_key: SecretKey, *, rotation_strategy: str='power_of_two') -> RotationKeySet: ...Generate only the selected bootstrap rotation-key inventory.
secret_key is consumed by primitive engine key generation and is not stored in the returned set. Relinearization and conjugation keys are intentionally not created here; applications construct those separate capabilities and assemble an EvaluationKeySet.
cached_diagonal_bytes
property
cached_diagonal_bytes: intReturn encoded diagonal tensor bytes retained by this evaluator.
cached_constant_bytes
property
cached_constant_bytes: intReturn tensor bytes retained for scalar and structural constants.
clear_cache
method
def clear_cache() -> None: ...Release prepared constants, encoded diagonals, and arithmetic tables.