Determinants using Clifford algebra
Robin K. S. Hankin
Source:vignettes/determinants_clifford.Rmd
determinants_clifford.Rmd
To cite the clifford
package in publications please use
Hankin (2022). This short document
shows how determinants can be calculated using Clifford algebra as
implemented by the clifford
R package; notation follows
Hestenes and Sobczyk (1987). The methods shown here are
not computationally efficient compared with bespoke linear algebra
implementations (such as used in base R).
Given a square matrix
for some unique
suppressMessages(library("clifford"))
set.seed(0)
(M <- matrix(rnorm(9),3,3))
## [,1] [,2] [,3]
## [1,] 1.2629543 1.2724293 -0.928567035
## [2,] -0.3262334 0.4146414 -0.294720447
## [3,] 1.3297993 -1.5399500 -0.005767173
o <- as.1vector(M[,1]) ^ as.1vector(M[,2]) ^ as.1vector(M[,3])
Adag <- rev(e(seq_len(3)))
c(drop(Adag %.% o), det(M))
## [1] -1.031795 -1.031795
Above, we see numerical agreement [as a parenthetical note, we observe that the dagger is needed to get the correct sign if the dimension is odd]. Alternatively, we can examine the wedge product directly:
as.1vector(M[,1]) ^ as.1vector(M[,2]) ^ as.1vector(M[,3])
## Element of a Clifford algebra, equal to
## - 1.031795e_123
Note that the wedge product is given as a Clifford volume element. We
can extract its coefficient (which would be the determinant of
M
) using coeffs()
:
coeffs(as.1vector(M[,1]) ^ as.1vector(M[,2]) ^ as.1vector(M[,3]))
## [1] -1.031795
Just as a consistency check, we evaluate the wedge product of a set
of basis vectors, effectively calculating the determinant of
## [1] 1
We see
cliff_det <- function(M){
o <- as.1vector(M[,1])
for(i in 2:nrow(M)){
o <- o ^ as.1vector(M[,i])
}
return(coeffs(o))
}
Then
## [1] 1.478400e+02 1.478400e+02 1.136868e-13
above we see numerical agreement.