# module `concrete.compiler.compilation_options` CompilationOptions. --- ## class `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. ### method `__init__` ```python __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 --- ### method `add_composition` ```python add_composition(from_func: str, from_pos: int, to_func: str, to_pos: int) ``` Adds a composition rule. **Args:** - `from_func` (str): the name of the circuit the output comes from. - `from_pos` (int): the return position of the output. - `to_func` (str): the name of the circuit the input targets. - `to_pos` (int): the argument position of the input. **Raises:** - `TypeError`: if the inputs do not have the proper type. --- ### method `force_encoding` ```python 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 --- ### method `new` ```python new(backend=) → CompilationOptions ``` Build a CompilationOptions. **Args:** - `backend` (_Backend): backend to use. **Raises:** - `TypeError`: if function_name is not an str **Returns:** CompilationOptions --- ### method `set_all_v0_parameter` ```python 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 dimension - `log_poly_size` (int): log of polynomial size - `n_small` (int): n - `br_level` (int): bootstrap level - `br_log_base` (int): bootstrap base log - `ks_level` (int): keyswitch level - `ks_log_base` (int): keyswitch base log - `crt_decomp` (List[int]): CRT decomposition vector - `cbs_level` (int): circuit bootstrap level - `cbs_log_base` (int): circuit bootstrap base log - `pks_level` (int): packing keyswitch level - `pks_log_base` (int): packing keyswitch base log - `pks_input_lwe_dim` (int): packing keyswitch input LWE dimension - `pks_output_poly_size` (int): packing keyswitch output polynomial size **Raises:** - `TypeError`: if parameters are not of type int --- ### method `set_auto_parallelize` ```python 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 --- ### method `set_batch_tfhe_ops` ```python 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 --- ### method `set_composable` ```python set_composable(composable: bool) ``` Set composable flag. **Args:** - `composable` (bool): the composable flag. **Raises:** - `TypeError`: if the inputs do not have the proper type. --- ### method `set_compress_evaluation_keys` ```python 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 --- ### method `set_compress_input_ciphertexts` ```python 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 --- ### method `set_dataflow_parallelize` ```python 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 --- ### method `set_display_optimizer_choice` ```python 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 --- ### method `set_emit_gpu_ops` ```python 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 --- ### method `set_enable_overflow_detection_in_simulation` ```python set_enable_overflow_detection_in_simulation(enable_overflow_detection: bool) ``` Enable or disable overflow detection during simulation. **Args:** - `enable_overflow_detection` (bool): flag to enable or disable overflow detection **Raises:** - `TypeError`: if the value to set is not bool --- ### method `set_enable_tlu_fusing` ```python 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 --- ### method `set_funcname` ```python 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 --- ### method `set_global_p_error` ```python 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 float - `ValueError`: if the value to set is not in interval ]0; 1] --- ### method `set_loop_parallelize` ```python 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 --- ### method `set_optimize_concrete` ```python 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 --- ### method `set_optimizer_multi_parameter_strategy` ```python 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 --- ### method `set_optimizer_strategy` ```python 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 --- ### method `set_p_error` ```python 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 float - `ValueError`: if the value to set is not in interval ]0; 1] --- ### method `set_print_tlu_fusing` ```python 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 --- ### method `set_security_level` ```python 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 int - `ValueError`: if the value to set is not in interval ]0; 1] --- ### method `set_v0_parameter` ```python 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 dimension - `log_poly_size` (int): log of polynomial size - `n_small` (int): n - `br_level` (int): bootstrap level - `br_log_base` (int): bootstrap base log - `ks_level` (int): keyswitch level - `ks_log_base` (int): keyswitch base log **Raises:** - `TypeError`: if parameters are not of type int --- ### method `set_verify_diagnostics` ```python 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 --- ### method `simulation` ```python 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