fhelium.experimental.bootstrap.presets.cosine
Cosine Bootstrap profiles with replaceable execution components.
Profiles select a Chebyshev seed, double-angle recurrence and Fourier stage counts. The Engine supplies the modulus chain and default scale. The returned FullSlotBootstrap exposes its output depth, remaining depth and refresh window.
cosine_bootstrap
function View source
def cosine_bootstrap(engine: Engine, *, profile: Literal['7/44', '8/28', '8/28-s2c3', '3/30']='7/44', message_domain: Literal['complex', 'real']='complex', polynomial_evaluator: Any | None=None, giant_step_reduction: Literal['aggregate', 'independent'] | None=None, coeffs_to_slots_evaluator: Any | None=None, slots_to_coeffs_evaluator: Any | None=None, product_implementation: str | None='auto', product_chunk_size: int | None=16, retain_diagonals: bool=True, compress_diagonals: bool=True, retain_constants: bool=True, batch_modular_branches: bool=True, modulus_raising: ModulusRaising | None=None, source_depth: int | None=None, input_depth: int | None=None, input_scale: float | None=None, target_scales: Sequence[float] | None=None, modup_method: Literal['exact', 'crt', 'normalized_crt']='exact') -> FullSlotBootstrap: ...Construct a full-slot cosine Bootstrap with inspectable choices.
"7/44" uses seven double-angle iterations, a degree-44 Chebyshev seed, Blocked evaluation with baby step eight, and aggregate giant-step quotients. "8/28" uses eight iterations and a degree-28 seed; "8/28-s2c3" adds a third SlotsToCoeffs stage. Both degree-28 profiles default to Binary evaluation and independent giant quotients. These three profiles have raw branch bound
"3/30" selects raw bound B=32, four CoeffsToSlots stages, an even degree-30 seed evaluated through T2 and a degree-15 Blocked schedule, three double-angle iterations and three SlotsToCoeffs stages. The seed coordinate shifts by -1/64. Transform scaling and slot normalization occur in the last forward stage; the following coefficient product aligns scale. Its input range must be established for the chosen modulus-raising relation.
modulus_raising binds the selected raising component. source_depth, input_depth and input_scale define entry coordinates, while target_scales supplies coefficient-product targets for each depth. The example encapsulation parameters specify these values together.
Defaults are based on the logN16, generator-five, approximately remaining_depth and refresh_window and validate the decoded error for the intended parameter and message range.
polynomial_evaluator replaces the profile's polynomial schedule. giant_step_reduction selects QP accumulation followed by one quotient, or independent per-giant rescale and key switching. These schedules differ in rounding and workspace. A supplied linear evaluator is used unchanged; product and giant-step shortcuts configure only the default evaluators. Construct FullSlotBootstrap directly for custom transform compilers or modular-reduction components.
product_implementation="auto" selects weighted-product implementations from represented data and device. None selects native products, and a registered name requests that implementation. product_chunk_size=16 bounds fused product terms. Retaining diagonals and constants trades resident memory for repeated preparation; compress_diagonals losslessly compresses eligible encoded data. Branch batching applies to complex messages. Real messages require generator-five radix-2 reconstruction.