set.seed(0)
knitr::opts_chunk$set(echo = TRUE)
library("onion")

![](`r system.file("help/figures/onion.png", package = "onion")`){width=10%}

This short document introduces the dot object in the onion package and shows how it can be used to work with commutators and verify the Jacobi identity. The prototypical dot.Rmd is that of the freealg package. The dot object is a (trivial) S4 object of class dot:

`.` <- new("dot")

The point of the dot (!) is that it allows one to calculate the Lie bracket $[x,y]=xy-yx$ using R idiom .[x,y]. This is equivalent to commutator(x,y) but has more flexible syntax. Thus:

x <- rquat()
y <- rquat()
z <- rquat()
commutator(x,y)
.[x,y]

This is nonassociative:

.[x,.[y,z]] == .[.[x,y],z]

However, it does satisfy the Jacobi identity $\left[x,\left[y,z\right]\right]+\left[y,\left[z,x\right]\right]+ \left[z,\left[x,y\right]\right]=0$:

.[x,.[y,z]] + .[y,.[z,x]] + .[z,.[x,y]]

Package dataset {-}

Following lines create dot.rda, residing in the data/ directory of the package.

save(`.`,file="dot.rda")


RobinHankin/onion documentation built on April 20, 2024, 2:05 p.m.