Trait concrete_npe::gsw::GSW [−][src]
pub trait GSW: Sized {
type STorus;
fn external_product(
dimension: usize,
l_gadget: usize,
base_log: usize,
var_gsw: f64,
var_lwe: f64
) -> f64;
fn cmux(
var_lwe_0: f64,
var_lwe_1: f64,
var_gsw: f64,
dimension: usize,
base_log: usize,
l_gadget: usize
) -> f64;
}
Associated Types
Required methods
Implementations on Foreign Types
Return the variance of the external product given a set of parameters. To see how to use it, please refer to the test of the external product. Arguments
dimension
- the size of the LWE maskl_gadget
- number of elements for the Torus decompositionbase_log
- decomposition base of the gadget matrixvar_gsw
- noise variance of the GSWvar_lwe
- noise variance of the LWE
Output
- Returns the variance of the output LWE
Warning
- only correct for the external product inside a cmux
Example
use concrete_npe::GSW ;
type Torus = u32;
// settings
let dimension: usize = 256 ;
let l_gadget: usize = 4 ;
let base_log: usize = 7 ;
let var_gsw: f64 = f64::powi(2., -38) ;
let var_lwe: f64 = f64::powi(2., -40) ;
// Computing the noise
let var_external_product = <Torus as GSW>::external_product(dimension, l_gadget,
base_log, var_gsw, var_lwe) ;
Return the variance of the cmux given a set of parameters. To see how to use it, please refer to the test of the cmux. Arguments
var_lwe_0
- noise variance of the first LWEvar_lwe_1
- noise variance of the second LWEvar_gsw
- noise variance of the GSWdimension
- the size of the LWE maskbase_log
- decomposition base of the gadget matrixl_gadget
- number of elements for the Torus decomposition
Output
- Returns the variance of the output LWE
Example
use concrete_npe::GSW ;
type Torus = u32;
// settings
let dimension: usize = 256 ;
let l_gadget: usize = 4 ;
let base_log: usize = 7 ;
let var_gsw: f64 = f64::powi(2., -38) ;
let var_lwe_0: f64 = f64::powi(2., -40) ;
let var_lwe_1: f64 = f64::powi(2., -40) ;
// Computing the noise
let var_cmux = <Torus as GSW>::cmux(var_lwe_0, var_lwe_1, var_gsw,
dimension, base_log, l_gadget) ;
Return the variance of the external product given a set of parameters. To see how to use it, please refer to the test of the external product. Arguments
dimension
- the size of the LWE maskl_gadget
- number of elements for the Torus decompositionbase_log
- decomposition base of the gadget matrixvar_gsw
- noise variance of the GSWvar_lwe
- noise variance of the LWE
Output
- Returns the variance of the output LWE
Warning
- only correct for the external product inside a cmux
Example
use concrete_npe::GSW ;
type Torus = u64;
// settings
let dimension: usize = 256 ;
let l_gadget: usize = 4 ;
let base_log: usize = 7 ;
let var_gsw: f64 = f64::powi(2., -38) ;
let var_lwe: f64 = f64::powi(2., -40) ;
// Computing the noise
let var_external_product = <Torus as GSW>::external_product(dimension, l_gadget,
base_log, var_gsw, var_lwe) ;
Return the variance of the cmux given a set of parameters. To see how to use it, please refer to the test of the cmux. Arguments
var_lwe_0
- noise variance of the first LWEvar_lwe_1
- noise variance of the second LWEvar_gsw
- noise variance of the GSWdimension
- the size of the LWE maskbase_log
- decomposition base of the gadget matrixl_gadget
- number of elements for the Torus decomposition
Output
- Returns the variance of the output LWE
Example
use concrete_npe::GSW ;
type Torus = u64;
// settings
let dimension: usize = 256 ;
let l_gadget: usize = 4 ;
let base_log: usize = 7 ;
let var_gsw: f64 = f64::powi(2., -38) ;
let var_lwe_0: f64 = f64::powi(2., -40) ;
let var_lwe_1: f64 = f64::powi(2., -40) ;
// Computing the noise
let var_cmux = <Torus as GSW>::cmux(var_lwe_0, var_lwe_1, var_gsw,
dimension, base_log, l_gadget) ;