Skip to main content
Try out the RareSkills ZK AI Tutor!
The RareSkills Book of Zero Knowledge

Roots of Unity in Finite Fields

Last updated on Oct 29, 2025

This article explains what Roots of Unity in a Finite Field are and how they are intertwined with multiplicative subgroups. The reader is expected to be familiar with the prior chapter about the Fundamental Theorem of Cyclic Groups.

That theorem states that, given a multiplicative group 𝔽q∗ of order q−1, there exists a unique subgroup of order k when k divides q−1. Otherwise, if k does not divide q−1, no subgroup of order k exists.

It also states that, if g is a generator of 𝔽q∗, then gq−1k generates the subgroup of order k.

In this article, we will show that all elements of this subgroup are what are called k-th roots of unity, and that the generator ω is what is called a primitive k-th root of unity.

Motivation and goal for this chapter

The square roots of 1 in a finite field are easy to compute: they are the numbers congruent to 1 and negative 1 (which are 1 and q−1 respectively. Remember that, in a field 𝔽q, the number −x is congruent to q−x ). In other words, 1={1,q−1}. This set is the set of solutions of the equation a2≡1, where a is an element of the finite field.

But what if we want to compute the cube roots of 1, or more generally, the k-th roots of 1, i.e., 1k? By definition, k-th roots of unity are the elements that satisfy the equation ak≡1. But how can we find them?

We could try all elements one by one — a brute-force approach — but that would be infeasible when the field contains many elements. Fortunately, there is a simple way to find them all. In the finite field 𝔽q, the k-th roots of unity are precisely the elements of the multiplicative subgroup of order k. This definition assumes k divides q−1.

To state it in the strongest possible terms: If an element a in a finite field is part of a multiplicative subgroup of order k, then it is a k-th root of unity, and ak≡1. And if an element a is a k-th root of unity (meaning ak≡1), then it is part of a multiplicative subgroup of order k.

Equivalence of terminology

It may seem like we are just adding a new terminology for the same entity (an element in a multiplicative group) and pointing out that raising it to the k-th power equals 1.

In a certain sense, yes, we are introducing a new term for the same entity: a k-th root of unity is an element in a multiplicative subgroup of order k and vice-versa. Normally, giving the same entity two names leads to confusion, so we need to justify introducing the term “root of unity.”

When we speak about cyclic groups of order k in the most general sense, we do not have the guarantee that taking an element in that group and applying the binary operator to that element and itself k times results in the identity element, i.e., ak≡1 , or more generally for a binary operator ⋆:

a⋆a⋆⋯⋆a⏟k=identity

For cyclic groups in general, the above property is not guaranteed to hold, but for roots of unity in a finite field, it is guaranteed.

Therefore, we can say that roots of unity have all the properties the Fundamental Theorem of Cyclic groups says they should have, and they have the property that ak≡1.

So, to put the reader’s mind at ease, you already know a good bit about roots of unity in a finite group simply because you understand the Fundamental Theorem of Cyclic Groups. Since roots of unity in a finite field are a cyclic subgroup, the Fundamental Theorem of Cyclic Groups applies to them.

However, the added guarantee that ak≡1 unlocks additional properties that efficient ZK algorithms directly leverage. These properties enable us to create efficient algorithms like the Number Theoretic Transform and other Zero-Knowledge Proof algorithms, such as PLONK and ZK-STARKs.

We study these additional properties of roots of unity in later chapters. This chapter focuses on definitions and examples to build the understanding that an element a in a finite field has the property ak≡1 if and only if it is part of a multiplicative subgroup of order k.

Computing k-th roots of unity is the same as finding the multiplicative subgroup of order k

In the article on the Fundamental Theorem of Cyclic Groups, we learned how to find all the elements of a multiplicative subgroup of order k. First, we obtain a generator of this subgroup from the generator of the multiplicative group 𝔽q∗. Then, using this generator, we can find all the elements of the subgroup of order k.

Thus, finding the k-th roots of unity of 𝔽q is no different from finding the multiplicative subgroup of order k, if k divides q−1, which we already know how to do.

Our aim in this chapter is to prove this equivalence - between the group of all k-th roots of unity and the multiplicative subgroup of order k, if k divides q−1.

