-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathREADME.Rmd
More file actions
128 lines (86 loc) · 3.6 KB
/
README.Rmd
File metadata and controls
128 lines (86 loc) · 3.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
---
title: "Weyl algebra in R"
output:
github_document:
pandoc_args: --webtex
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
<img src="man/figures/weyl.png" width = "150" align="right" />
<!-- badges: start -->
[](https://app.codecov.io/gh/RobinHankin/weyl?branch=master)
[](https://cran.r-project.org/package=weyl)
[](https://app.codecov.io/gh/RobinHankin/weyl)
<!-- badges: end -->
```{r setup, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
To cite the `weyl` package in publications please use
Hankin 2022. The `weyl` package provides R-centric
functionality for working with Weyl algebras of arbitrary dimension.
A detailed vignette is provided in the package.
The Weyl algebra is a noncommutative algebra which is used in quantum
mechanics and the theory of differential equations (Coutinho 1997).
The `weyl` package offers a consistent and documented suite of
R-centric software. It is based on the `spray` package for sparse
arrays for computational efficiency.
The Weyl algebra is arguably the simplest noncommutative algebra and
is useful in quantum mechanics. It is isomorphic to the quotient ring
of the free algebra on two elements $\left\lbrace X,Y\right\rbrace$
over the ideal generated by $XY=YX+1$. The `weyl` package implements
this and also the $n$-th Weyl algebra.
One usually writes the Weyl algebra in terms of operators $x,\partial$
where $x$ means multiply by $x$ and $\partial$ means differentiate
with respect to $x$. We find that $\partial x-x\partial=1$.
The Weyl algebra is also known as the symplectic Clifford algebra.
# Installation
You can install the released version of the weyl package from
[CRAN](https://CRAN.R-project.org) with:
```{r, message=FALSE}
# install.packages("weyl") # uncomment this to install the package
library("weyl")
set.seed(0)
```
# The `weyl` package in use
The basic creation function is `weyl()`, which takes a `spray` object
and returns a member of the Weyl algebra.
```{r makespray}
S <- spray(rbind(c(1,0,0,1,1,0),c(0,1,1,3,2,0)) ,1:2)
S
```
Above, object `S` is a standard `spray` object but to work with Weyl
algebra we need to coerce it to a `weyl` object with `weyl()`:
```{r makeweyl}
W <- weyl(S)
W
```
Above, object `W` is a member of the third Weyl algebra: that is, the
algebra generated by $\left\lbrace
x,y,z,\partial_x,\partial_y,\partial_z\right\rbrace$. In this case
$W=x\partial_x\partial_y + 2yz\partial_x^3\partial_y^2$. In other
words $Wf=x\frac{\partial^2f}{\partial x\partial y} +
2yz\frac{\partial^5f}{\partial x^3\partial y^2}$.
We might ask what $WWf$ is, and this is easy in the package:
```{r calculatewsquared}
Wsquared <- W*W
Wsquared
```
This is a more complicated operator. However, we might wish to
display it in symbolic form:
```{r winsymbolicform}
options(polyform=TRUE)
Wsquared
```
## References
* S. C. Coutinho 1997. _The many avatars of a simple algebra_. The
American Mathematical Monthly, 104(7):593-604. DOI
[https://doi.org/10.1080/00029890.1997.11990687](https://doi.org/10.1080/00029890.1997.11990687).
* Hankin 2022. _Quantum algebra in R: the weyl package_. Arxiv, DOI
[https://doi.org/10.48550/ARXIV.2212.09230](https://doi.org/10.48550/ARXIV.2212.09230).
# Further information
For more detail, see the package vignette
`vignette("weyl")`