fhelium.backend.ckks.rotation._hoisted
Share coefficient-digit preparation across direct rotation key products.
rotate_component
function View source
python
def rotate_component(source: torch.Tensor, step: int, tensors: Mapping[str, torch.Tensor], attributes: Mapping[str, object]) -> torch.Tensor: ...1
prepare_digits
function View source
python
def prepare_digits(source: torch.Tensor, tensors: Mapping[str, torch.Tensor], attributes: Mapping[str, object]) -> torch.Tensor: ...1
Materialize each active hybrid digit once in QP NTT/Montgomery form.
accumulate
function View source
python
def accumulate(prepared: torch.Tensor, key: torch.Tensor, step: int, tensors: Mapping[str, torch.Tensor], attributes: Mapping[str, object]) -> torch.Tensor: ...1
Gather each digit's NTT permutation in the key-product load.
apply_rotation
function View source
python
def apply_rotation(c0: torch.Tensor, prepared: torch.Tensor, key: torch.Tensor, step: int, tensors: Mapping[str, torch.Tensor], attributes: Mapping[str, object], *, output_ntt: bool) -> tuple[torch.Tensor, torch.Tensor]: ...1