Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add TUniform distribution #130

Merged
merged 1 commit into from
Nov 20, 2024
Merged

Add TUniform distribution #130

merged 1 commit into from
Nov 20, 2024

Conversation

bencrts
Copy link
Collaborator

@bencrts bencrts commented Sep 25, 2024

Adding the TUniform distribution which is used in the tfhe-rs library (as well as other FHE schemes, such as BGV/CKKS). This is essentially a generalisation (consider b=0) of the distribution which samples:

-1 with prob 1/4
1 with prob 1/4
0 with prob 1/2

which is commonly mixed up with the uniform ternary distribution. More generically, the distribution TUniform(-2**b, 2**b) samples:

-2**b, 2**b each with probability 1/2**(b+2)
the other terms with probability 1/2**(b+1)

For small values of b, the associated standard deviation is different enough from the Uniform() distribution that it is worth including both.

@malb
Copy link
Owner

malb commented Nov 20, 2024

lgtm

@malb malb merged commit 5c9fc14 into main Nov 20, 2024
4 checks passed
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.

2 participants