To do this, we need to prove the following two statements:

  1. Every element a within the multiplicative subgroup of order k satisfies ak≡1.
  2. Suppose k divides q−1. Then, every element a in 𝔽q∗ that satisfies ak≡1 belongs to the unique subgroup of order k.

We will explore these two statements through examples to illustrate that they hold true. Since the formal proofs can be somewhat mathematically demanding, we will defer some of them to the appendix for the interested reader, though we have made the effort to make the proofs as widely understandable as possible.

1. Every element a in the subgroup of order k satisfies ak≡1

This first statement shows that all elements of the multiplicative subgroup of order k are k-th roots of unity.

However, this is NOT sufficient to establish the equivalence between the group of all k-th roots of unity and the multiplicative subgroup of order k (when k divides q−1) since it does not guarantee that all k-th roots of unity belong to this subgroup — which will be discussed in Statement 2.

We will begin this section with a proof of this statement, and then show through examples that this statement holds true.

Proof of Statement 1

Recall from the article on the Fundamental Theorem of Cyclic Groups that a unique subgroup of order k is generated by ω=gq−1k, where g is a generator of the multiplicative group 𝔽q∗. We refer to ⟨ω⟩ as the elements generated by taking successive powers of ω modulo q:

⟨ω⟩={ω0,ω1,ω2,…,ωk−1}.

Let ωm be an arbitrary element in ⟨ω⟩ for some 0≤m≤k−1. The goal is to prove that (ωm)k≡1.

The proof below assumes that the generator has the property ωk≡1; see Appendix A for the proof of this fact.

Let’s compute (ωm)k as follows:

(ωm)k=(ωmk)Power of a power rule =(ωkm)Commutativity of exponents=(ωk)mFactoring the exponent≡(1)mBased on the discussion in the appendix A: ωk≡1≡1One raised to an arbitrary power is 1.

Therefore, every element in the subgroup of order k, when raised to the power k, equals 1.

Example of Statement 1 in 𝔽7={0,1,2,3,4,5,6}

In this example, we have q−1=7−1=6. Also, the element g=3 is a generator of the multiplicative group 𝔽q∗={1,2,3,4,5,6}.

How to find the generator of the multiplicative group will not be covered in this article, but the galois library provides a quick way to do it. Given the field 𝔽q, one way to find the generator is by using the primitive_element property, as shown below.

import galois
GF = galois.GF(7) # define the field
GF.primitive_element # GF(3, order=7) 

Subgroup of order 3

Since 3 divides q−1=6, the Fundamental Theorem of Cyclic Groups guarantees the existence of a unique subgroup of order 3.

This subgroup is generated by 3q−1k=363=32=9≡2(mod7). Thus,

⟨2⟩={20,21,22}={1,2,4}.

Now, we want to verify that every element a in ⟨2⟩ satisfies a3≡1. This is done below:

13≡1(mod7)23≡8≡1(mod7)43≡16⋅4≡2⋅4≡8≡1(mod7)

So, the elements 1,2 and 4 satisfy a3≡1(mod7). Therefore, the condition is satisfied.

Subgroup of order 2

Since 2 divides q−1=6, the Fundamental Theorem of Cyclic Groups guarantees the existence of a unique subgroup of order 2.

This subgroup is generated by 3q−1k=362=33=27≡6(mod7). Thus,

⟨6⟩={60,61}={1,6}.

Now, we want to verify that every element a in ⟨6⟩ satisfies a2≡1.

12≡1(mod7)62=36≡1(mod7)

So, the elements 1 and 6 satisfy a2≡1(mod7). Therefore, the condition is satisfied.

Exercise. Verify that every element a in 𝔽7∗ satisfies a6≡1.

2. If k divides q−1, then every element a in 𝔽q∗ with ak≡1 belongs to the unique subgroup of order k

This statement asserts that ALL k-th roots of unity belong to the multiplicative subgroup of order k, provided that k divides q−1.

In this section, we illustrate this claim through a few examples. The full proof is provided in Appendix B for the interested reader.

Before moving on, let’s consider the case where k does not divide q−1. In this situation, the Fundamental Theorem of Cyclic Groups tells us that there is no subgroup of order k, and therefore no equivalence can exist.

