LLL reduction

From Xenharmonic Wiki
Revision as of 17:05, 27 December 2024 by Sintel (talk | contribs) (first draft)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

The LLL (Lenstra–Lenstra–Lovász) reduction is an algorithm that computes a basis with short, nearly orthogonal vectors when given an integer lattice. Although determining the 'best' basis is an NP-complete problem[citation needed], the LLL algorithm can find a good basis in polynomial time.

Applications

The most obvious application of LLL reduction is finding a good comma basis for some abstract temperament. When computing the kernel of a temperament, the commas define a lattice. Applying LLL reduction to this lattice finds a new basis where all commas are short. Note that 'short' with respect to a suitable norm here means really means 'simple'. Since LLL reduction depends on the choice of inner product, we can use something like the Tenney or Wilson norm to define the complexity we want to penalize.

Example of computing a comma basis

Let's take 7-limit meantone as an example. The mapping matrix is: $$ \begin{eqnarray} \left[ \begin{array}{rrrr} 1 & 0 & -4 & 13 \\ 0 & 1 & 4 & 10 \end{array} \right] \end{eqnarray} $$

When computing the kernel of this map (using e.g. hermite normal form), you will get something like: $$ \begin{eqnarray} \left[ \begin{array}{rrr} 1 & 0 \\ 2 & 12 \\ -3 & -13 \\ 1 & 4 \end{array} \right] \end{eqnarray} $$

Reading off the columns of this matrix, these give [math]\displaystyle{ 2 \cdot 3^{2} \cdot 5^{-3} \cdot 7 = }[/math] 126/125 and [math]\displaystyle{ 3^{12} \cdot 5^{-13} \cdot 7^{4} = }[/math] 1275989841/1220703125, which is probably not what we want.

Applying LLL reduction to the columns of this matrix gives: $$ \begin{eqnarray} \left[ \begin{array}{rrr} 1 & -4 \\ 2 & 4 \\ -3 & -1 \\ 1 & 0 \end{array} \right] \end{eqnarray} $$

This gives a comma basis of 126/125 and 81/80, which is what we expect for septimal meantone.