Pullback with large symbolic expressions

This worksheet is relative the ask.sagemath question Pullback computation hanging

In [1]:
version()
Out[1]:
'SageMath version 8.1, Release Date: 2017-12-07'
In [2]:
%display latex
In [3]:
M = Manifold(3, 'M')
X.<x,y,z> = M.chart()

N = Manifold(3, 'N')
XN.<a,b1,b2> = N.chart()

omega = N.diff_form(2)
omega[0,1] = 2*b2/a^3
omega[0,2] = -2*b1/a^3
omega[1,2] = -2/a^2
omega.display()
Out[3]:
In [4]:
r = sqrt(x^2+y^2+z^2)
t = var('t', domain='real')
STSa = r^(1/2)*(r*cosh(2*r*t) - z*sinh(2*r*t))^(-1/2)
STSb1 = (x*sinh(2*r*t)/r)*STSa
STSb2 = (y*sinh(2*r*t)/r)*STSa

STS = M.diffeomorphism(N, [STSa, STSb1, STSb2])
STS.display()
Out[4]:
In [5]:
%time STS.jacobian_matrix()[0,0]
CPU times: user 8.43 s, sys: 28 ms, total: 8.46 s
Wall time: 8.44 s
Out[5]:
In [6]:
%time s = STS.pullback(omega)
s
CPU times: user 19min 52s, sys: 2.72 s, total: 19min 54s
Wall time: 19min 51s
Out[6]:

The number of characters in each of the non-vanishing components of $s$:

In [7]:
[len(str(s[ind])) for ind in [(0,1), (0,2), (1,2)]] 
Out[7]:

The first 1000 characters of $s_{01}$:

In [10]:
print(str(s[0,1])[:1000])
-8*((536870912*(268435456*z^31 + 2080374784*(x^2 + y^2)*z^29 + 7264534528*(x^4 + 2*x^2*y^2 + y^4)*z^27 + 15099494400*(x^6 + 3*x^4*y^2 + 3*x^2*y^4 + y^6)*z^25 + 20789067776*(x^8 + 4*x^6*y^2 + 6*x^4*y^4 + 4*x^2*y^6 + y^8)*z^23 + 19963052032*(x^10 + 5*x^8*y^2 + 10*x^6*y^4 + 10*x^4*y^6 + 5*x^2*y^8 + y^10)*z^21 + 13710721024*(x^12 + 6*x^10*y^2 + 15*x^8*y^4 + 20*x^6*y^6 + 15*x^4*y^8 + 6*x^2*y^10 + y^12)*z^19 + 6794969088*(x^14 + 7*x^12*y^2 + 21*x^10*y^4 + 35*x^8*y^6 + 35*x^6*y^8 + 21*x^4*y^10 + 7*x^2*y^12 + y^14)*z^17 + 2421104640*(x^16 + 8*x^14*y^2 + 28*x^12*y^4 + 56*x^10*y^6 + 70*x^8*y^8 + 56*x^6*y^10 + 28*x^4*y^12 + 8*x^2*y^14 + y^16)*z^15 + 610568192*(x^18 + 9*x^16*y^2 + 36*x^14*y^4 + 84*x^12*y^6 + 126*x^10*y^8 + 126*x^8*y^10 + 84*x^6*y^12 + 36*x^4*y^14 + 9*x^2*y^16 + y^18)*z^13 + 105797120*(x^20 + 10*x^18*y^2 + 45*x^16*y^4 + 120*x^14*y^6 + 210*x^12*y^8 + 252*x^10*y^10 + 210*x^8*y^12 + 120*x^6*y^14 + 45*x^4*y^16 + 10*x^2*y^18 + y^20)*z^11 + 11994112*(x^22 + 11*x^20*y^2 + 55*x^18*y^4 + 16
In [ ]: