cswiercz/abelfunctions — Issue #1: Puiseux 'classical' algorithm can't construct polynomial
Author: cswiercz
Created: 2012-03-03 22:05:05+00:00
State: open
Labels: bug

In the function `singular_term(...)` the 'classical' algorithm needs to create a polynomial `U**q-xi` where `xi` is an algebraic number.

```python
for (Psi,r) in _square_free(Phi):
for (xi, M) in sympy.roots(Psi).iteritems():
# the classical version returns the "raw" roots
if version == 'classical':
P = sympy.poly(U**q-xi,U)
for beta in sympy.roots(P).keys():
tau = (q,1,m,beta)
T.append((tau,l,r))
```

Sometimes, this fails due to a value error `ValueError: can't raise polynomial to a negative power`. With some experimentation, it turns out that certain `xi` with `I` in the denominator cause the fault.

Possible fixes include simplifying `xi`. If sympy has special functionality for computing cyclotomic roots then I'll try that as well.

This issue is mostly a reminder to me beacuse I have to work on other things for the next few days.