@classmethod
def init_from_nonzero_tuples(cls, d, dtype):
    """
        Create a polynomial from a list of tuples (in the format
        of poly.nonzero output).
        """
    q = cls.zero(dtype=dtype)
    for idx, val in d:
        q[idx] = val
    return q
