Skip to content

ModularMatrix ​

An element of PSL(2,Z)\mathrm{PSL}(2,\mathbb{Z}) — or an LRLR word standing for one. Wolfram has no dedicated modular-group heads: elements multiply, invert and raise to a power exactly like any other integer matrix, via Dot, Inverse and MatrixPower — which is why those are widened in place to recognise a ModularMatrix or a word, rather than declared afresh.

ModularMatrix(a, b, c, d)the matrix (abcd)\begin{pmatrix}a&b\\c&d\end{pmatrix}, determinant 1
Dot(m, n)the group product — compute-engine's own head
MatrixPower(m, k)mm to the kk-th power, for any integer kk — compute-engine's own head
Inverse(m)the group inverse — compute-engine's own head
Typed signatures
TypePackageApplies
((string) -> expression<ModularMatrix>) & ((integer, integer, integer, integer) -> expression<ModularMatrix>)modularalways

Domain: The modular group

Details
  • Every head here also accepts a WORD in place of a matrix — ModularMatrix("LR") or just the string
  • A plain nested-list matrix pairs with a ModularMatrix too, since it canonicalises the same way; a Tuple or a Vector does not, and is left unevaluated — there's no settled convention for what that pairing should mean
  • MM and −M-M are the same element of PSL(2,Z)\mathrm{PSL}(2,\mathbb{Z}), so Inverse and MatrixPower may hand back the negated matrix

Examples

Basic #

the group product

live ↗
InDot(ModularMatrix(1,1,0,1),ModularMatrix(1,0,1,1))\mathrm{Dot}(\mathrm{ModularMatrix}(1, 1, 0, 1), \mathrm{ModularMatrix}(1, 0, 1, 1))OutModularMatrix(2,1,1,1)\mathrm{ModularMatrix}(2, 1, 1, 1)

no division needed at determinant 1

live ↗
InModularMatrix(1,1,0,1)−1\mathrm{ModularMatrix}(1, 1, 0, 1)^{-1}OutModularMatrix(1,−1,0,1)\mathrm{ModularMatrix}(1, -1, 0, 1)

T5T^5

live ↗
InMatrixPower(ModularMatrix(1,1,0,1),5)\mathrm{MatrixPower}(\mathrm{ModularMatrix}(1, 1, 0, 1), 5)OutModularMatrix(1,5,0,1)\mathrm{ModularMatrix}(1, 5, 0, 1)
Scope #

words multiply their matrices

live ↗
InDot("L",R)\mathrm{Dot}("L", \text{R})OutModularMatrix(1,1,1,2)\mathrm{ModularMatrix}(1, 1, 1, 2)

the inverse of a word

live ↗
In"L"−1"L"^{-1}OutModularMatrix(1,0,−1,1)\mathrm{ModularMatrix}(1, 0, -1, 1)

R3R^3

live ↗
InMatrixPower(R,3)\mathrm{MatrixPower}(\text{R}, 3)OutModularMatrix(1,3,0,1)\mathrm{ModularMatrix}(1, 3, 0, 1)

negative powers are powers of the inverse

live ↗
InMatrixPower(ModularMatrix(1,1,1,2),−2)\mathrm{MatrixPower}(\mathrm{ModularMatrix}(1, 1, 1, 2), -2)OutModularMatrix(5,−3,−3,2)\mathrm{ModularMatrix}(5, -3, -3, 2)
Applications #

a plain integer matrix goes to compute-engine's own MatrixPower: the Fibonacci numbers F11,F10,F9F_{11}, F_{10}, F_9

live ↗
InMatrixPower([[1,1],[1,0]],10)\mathrm{MatrixPower}(\bigl\lbrack\bigl\lbrack1, 1\bigr\rbrack, \bigl\lbrack1, 0\bigr\rbrack\bigr\rbrack, 10)Out[[89,55],[55,34]]\bigl\lbrack\bigl\lbrack89, 55\bigr\rbrack, \bigl\lbrack55, 34\bigr\rbrack\bigr\rbrack
Properties #

the zeroth power is the identity

live ↗
InMatrixPower(ModularMatrix(1,1,0,1),0)\mathrm{MatrixPower}(\mathrm{ModularMatrix}(1, 1, 0, 1), 0)OutModularMatrix(1,0,0,1)\mathrm{ModularMatrix}(1, 0, 0, 1)
About
Examples9
Checked againstWolfram Language 1 differ

See also: ModularWord, RademacherSymbol