fhelium.ir.ckks_state
Metadata equations shared by CKKS execution and callable capture.
These functions operate on scales, prime identities, and representation labels; they do not construct Programs, allocate Tensor storage, or execute arithmetic.
depth_prime_ids
function View source
def depth_prime_ids(config: CkksConfig, depth: int, basis: ModulusBasis) -> tuple[int, ...]: ...Select the Q suffix at a depth and retain P rows for a QP value.
output_residues
function View source
def output_residues(domain: PolynomialDomain) -> ResidueRepresentation: ...Return the ciphertext residue representation for a selected domain.
product_scale
function View source
def product_scale(lhs: float, rhs: float) -> float: ...Return
quotient_scale
function View source
def quotient_scale(scale: float, divisor: int) -> float: ...Return
reinterpreted_scale
function View source
def reinterpreted_scale(current: float, target: float, max_relative_change: float | None=None) -> float: ...Validate the caller's metadata-only scale change and return its target.
transform_state
function View source
def transform_state(direction: Literal['forward', 'inverse'], *, ciphertext: bool) -> tuple[PolynomialDomain, ResidueRepresentation]: ...Return the public state after a forward or inverse negacyclic NTT.
Forward transforms produce NTT/Montgomery values. Inverse transforms produce coefficient/standard ciphertexts or coefficient/Montgomery plaintexts.