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]]
Following lines create dot.rda
, residing in the data/
directory
of the package.
save(`.`,file="dot.rda")
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.