clifford: array of multivectors fails
@rkern or @moble, do either of you know why this happens?
import numpy as np
from clifford import Cl
layout,blades = Cl(2) # note i changed firstIdx=1 by default in Cl
locals().update(blades)
np.array([e1,e2],dtype=np.object)
yields
array([[0, 1, 0, 0],
[0, 0, 1, 0]], dtype=object)
perhaps there are some special array-like methods that Multivector implements? is there a way to have an array of multivectors, instead of an array of their values?
About this issue
- Original URL
- State: open
- Created 8 years ago
- Comments: 15 (15 by maintainers)
The big problem with
__array_wrap__is it runs after numpy has already done the computation. If you’re going to just do your own computation, you should use__array_ufunc__.But if you’re not trying to be an array at all, then telling numpy how to turn yourself into one is sufficient.