Concrete Numpy supported method not compilable with multi input

I’m trying to compile the right shift function np.right_shift which is under the list of supported numpy functions but I run into an error. This seems to be the case with all multi input bitwise operators. Functions such as np.add work fine. Even these functions as long as I make them single parameter, they work fine. i.e return np.right_shift(x,2)

My code:

import concrete.numpy as cnp

def shift_right(x,n):
    return np.right_shift(x,n)

compiler = cnp.Compiler(shift_right, {"x": "encrypted", "n": "encrypted"})
circuit = compiler.compile(inputset)
inputset = [(2, 3), (0, 0), (1, 6), (7, 7), (7, 1), (3, 2), (6, 1), (1, 7), (4, 5), (5, 4)]

RuntimeError: Function you are trying to compile cannot be converted to MLIR

%0 = x # EncryptedScalar
%1 = n # EncryptedScalar
%2 = right_shift(%0, %1) # EncryptedScalar
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ only single input table lookups are supported
return %2

What am I missing ?

Hey @Abhinay1997,

Most of those operations are converted to table lookups, and table lookups cannot have 2 inputs. Basically, they are mostly supported between an encrypted value and a constant.

That being said, we’re aware that bitwise operations are very useful between encrypted values. Therefore, we created bounties to support them between encrypted values (see bounty-program/Bounties/Engineering at main · zama-ai/bounty-program · GitHub). And there are people working on them, so they might be available soon!

Hope this answers your question.
Umut