unfrozen = poly(**{
("q%d" % idx): 1 for idx, keep in enumerate(freeze) if keep})
frozen = poly(**{
("q%d" % idx): 1 for idx, keep in enumerate(freeze) if not keep})
// if no unfrozen, poly will return numpy.ndarray instead of numpoly.ndpoly
if not isinstance(unfrozen, polynomials.ndpoly):
return polynomials.sum(frozen, 0)
// Remove frozen coefficients, such that poly == sum(frozen*unfrozen) holds
for key in unfrozen.keys:
unfrozen[key] = unfrozen[key] != 0
return polynomials.sum(frozen*E(unfrozen, dist), 0)