Default lp_degree of MultiIndexSet initialized from array
When initializing the MultiIndexSet
using array, if the lp_degree is not explicitly specified, it is assumed to be 2.0
by default. This causes issue in the current version of Canonical poly with the result of any arithmetic operation being always a polynomial of lp_degree 2.0
because the resulting MultiIndexSet is initialized in this way.
- Can
lp_degree
be inferred from the array? If not, we should enforce thatlp_degree
must be specified when initializing with arrays. - Can we define
lp_degree
if the multiindices are incomplete?
Minimal code to reproduce the issue:
import minterpy as mp
from numpy.testing import assert_equal
mi1 = mp.MultiIndexSet.from_degree(spatial_dimension=2, poly_degree=3, lp_degree=1.0)
mi2 = mp.MultiIndexSet(mi1.exponents)
assert mi1.lp_degree == mi2.lp_degree