Example in 𝔽7={0,1,2,3,4,5,6}

In this example, we have q−1=7−1=6. Also, the element g=3 is a generator of the multiplicative group 𝔽q∗={1,2,3,4,5,6}.

Subgroup of order k=3

Since 3 divides q−1=6, there exists a unique subgroup of order 3. This subgroup is generated by 3q−1k=363=32=9≡2(mod7). Thus,

⟨2⟩={20,21,22}={1,2,4}.

We want to verify that every element a in 𝔽7∗ satisfying a3≡1 belongs to this unique subgroup of order k=3 in 𝔽7∗. Let’s find all such elements a in 𝔽7∗, as follows:

13≡1(mod7)23≡8≡1(mod7)33≡9⋅3≡2⋅3≡6(mod7)43≡16⋅4≡2⋅4≡8≡1(mod7)53≡25⋅5≡4⋅5≡20≡6(mod7)63≡36⋅6≡1⋅6≡6(mod7).

The elements 1,2 and 4 satisfy a3≡1(mod7). These three elements are exactly the members of the subgroup of order k=3 in 𝔽7∗. Therefore, every element a in 𝔽7∗ with a3≡1 belongs to the unique subgroup of order k=3.

Exercise. Verify that every element a in 𝔽7∗ satisfying a2≡1 belongs to the unique subgroup of order k=2.

Example in 𝔽17={0,1,2,…,16}

In this example, we have q−1=17−1=16. Also, the element g=3 is a generator of the multiplicative group 𝔽q∗={1,2,…,16}, which can be verified using the galois library:

GF = galois.GF(17) # define the field
GF.primitive_element # GF(3, order=17) 

Subgroup of order k=4

Since 4 divides q−1=16, there exists a unique subgroup of order 4. This subgroup is generated by 3q−1k=3164=34=81≡13(mod17). Thus,

⟨13⟩={130,131,132,133}={1,13,16,4}.

We want to verify that every element a in 𝔽17∗ satisfying a4≡1 belongs to this unique subgroup of order k=4 in 𝔽17∗. Let’s find all such elements a in 𝔽17∗, as follows:

14=124=16≢134=81≡13≢144≡16⋅16≡(−1)⋅(−1)≡154≡25⋅25≡7⋅7≡49≡15≢164≡36⋅36≡2⋅2≡4≢174≡49⋅49≡15⋅15≡(−2)⋅(−2)≡4≢184≡(23)4=(24)3≡(−1)3≡−1≡16≢1(mod17)94=81⋅81≡13⋅13≡(−4)⋅(−4)≡16≢1104≡100⋅100≡15⋅15≡(−2)⋅(−2)≡4≢1114≡121⋅121≡2⋅2≡4≢1124≡144⋅144≡8⋅8≡13≢1134≡169⋅169≡16⋅16≡(−1)⋅(−1)≡1144≡(−3)4≡9⋅9≡13≢1154≡(−2)4≡16≢1164≡(−1)4≡1.

The elements 1,4,13 and 16 satisfy a4≡1(mod17). These four elements are exactly the members of the subgroup of order k=4 in 𝔽17∗. Therefore, every element a in 𝔽17∗ with a4≡1 belongs to the unique subgroup of order k=4.

Exercise. Verify that every element a in 𝔽17∗ satisfying a8≡1 belongs to the unique subgroup of order k=8.

Primitive k-th root of unity

A primitive k-th root of unity is a special k-th root of unity: it is a k-th root of unity that generates all other k-th roots of unity.

Since the group of k-th roots of unity we are interested in is the same as the subgroup of order k, the primitive k-th roots of unity are exactly the generators of this subgroup.

Note: In the case where k does not divide q−1 (considering finite fields 𝔽q), there may still be k-th roots of unity, but in this case there are NO primitive k-th roots of unity.

Thus, finding a primitive k-th root of unity is straightforward: it is the same as finding a generator of the subgroup of order k, and the Fundamental Theorem of Cyclic Groups tells us how to do this.

A formal definition of a primitive k-th root of unity is that it is a k-th root of unity with order k, where the order of an element a is the smallest positive integer greater than zero r such that ar≡1.

For example, 4 is a 6th root of unity in 𝔽7 because 46≡1(mod7), but it is not a primitive 6th root because there is a power lower than 6 that makes it 1, specifically 3, i.e. 43≡1(mod7).

The number of primitive k-th roots of unity

Just as a subgroup of order k can have more than one generator, there can be more than one primitive k-th root of unity. The number of primitive k-th roots of unity is the same as the number of generators of the subgroup of order k.

The number of primitive k-th roots of unity (and generators) is given by Euler’s totient function ϕ(k). The proof of this fact is beyond the scope of this article. For the application we are considering—the Number Theoretic Transform—we only need a primitive k-th root of unity, which can be found using the Fundamental Theorem, assuming we know a generator for 𝔽q∗.

In the rest of this chapter, we will present examples showing how to use the Fundamental Theorem to find a primitive k-th root of unity, and then all k-th roots of unity for a given k.

Example of 4th roots of unity in 𝔽17∗

A generator of the multiplicative group 𝔽17∗ is the element 3, which can be found using the galois library.

A generator for the subgroup of order 4 is then ω=3164=34≡13.

Based on our discussion, this generator is a primitive 4th root of unity. Let us check that using the definition of a primitive k-th root of unity. We need to show that:

  1. Element 13 is a 4th root of unity. This can be seen by checking that 134≡1(mod17).
  2. The order of element 13 is 4. This means that 4 is the smallest positive integer r such that 13r≡1(mod17). Let us check that below:
131=13,132≡16,(mod17)133≡13⋅16≡4,134≡16⋅16≡−1⋅−1≡1.

Therefore, element 13 is a primitive 4th root of unity, and we can use element 13 to generate the subgroup of all 4th roots of unity, as follows:

⟨ω⟩={ω0,ω1,ω2,ω3,ω4}={130,131,132,133}={1,13,16,4}.

Example of 8th roots of unity in 𝔽17∗

Since g=3 is a generator of the multiplicative group 𝔽17∗, a generator for the subgroup of order 8 is ω=3168=32≡9.

Let us check that it is also a primitive 8th root of unity. We need to check that:

  1. Element 9 is a 8th root of unity. This can be seen by checking that 98≡1(mod17).
  2. The order of element 9 is 8. This means that 8 is the smallest positive integer r such that 9r≡1(mod17). Let us check that below:
91=9,92≡13,93≡9⋅13≡15,94≡13⋅13≡(−4)⋅(−4)≡16,(mod17)95≡9⋅16≡8,96≡9⋅8≡4,97≡9⋅4≡2,98≡9⋅2=18≡1.

Therefore, element 9 is a primitive 8th root of unity, and we can use element 9 to generate the subgroup of all 8th roots of unity, as follows:

⟨ω⟩={ω0,ω1,ω2,ω3,ω4,ω5,ω6,ω7}={90,91,92,93,94,95,96,97}={1,9,13,15,16,8,4,2}.

Exercise. Find a primitive 2nd root of unity in 𝔽17∗ and the subgroup of all 2nd roots of unity.

Conclusion and summary

An efficient method is needed to find all k-th roots of unity, which is what we studied in this article. In summary, we established that:

  • An element a of a finite field 𝔽q is a k-th root of unity if ak≡1.
  • If k divides q−1, then the subgroup of 𝔽q∗ containing all k-th roots of unity is the unique subgroup of order k guaranteed by the Fundamental Theorem of Cyclic Groups.
  • A primitive k-th root of unity generates the subgroup of all k-th roots of unity. If g is a generator of the multiplicative group 𝔽q∗ and k divides q−1, then the element ω=gq−1k is a primitive k-th root of unity.

Appendix A

The generator ω of the subgroup of order k satisfies**: ωk≡1**

Let g be a generator of the multiplicative group 𝔽q∗. Recall from the Fundamental Theorem of Cyclic Groups that the element ω=gq−1k generates the unique subgroup of order k. We aim to prove that ωk≡1.

Proof. Fermat’s Little Theorem states that if q is a prime number, then for any integer g:

gq≡g(modq).

For example, if g=2 and q=7, then 27≡2(mod7).

