Skip to content

Commit

Permalink
add docs for fdl inverse method
Browse files Browse the repository at this point in the history
  • Loading branch information
Jollywatt committed Aug 21, 2024
1 parent f802eca commit 4bc8961
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 5 deletions.
6 changes: 3 additions & 3 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ DocMeta.setdocmeta!(GeometricAlgebra, :DocTestSetup, quote
using Revise, GeometricAlgebra
end; recursive=true)

const bib = CitationBibliography("src/references.bib")
const bibfile = "src/references.bib"

function make(; kwargs...)
macros = Dict(
Expand All @@ -27,7 +27,7 @@ function make(; kwargs...)
sitename="GeometricAlgebra.jl",
root=joinpath(project_root, "docs"),
modules=[GeometricAlgebra],
plugins=[bib],
plugins=[CitationBibliography(bibfile)],
pages=[
"index.md",
"design.md",
Expand Down Expand Up @@ -63,7 +63,7 @@ test() = doctest(GeometricAlgebra)

fix() = begin
Revise.revise()
doctest(GeometricAlgebra, fix=true, plugins=[bib])
doctest(GeometricAlgebra, fix=true, plugins=[CitationBibliography(bibfile)])
nothing
end

Expand Down
4 changes: 2 additions & 2 deletions docs/src/references.bib
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,6 @@ @InProceedings{Dimiter2024
publisher="Springer Nature Switzerland",
address="Cham",
pages="379--390",
isbn="978-3-031-50078-7"
isbn="978-3-031-50078-7",
doi = {10.1007/978-3-031-50078-7_30},
}

35 changes: 35 additions & 0 deletions docs/src/theory/special.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,41 @@ For a multivector ``A ∈ Cl(ℝ^d, ·)`` with metric ``·`` in ``d`` dimensions
| ``d = 5`` | ``A^{-1} = \frac{B}{AB}, B = ĀÂÃ[AĀÂÃ]_{1,4}``


### Faddeev--LeVerrier inverse algorithm

The [Faddeev--LeVerrier inverse algorithm](https://en.wikipedia.org/wiki/Faddeev–LeVerrier_algorithm) may be used to find the inverse of an ``n \times n`` matrix ``A`` in exactly ``n`` steps (with one matrix multiplication per step).
This algorithm can also be used to invert elements in a geometric algebra by considering a linear representation of multivectors as ``n \times n`` matrices. [Dimiter2024](@cite)
This method is implemented in [`inv_flv_method`](@ref).

Crucially, we do not actually need to find a linear representation to use this method: we only need to know that one exists for a given dimension ``n``.
Assume the dimension of the smallest representation is ``\text{repsize}(A)``.

**Algorithm pseudocode**
1. **given** a multivector ``A``
1. ``n := \text{repsize}(A)``
1. ``c_n := 1``
1. ``N \leftarrow 1``
1. **for** ``k \in (n - 1, n - 2, ..., 1, 0)``
1.``N \leftarrow N + c_{k + 1} I``
1.``c_k := \frac{n}{k - n} A \odot N``
1. **return** ``A^{-1} = -N/c_0``

The inverse exists if and only if ``c_0 \ne 0``.

If ``A`` is a ``d``-dimensional multivector, then:
```math
\text{repsize}(A) = \begin{cases}
1 & A = ⟨A⟩_0 \\
2 & \text{$A$ is a pseudoscalar or (pseudo)vector} \\
2^{\lfloor d/2 \rfloor} & \text{$A$ is even} \\
2^{\lceil d/2 \rceil} & \text{in general} \\
\end{cases}
```
In some cases, the algorithm works in fewer steps than given above, particularly for multivectors of particular grades.
However, I have not figured out how to determine the true minimum number of steps.
(For example, by inspection, inverting a ``5``-dimensional ``3``-vector requires only ``n = 4`` steps, not ``8`` as suggested by this prescription.)
It's an interesting problem!


## Formulae for multivector square roots

Expand Down

0 comments on commit 4bc8961

Please sign in to comment.