Ask Your Question

Revision history [back]

What you are looking for is J.gens_reduced() instead of J.gens().

Instead of g^4 you can just write cl.one(). The class group has order $2$ so g^2 is already cl.one(). Instead of comparing classes you can also just ask J.is_principal().