Introduction
Introduction to groups, representations, and steerable convolutions using the SteerableConvolutions.jl package.
using SteerableConvolutions
Groups
A group
G = CyclicGroup(8)
CyclicGroup(8)
We can access or create elements of the group. An element
g = G(3)
CyclicGroup(8)(3)
A group element
typeof(g), g.group, g.n
(Element{CyclicGroup, Int64}, CyclicGroup(8), 3)
Since the group is finite, all the group elements can be accessed with the elements
function:
elements(G)
8-element Vector{Element{CyclicGroup, Int64}}:
CyclicGroup(8)(0)
CyclicGroup(8)(1)
CyclicGroup(8)(2)
CyclicGroup(8)(3)
CyclicGroup(8)(4)
CyclicGroup(8)(5)
CyclicGroup(8)(6)
CyclicGroup(8)(7)
Group elements can be multiplied. This group action represents consecutive rotations, which creates a new group element. Note how the angles start over after 8 rotations.
G(1) * G(2), G(3) * G(7)
(CyclicGroup(8)(3), CyclicGroup(8)(2))
The unit element
one(G), one(g), G(0), G(2) * G(-2)
(CyclicGroup(8)(0), CyclicGroup(8)(0), CyclicGroup(8)(0), CyclicGroup(8)(0))
The unit elements does not modify the angle:
one(G) * G(3)
CyclicGroup(8)(3)
Since the group action is analogous to multiplication, we can compute inverses and powers:
inv(g), g^2
(CyclicGroup(8)(5), CyclicGroup(8)(6))
Group representations
A linear Representation
of a group
where
Regular representation
One such representation is the regular representation, which encodes the group action using a permutation matrix of size
ρ = regular_representation(G)
round.(Int, ρ(g))
8×8 Matrix{Int64}:
0 0 0 0 0 1 0 0
0 0 0 0 0 0 1 0
0 0 0 0 0 0 0 1
1 0 0 0 0 0 0 0
0 1 0 0 0 0 0 0
0 0 1 0 0 0 0 0
0 0 0 1 0 0 0 0
0 0 0 0 1 0 0 0
Internally, all Representation
s are stored in a different basis, leading to some round-off errors:
ρ(g)
8×8 Matrix{Float64}:
2.08322e-16 2.52189e-17 -2.25256e-16 … 4.77749e-16 -4.14108e-16
-1.25056e-16 3.02922e-17 -6.61772e-17 1.0 2.7533e-16
9.73001e-17 1.63997e-16 -1.14234e-16 -1.32874e-16 1.0
1.0 2.53663e-18 -3.84216e-17 -1.16926e-16 -2.9981e-17
1.52811e-16 1.0 2.32711e-16 5.90395e-18 -1.64308e-16
-1.52811e-16 1.41315e-16 1.0 … -2.00193e-16 1.36552e-16
9.73001e-17 -1.41315e-16 9.39328e-17 -1.18996e-16 4.38588e-17
-4.17889e-17 -1.36241e-16 1.83623e-16 -2.27949e-16 1.08797e-16
One property of group representations is that group actions are represented as matrix multiplications:
g, h = G(3), G(-1)
g * h
CyclicGroup(8)(2)
The corresponding matrix is
matrix = ρ(g * h)
round.(Int, matrix)
8×8 Matrix{Int64}:
0 0 0 0 0 0 1 0
0 0 0 0 0 0 0 1
1 0 0 0 0 0 0 0
0 1 0 0 0 0 0 0
0 0 1 0 0 0 0 0
0 0 0 1 0 0 0 0
0 0 0 0 1 0 0 0
0 0 0 0 0 1 0 0
Compare with
matrix = ρ(g) * ρ(h)
round.(Int, matrix)
8×8 Matrix{Int64}:
0 0 0 0 0 0 1 0
0 0 0 0 0 0 0 1
1 0 0 0 0 0 0 0
0 1 0 0 0 0 0 0
0 0 1 0 0 0 0 0
0 0 0 1 0 0 0 0
0 0 0 0 1 0 0 0
0 0 0 0 0 1 0 0
As a result, the matrix of the unit element is always the identity matrix:
round.(Int, ρ(one(G)))
8×8 Matrix{Int64}:
1 0 0 0 0 0 0 0
0 1 0 0 0 0 0 0
0 0 1 0 0 0 0 0
0 0 0 1 0 0 0 0
0 0 0 0 1 0 0 0
0 0 0 0 0 1 0 0
0 0 0 0 0 0 1 0
0 0 0 0 0 0 0 1
Irreducible representations
The regular representation is composed of irreducible represenations (Irrep
s). For the circular group, there are
ψ₀ = Irrep(G, 0)
ψ₀(G(0)), ψ₀(G(1)), ψ₀(G(2))
([1.0;;], [1.0;;], [1.0;;])
The next irrep
ψ₁ = Irrep(G, 1)
ψ₁(g)
2×2 Matrix{Float64}:
-0.707107 -0.707107
0.707107 -0.707107
All the valid irrep frequencies are accessible through the frequencies
function:
frequencies(G)
0:4
Direct sums
The direct sum of two represenations is a new representation that gives the block diagonal concatenation of the original matrices. It can be called using the directsum
function or the ⊕
operator (type \oplus<tab>
):
ρ_sum = ψ₀ ⊕ ψ₀ ⊕ ψ₀ ⊕ ψ₁
ρ_sum(G(1))
5×5 Matrix{Float64}:
1.0 0.0 0.0 0.0 0.0
0.0 1.0 0.0 0.0 0.0
0.0 0.0 1.0 0.0 0.0
0.0 0.0 0.0 0.707107 -0.707107
0.0 0.0 0.0 0.707107 0.707107
ρ_sum(G(2))
5×5 Matrix{Float64}:
1.0 0.0 0.0 0.0 0.0
0.0 1.0 0.0 0.0 0.0
0.0 0.0 1.0 0.0 0.0
0.0 0.0 0.0 6.12323e-17 -1.0
0.0 0.0 0.0 1.0 6.12323e-17
ρ_sum(G(3))
5×5 Matrix{Float64}:
1.0 0.0 0.0 0.0 0.0
0.0 1.0 0.0 0.0 0.0
0.0 0.0 1.0 0.0 0.0
0.0 0.0 0.0 -0.707107 -0.707107
0.0 0.0 0.0 0.707107 -0.707107
Any representation
where ρ
:
B = basis(ρ)
8×8 Matrix{Float64}:
0.353553 0.5 0.0 … 0.0 0.353553
0.353553 0.353553 0.353553 0.353553 -0.353553
0.353553 3.06162e-17 0.5 -0.5 0.353553
0.353553 -0.353553 0.353553 0.353553 -0.353553
0.353553 -0.5 6.12323e-17 1.83697e-16 0.353553
0.353553 -0.353553 -0.353553 … -0.353553 -0.353553
0.353553 -9.18485e-17 -0.5 0.5 0.353553
0.353553 0.353553 -0.353553 -0.353553 -0.353553
The irreps of ρ are stored as a list of frequencies
I = frequencies(ρ)
5-element Vector{Int64}:
0
1
2
3
4
We can assemble the direct sum:
ρ_block = ⊕(map(i -> Irrep(G, i), I)...)
ρ_block(g)
8×8 Matrix{Float64}:
1.0 0.0 0.0 0.0 … 0.0 0.0 0.0
0.0 -0.707107 -0.707107 0.0 0.0 0.0 0.0
0.0 0.707107 -0.707107 0.0 0.0 0.0 0.0
0.0 0.0 0.0 -1.83697e-16 0.0 0.0 0.0
0.0 0.0 0.0 -1.0 0.0 0.0 0.0
0.0 0.0 0.0 0.0 … 0.707107 -0.707107 0.0
0.0 0.0 0.0 0.0 0.707107 0.707107 0.0
0.0 0.0 0.0 0.0 0.0 0.0 -1.0
We can verify that the direct sum is equal to the regular representation when applying the change of basis:
B * ρ_block(g) * inv(B) ≈ ρ(g)
true
This page was generated using Literate.jl.