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

Annotate examples

parent ade283c0
No related branches found
No related tags found
No related merge requests found
Pipeline #44425 failed
%% Cell type:markdown id:63724666 tags:
%% Cell type:markdown id:6879f29a tags:
# Utilities
Notebook for the Recurring examples that appear across Part $\text{\ref{part:fin-walls}}$
%% Cell type:code id:abe149f0 tags:
``` sage
# Requires extra package:
#! sage -pip install "pseudowalls==0.0.3" --extra-index-url https://gitlab.com/api/v4/projects/43962374/packages/pypi/simple
%display latex
from pseudowalls import *
Δ = lambda v: v.Q_tilt()
mu = stability.Mumford().slope
ts = stability.Tilt
var("beta", domain="real")
def beta_minus(v):
beta = stability.Tilt().beta
solutions = solve(
stability.Tilt(alpha=0).degree(v)==0,
beta)
return min(map(lambda s: s.rhs(), solutions))
class Object(object):
pass
```
%% Cell type:markdown id:0b574b63 tags:
# Define Cherns in Examples
%% Cell type:markdown id:f1c3a606 tags:
Define two recurring examples used to illustrate performance of the different theorems to find semistabilizer bounds:
%% Cell type:code id:30d3738a tags:
``` sage
recurring = Object()
recurring.chern = Chern_Char(3, 2, -2)
recurring.chern
```
%% Output
$\displaystyle \text{Chern Character:} \\ \begin{array}{l} \mathrm{ch}_{0} = 3 \\ \mathrm{ch}_{1} = 2 \ell^{1} \\ \mathrm{ch}_{2} = -2 \ell^{2} \end{array}$
<pseudowalls.chern_character.Chern_Char object at 0x7f1718d278e0>
<pseudowalls.chern_character.Chern_Char object at 0x7f7ef1c08150>
%% Cell type:code id:fe394909 tags:
``` sage
extravagant = Object()
extravagant.chern = Chern_Char(29, 13, -3/2)
extravagant.chern
```
%% Output
$\displaystyle \text{Chern Character:} \\ \begin{array}{l} \mathrm{ch}_{0} = 29 \\ \mathrm{ch}_{1} = 13 \ell^{1} \\ \mathrm{ch}_{2} = -\frac{3}{2} \ell^{2} \end{array}$
<pseudowalls.chern_character.Chern_Char object at 0x7f1718d263b0>
<pseudowalls.chern_character.Chern_Char object at 0x7f7ee76c5850>
%% Cell type:markdown id:09692ba5 tags:
# Calculate Preliminary Quantities
%% Cell type:code id:7576ebe4 tags:
``` sage
# add attributes for ...
for example in [recurring, extravagant]:
example.betaminus = beta_minus(example.chern)
example.twisted = example.chern.twist(example.betaminus)
example.n = example.betaminus.denominator()
example.m = 1 # \ell^2 = 1 on P^1
example.bgmlv = example.chern.Q_tilt()
# Actual maximal rank of Pseudo-Semistabilizers
# (needs to be calculated elsewhere)
recurring.actual_rmax = 25
extravagant.actual_rmax = 49313
```
%% Cell type:markdown id:500abba3 tags:
# First Loose Bound
%% Cell type:markdown id:f3e61899 tags:
Formula for loose bound:
%% Cell type:code id:77fff07c tags:
``` sage
def loose_bound(example):
n = example.n
twisted = example.twisted
return ( example.m*n^2*twisted.ch[1]^2
) / gcd(example.m, 2*n^2)
for example in [recurring, extravagant]:
example.loose_bound = loose_bound(example)
```
%% Cell type:markdown id:218fa169 tags:
Loose bounds for the two examples:
%% Cell type:code id:9edbb954 tags:
``` sage
recurring.loose_bound
```
%% Output
$\displaystyle 144$
144
%% Cell type:code id:21b52c4d tags:
``` sage
extravagant.loose_bound
```
%% Output
$\displaystyle 215296$
215296
%% Cell type:markdown id:22bc4b5f tags:
# Stronger Convenient Bound
%% Cell type:markdown id:ee140573 tags:
Use expression for bound used in main document
%% Cell type:code id:712b7324 tags:
``` sage
from plots_and_expressions import main_theorem1, bgmlv_v, m, R, n, lcm_m_2n2
# Delta: symbol for Δ(v)
# n: symbol for denominator for β_(v)
# R : symbol for chern_0(v)
# nu : ...
main_theorem1.corollary_r_bound
```
%% Output
$\displaystyle \frac{1}{2} \, R + \frac{{\Delta(v)} {\operatorname{lcm}(m,2n^2)}}{8 \, m} + \frac{R^{2} m}{2 \, {\Delta(v)} {\operatorname{lcm}(m,2n^2)}}$
1/2*R + 1/8*bgmlv_v*lcm_m_2n2/m + 1/2*R^2*m/(bgmlv_v*lcm_m_2n2)
%% Cell type:code id:43aa5f56 tags:
``` sage
def corrolary_bound(example):
return (
main_theorem1.corollary_r_bound
.subs(bgmlv_v==example.bgmlv)
.subs(m==example.m)
.subs(R==example.chern.ch[0])
.subs(n==example.n)
.subs(lcm_m_2n2==lcm(example.m,2*example.n^2))
)
for example in [recurring, extravagant]:
example.corrolary_bound = corrolary_bound(example)
```
%% Cell type:code id:5baed51c tags:
``` sage
extravagant.corrolary_bound
```
%% Output
$\displaystyle \frac{55130625}{1024}$
55130625/1024
%% Cell type:code id:fcc15f60 tags:
``` sage
float(recurring.corrolary_bound)
```
%% Output
$\displaystyle 37.515625$
37.515625
%% Cell type:markdown id:e678a488 tags:
# Stronger Complicated Bounds
%% Cell type:code id:ef8f09ff tags:
``` sage
import numpy as np
def bound_comparisons(example):
n = example.n
a_v = example.betaminus.numerator()
def theorem_bound(v_twisted, q_val, k):
return int(min(
n^2*q_val^2/k,
v_twisted.ch[0]
+ n^2*(v_twisted.ch[1] - q_val)^2/k
))
def k(n, a_v, b_q):
n = int(n)
a_v = int(a_v)
b_q = int(b_q)
k = -a_v*b_q % n
return k if k > 0 else k + n
b_qs = list(range(example.twisted.ch[1]*n+1))
qs = list(map(lambda x: x/n,b_qs))
ks = list(map(lambda b_q: k(n, a_v, b_q), b_qs))
theorem2_bounds = [
theorem_bound(example.twisted, q_val, 1)
for q_val in qs
]
theorem3_bounds = [
theorem_bound(example.twisted, q_val, k)
for q_val, k in zip(qs,ks)
]
return qs, theorem2_bounds, theorem3_bounds
```
%% Cell type:markdown id:b1c51cd8 tags:
Array content:
- First row: $q$-values
- Second row: Theorem 1 bounds on $ch_0(u)$ for u solutions to prob with $ch_1^{\beta}=q$
- Second row: Theorem 2 bounds on $ch_0(u)$ for u solutions to prob with $ch_1^{\beta}=q$
%% Cell type:code id:9cd102ac tags:
``` sage
np.array(bound_comparisons(recurring))
```
%% Output
$\displaystyle \begin{array}{l}
\verb|[[0|\verb| |\verb|1/3|\verb| |\verb|2/3|\verb| |\verb|1|\verb| |\verb|4/3|\verb| |\verb|5/3|\verb| |\verb|2|\verb| |\verb|7/3|\verb| |\verb|8/3|\verb| |\verb|3|\verb| |\verb|10/3|\verb| |\verb|11/3|\verb| |\verb|4]|\\
\verb| |\verb|[0|\verb| |\verb|1|\verb| |\verb|4|\verb| |\verb|9|\verb| |\verb|16|\verb| |\verb|25|\verb| |\verb|36|\verb| |\verb|28|\verb| |\verb|19|\verb| |\verb|12|\verb| |\verb|7|\verb| |\verb|4|\verb| |\verb|3]|\\
\verb| |\verb|[0|\verb| |\verb|0|\verb| |\verb|4|\verb| |\verb|3|\verb| |\verb|8|\verb| |\verb|25|\verb| |\verb|12|\verb| |\verb|15|\verb| |\verb|19|\verb| |\verb|6|\verb| |\verb|5|\verb| |\verb|4|\verb| |\verb|3]]|
\end{array}$
array([[0, 1/3, 2/3, 1, 4/3, 5/3, 2, 7/3, 8/3, 3, 10/3, 11/3, 4],
[0, 1, 4, 9, 16, 25, 36, 28, 19, 12, 7, 4, 3],
[0, 0, 4, 3, 8, 25, 12, 15, 19, 6, 5, 4, 3]], dtype=object)
......
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