change_level

Engine.change_level(light_plaintext, level)
Changes the level of the given light plaintext to the target level. In any operation, the engine will automatically change the level of the input light plaintexts if needed. This function is intended for experts who want the best possible performance.
  • Input:
    • LightPlaintext
    • level
      • The level should be an integer greater than or equal to 1.
  • Output:
    • LightPlaintext
from desilofhe import Engine

engine = Engine()

message = [1, 2, 3]
light_plaintext = engine.encode_to_light_plaintext(message)

level_changed = engine.change_level(light_plaintext, level=1)

print(level_changed.level)  # 1
Engine.change_level(light_plain_matrix, level)
Changes the level of the given light plain matrix to the target level. In any operation, the engine will automatically change the level of the input light plain matrices if needed. This function is intended for experts who want the best possible performance.
  • Input:
    • LightPlainMatrix
    • level
      • The level should be an integer greater than or equal to 1.
  • Output:
    • LightPlainMatrix
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)

level_changed = engine.change_level(light_plain_matrix, level=1)

print(level_changed.level)  # 1