Jupyter notebook

  • Notebook interface for Python, Julia, Perl, R, Go, Mathematica, etc, etc.
  • This is a markdown cell for text (including weblinks, LaTeX formulas, etc).
  • One can write LaTeX code here: $ \Gamma(z+1) = z\, \Gamma(z)$
  • Next cell is a code cell, use Shift + Enter for executing it.
In [1]:
print("Hello World!")
Hello World!

Basic Python

In [2]:
3**123
Out[2]:
48519278097689642681155855396759336072749841943521979872827
In [3]:
# Boolean XOR 
True^False
Out[3]:
True
In [4]:
# Division versus integer division in Python 3.
print(1/3)
print(1//3)
0.3333333333333333
0

Lists, loops, and ifs

In [5]:
for w in ["bim", "bum", "bam"]:
    
    word = ""
    
    if w == "bim":
        word = word + " BIM BIM"
    
    elif w == "bum":
        word += " BUM BUM"
    
    else:
        word += " BAM BAM !!!"
    
    word = w + " " + word
    print(word)
bim  BIM BIM
bum  BUM BUM
bam  BAM BAM !!!

Functions

In [6]:
def factors(n):
    """
    An inefficient but simple method for finding the factors of
    an integer number n, omitting n itself.
    """

    return [i for i in range(1, n//2+1) if n % i == 0]

factors(144)
Out[6]:
[1, 2, 3, 4, 6, 8, 9, 12, 16, 18, 24, 36, 48, 72]
In [7]:
# Help on that function
?factors
In [8]:
def perfects(n):
    """ Computing perfect numbers less than n, using a previously defined function. """

    return [i for i in range(1, n) if sum(factors(i)) == i]

perfects(2000)
Out[8]:
[6, 28, 496]

SymPy

Online version: SymPy Gamma

Setting up

In [9]:
# Start by importing all default objects from sympy
from sympy import * 

#Set up best available printing interface
init_printing()

Constants

In [10]:
I, pi, E, EulerGamma, oo, sqrt(-2), log(-2), S(1)/3, Rational(1, 3)
Out[10]:
$$\left ( i, \quad \pi, \quad e, \quad \gamma, \quad \infty, \quad \sqrt{2} i, \quad \log{\left (2 \right )} + i \pi, \quad \frac{1}{3}, \quad \frac{1}{3}\right )$$

Symbolic variables

In [11]:
beta = symbols('beta')
z = symbols('z_0:10')

beta, z
Out[11]:
$$\left ( \beta, \quad \left ( z_{0}, \quad z_{1}, \quad z_{2}, \quad z_{3}, \quad z_{4}, \quad z_{5}, \quad z_{6}, \quad z_{7}, \quad z_{8}, \quad z_{9}\right )\right )$$
In [12]:
sin(z[3]) + beta**5
Out[12]:
$$\beta^{5} + \sin{\left (z_{3} \right )}$$

By default symbols are complex valued. If we do not want them to behave as complex numbers, we should specify another behaviour using the keywords:

commutative, complex, imaginary, real, integer, odd, even, prime, composite, zero, nonzero, rational, algebraic, transcendental, irrational, finite, infinite, negative, nonnegative, positive, nonpositive, hermitian, antihermitian

In [13]:
x = symbols('x')
n = symbols('n', integer = True)

sin(pi*x) + cos(pi*n)
Out[13]:
$$\left(-1\right)^{n} + \sin{\left (\pi x \right )}$$

Calculus

Series, limits, derivatives, integrals.

In [14]:
x, y, z, t = symbols('x, y, z, t')
a, b, c = symbols('a, b, c')
m, n = symbols('m, n', integer = True)

[
summation(m**3, (m, 1, n)),

summation(1/n**17, (n, 1, oo)),

limit(sin(x)/x, x, 0),

limit(sin(exp(-1/x)+x)/x, x, 0, '+'),

diff(sin(x)**2, x),

diff(exp(x*y), x, 2, y),

integrate(cos(x), x),

integrate(exp(-x**2), (x, -oo, +oo))
]
Out[14]:
$$\left [ \frac{n^{4}}{4} + \frac{n^{3}}{2} + \frac{n^{2}}{4}, \quad \zeta\left(17\right), \quad 1, \quad 1, \quad 2 \sin{\left (x \right )} \cos{\left (x \right )}, \quad y \left(x y + 2\right) e^{x y}, \quad \sin{\left (x \right )}, \quad \sqrt{\pi}\right ]$$
In [15]:
""" A table of integrals. """

from IPython.display import Math, display

iData=[(sin(x)**2, (x, 0, pi)),
       (t**(z-1)*exp(-t), (t, 0, oo)),
       (exp(-t*x)*log(t), (t, 0, oo)),
       ((1-t)**(S(1)/2)*t**(S(1)/3), (t, 0, 1))]

for d in iData:
    i = Integral(*d)
    result = latex(i) + " = " + latex(simplify(i.doit()))
    display(Math(result))
$$\int_{0}^{\pi} \sin^{2}{\left (x \right )}\, dx = \frac{\pi}{2}$$
$$\int_{0}^{\infty} t^{z - 1} e^{- t}\, dt = \begin{cases} \Gamma\left(z\right) & \text{for}\: - \Re{\left(z\right)} + 1 < 1 \\\int_{0}^{\infty} t^{z - 1} e^{- t}\, dt & \text{otherwise} \end{cases}$$
$$\int_{0}^{\infty} e^{- t x} \log{\left (t \right )}\, dt = \begin{cases} - \frac{\log{\left (x \right )} + \gamma}{x} & \text{for}\: \frac{\pi}{2} \geq \left|{\arg{\left (x \right )}}\right| \wedge \frac{\pi}{2} > \left|{\arg{\left (x \right )}}\right| \\\int_{0}^{\infty} e^{- t x} \log{\left (t \right )}\, dt & \text{otherwise} \end{cases}$$
$$\int_{0}^{1} \sqrt[3]{t} \sqrt{- t + 1}\, dt = - \frac{6 \sqrt{\pi} \Gamma\left(\frac{1}{3}\right)}{55 \Gamma\left(\frac{5}{6}\right)}$$

Some series

In [16]:
f1 = log(gamma(x))

f1s = series(f1, x, 0, 8)

result = (latex(f1) + r"\\=" + latex(f1s) + r"\\=" 
          + latex(f1s.rewrite(zeta))) 

display(Math(result))

print('\n', result)
$$\log{\left (\Gamma\left(x\right) \right )}\\=- \log{\left (x \right )} - \gamma x + \frac{\pi^{2} x^{2}}{12} + \frac{x^{3} \operatorname{polygamma}{\left (2,1 \right )}}{6} + \frac{\pi^{4} x^{4}}{360} + \frac{x^{5} \operatorname{polygamma}{\left (4,1 \right )}}{120} + \frac{\pi^{6} x^{6}}{5670} + \frac{x^{7} \operatorname{polygamma}{\left (6,1 \right )}}{5040} + O\left(x^{8}\right)\\=- \log{\left (x \right )} - \gamma x + \frac{\pi^{2} x^{2}}{12} - \frac{x^{3} \zeta\left(3\right)}{3} + \frac{\pi^{4} x^{4}}{360} - \frac{x^{5} \zeta\left(5\right)}{5} + \frac{\pi^{6} x^{6}}{5670} - \frac{x^{7} \zeta\left(7\right)}{7} + O\left(x^{8}\right)$$
 \log{\left (\Gamma\left(x\right) \right )}\\=- \log{\left (x \right )} - \gamma x + \frac{\pi^{2} x^{2}}{12} + \frac{x^{3} \operatorname{polygamma}{\left (2,1 \right )}}{6} + \frac{\pi^{4} x^{4}}{360} + \frac{x^{5} \operatorname{polygamma}{\left (4,1 \right )}}{120} + \frac{\pi^{6} x^{6}}{5670} + \frac{x^{7} \operatorname{polygamma}{\left (6,1 \right )}}{5040} + O\left(x^{8}\right)\\=- \log{\left (x \right )} - \gamma x + \frac{\pi^{2} x^{2}}{12} - \frac{x^{3} \zeta\left(3\right)}{3} + \frac{\pi^{4} x^{4}}{360} - \frac{x^{5} \zeta\left(5\right)}{5} + \frac{\pi^{6} x^{6}}{5670} - \frac{x^{7} \zeta\left(7\right)}{7} + O\left(x^{8}\right)
In [17]:
f2 = sin(x**Rational(1, 3) + x**Rational(1, 5))

f2s = series(f2, x, 0, 1.5)

display(Math(latex(f2) + "=" + latex(f2s)))
$$\sin{\left (\sqrt[5]{x} + \sqrt[3]{x} \right )}=- \frac{19 x}{120} + \sqrt[3]{x} + \sqrt[5]{x} - \frac{x^{\frac{3}{5}}}{6} + \frac{419 x^{\frac{7}{5}}}{5040} - \frac{x^{\frac{11}{15}}}{2} - \frac{x^{\frac{13}{15}}}{2} + \frac{x^{\frac{17}{15}}}{24} + \frac{x^{\frac{19}{15}}}{12} + O\left(x^{1.5}\right)$$

Some numerics

In [18]:
N(pi**E, 1000)
Out[18]:
$$22.45915771836104547342715220454373502758931513399669224920300255406692604039911791231851975272714303153145007314889637271665416272720003684124587848382578019739992751627091118523867135294083489216233769249673053675166259960166872554777588806087374292011817166116137224619720904489633131459927327914091484057676488975378488534410200649259349035759476346916528629400784739540775529801982902613122402951137999068865244293114633593928571607332954149153253013772276755518306879304362284231908828679757829796726471816400070435718105836426064145802122396906974474988516161331840510621636455956108413309428992831263755783615874304692916424601833531934233642003612726382452362470354957183504907341963002354534256412909792119430311690800129252277049440369885261286191183951596873159169810191151307022170454764661795922522468451098320875962159442148399874744726417593402569366826503558047664237423706170850564466432445749673888419368868311592520055560264570505932011700936276055359582664120199812004276137019217$$

Let us sum the following series: $$\sum_{k=1}^{\infty}\left(\frac{1}{k}-\log(1+\frac{1}{k})\right) = \gamma_E$$

In [19]:
k = symbols('k', integer = True)

s1 = N(Sum(1/k - log(1 + 1/k), (k, 1, oo)), 20)

s2 = N(EulerGamma, 50)

print(s1)
print(s2)
print("%.3g" %(s1-s2))
0.57721566490153286061
0.57721566490153286060651209008240243104215933593992
-3.69e-22

An inverse Mellin tranform:

\begin{align} \int_{-\infty}^\infty dt\; \Gamma\left(it+\tfrac{1}{2}\right) \pi^{-it} = 2\pi^\frac{3}{2} e^{-\pi} \end{align}
In [20]:
i1 = N(Integral(gamma(I*t + S(1)/2)*pi**(-I*t), (t, -oo, +oo)), 20)

i2 = N(2*pi**(S(3)/2)*exp(-pi), 30)

print(i1)
print(i2)
print("%.3g" %abs(i1-i2))
0.48125854184192017166 + 0.e-45*I
0.481258541841920171664542461845
1.14e-22

Plots

In [21]:
%matplotlib inline

plot(*[legendre(i, x) for i in range(1, 5)], (x, -1, 1))
Out[21]:
<sympy.plotting.plot.Plot at 0x7f1cd3fe5c50>
In [22]:
from sympy.plotting.plot import *

r, phi = symbols('r, phi')
a = 20.1
b = 0.05
c = 10
d = 0.35

plot3d_parametric_surface(r*sin(a*r)*(1 + d*r*sin(phi)), 
                          r*cos(a*r)*(1 + d*r*cos(phi)), 
                          b*r**c,
                          (r, 0, 1), (phi, 0, 2*pi), 
                          nb_of_points_u = 100, 
                          nb_of_points_v = 100,
                          title = "Snake")
Out[22]:
<sympy.plotting.plot.Plot at 0x7f1cd4155f98>

The Kac table

Let's do some object-oriented programming.

In 2d CFT, the Kac table is the set of dimension $$ \Delta_{(r,s)} = \frac14\left( \frac{q}{p}(r^2-1) +\frac{p}{q}(s^2-1) -2rs\right) \quad \text{with} \quad \left\{\begin{array}{l} 1\leq r\leq p-1 \\ 1\leq s\leq q-1 \end{array}\right. $$ for $p, q$ positive integers.

In [23]:
class Kac:
    
    def __init__(self, indices = (3, 4)):
        
        self.indices = indices
        (p, q) = indices
        self.table = [[self.Dimension((r, q-s)) for r in range(1, p)] 
                      for s in range(1, q)]
        
    def Dimension(self, pair):
        
        (p, q) = self.indices
        (r, s) = pair
        return (S(q)/p*(r**2-1) + S(p)/q*(s**2-1) + 2*(1-r*s))/4
        
    def display(self, source = False):  
        
        if source:
            print(latex(Matrix(self.table)))
        else:
            return Matrix(self.table)
                    
    def ground_state(self):
        
        return min(sum(self.table, []))
In [24]:
myKac = Kac((5, 8))

myKac.Dimension((3, 2))
Out[24]:
$$\frac{187}{160}$$
In [25]:
myKac.display()
Out[25]:
$$\left[\begin{matrix}\frac{9}{2} & \frac{11}{5} & \frac{7}{10} & 0\\\frac{95}{32} & \frac{187}{160} & \frac{27}{160} & - \frac{1}{32}\\\frac{7}{4} & \frac{9}{20} & - \frac{1}{20} & \frac{1}{4}\\\frac{27}{32} & \frac{7}{160} & \frac{7}{160} & \frac{27}{32}\\\frac{1}{4} & - \frac{1}{20} & \frac{9}{20} & \frac{7}{4}\\- \frac{1}{32} & \frac{27}{160} & \frac{187}{160} & \frac{95}{32}\\0 & \frac{7}{10} & \frac{11}{5} & \frac{9}{2}\end{matrix}\right]$$
In [26]:
myKac.display(source = True)
\left[\begin{matrix}\frac{9}{2} & \frac{11}{5} & \frac{7}{10} & 0\\\frac{95}{32} & \frac{187}{160} & \frac{27}{160} & - \frac{1}{32}\\\frac{7}{4} & \frac{9}{20} & - \frac{1}{20} & \frac{1}{4}\\\frac{27}{32} & \frac{7}{160} & \frac{7}{160} & \frac{27}{32}\\\frac{1}{4} & - \frac{1}{20} & \frac{9}{20} & \frac{7}{4}\\- \frac{1}{32} & \frac{27}{160} & \frac{187}{160} & \frac{95}{32}\\0 & \frac{7}{10} & \frac{11}{5} & \frac{9}{2}\end{matrix}\right]
In [27]:
myKac.ground_state()
Out[27]:
$$- \frac{1}{20}$$

Schwarzschild black hole

In [28]:
from IPython.display import Math,Latex,display

from sympy import *
from sympy.diffgeom import *

# Let's define our own abbreviations for some useful functions
TP = TensorProduct
d = Differential
LieD = LieDerivative

# A manifold, a patch, and coordinates, with our own names
m = Manifold('Schwarzschild_4', 4)
p = Patch('External', m)
spherical = CoordSystem('Spherical', p, ['t', 'r', 'theta', 'phi'])

# Coordinate, derivatives (vector fields), one-forms
xs = t, r, theta, phi = spherical.coord_functions()
es = e_t, e_r, e_theta, e_phi = spherical.base_vectors()
fs = dt, dr, dtheta, dphi = spherical.base_oneforms()

xs, es, fs
Out[28]:
$$\left ( \left [ \boldsymbol{\mathrm{t}}, \quad \boldsymbol{\mathrm{r}}, \quad \boldsymbol{\mathrm{\theta}}, \quad \boldsymbol{\mathrm{\phi}}\right ], \quad \left [ \partial_{t}, \quad \partial_{r}, \quad \partial_{\theta}, \quad \partial_{\phi}\right ], \quad \left [ \mathrm{d}t, \quad \mathrm{d}r, \quad \mathrm{d}\theta, \quad \mathrm{d}\phi\right ]\right )$$

Let's check that $dx^j(\partial_{x^i}) = \delta_i^j$

In [29]:
pprint(Matrix([[f(e) for f in fs] for e in es]))
⎡1  0  0  0⎤
⎢          ⎥
⎢0  1  0  0⎥
⎢          ⎥
⎢0  0  1  0⎥
⎢          ⎥
⎣0  0  0  1⎦

Spherical, stationary ansatz

We introduce a metric that depends on two unknown functions: $$ ds^2 = -A_0(r) dt^2 + A_1(r) dr^2 + r^2(d\theta^2 + \sin^2\theta d\phi^2) $$

In [30]:
(A0, A1) = symbols('A_0, A_1', cls = Function)

metric = (-A0(r)*TP(dt, dt) + A1(r)*TP(dr, dr) 
          + r**2*(TP(dtheta, dtheta) + sin(theta)**2*TP(dphi, dphi)))
metric
Out[30]:
$$\boldsymbol{\mathrm{r}}^{2} \left(\sin^{2}{\left (\boldsymbol{\mathrm{\theta}} \right )} \mathrm{d}\phi \otimes \mathrm{d}\phi + \mathrm{d}\theta \otimes \mathrm{d}\theta\right) - \operatorname{A_{0}}{\left (\boldsymbol{\mathrm{r}} \right )} \mathrm{d}t \otimes \mathrm{d}t + \operatorname{A_{1}}{\left (\boldsymbol{\mathrm{r}} \right )} \mathrm{d}r \otimes \mathrm{d}r$$
In [31]:
""" We compute the Ricci tensor, check that its off-diagonal terms 
identically vanish, and write the vanishing of the diagonal terms 
as equations for A_0, A_1. """

ricci = metric_to_Ricci_components(metric)

print("Off-diagonal terms of the Ricci tensor:", 
      [[ricci[i, j] for i in range(4) if not(i == j)] for j in range(4)])
Off-diagonal terms of the Ricci tensor: [[0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0]]
In [32]:
# Technicality: r  is a ScalarField, for solving ODE's it is better 
# to replace it by a symbol
R = symbols('R', Positive = True)
ricciII = ricci.replace(r, R).doit()

print("\nDiagonal terms of the Ricci tensor:")

for i in range(4):
    display(Math("(" + str(i) + ")\quad   " 
                 + latex(Eq(ricciII[i, i], 0))))
Diagonal terms of the Ricci tensor:
$$(0)\quad \frac{\frac{d^{2}}{d R^{2}} \operatorname{A_{0}}{\left (R \right )}}{2 \operatorname{A_{1}}{\left (R \right )}} - \frac{\frac{d}{d R} \operatorname{A_{0}}{\left (R \right )} \frac{d}{d R} \operatorname{A_{1}}{\left (R \right )}}{4 \operatorname{A_{1}}^{2}{\left (R \right )}} - \frac{\left(\frac{d}{d R} \operatorname{A_{0}}{\left (R \right )}\right)^{2}}{4 \operatorname{A_{0}}{\left (R \right )} \operatorname{A_{1}}{\left (R \right )}} + \frac{\frac{d}{d R} \operatorname{A_{0}}{\left (R \right )}}{R \operatorname{A_{1}}{\left (R \right )}} = 0$$
$$(1)\quad - \frac{\frac{d^{2}}{d R^{2}} \operatorname{A_{0}}{\left (R \right )}}{2 \operatorname{A_{0}}{\left (R \right )}} + \frac{\frac{d}{d R} \operatorname{A_{0}}{\left (R \right )} \frac{d}{d R} \operatorname{A_{1}}{\left (R \right )}}{4 \operatorname{A_{0}}{\left (R \right )} \operatorname{A_{1}}{\left (R \right )}} + \frac{\left(\frac{d}{d R} \operatorname{A_{0}}{\left (R \right )}\right)^{2}}{4 \operatorname{A_{0}}^{2}{\left (R \right )}} + \frac{\frac{d}{d R} \operatorname{A_{1}}{\left (R \right )}}{R \operatorname{A_{1}}{\left (R \right )}} = 0$$
$$(2)\quad \frac{R \frac{d}{d R} \operatorname{A_{1}}{\left (R \right )}}{2 \operatorname{A_{1}}^{2}{\left (R \right )}} - \frac{R \frac{d}{d R} \operatorname{A_{0}}{\left (R \right )}}{2 \operatorname{A_{0}}{\left (R \right )} \operatorname{A_{1}}{\left (R \right )}} + 1 - \frac{1}{\operatorname{A_{1}}{\left (R \right )}} = 0$$
$$(3)\quad \frac{R \sin^{2}{\left (\boldsymbol{\mathrm{\theta}} \right )} \frac{d}{d R} \operatorname{A_{1}}{\left (R \right )}}{2 \operatorname{A_{1}}^{2}{\left (R \right )}} - \frac{R \sin^{2}{\left (\boldsymbol{\mathrm{\theta}} \right )} \frac{d}{d R} \operatorname{A_{0}}{\left (R \right )}}{2 \operatorname{A_{0}}{\left (R \right )} \operatorname{A_{1}}{\left (R \right )}} + \sin^{2}{\left (\boldsymbol{\mathrm{\theta}} \right )} - \frac{\sin^{2}{\left (\boldsymbol{\mathrm{\theta}} \right )}}{\operatorname{A_{1}}{\left (R \right )}} = 0$$

Solving the equations

In [33]:
""" We find that the first two equations have a simple combination 
that can be easily solved. """

eq5 = expand( R * A1(R) * (ricciII[0, 0]*A1(R) + ricciII[1, 1]*A0(R)) )

display(Eq(eq5, 0))

sol5 = dsolve(eq5, A1(R), ics = {A1(1):1/A0(1)})  
# Specifying initial conditions

display(sol5)
$$\operatorname{A_{0}}{\left (R \right )} \frac{d}{d R} \operatorname{A_{1}}{\left (R \right )} + \operatorname{A_{1}}{\left (R \right )} \frac{d}{d R} \operatorname{A_{0}}{\left (R \right )} = 0$$
$$\operatorname{A_{1}}{\left (R \right )} = \frac{1}{\operatorname{A_{0}}{\left (R \right )}}$$
In [34]:
""" We plug this solution into the original four equations. """

ricciIII = ricciII.replace(sol5.lhs, sol5.rhs).doit()

for i in range(4):
    display(Math("(" + str(i) + "')\quad   " 
                 + latex(Eq(ricciIII[i,i], 0))))
$$(0')\quad \frac{\operatorname{A_{0}}{\left (R \right )} \frac{d^{2}}{d R^{2}} \operatorname{A_{0}}{\left (R \right )}}{2} + \frac{\operatorname{A_{0}}{\left (R \right )} \frac{d}{d R} \operatorname{A_{0}}{\left (R \right )}}{R} = 0$$
$$(1')\quad - \frac{\frac{d^{2}}{d R^{2}} \operatorname{A_{0}}{\left (R \right )}}{2 \operatorname{A_{0}}{\left (R \right )}} - \frac{\frac{d}{d R} \operatorname{A_{0}}{\left (R \right )}}{R \operatorname{A_{0}}{\left (R \right )}} = 0$$
$$(2')\quad - R \frac{d}{d R} \operatorname{A_{0}}{\left (R \right )} - \operatorname{A_{0}}{\left (R \right )} + 1 = 0$$
$$(3')\quad - R \sin^{2}{\left (\boldsymbol{\mathrm{\theta}} \right )} \frac{d}{d R} \operatorname{A_{0}}{\left (R \right )} - \operatorname{A_{0}}{\left (R \right )} \sin^{2}{\left (\boldsymbol{\mathrm{\theta}} \right )} + \sin^{2}{\left (\boldsymbol{\mathrm{\theta}} \right )} = 0$$
In [35]:
""" We solve (2'), and check that all equations are satisfied. """

M = Symbol('M')

sol = dsolve(ricciIII[2,2], A0(R), ics = {A0(M):0})

ricciIV = ricciIII.replace(sol.lhs, sol.rhs).doit()

display(sol)

for i in range(4):
    display(Math("(" + str(i) + "')\quad   " 
                 + latex(Eq(simplify(ricciIV[i, i]), 0))))
$$\operatorname{A_{0}}{\left (R \right )} = - \frac{M}{R} + 1$$
$$(0')\quad \mathrm{True}$$
$$(1')\quad \mathrm{True}$$
$$(2')\quad \mathrm{True}$$
$$(3')\quad \mathrm{True}$$
In [36]:
""" Computing the metric. """

schwMetric = ( metric.replace(r, R).replace(sol5.lhs, sol5.rhs).doit()
              .replace(sol.lhs, sol.rhs).doit() )
schwMetric
Out[36]:
$$R^{2} \left(\sin^{2}{\left (\boldsymbol{\mathrm{\theta}} \right )} \mathrm{d}\phi \otimes \mathrm{d}\phi + \mathrm{d}\theta \otimes \mathrm{d}\theta\right) - \left(- \frac{M}{R} + 1\right) \mathrm{d}t \otimes \mathrm{d}t + \frac{d(R) \otimes d(R)}{- \frac{M}{R} + 1}$$

References

References on Python 3.x

References on Jupyther and IPython kernel

References on Markdown

References on Sympy

References on Numpy

References on SciPy

Plotting in Python

In [ ]: