encode_to_light_plain_matrix
Engine.encode_to_light_plain_matrix(matrix, level)
- Encodes a matrix into a light plain matrix format for matrix multiplication.
- Input:
- matrix: A Python list or numpy array. Data types supported include int, double, and complex double.
- The matrix should be square, with both dimensions equal to
Engine.slot_count.
- level: optional
- Specifies the maximum multiplication level for encoding. Lower levels reduce space usage but also reduce the maximum multiplication depth.
- The level should be an integer greater than or equal to 1.
- Output:
import numpy as np
from desilofhe import Engine
engine = Engine(slot_count=64)
message = np.arange(64 * 64).reshape(64, 64)
light_plain_matrix = engine.encode_to_light_plain_matrix(message)
light_plain_matrix_level_2 = engine.encode_to_light_plain_matrix(
message, level=2
)