Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Roots of unity are best defined as generator of the cyclotomic field. That is, a good start for your code would be

F.<w> = CyclotomicField(q) 
TwoPolyRing.<t> = F[]

and then you don't need to worry about the relation w^q - 1 as it automatically holds for w.