| 1 | initial version |
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().
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.