Problem
CTArray currently mixes user-facing API methods with backend arithmetic logic. Some operations use __tensor_function__, while others call arithmetic operations directly inside the class.
Proposed change
Keep NumPy-style wrappers such as a.sum() inside CTArray, but move the actual arithmetic logic to backend modules such as matrix_arithmetic.py.
Expected structure:
CTArray.sum(...)
-> __tensor_function__("sum", ...)
-> registered backend function
-> OpenFHE implementation
Problem
CTArraycurrently mixes user-facing API methods with backend arithmetic logic. Some operations use__tensor_function__, while others call arithmetic operations directly inside the class.Proposed change
Keep NumPy-style wrappers such as
a.sum()insideCTArray, but move the actual arithmetic logic to backend modules such asmatrix_arithmetic.py.Expected structure: