The function divide_by_vanishing_poly(domain) for the DensePolynomial, seems assuming the domain is a multiplicative subgroup, i.e., the vanishing polynomial is of the form x^n - 1. However, this fact is not reflecting from the comments and description of such function. In practice, the domain could also be a coset(i.e.,an "offset" domain, where the vanishing polynomial of the form x^n - w for a specific w). Perhaps this function needs to be refined a little bit for more clarification, or adapt to a more general domain.