Skip to content
Snippets Groups Projects
Commit 9aed81df authored by Luke Naylor's avatar Luke Naylor
Browse files

Add notebook for creating figures with sage

parent 1ff011bb
No related branches found
No related tags found
No related merge requests found
Pipeline #24597 failed
%% Cell type:code id:ae7688ac tags:
``` sage
from pseudowalls import *
```
%% Cell type:code id:cc0d5079 tags:
``` sage
O = Chern_Char(1,0)
O
```
%% Output
Chern Character:\begin{array}{l} \mathrm{ch}_{0} = 1 \\ \mathrm{ch}_{1} = 0 \ell^{1} \end{array}
<pseudowalls.chern_character.Chern_Char object at 0x7f1b13fac400>
%% Cell type:code id:2a351730 tags:
``` sage
O1 = exponential_chern(1,1)
O1
```
%% Output
Chern Character:\begin{array}{l} \mathrm{ch}_{0} = 1 \\ \mathrm{ch}_{1} = 1 \ell^{1} \end{array}
<pseudowalls.chern_character.Chern_Char object at 0x7f1b14057400>
%% Cell type:code id:feb674aa tags:
``` sage
O1inv = exponential_chern(-1,1)
O1inv
```
%% Output
Chern Character:\begin{array}{l} \mathrm{ch}_{0} = 1 \\ \mathrm{ch}_{1} = -1 \ell^{1} \end{array}
<pseudowalls.chern_character.Chern_Char object at 0x7f1b140577c0>
%% Cell type:code id:ec14fd95 tags:
``` sage
O2 = O1 * O1
O2
```
%% Output
Chern Character:\begin{array}{l} \mathrm{ch}_{0} = 1 \\ \mathrm{ch}_{1} = 2 \ell^{1} \end{array}
<pseudowalls.chern_character.Chern_Char object at 0x7f1b14054f40>
%% Cell type:code id:45fcb764 tags:
``` sage
O_x = Chern_Char(0,1)
O_x
```
%% Output
Chern Character:\begin{array}{l} \mathrm{ch}_{0} = 0 \\ \mathrm{ch}_{1} = 1 \ell^{1} \end{array}
<pseudowalls.chern_character.Chern_Char object at 0x7f1b0bb9bfa0>
%% Cell type:code id:a0847d59 tags:
``` sage
def plot_central_charge(chern, name):
Z = stability.Mumford().central_charge(chern)
x = Z.real()
y = Z.imag()
argument = arctan(y/x) if x != 0 else pi
if argument <= 0:
argument += pi
return point(
Z,
marker = "o",
size = 600,
rgbcolor = "white",
#markeredgecolor = "purple",
zorder = 100
) + point(
Z,
marker = name,
size = 500,
rgbcolor = "red",
zorder = 101
) + line(
(0, Z),
rgbcolor = "red",
linestyle = "dashed",
zorder = 99
) + disk(
(0,0),
float((pi-argument/2)/pi),
(0, float(argument)),
alpha=.2,
fill=False,
thickness=1,
rgbcolor="purple"
)
p = sum(
plot_central_charge(chern, name)
for chern, name in [
(O1, r"$\mathcal{O}(1)$"),
(O, r"$\mathcal{O}_X$"),
(O1inv, r"$\mathcal{O}(-1)$"),
(O2, r"$\mathcal{O}(2)$"),
(O_x, r"$\mathcal{O}_p$")
]
)
xmax = (2.5)
xmin = (-2.5)
ymin = (-0.25)
ymax = (1.5)
aspect_ratio = (1)
p += polygon(
[
(xmax + 1,0),
(xmin - 1,0),
(xmin - 1,ymax + 1),
(xmax + 1,ymax + 1)
],
rgbcolor = "yellow",
alpha = 0.2,
zorder = 102
)
p.xmax(xmax)
p.xmin(xmin)
p.ymin(ymin)
p.ymax(ymax)
p.set_aspect_ratio(aspect_ratio)
p.axes_labels([r"$\mathcal{R}$",r"$\mathcal{I}$"])
p.show()
```
%% Output
%% Cell type:code id:011017ec tags:
``` sage
z = 1 + I
arctan(1)
```
%% Output
1/4*pi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment