|q⟩ Bad Qubits

intermediate · Programming · The Hidden Subgroup Problem (Intro)

Group Theory Essentials

Several of the most important quantum algorithms — Shor's factoring, Deutsch–Jozsa, Simon's algorithm — are unified by a single algebraic framework called the Hidden Subgroup Problem. Before diving into that framework you need a small vocabulary from abstract algebra. This lesson gives you exactly what you need: groups, subgroups, and cosets.

Groups

A group (G,)(G, \cdot) is a set GG equipped with a binary operation \cdot satisfying four axioms:

  1. Closure — for all a,bGa, b \in G, the product aba \cdot b is also in GG.
  2. Associativity(ab)c=a(bc)(a \cdot b) \cdot c = a \cdot (b \cdot c) for all a,b,cGa, b, c \in G.
  3. Identity — there exists an element eGe \in G such that ea=ae=ae \cdot a = a \cdot e = a for every aGa \in G.
  4. Inverses — for every aGa \in G there exists a1Ga^{-1} \in G with aa1=ea \cdot a^{-1} = e.

The operation need not be commutative. When ab=baa \cdot b = b \cdot a for all a,ba, b the group is called abelian (or commutative).

Familiar examples

| Group | Operation | Identity | Abelian? | |-------|-----------|----------|----------| | Z\mathbb{Z} (integers) | addition | 00 | yes | | ZN={0,1,,N1}\mathbb{Z}_N = \{0,1,\dots,N{-}1\} | addition mod NN | 00 | yes | | Z2n={0,1}n\mathbb{Z}_2^n = \{0,1\}^n | bitwise XOR | 0\mathbf{0} | yes | | (Z/NZ)(\mathbb{Z}/N\mathbb{Z})^* (units mod NN) | multiplication mod NN | 11 | yes | | SnS_n (permutations of nn items) | composition | identity permutation | no (for n3n \geq 3) |

The group Z2n\mathbb{Z}_2^n with bitwise XOR is the domain for Simon's algorithm; the group (Z/NZ)(\mathbb{Z}/N\mathbb{Z})^* is the domain for Shor's order-finding.

Subgroups

A subset HGH \subseteq G is a subgroup of GG if HH is itself a group under the same operation. The quickest check is the subgroup criterion: a non-empty subset HH is a subgroup if and only if for every a,bHa, b \in H, the element ab1a \cdot b^{-1} is also in HH.

Example — even integers

Inside (Z,+)(\mathbb{Z}, +), the set of even integers 2Z={,4,2,0,2,4,}2\mathbb{Z} = \{\dots, -4, -2, 0, 2, 4, \dots\} is a subgroup: the sum of two even numbers is even, and the additive inverse of an even number is even.

Example — powers of a group element

Given any gGg \in G, the set g={e,g,g2,g3,}\langle g \rangle = \{e, g, g^2, g^3, \dots\} is a subgroup called the cyclic subgroup generated by gg. If gg has order rr, then g=r|\langle g \rangle| = r.

Lagrange's theorem states that for a finite group GG and any subgroup HH, H divides G.|H| \text{ divides } |G|. This is the reason we always expect the order rr in Shor's algorithm to divide ϕ(N)\phi(N).

Cosets

Given a subgroup HGH \leq G and an element gGg \in G, the left coset of HH containing gg is

gH={gh    hH}.g H = \{ g \cdot h \;\mid\; h \in H \}.

Two left cosets are either identical or completely disjoint; together they partition GG into [G:H]=G/H[G : H] = |G|/|H| equal-sized pieces (each of size H|H|).

Concrete example in Z6\mathbb{Z}_6

Let G=Z6={0,1,2,3,4,5}G = \mathbb{Z}_6 = \{0,1,2,3,4,5\} (addition mod 6) and H={0,2,4}H = \{0, 2, 4\} (the even residues — a subgroup of order 3). The cosets are

H={0,2,4},1+H={1,3,5}.H = \{0, 2, 4\}, \qquad 1 + H = \{1, 3, 5\}.

There are two cosets (G/H=6/3=2|G|/|H| = 6/3 = 2), they are disjoint, and their union is all of Z6\mathbb{Z}_6.

Why this matters for quantum computing

The Hidden Subgroup Problem (HSP) asks: given a function f:GSf : G \to S that is constant on cosets of some hidden subgroup HH and distinct on different cosets, find HH.

Every classical algorithm for this problem requires exponentially many queries when GG is large. Quantum algorithms can solve it with a polynomial number by creating a uniform superposition over a coset, measuring ff, and then using the quantum Fourier transform to extract the hidden subgroup from the resulting coset state.

Deutsch–Jozsa, Bernstein–Vazirani, Simon's algorithm, and Shor's algorithm are all instances of this single template applied to specific groups:

The next lesson makes this connection precise.

Sign in on the full site to ask questions and join the discussion.