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

if_then_else_parallelized(c, a, b): Allow a and b to be BooleanBlock #825

Closed
matthiasgeihs opened this issue Jan 28, 2024 · 3 comments · Fixed by #1155
Closed

if_then_else_parallelized(c, a, b): Allow a and b to be BooleanBlock #825

matthiasgeihs opened this issue Jan 28, 2024 · 3 comments · Fixed by #1155
Assignees

Comments

@matthiasgeihs
Copy link

matthiasgeihs commented Jan 28, 2024

What is the problem you want to solve and can not with the current version?
Since the introduction of BooleanBlock in 0.5.0, k.if_then_else_parallelized(c, a, b) expects c to be a BooleanBlock and a and b to implement trait IntegerRadixCiphertext, for an integer radix key k.

Sometimes, however, we want to compute an if_then_else on a triple of boolean values (i.e., a and b being of type BooleanBlock). This is not possible currently.

Describe the solution you'd like
Either allow a and b of type BooleanBlock as an input to k.if_then_else_parallelized(c, a, b), or provide a separate function on the key that permits such inputs.

Describe alternatives you've considered
It is possible to achieve the desired functionality by converting to and from RadixCiphertext, or via k.boolean_bitor(k.boolean_bitand(c, a), k.boolean_bitand(k.boolean_bitnot(c), a)), but this is cumbersome.

Additional context
tfhe-rs = { version="0.5.0" }

@IceTDrinker
Copy link
Member

Hello @matthiasgeihs yep, we'll add that possibility, it's really not much but it is indeed not available currently

@arajasek
Copy link

Is the proposal here simply to add an if_then_else_boolean_parallelized? I'm happy to open a PR implementing that if that's the case.

@IceTDrinker
Copy link
Member

Yes I think it's the idea, we have been far more busy than anticipated and in the end did not tackle that, @arajasek if you have signed the CLA and see how to integrate that in integer and in the tests then sure

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 a pull request may close this issue.

4 participants