Add an inner method to BindingsArray that allows combining two bindings arrays with the same shape
Eg
class BindingsArray:
def inner(self, other: BindingsArray) -> BindingsArray:
# validate self and other have distinct parameters
# validate self and other have same shape (or more generally broadcast compatible shapes?)
# construct the data dict combining the two bas
...
This method could either require the arrays have the same shape, or alternatively that they have broadcastable
shapes (eg if other.shape = (*extra_dims, *self.shape) the return would be other.shape, or if other.shape = shape + self.ndim * (1,) the return would be equivalent to the outer product (up to ordering of dimensions).
Maybe this method could be called combine or something like that instead.
What should we add?
Add an
inner
method toBindingsArray
that allows combining two bindings arrays with the same shapeEg
This method could either require the arrays have the same shape, or alternatively that they have broadcastable shapes (eg if
other.shape = (*extra_dims, *self.shape)
the return would beother.shape
, or ifother.shape = shape + self.ndim * (1,)
the return would be equivalent to the outer product (up to ordering of dimensions). Maybe this method could be calledcombine
or something like that instead.Related to #12437