Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
'''
These functions are meant to be used with SageMath or SageMathCloud.
They were written for the paper "On the integral Tate conjecture for
finite fields and representation theory" by Benjamin Antieau.
To use them, simply copy and paste them into a Sage file or a Sage notebook cell.
Examples are included below.
EXAMPLES:
sage: load("~/src/c2.sage")
sage: c2(4,(1,1))
2
Tested: 2015/04/19 with SageMath 6.5.
Author: Benjamin Antieau.
Todo: it would be easy to adopt this code to compute all Chern classes of
representations of GL_n.
'''
def trim(f,n):
'''
This function is a helper function for c2(n,p),
which trims higher degree monomials to make computation faster.
'''
g=0
for m in f.monomials():
if m.degree()<=n:
g=g+f.monomial_coefficient(m)*m
return g
def c2(n,p):
'''
This function returns k where c_2(E^p)=k*c_2(E) in the cohomology of BSL_n,
where p is a partition and E is the standard representation of SL_n.
EXAMPLES:
sage: c2(4,(1,1))
2
sage: c2(8,(2,2,2,2,2,1,1))
156
sage: c2(4,(1,1))
2
sage: c2(6,(1,1))
4
sage: c2(6,(1,1,1))
6
sage: c2(6,(2,1))
33
sage: c2(9,(3))
165
sage: c2(9,(3,3,3,3))
116424
'''
R=PolynomialRing(ZZ,['x'+repr(i) for i in range(1,n+1)])
R.inject_variables(verbose=False)
q=1
for t in SemistandardTableaux(p,max_entry=n).list():
m=0
for r in t:
for c in r:
m=m+eval('x'+repr(c))
q=q*(1+m)
q=trim(q,2)
c1=(sum(v for v in R.gens()))**2
r=q-q.monomial_coefficient(x1**2)*c1
return r.monomial_coefficient(x1*x2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment