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
iter_rotations
function View source
python
def iter_rotations(source: torch.Tensor, keys: Sequence[torch.Tensor | None], steps: Sequence[int], tensors: Mapping[str, torch.Tensor], attributes: Mapping[str, object], *, output_ntt: bool=False) -> Iterator[torch.Tensor]: ...1
Yield direct rotations from one shared decomposition of component one.
A None key denotes the identity. Outputs own their payloads; consuming one does not retain previous outputs. The prepared digits live only until the iterator completes or is closed.