fhelium.backend.ckks.rotation.operations
Independent, hoisted, and weighted CKKS rotation implementations.
NativeRotateImplementation
class View source
python
NativeRotateImplementation(supports_in_place: bool = False, name: str = 'native-rotate-streaming', operation_types: tuple[type[Operation], ...] = (ckks.RotateOp,))1
Rotate CT2 through one automorphism and streaming hybrid key switch.
Attributes
| Name | Type | Default/value |
|---|---|---|
supports_in_place | bool | False |
name | str | 'native-rotate-streaming' |
operation_types | tuple[type[Operation], ...] | (ckks.RotateOp,) |
tensor_requirements | staticmethod(native_key_switch_requirements) | |
prepare_operation | prepare_native_key_switch |
resource_requirements
method
python
def resource_requirements(invocation: OperationInvocation) -> tuple[ResourceRequirement, ...]: ...1
execute
method
python
def execute(invocation: OperationInvocation, inputs: tuple[torch.Tensor, ...], resources: tuple[BoundResource, ...], *, in_place: bool) -> tuple[torch.Tensor, ...]: ...1
NativeHoistedRotateManyImplementation
class View source
python
NativeHoistedRotateManyImplementation(supports_in_place: bool = False, name: str = 'native-rotate-many-hoisted', operation_types: tuple[type[Operation], ...] = (ckks.RotateManyOp,))1
Execute one scheduled rotation group without changing its membership.
Attributes
| Name | Type | Default/value |
|---|---|---|
supports_in_place | bool | False |
name | str | 'native-rotate-many-hoisted' |
operation_types | tuple[type[Operation], ...] | (ckks.RotateManyOp,) |
tensor_requirements | staticmethod(native_key_switch_requirements) | |
prepare_operation | prepare_native_key_switch |
resource_requirements
method
python
def resource_requirements(invocation: OperationInvocation) -> tuple[ResourceRequirement, ...]: ...1
execute
method
python
def execute(invocation: OperationInvocation, inputs: tuple[torch.Tensor, ...], resources: tuple[BoundResource, ...], *, in_place: bool) -> tuple[torch.Tensor, ...]: ...1
NativeGroupedRotationWeightedSumImplementation
class View source
python
NativeGroupedRotationWeightedSumImplementation(supports_in_place: bool = False, name: str = 'native-grouped-rotation-weighted-sum', operation_types: tuple[type[Operation], ...] = (ckks.GroupedRotationWeightedSumOp,))1
Execute one supplied direct-rotation/plaintext group matrix.
Attributes
| Name | Type | Default/value |
|---|---|---|
supports_in_place | bool | False |
name | str | 'native-grouped-rotation-weighted-sum' |
operation_types | tuple[type[Operation], ...] | (ckks.GroupedRotationWeightedSumOp,) |
resource_requirements
method
python
def resource_requirements(invocation: OperationInvocation) -> tuple[ResourceRequirement, ...]: ...1
execute
method
python
def execute(invocation: OperationInvocation, inputs: tuple[torch.Tensor, ...], resources: tuple[BoundResource, ...], *, in_place: bool) -> tuple[torch.Tensor, ...]: ...1