fhelium.backend.rns.chain
Mathematical Q/P modulus-chain layout for rank-local CKKS values.
RnsChain
class View source
python
RnsChain(num_q_primes: int, num_p_primes: int, q_depth_group_sizes: tuple[int, ...] | None = None)1
Prime identities and active bases for a CKKS modulus chain.
Prime ids follow the RNS parameter order [Q | P]. Q rows are partitioned by q_depth_group_sizes. If
include_p=True appends every P id and therefore describes j to parameter prime prime_ids[j] exactly.
Attributes
| Name | Type | Default/value |
|---|---|---|
num_q_primes | int | |
num_p_primes | int | |
q_depth_group_sizes | tuple[int, ...] | None | None |
basis_row_starts
property
python
basis_row_starts: tuple[int, ...]1
Return the flattened Q-row offset of every chain position.
basis_count
property
python
basis_count: int1
total_modulus_count
property
python
total_modulus_count: int1
q_prime_ids
property
python
q_prime_ids: tuple[int, ...]1
p_prime_ids
property
python
p_prime_ids: tuple[int, ...]1
check_depth
method
python
def check_depth(depth: int) -> None: ...1
q_prime_ids_at_depth
method
python
def q_prime_ids_at_depth(depth: int) -> tuple[int, ...]: ...1
Return ordered ids for
qp_prime_ids_at_depth
method
python
def qp_prime_ids_at_depth(depth: int) -> tuple[int, ...]: ...1
Return ordered ids for
prime_ids
method
python
def prime_ids(depth: int, *, include_p: bool=False) -> tuple[int, ...]: ...1
parameter_rows
method
python
def parameter_rows(depth: int, *, include_p: bool=False) -> slice: ...1
Return the zero-copy interval for the selected basis.