id,summary,reporter,owner,description,type,status,priority,milestone,component,resolution,keywords,cc,merged,author,reviewer,upstream,work_issues,branch,commit,dependencies,stopgaps
24623,Euclidean spaces and vector calculus,egourgoulhon,,"This ticket implements Euclidean spaces as Riemannian manifolds diffeomorphic to '''R'''^n^ and equipped with a flat metric, which defines the Euclidean dot product. Using the operators introduced in #24622, this provides the standard operators of vector calculus: dot product, norm, cross product, gradient, divergence, curl and Laplacian, along with the standard coordinate systems (Cartesian, spherical, cylindrical, etc.).
See this [https://ask.sagemath.org/question/40792/div-grad-and-curl-once-again/ ask.sagemath question] for a motivation, as well as this [https://ask.sagemath.org/question/41898/ one].
The implementation is performed via the parent class `EuclideanSpace`, which inherits from `PseudoRiemannianManifold` (introduced in #24622). Two subclasses are devoted to specific cases:
- `EuclideanPlane` for n=2
- `Euclidean3dimSpace` for n=3
The user interface for constructing an Euclidean space relies on the `EuclideanSpace.__classcall_private__` to direct to the appropriate subclass.
The implementation through the manifold framework allows for an easy use of various coordinate systems, along with the related transformations. However, the user interface does not assume any knowledge of Riemannian geometry. In particular, no direct manipulation of the metric tensor is required.
A minimal example is
{{{
sage: E. = EuclideanSpace(3)
sage: v = E.vector_field(-y, x, 0)
sage: v.display()
-y e_x + x e_y
sage: v[:]
[-y, x, 0]
sage: w = v.curl()
sage: w.display()
2 e_z
sage: w[:]
[0, 0, 2]
}}}
The transformation to spherical coordinates:
{{{
sage: spherical. = E.spherical_coordinates()
sage: spherical_frame = E.spherical_frame() # orthonormal frame (e_r, e_th, e_ph)
sage: v.display(spherical_frame)
sqrt(x^2 + y^2) e_ph
sage: v.display(spherical_frame, spherical)
r*sin(th) e_ph
sage: v[spherical_frame, :, spherical]
[0, 0, r*sin(th)]
sage: w.display(spherical_frame, spherical)
2*cos(th) e_r - 2*sin(th) e_th
sage: w[spherical_frame, :, spherical]
[2*cos(th), -2*sin(th), 0]
}}}
More detailed examples are in the following Jupyter notebooks:
- [http://nbviewer.jupyter.org/github/egourgoulhon/SageMathTest/blob/master/Worksheets/vector_calc_cartesian.ipynb vector calculus in Cartesian coordinates]
- [http://nbviewer.jupyter.org/github/egourgoulhon/SageMathTest/blob/master/Worksheets/vector_calc_spherical.ipynb vector calculus in spherical coordinates]
- [http://nbviewer.jupyter.org/github/egourgoulhon/SageMathTest/blob/master/Worksheets/vector_calc_cylindrical.ipynb vector calculus in cylindrical coordinates]
- [http://nbviewer.jupyter.org/github/egourgoulhon/SageMathTest/blob/master/Worksheets/vector_calc_change.ipynb changing coordinates in the Euclidean 3-space]
- [http://nbviewer.jupyter.org/github/egourgoulhon/SageMathTest/blob/master/Worksheets/vector_calc_advanced.ipynb Advanced aspects: Euclidean spaces as Riemannian manifolds]
- [http://nbviewer.jupyter.org/github/egourgoulhon/SageMathTest/blob/master/Worksheets/Euclidean_plane.ipynb the Euclidean plane]
This work is part of the [http://sagemanifolds.obspm.fr/ SageManifolds project], see #18528 for an overview.",enhancement,closed,major,sage-8.3,geometry,fixed,"Euclidean space, vector calculus, gradient, divergence, curl, Laplacian",tmonteil,,Eric Gourgoulhon,Travis Scrimshaw,N/A,,220726c07bc00ba69b12a5cc7dc9499d930f1e8c,,"#24622, #24792",