If g is not divisible by q, we can divide both sides of the equation above by g. This shows that Fermat’s Little Theorem is equivalent to the statement:

gq−1≡1(modq).

We now compute ωk as follows:

ωk=(gq−1k)kBy definition of ω=gq−1Simplifying the exponent≡1(modq)Applying Fermat’s Little Theorem

Appendix B

If a∈𝔽q∗ and ak≡1 then a is a member of a unique cyclic subgroup of order k.

Let g be a generator of 𝔽q∗. This equivalently means that g is a (q−1)-th root of unity.

Let ω=gq−1k be a generator for the multiplicative subgroup of order k (ω=gq−1k is directly from the Fundamental Theorem of Cyclic Groups).

If a∈𝔽q∗ and ak≡1 then we must prove that there exists an integer s such that ωs=a. The existence of integer s in ωs≡a proves that a can be generated by ω and thus is part of the unique subgroup of order k.

To find such an s, we will substitute ω with gq−1kand a with gm to convert ωs=a into:

(gq−1k)s=?gm

Can we come up with an s that makes the equation true? If we strategically pick an s such that the exponent q−1k will cancel and leave m we have:

s=mkq−1

Plugging s=mkq−1 into the left-hand side of this equation (gq−1k)s=?gm, we obtain

(gq−1k)(mkq−1)

We can see that the q−1 and k terms cancel, leaving us with gm.

gq−1kmkq−1⟹gm

We can substitute back the original definitions for gq−1k=ω, mkq−1=s, and gm=a and see that

ωs=a

Therefore, if ak≡1, then there does in fact exist an s such that ωs=a. s is simply

s=mkq−1

where m is the solution to gm=a, k is the order of the subgroup, and q is the modulus of our finite field.

However, we must still prove that s is an integer because generating a value by raising ω to a fraction doesn’t qualify as being a member of the subgroup generated by ω.

Showing s is an integer

To show that mkq−1 is an integer, we need to show that dividing mk by q−1 has no remainder.

When we carry out the division, we should get a quotient n and a remainder r. We want to show that r is necessarily 0.

mkq−1=n+r

A remainder cannot be larger than the divisor (e.g., 115 cannot have a remainder 5 or larger), so we also have the condition that:

0≤r<q−1

We can isolate mk in mk(q−1)=n+r by translating it from the form dividend / divisor = quotient + remainder to dividend = quotient⋅divisor + remainder. (To illustrate this re-write, consider that 6/4=1 remainder 2 can be written as 6 = 4⋅1 + 2). In re-written form, we have:

mk=n⋅(q−1)+rwhere 0≤r<q−1

In order to show that r=0, we will set aside mk=n⋅(q−1)+r for a moment, and derive another property of mk.

Fact: gmk≡1

gmk≡1 can be derived from the following facts:

  • ak≡1
  • a=gm

So by substitution, (gm)k≡1 and by the power of a power rule, gmk≡1.

Substitute mk=n⋅(q−1)+r into gmk≡1

We now have enough tools to show that the remainder r in mk=n⋅(q−1)+r is zero. We remind the reader that gq−1≡1 since g is a primitive (q−1)-th root of unity.

We now show that using the definitions

  • gmk≡1
  • mk=n⋅(q−1)+r
  • gq−1≡1

are sufficient to show that gmk≡gr:

gmk=gn⋅(q−1)+rSubstitution=gn⋅(q−1)⋅grPower multiplication rule=(gq−1)n⋅grPower of a power rule≡1⋅grBecause gq−1≡1=gr

As a consequence of gmk≡gr and gmk≡1, we have that

gr≡1

Since g is a primitive (q−1)-th root of unity, there are only two solutions for r:

  • r=0
  • r≡q−1

Recall that r is defined as the solution to

mkq−1=n+rwhere 0≤r<q−1

We know that any valid division mkq−1 cannot result in a remainder r of q−1 or higher, specifically, the remainder must be in the range 0≤r<q−1. That range restriction on the remainder implies r≠q−1.

So ruling out the possibility that r=q−1, the only solution for gr≡1 is r=0 (i.e. g0≡1).

Since r=0, the result of dividing mk by q−1 is an integer.

Finally, since s is defined as

s=mkq−1

s is an integer.