```python
# Init

from sympy import init_printing
init_printing()
```


```python
from sympy import symbols, sin, cos, pi
from sympy.diffgeom import Manifold, Patch, CoordSystem
from sympy.simplify import simplify

r, theta = symbols('r, theta')
m = Manifold('M', 2)
patch = Patch('P', m)

rect = CoordSystem('rect', patch)
polar = CoordSystem('polar', patch)

rect in patch.coord_systems

```


```python
from sympy import symbols, pi, Function
from sympy.diffgeom.rn import R2, R2_p, R2_r
from sympy.diffgeom import BaseVectorField

x0, y0, r0, theta0 = symbols('x0, y0, r0, theta0')

point_p = R2_p.point([r0, theta0])
point_r = R2_r.point([x0, y0])

point_r
```


```python
from sympy import symbols, pi, Function
from sympy.diffgeom.rn import R2, R2_p, R2_r
from sympy.diffgeom import BaseVectorField
x0, y0, r0, theta0 = symbols('x0, y0, r0, theta0')

point_p = R2_p.point([r0, theta0])
point_r = R2_r.point([x0, y0])

g = Function('g')
s_field = g(R2.x, R2.y)
s_field.rcall(point_r)
s_field.rcall(point_p)
```


```python
from sympy import symbols, pi, Function
from sympy.diffgeom.rn import R2, R2_p, R2_r
from sympy.diffgeom import BaseVectorField
x0, y0, r0, theta0 = symbols('x0, y0, r0, theta0')

point_r = R2_r.point([x0, y0])

g = Function('g')
s_field = g(R2.x, R2.y)

s_field.rcall(point_r)


f = Function('f')

dx = BaseVectorField(R2_r, 0)
dy = BaseVectorField(R2_r, 1)

dy(s_field)
```


```python
from sympy.diffgeom.rn import R2
from sympy.diffgeom import Commutator
from sympy.simplify import simplify

e_x, e_y, e_r = R2.e_x, R2.e_y, R2.e_r
c_xy = Commutator(e_x, e_y)
c_xr = Commutator(e_x, e_r)

c_xy

# X = R2.e_x + R2.e_y
```


```python
from sympy import symbols, sin, cos, pi
from sympy.diffgeom import Manifold, Patch, CoordSystem
from sympy.simplify import simplify
from sympy.diffgeom import Commutator
from sympy.simplify import simplify
from sympy.diffgeom.rn import R4


# x1, x2, x3, x4 = symbols('x_1 x_2 x_3 x_4')

# m = Manifold('M', 4)
# patch = Patch('P', m)

# rect = CoordSystem('rect', patch)
# polar = CoordSystem('polar', patch)


e_x, e_y, e_r = R4.e_x, R4.e_y, R4.e_r
c_xy = Commutator(e_x, e_y)
c_xr = Commutator(e_x, e_r)

c_xy
```


```python
from sympy.diffgeom.rn import R2, R2_r
from sympy.diffgeom import BaseCovarDerivativeOp
from sympy.diffgeom import metric_to_Christoffel_2nd, TensorProduct
TP = TensorProduct
ch = metric_to_Christoffel_2nd(TP(R2.dx, R2.dx) + TP(R2.dy, R2.dy))
ch
# TP(R2.dx, R2.dy + R2.dx * 8)(R2.e_x, R2.e_y + R2.e_x)
```


```python
# Compute Poincaire Christoffel coefficients

from sympy.diffgeom import Manifold, Patch, CoordSystem, TensorProduct
from sympy import sin,cos
from sympy import Matrix

dim = 2
m = Manifold("M",dim)
patch = Patch("P",m)
system = CoordSystem('egg_carton', patch, ["u", "v"])
u,v = system.coord_functions()
du,dv = system.base_oneforms()
metric = (1/v**2)*TensorProduct(dv, dv) +\
         (1/v**2)*TensorProduct(du, du) +\
         (0)*TensorProduct(du, dv) +\
         (0)*TensorProduct(dv, du)

ch = metric_to_Christoffel_2nd(metric)
ch
# Matrix(ch)
```

68763e71200a931f0aee26ac868109f1a3987f53
ipynb
Jupyter Notebook
py/jupyter/differential_geometry.ipynb
YodaEmbedding/experiments
567c6a1c18fac2d951fe2af54aaa4917b7d529d2
MIT
py/jupyter/differential_geometry.ipynb
YodaEmbedding/experiments
567c6a1c18fac2d951fe2af54aaa4917b7d529d2
MIT
py/jupyter/differential_geometry.ipynb
YodaEmbedding/experiments
567c6a1c18fac2d951fe2af54aaa4917b7d529d2
MIT
Qwen/Qwen-72B
1. YES
2. YES