Roots of Unity

class fft.roots_of_unity.NthRootsOfUnity(n: int)

This calculates a list of the nth roots of unity.

This is initialised with the order of the roots of unity we want to generate. The order of a cyclic group is smallest power you can raise them all to, to make the identity.

nint

The order of the roots.

squared()NthRootsOfUnity

Returns a list of the square of each of the roots of unity. The type was kept as NthRootsOfUnity for convenience.

copy_roots()

Creates a copy of the NthRootsOfUnity.

Returns

The nth root of unity where n was the input value at some point in time.

first_half()
Returns

The first half of the NthRootsOfUnity.

squared()
Returns

The square of each of the roots of unity.