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

Have first sage plot working

parent 765a9152
No related branches found
No related tags found
No related merge requests found
Pipeline #24618 canceled
main*
!main.tex
sage-plots-for-main.tex/*
**/__pycache__/
sagetexscripts/*.py
Makefile 0 → 100644
# Requires GNU make, xargs, a latex distribution, sage
# and sagetex.sty visible in TEXINPUTS
MAINTEXFILE = main.tex
TEXFILES = ${MAINTEXFILE}
SAGESCRIPT = main.sagetex.sage
SAGEPLOTFILES = sagetexscripts/fig1
main.pdf: ${TEXFILES} main.sagetex.sout
latexmk
main.sagetex.sout: ${SAGESCRIPT} pymodules
sage $?
${SAGESCRIPT}: ${TEXFILES}
pdflatex -interaction=nonstopmode ${MAINTEXFILE}
pymodules: $(addsuffix .py,${SAGEPLOTFILES})
$(addsuffix .py,${SAGEPLOTFILES}): $(addsuffix .sage,${SAGEPLOTFILES})
# Preparse Sagemath scripts in sagetexscripts,
# converting them to python files of form <basename>.py
# (ready to be imported as python modules)
sage --preparse $^
echo ${SAGEPLOTFILES} | xargs -I % sh -c 'mv %.sage.py %.py'
.PHONY: clean
clean:
latexmk -C
rm -f main.pdf
rm -f *.sagetex.*
rm -f *.xml
rm -f *.sta
rm -f *.bbl
rm -rf sage-plots-for-main.tex
rm -f *.tmp
......@@ -7,6 +7,7 @@
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{mathtools}
\usepackage{sagetex}
\usepackage{ulem}
\usepackage{xcolor}
......@@ -16,7 +17,7 @@
\title{Bridgeland Stabilities and Finding Walls}
\subtitle{}
\author{Luke Naylor}
\institute{University of Edinburgh}
\institute{Hodge Club}
\date{March 2023}
\newcommand\RR{\mathbb{R}}
......@@ -32,7 +33,7 @@
\titlepage
\end{frame}
\section{Transitioning to Stab on $D^b(X)$}
\section{Transitioning to Stab on Triangulated Categories}
\begin{frame}{Central Charge}
\begin{align*}
......@@ -41,6 +42,14 @@
\end{align*}
\end{frame}
\begin{sagesilent}
import sagetexscripts.fig1
\end{sagesilent}
\begin{frame}{plot}
\sageplot{sagetexscripts.fig1.plot()}
\end{frame}
\section{Section 1}
\section{Section 2}
......
#!/usr/bin/env sage
from pseudowalls import *
def plot():
O = Chern_Char(1,0)
O1 = exponential_chern(1,1)
O1inv = exponential_chern(-1,1)
O2 = O1 * O1
O_x = Chern_Char(0,1)
def plot_central_charge(chern, name, argument = None, radius = None):
Z = stability.Mumford().central_charge(chern)
x = Z.real()
y = Z.imag()
if not argument:
argument = arctan(y/x) if x != 0 else pi / 2
if argument <= 0:
argument += pi
if not radius:
radius = (pi-argument/2)/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(radius),
(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}$"])
return p
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