We compute $\kappa$ by the formula $$\kappa^2 = - \frac{1}{2} \nabla_a k_b \nabla^a k^b $$ where $k^a$ is the Killing vector $\frac{\partial}{\partial t}$, which coincides on the horizon with the horizon null generator.
%display latex
M = Manifold(4, 'M', structure='Lorentzian')
X.<t,r,th,ph> = M.chart(r"t r:(0,+oo) th:(0,pi):\theta phi:(0,2*pi):\phi")
X
m = var('m')
assume(m>0)
g = M.metric()
g[0,0] = - (1-2*m/r)
g[1,1] = 1/(1-2*m/r)
g[2,2] = r^2
g[3,3] = r^2*sin(th)^2
g.display()
k = M.vector_field(name='k')
k[0] = 1
k.display()
nabla = g.connection()
Dk = nabla(k)
Dk.display()
The tensor $\nabla_a k_b$:
Dk_down = Dk.down(g)
Dk_down.display()
Let us check in passing Killing equation:
Dk_down.symmetrize().display()
The tensor $\nabla^a k^b$:
Dk_up = Dk.up(g)
Dk_up.display()
We are ready now to evaluate the formula $$\kappa^2 = - \frac{1}{2} \nabla_a k_b \nabla^a k^b $$ We contract both over index no. 0 (first index) and index no. 1 (second index):
kappa2 = -1/2 * Dk_down.contract(0, 1, Dk_up, 0, 1)
kappa2.display()
If one wishes, LaTeX notations can be used to perform the contraction instead of using the method contract
:
kappa2 = -1/2 * Dk_down['_{ab}']*Dk_up['^{ab}']
kappa2.display()
The symbolic expression representing the scalar field $\kappa^2$:
kappa2.expr()
The final result:
kappa = sqrt(kappa2.expr().subs(r=2*m))
kappa