Skip to content

Euclidean spaces and vector calculus #24623

@egourgoulhon

Description

@egourgoulhon

This ticket implements Euclidean spaces as Riemannian manifolds diffeomorphic to Rn 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 ask.sagemath question for a motivation, as well as this 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.<x,y,z> = 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.<r,th,ph> = 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:

This work is part of the SageManifolds project, see #18528 for an overview.

Depends on #24622
Depends on #24792

CC: @sagetrac-tmonteil

Component: geometry

Keywords: Euclidean space, vector calculus, gradient, divergence, curl, Laplacian

Author: Eric Gourgoulhon

Branch: 220726c

Reviewer: Travis Scrimshaw

Issue created by migration from https://trac.sagemath.org/ticket/24623

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions