fhelium.backend.rns.decomposition
Hybrid-RNS key-switch decomposition metadata.
RnsDecompositionDigit
class View source
RnsDecompositionDigit(key_digit_index: int, prime_ids: tuple[int, ...])One active hybrid-RNS digit and its stable key-storage digit index.
Attributes
| Name | Type | Default/value |
|---|---|---|
key_digit_index | int | |
prime_ids | tuple[int, ...] |
HybridRnsDecomposition
class View source
HybridRnsDecomposition(chain: RnsChain, q_moduli: tuple[int, ...], p_moduli: tuple[int, ...])Partition
Contiguous Q rows form digits whose product is below the special modulus key_digit_index so it selects the correct axis of the depth-zero key-switching key. The enumeration index returned at one depth is only local digit_index and is intentionally distinct from that stable key index.
digit_count
property
digit_count: intdigits_at_depth
method
def digits_at_depth(depth: int) -> tuple[RnsDecompositionDigit, ...]: ...digit_rows
method
def digit_rows(depth: int, *, include_p: bool=False) -> tuple[tuple[int, ...], ...]: ...Return ordered parameter rows for active Q digits.
component_digit_rows
method
def component_digit_rows(depth: int) -> tuple[tuple[int, ...], ...]: ...Return digit rows relative to a compact depth-specific component.