Source

6-d Anomaly Cancellation / example_search.py

Full commit

basedir = '/home/vbraun/Sage/ReflexivePolyhedra4d/Hodge4d_fibrations_2d'
outdir = os.path.join(basedir, 'build-5-Matter')
#outdir = os.path.join(basedir, 'build-4-GaugeGroup')

f = open(os.path.join(basedir, 'Hodge_numbers.py'))
HodgeNumbers = eval(f.read())
f.close()



import sys
sys.path.append('/home/vbraun/Sage/ReflexivePolyhedra4d/Hodge4d_fibrations_2d/src')

from toric_elliptic  import fib_to_morphism
from toric_elliptic import WeierstrassForm, WeierstrassData
from toric_elliptic.Sections import toric_sections



single_block_SU = []
for h11,h21 in HodgeNumbers:
    if h11 != 3:
        continue
    infile  = os.path.join(outdir, 'Kodaira-'+str(h11)+'-'+str(h21)+'.sobj')
    try:
        fibs = load(infile)
    except IOError:
        fibs = []
    for fib in fibs:
        gauge_group = list(fib['GaugeGroup'])
        try:
            gauge_group.remove('None')
            gauge_group.remove('None')
        except ValueError:  # not in list
            continue
        assert len(gauge_group) == 1
        if gauge_group[0][0] != 'SU':
            continue
        n =  gauge_group[0][1]
        if n+1 != fib['h11']:
            continue
        #if not all( fib['flat_over_curve'] ): 
        #    continue
        single_block_SU.append(fib)






####################################3333
# nontoric

nontoric_SU = []
for h11,h21 in HodgeNumbers:
    if 3 != h11:
        continue
    infile  = os.path.join(outdir, 'Kodaira-'+str(h11)+'-'+str(h21)+'.sobj')
    fibs = load(infile)
    for fib in fibs:
        gauge_group = list(fib['GaugeGroup'])
        try:
            gauge_group.remove('None')
            gauge_group.remove('None')
            gauge_group.remove('None')
        except ValueError:  # not in list
            continue
        assert len(gauge_group) == 0
        nontoric_SU.append(fib)





def discriminant_factorization(fib):
    f = fib_to_morphism(fib)
    fm = f.fan_morphism()
    a, b, disc = WeierstrassData(fm)
    R.<X,Y> = PolynomialRing(QQ, 2)
    a    =    a.subs(u=1+X,v=3+X+Y,w=1+Y)
    b    =    b.subs(u=1+X,v=3+X+Y,w=1+Y)
    disc = disc.subs(u=1+X,v=3+X+Y,w=1+Y)
    N = nth_prime(randint(10000,20000))
    pdisc = disc.factor()[-1][0].change_ring(GF(N)).discriminant(Y.change_ring(GF(N)))
    pdisc_factor = pdisc.factor(proof=False)
    [ (f[0].degree(), f[1]) for f in pdisc_factor ]
    d1 = sum([ f[0].degree()  for f in pdisc_factor if f[1]==1 ])
    d2 = sum([ f[0].degree()  for f in pdisc_factor if f[1]==2 ])
    d3 = sum([ f[0].degree()  for f in pdisc_factor if f[1]==3 ])
    # assert (d1+2*d2+3*d3 == pdisc.degree())
    return (d1, d2, d3)


for fib in nontoric_SU:
    if fib['disc_nontoric']!=(): continue
    d = discriminant_factorization(fib)
    print fib['h21'], d, d[1]+fib['h21'], toric_sections(fib_to_morphism(fib)), fib['disc_nontoric']




f = fib_to_morphism(fib)
fm = f.fan_morphism()
a, b, disc = WeierstrassData(fm)
disc = (disc.factor()[0][0]).change_ring(ZZ)
a    = (a.factor()[0][0]).change_ring(ZZ)
b    = (b.factor()[0][0]).change_ring(ZZ)
F = GF(nth_prime(10000))
# F = QQ
R.<X,Y> = PolynomialRing(F, 2) #, order='lex')
a    =    a.subs(u=1+X,v=3+X+Y,w=1+Y)
b    =    b.subs(u=1+X,v=3+X+Y,w=1+Y)
disc = disc.subs(u=1+X,v=3+X+Y,w=1+Y)
pdisc = disc.discriminant(Y)
save((a,b,disc), '/tmp/disc.sobj')
save(pdisc, '/tmp/pdisc.sobj')


R.ideal([disc, disc.derivative(X), disc.derivative(Y)]).vector_space_dimension()



solutions = []
for b in range(6,30):
    P = Polyhedron(ieqs=[(0,1,0,0,0,0),(0,0,1,0,0,0),(0,0,0,1,0,0),(0,0,0,0,1,0),(0,0,0,0,0,1)], 
                   eqns=[(-18*b,1,4,9,16,25)])
    for n in P.integral_points():
        if 3*b**2 == sum( ni*(i+1)**4 for i,ni in enumerate(n)):
            solutions.append(n)
            print sum(n), n




a, b, disc = WeierstrassData(fm)
R.<X,Y> = PolynomialRing(ZZ, 2)
disc = (disc.factor()[0][0]).change_ring(ZZ)
disc = disc.subs(u=1+X,v=3+X+Y,w=1+Y)
    

def mod_p_discriminant(polynomial, variable, p):
    F = GF(p)
    polynomial = polynomial.change_ring(F)
    variable = variable.change_ring(F)
    disc = polynomial.discriminant(variable)
    return disc.change_ring(ZZ)


def multi_mod_discriminant(polynomial, variable):
    moduli = [ nth_prime(1000+i) for i in range(2000) ]
    mod_p_disc = [ mod_p_discriminant(polynomial, variable, p) for p in moduli ]