
from itertools import *
import sympy

print("This computes the eigenvalue lambda-infinity of the")
print("quantum product with c_1 on a rational elliptic surface.")
print()
low=-5
high=5

q = sympy.symbols('q')
value = 0
for a,b,c,d,e,f,g,h in product(range(low,high),range(low,high),range(low,high),range(low,high),range(low,high),range(low,high),range(low,high),range(low,high)):
    if a!=b:
        sum = a+b+c+d+e+f+g+h
        if (sum // 3)*3 == sum:
            v = (a*a+b*b+c*c+d*d+e*e+f*f+g*g+h*h)*9 - (sum*sum) 
            exponent = v//2 + sum
            if exponent <= 5:
                print(a,b,c,d,e,f,g,h,exponent)
            if exponent <= 35:
                coefficient = (a-b)*(a-b)
                value = value+q**exponent*coefficient
factor =  (1 + 12*q**9 + 90*q**18 + 520*q**27 + 2535*q**36)/(-2)
lambdainfty = sympy.series(factor*value,q,n=36)/q

print()
print("The eigenvalue is:")
print(lambdainfty)
