Context: Dunder methods on ArrayAnsatz such as __add__ currently fail if the shapes of the arrays do not match (e.g. adding a (1, 2, 2) and a (1, 3, 3) array). This PR includes calls to reduce in these dunder methods exploiting the fact we can just pad the smaller array with zeros making them compatible.
Description of the Change:reduce has been moved to ArrayAnsatz and __add__, __mul__ and __truediv__ make use of calls to reduce. Additionally, some cleanup such as reordering methods alphabetically.
Benefits: Interactions between ArrayAnsatz of different fock cutoffs are more flexible
Context: Dunder methods on ArrayAnsatz such as
__add__
currently fail if the shapes of the arrays do not match (e.g. adding a(1, 2, 2)
and a(1, 3, 3)
array). This PR includes calls to reduce in these dunder methods exploiting the fact we can just pad the smaller array with zeros making them compatible.Description of the Change:
reduce
has been moved toArrayAnsatz
and__add__
,__mul__
and__truediv__
make use of calls toreduce
. Additionally, some cleanup such as reordering methods alphabetically.Benefits: Interactions between ArrayAnsatz of different fock cutoffs are more flexible