Skip to content

Conversation

@rickwebiii
Copy link

Allow users to read the invariant noise as a double precision value. This provides more fidelity when validating noise models.

for (size_t i = 0; i < coeff_modulus_size; i++) {
auto power = static_cast<double>(sizeof(uint64_t) * 8 * i);
auto word = static_cast<double>(norm.get()[i]);
invariant_noise += word * exp2(power);
Copy link
Author

@rickwebiii rickwebiii Aug 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking through other code, I suspect this is the wrong way to reduce a coefficient into a double precision number as this doesn't take into account the coefficient modulus values.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nevermind, I now think this is correct. The coefficients are indeed stored as RNS, which is what led to my doubt. However, invariant_noise_internal (the code I factored out of the existing invariant_noise_budget function) calls compose_array(noise_poly, coeff_count, pool_) before computing the infinity norm. This converts the RNS to multi-precision, so the infinity norm is a multi-precision value, which is what I was assuming here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant