factoring in Gaussian integers

27 views
Skip to first unread message

Michael Beeson

unread,
Jun 24, 2022, 12:14:10 PM6/24/22
to sage-support

The following seems fishy:

``

sage: K.<a> = QuadraticField(-1)                                                

sage: K.factor(13)                                                              

(Fractional ideal (-3*a - 2)) * (Fractional ideal (2*a + 3))

``

slelievre

unread,
Jun 24, 2022, 1:01:51 PM6/24/22
to sage-support
2022-06-24 16:14:10 UTC, Michael Beeson:
> ```

From the documentation for `K.factor`:

   Ideal factorization of the principal ideal generated by n.

Is this closer to what you wanted?
```
sage: K(13).factor()
(a) * (-3*a - 2) * (2*a + 3)
```


Reply all
Reply to author
Forward
0 new messages