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.
  • Input:
    • LightPlaintext
    • level
      • The level should be an integer greater than or equal to 1.
  • Output:
    • LightPlaintext

Warning

  • This function is intended for experts who want the best possible performance.
  • The matrix form does not yet support this operation.
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