fhelium.backend.ckks.modulus_raise
Centered CKKS basis raising and low-basis key encapsulation.
encapsulated_modulus_raise
function View source
python
def encapsulated_modulus_raise(source: torch.Tensor, low_key: torch.Tensor, return_key: torch.Tensor, tensors: Mapping[str, torch.Tensor], attributes: Mapping[str, object]) -> torch.Tensor: ...1
Switch into a low secret relation, center-raise and return to the main key.
Source is CT2 coefficient/standard Q at the declared low basis. Low key digits encode P_lows under t. The one-digit return hint encodes Dt under s, where D=guardP_return. The output is (c0_tilde,0)+Round(c1_tilde(H0,H1)/D) on the selected target Q rows. All operands remain live and unmodified; output storage is independent.
modulus_raise_requirements
function View source
python
def modulus_raise_requirements(operation, config): ...1
Declare deterministic numerical operands without constructing their data.
NativeModulusRaiseImplementation
class View source
python
NativeModulusRaiseImplementation(name: str = 'native-modulus-raise', supports_in_place: bool = False, operation_types: tuple = (ckks.ModulusRaiseOp, ckks.EncapsulatedModulusRaiseOp))1
Execute centered or encapsulated basis raising from bound Tensor operands.
Attributes
| Name | Type | Default/value |
|---|---|---|
name | str | 'native-modulus-raise' |
supports_in_place | bool | False |
operation_types | tuple | (ckks.ModulusRaiseOp, ckks.EncapsulatedModulusRaiseOp) |
tensor_requirements | staticmethod(modulus_raise_requirements) |
resource_requirements
method
python
def resource_requirements(invocation): ...1
prepare_operation
method
python
def prepare_operation(operation): ...1
execute
method
python
def execute(invocation, inputs, resources, *, in_place): ...1