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

Adjust Examples notebook to main notebook changes'

parent 566cf53a
No related branches found
No related tags found
No related merge requests found
%% Cell type:markdown id:63724666 tags:
# Utilities
%% 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 0x7f679c692150>
<pseudowalls.chern_character.Chern_Char object at 0x7f25db3a9990>
%% 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 0x7f67924d6810>
<pseudowalls.chern_character.Chern_Char object at 0x7f25d1953e20>
%% Cell type:markdown id:09692ba5 tags:
# Calculate Preliminary Quantities
%% Cell type:code id:7576ebe4 tags:
``` sage
m = 1 # value of $\ell^2$
# 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.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 ( m*n^2*twisted.ch[1]^2
) / gcd(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:markdown id:8de156d1 tags:
$\renewcommand\nu\ell$
Redefine \nu to $\nu$ in latex
$\let\originalDelta\Delta$
$\renewcommand\Delta{\originalDelta(v)}$
Redefine \Delta in latex to be $\Delta$
%% Cell type:code id:712b7324 tags:
``` sage
from plots_and_expressions import \
r_upper_bound_all_q, Delta, nu, n, R
from plots_and_expressions import main_theorem1, Delta, nu, R, n
# Delta: symbol for Δ(v)
# n: symbol for denominator for β_(v)
# R : symbol for chern_0(v)
# nu : ...
```
%% Cell type:code id:5814dd1d tags:
``` sage
r_upper_bound_all_q
main_theorem1.corollary_r_bound
```
%% Output
$\displaystyle \frac{{\left(R + \frac{\Delta n^{2}}{\nu^{2}}\right)}^{2} \nu^{2}}{4 \, \Delta n^{2}}$
1/4*(R + Delta*n^2/nu^2)^2*nu^2/(Delta*n^2)
$\displaystyle \frac{1}{2} \, R + \frac{\Delta n^{2}}{4 \, \nu^{2}} + \frac{R^{2} \nu^{2}}{4 \, \Delta n^{2}}$
1/2*R + 1/4*Delta*n^2/nu^2 + 1/4*R^2*nu^2/(Delta*n^2)
%% Cell type:code id:43aa5f56 tags:
``` sage
def corrolary_bound(example):
return (
r_upper_bound_all_q.expand()
main_theorem1.corollary_r_bound
.subs(Delta==example.bgmlv)
.subs(nu==1)
.subs(R==example.chern.ch[0])
.subs(n==example.n)
)
for example in [recurring, extravagant]:
example.corrolary_bound = corrolary_bound(example)
```
%% Cell type:code id:5baed51c tags:
``` sage
float(extravagant.corrolary_bound)
```
%% Output
$\displaystyle 53838.5009765625$
53838.5009765625
%% 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