numpoly.remove_redundant_names#
- numpoly.remove_redundant_names(exponents: ArrayLike, names: Sequence[str] | None) Tuple[ndarray, Tuple[str, ...] | None][source]#
Remove names if they are redundant to the polynomial representation.
Will always keep at least one dimension.
- Args:
- exponents:
The exponents in an integer array with shape
(N, D), whereNis the number of terms in the polynomial sum andDis the number of dimensions.- names:
The indeterminant names, either as string names or as simple polynomials. Must correspond to the exponents by having length
D.
- Return:
Same as inputs, but with redundant exponent columns and names removed. This corresponds to
Dbeing lowered.- Example:
>>> exponents, names = remove_redundant_names( ... [[0, 0], [1, 1]], ["q0", "q1"]) >>> exponents array([[0, 0], [1, 1]]) >>> names ('q0', 'q1') >>> exponents, names = remove_redundant_names( ... [[0, 0], [0, 1]], ["q0", "q1"]) >>> exponents array([[0], [1]]) >>> names ('q1',) >>> exponents, names = remove_redundant_names( ... [[0, 0]], ["q0", "q1"]) >>> exponents array([[0]]) >>> names ('q0',)