CompilationOptions.
CompilationOptions holds different flags and options of the compilation process.
It controls different parallelization flags, diagnostic verification, and also the name of entrypoint function.
__init__(compilation_options: CompilationOptions)
Wrap the native Cpp object.
Args:
compilation_options
(_CompilationOptions): object to wrap
Raises:
TypeError
: if compilation_options is not of type _CompilationOptions
force_encoding(encoding: Encoding)
Force the compiler to use a specific encoding.
Args:
encoding
(Encoding): the encoding to force the compiler to use
Raises:
TypeError
: if encoding is not of type Encoding
new(backend=<Backend.CPU: 0>) → CompilationOptions
Build a CompilationOptions.
Args:
backend
(_Backend): backend to use.
Raises:
TypeError
: if function_name is not an str
Returns: CompilationOptions
set_all_v0_parameter(
glwe_dim: int,
log_poly_size: int,
n_small: int,
br_level: int,
br_log_base: int,
ks_level: int,
ks_log_base: int,
crt_decomp: List[int],
cbs_level: int,
cbs_log_base: int,
pks_level: int,
pks_log_base: int,
pks_input_lwe_dim: int,
pks_output_poly_size: int
)
Set all the V0 parameters.
Args:
glwe_dim
(int): GLWE dimensionlog_poly_size
(int): log of polynomial sizen_small
(int): nbr_level
(int): bootstrap levelbr_log_base
(int): bootstrap base logks_level
(int): keyswitch levelks_log_base
(int): keyswitch base logcrt_decomp
(List[int]): CRT decomposition vectorcbs_level
(int): circuit bootstrap levelcbs_log_base
(int): circuit bootstrap base logpks_level
(int): packing keyswitch levelpks_log_base
(int): packing keyswitch base logpks_input_lwe_dim
(int): packing keyswitch input LWE dimensionpks_output_poly_size
(int): packing keyswitch output polynomial size
Raises:
TypeError
: if parameters are not of type int
set_auto_parallelize(auto_parallelize: bool)
Set option for auto parallelization.
Args:
auto_parallelize
(bool): whether to turn it on or off
Raises:
TypeError
: if the value to set is not boolean
set_batch_tfhe_ops(batch_tfhe_ops: bool)
Set flag that triggers the batching of scalar TFHE operations.
Args:
batch_tfhe_ops
(bool): whether to batch tfhe ops.
Raises:
TypeError
: if the value to set is not bool
set_composable(composable: bool)
Set option for composition.
Args:
composable
(bool): whether to turn it on or off
Raises:
TypeError
: if the value to set is not boolean
set_compress_evaluation_keys(compress_evaluation_keys: bool)
Set option for compression of evaluation keys.
Args:
compress_evaluation_keys
(bool): whether to turn it on or off
Raises:
TypeError
: if the value to set is not boolean
set_compress_input_ciphertexts(compress_input_ciphertexts: bool)
Set option for compression of input ciphertexts.
Args:
compress_input_ciphertexts
(bool): whether to turn it on or off
Raises:
TypeError
: if the value to set is not boolean
set_dataflow_parallelize(dataflow_parallelize: bool)
Set option for dataflow parallelization.
Args:
dataflow_parallelize
(bool): whether to turn it on or off
Raises:
TypeError
: if the value to set is not boolean
set_display_optimizer_choice(display: bool)
Set display flag of optimizer choices.
Args:
display
(bool): if true the compiler display optimizer choices
Raises:
TypeError
: if the value is not a bool
set_emit_gpu_ops(emit_gpu_ops: bool)
Set flag that allows gpu ops to be emitted.
Args:
emit_gpu_ops
(bool): whether to emit gpu ops.
Raises:
TypeError
: if the value to set is not bool
set_enable_tlu_fusing(enable_tlu_fusing: bool)
Enable or disable tlu fusing.
Args:
enable_tlu_fusing
(bool): flag to enable or disable tlu fusing
Raises:
TypeError
: if the value to set is not bool
set_funcname(funcname: str)
Set entrypoint function name.
Args:
funcname
(str): name of the entrypoint function
Raises:
TypeError
: if the value to set is not str
set_global_p_error(global_p_error: float)
Set global error probability for the full circuit.
Args:
global_p_error
(float): probability of error for the full circuit
Raises:
TypeError
: if the value to set is not floatValueError
: if the value to set is not in interval ]0; 1]
set_loop_parallelize(loop_parallelize: bool)
Set option for loop parallelization.
Args:
loop_parallelize
(bool): whether to turn it on or off
Raises:
TypeError
: if the value to set is not boolean
set_optimize_concrete(optimize: bool)
Set flag to enable/disable optimization of concrete intermediate representation.
Args:
optimize
(bool): whether to turn it on or off
Raises:
TypeError
: if the value to set is not boolean
set_optimizer_multi_parameter_strategy(
strategy: OptimizerMultiParameterStrategy
)
Set the strategy of the optimizer for multi-parameter.
Args:
strategy
(OptimizerMultiParameterStrategy): Use the specified optmizer multi-parameter strategy.
Raises:
TypeError
: if the value is not a OptimizerMultiParameterStrategy
set_optimizer_strategy(strategy: OptimizerStrategy)
Set the strategy of the optimizer.
Args:
strategy
(OptimizerStrategy): Use the specified optmizer strategy.
Raises:
TypeError
: if the value is not an OptimizerStrategy
set_p_error(p_error: float)
Set error probability for shared by each pbs.
Args:
p_error
(float): probability of error for each lut
Raises:
TypeError
: if the value to set is not floatValueError
: if the value to set is not in interval ]0; 1]
set_print_tlu_fusing(print_tlu_fusing: bool)
Enable or disable printing tlu fusing.
Args:
print_tlu_fusing
(bool): flag to enable or disable printing tlu fusing
Raises:
TypeError
: if the value to set is not bool
set_security_level(security_level: int)
Set security level.
Args:
security_level
(int): the target number of bits of security to compile the circuit
Raises:
TypeError
: if the value to set is not intValueError
: if the value to set is not in interval ]0; 1]
set_v0_parameter(
glwe_dim: int,
log_poly_size: int,
n_small: int,
br_level: int,
br_log_base: int,
ks_level: int,
ks_log_base: int
)
Set the basic V0 parameters.
Args:
glwe_dim
(int): GLWE dimensionlog_poly_size
(int): log of polynomial sizen_small
(int): nbr_level
(int): bootstrap levelbr_log_base
(int): bootstrap base logks_level
(int): keyswitch levelks_log_base
(int): keyswitch base log
Raises:
TypeError
: if parameters are not of type int
set_verify_diagnostics(verify_diagnostics: bool)
Set option for diagnostics verification.
Args:
verify_diagnostics
(bool): whether to turn it on or off
Raises:
TypeError
: if the value to set is not boolean
simulation(simulate: bool)
Enable or disable simulation.
Args:
simulate
(bool): flag to enable or disable simulation
Raises:
TypeError
: if the value to set is not bool