Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src/sage/manifolds/differentiable: Docstring/doctest edits #37829

Merged
merged 1 commit into from
May 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/sage/manifolds/differentiable/affine_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,10 @@ class AffineConnection(SageObject):

Unset components are initialized to zero::

sage: nab[:] # list of coefficients relative to the manifold's default vector frame
sage: nab[:] # list of coefficients relative to the manifold's default vector frame
[[[0, x^2, 0], [0, 0, 0], [0, 0, 0]],
[[0, 0, 0], [0, 0, 0], [0, 0, 0]],
[[0, 0, 0], [0, 0, y*z], [0, 0, 0]]]
[[0, 0, 0], [0, 0, 0], [0, 0, 0]],
[[0, 0, 0], [0, 0, y*z], [0, 0, 0]]]

The treatment of connection coefficients in a given vector frame is similar
to that of tensor components; see therefore the class
Expand Down Expand Up @@ -2378,7 +2378,7 @@ def curvature_form(self, i, j, frame=None):
2-form curvature (1,1) of connection nabla w.r.t. Vector frame
(M, (e_1,e_2,e_3)) on the 3-dimensional differentiable manifold M
sage: nab.curvature_form(1,1,e).display(e) # long time (if above is skipped)
curvature (1,1) of connection nabla w.r.t. Vector frame
curvature (1,1) of connection nabla w.r.t. Vector frame
(M, (e_1,e_2,e_3)) =
(y^3*z^4 + 2*x*y*z + (x*y^4 - x*y)*z^2) e^1∧e^2
+ (x^4*y*z^2 - x^2*y^2) e^1∧e^3 + (x^5*y*z^3 - x*z^2) e^2∧e^3
Expand Down
58 changes: 29 additions & 29 deletions src/sage/manifolds/differentiable/bundle_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,11 @@ class BundleConnection(SageObject, Mutability):
sage: nab[e, 1, 1][:] = [x+z, y-z, x*y*z]
sage: nab.display()
connection (1,1) of bundle connection nabla w.r.t. Local frame
(E|_M, (e_1,e_2)) = (x + z) dx + (y - z) dy + x*y*z dz
connection (1,2) of bundle connection nabla w.r.t. Local frame
(E|_M, (e_1,e_2)) = x*z dx + y*z dy + z^2 dz
connection (2,1) of bundle connection nabla w.r.t. Local frame
(E|_M, (e_1,e_2)) = x dx + x^2 dy + x^3 dz
(E|_M, (e_1,e_2)) = (x + z) dx + (y - z) dy + x*y*z dz
connection (1,2) of bundle connection nabla w.r.t. Local frame
(E|_M, (e_1,e_2)) = x*z dx + y*z dy + z^2 dz
connection (2,1) of bundle connection nabla w.r.t. Local frame
(E|_M, (e_1,e_2)) = x dx + x^2 dy + x^3 dz

Notice, when we omit the frame, the default frame of the vector bundle is
assumed (in this case ``e``)::
Expand Down Expand Up @@ -190,14 +190,14 @@ class BundleConnection(SageObject, Mutability):
sage: nab.display(frame=f)
connection (1,1) of bundle connection nabla w.r.t. Local frame
(E|_M, (f_1,f_2)) = ((x^3 + x)*z + 2*x)/(x^2 + 1) dx + y*z dy + z^2 dz
connection (1,2) of bundle connection nabla w.r.t. Local frame
(E|_M, (f_1,f_2)) = -(x^3 + x)*z dx - (x^2 + 1)*y*z dy -
connection (1,2) of bundle connection nabla w.r.t. Local frame
(E|_M, (f_1,f_2)) = -(x^3 + x)*z dx - (x^2 + 1)*y*z dy -
(x^2 + 1)*z^2 dz
connection (2,1) of bundle connection nabla w.r.t. Local frame
(E|_M, (f_1,f_2)) = (x*z - x)/(x^2 + 1) dx -
connection (2,1) of bundle connection nabla w.r.t. Local frame
(E|_M, (f_1,f_2)) = (x*z - x)/(x^2 + 1) dx -
(x^2 - y*z)/(x^2 + 1) dy - (x^3 - z^2)/(x^2 + 1) dz
connection (2,2) of bundle connection nabla w.r.t. Local frame
(E|_M, (f_1,f_2)) = -x*z dx - y*z dy - z^2 dz
connection (2,2) of bundle connection nabla w.r.t. Local frame
(E|_M, (f_1,f_2)) = -x*z dx - y*z dy - z^2 dz

The new connection 1-forms obey the defining formula, too::

Expand All @@ -215,14 +215,14 @@ class BundleConnection(SageObject, Mutability):
....: print(Omega(i ,j, e).display())
curvature (1,1) of bundle connection nabla w.r.t. Local frame
(E|_M, (e_1,e_2)) = -(x^3 - x*y)*z dx∧dy + (-x^4*z + x*z^2) dx∧dz +
(-x^3*y*z + x^2*z^2) dy∧dz
curvature (1,2) of bundle connection nabla w.r.t. Local frame
(-x^3*y*z + x^2*z^2) dy∧dz
curvature (1,2) of bundle connection nabla w.r.t. Local frame
(E|_M, (e_1,e_2)) = -x dx∧dz - y dy∧dz
curvature (2,1) of bundle connection nabla w.r.t. Local frame
curvature (2,1) of bundle connection nabla w.r.t. Local frame
(E|_M, (e_1,e_2)) = 2*x dx∧dy + 3*x^2 dx∧dz
curvature (2,2) of bundle connection nabla w.r.t. Local frame
curvature (2,2) of bundle connection nabla w.r.t. Local frame
(E|_M, (e_1,e_2)) = (x^3 - x*y)*z dx∧dy + (x^4*z - x*z^2) dx∧dz +
(x^3*y*z - x^2*z^2) dy∧dz
(x^3*y*z - x^2*z^2) dy∧dz

The derived forms certainly obey the structure equations, see
:meth:`curvature_form` for details::
Expand Down Expand Up @@ -484,17 +484,17 @@ def _new_forms(self, frame):
sage: forms = nab._new_forms(e)
sage: [forms[k] for k in sorted(forms)]
[1-form connection (1,1) of bundle connection nabla w.r.t. Local
frame (E|_M, (e_1,e_2)) on the 2-dimensional differentiable
manifold M,
1-form connection (1,2) of bundle connection nabla w.r.t. Local
frame (E|_M, (e_1,e_2)) on the 2-dimensional differentiable
manifold M,
1-form connection (2,1) of bundle connection nabla w.r.t. Local
frame (E|_M, (e_1,e_2)) on the 2-dimensional differentiable
manifold M,
1-form connection (2,2) of bundle connection nabla w.r.t. Local
frame (E|_M, (e_1,e_2)) on the 2-dimensional differentiable
manifold M]
frame (E|_M, (e_1,e_2)) on the 2-dimensional differentiable
manifold M,
1-form connection (1,2) of bundle connection nabla w.r.t. Local
frame (E|_M, (e_1,e_2)) on the 2-dimensional differentiable
manifold M,
1-form connection (2,1) of bundle connection nabla w.r.t. Local
frame (E|_M, (e_1,e_2)) on the 2-dimensional differentiable
manifold M,
1-form connection (2,2) of bundle connection nabla w.r.t. Local
frame (E|_M, (e_1,e_2)) on the 2-dimensional differentiable
manifold M]

"""
dom = frame._domain
Expand Down Expand Up @@ -1308,8 +1308,8 @@ def display(self, frame=None, vector_frame=None, chart=None,
sage: nab.display()
connection (1,1) of bundle connection nabla w.r.t. Local frame
(E|_M, (e_1,e_2)) = x dx + y dy + z dz
connection (2,2) of bundle connection nabla w.r.t. Local frame
(E|_M, (e_1,e_2)) = x^2 dx + y^2 dy + z^2 dz
connection (2,2) of bundle connection nabla w.r.t. Local frame
(E|_M, (e_1,e_2)) = x^2 dx + y^2 dy + z^2 dz
sage: latex(nab.display())
\begin{array}{lcl} \omega^1_{\ \, 1} = x \mathrm{d} x +
y \mathrm{d} y + z \mathrm{d} z \\ \omega^2_{\ \, 2} = x^{2}
Expand Down
18 changes: 9 additions & 9 deletions src/sage/manifolds/differentiable/differentiable_submanifold.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,14 @@ class DifferentiableSubmanifold(DifferentiableManifold, TopologicalSubmanifold):
- ``field`` -- field `K` on which the sub manifold is defined; allowed
values are

- ``'real'`` or an object of type ``RealField`` (e.g., ``RR``) for
a manifold over `\RR`
- ``'complex'`` or an object of type ``ComplexField`` (e.g., ``CC``)
for a manifold over `\CC`
- an object in the category of topological fields (see
:class:`~sage.categories.fields.Fields` and
:class:`~sage.categories.topological_spaces.TopologicalSpaces`)
for other types of manifolds
- ``'real'`` or an object of type ``RealField`` (e.g., ``RR``) for
a manifold over `\RR`
- ``'complex'`` or an object of type ``ComplexField`` (e.g., ``CC``)
for a manifold over `\CC`
- an object in the category of topological fields (see
:class:`~sage.categories.fields.Fields` and
:class:`~sage.categories.topological_spaces.TopologicalSpaces`)
for other types of manifolds

- ``structure`` -- manifold structure (see
:class:`~sage.manifolds.structure.TopologicalStructure` or
Expand Down Expand Up @@ -137,7 +137,7 @@ class DifferentiableSubmanifold(DifferentiableManifold, TopologicalSubmanifold):
sage: phi_inv_t = M.scalar_field({CM: z-x^2-y^2})
sage: phi_inv_t.display()
M β†’ ℝ
(x, y, z) ↦ -x^2 - y^2 + z
(x, y, z) ↦ -x^2 - y^2 + z

`\phi` can then be declared as an embedding `N\to M`::

Expand Down
3 changes: 1 addition & 2 deletions src/sage/manifolds/differentiable/multivectorfield.py
Original file line number Diff line number Diff line change
Expand Up @@ -1041,8 +1041,7 @@ def wedge(self, other):
sage: b.display()
b = y^2 βˆ‚/βˆ‚xβˆ§βˆ‚/βˆ‚y + (x + z) βˆ‚/βˆ‚xβˆ§βˆ‚/βˆ‚z + z^2 βˆ‚/βˆ‚yβˆ§βˆ‚/βˆ‚z
sage: s = a.wedge(b); s
3-vector field a∧b on the 3-dimensional differentiable
manifold M
3-vector field a∧b on the 3-dimensional differentiable manifold M
sage: s.display()
a∧b = (-x^2 + (y^3 - x - 1)*z + 2*z^2 - x) βˆ‚/βˆ‚xβˆ§βˆ‚/βˆ‚yβˆ§βˆ‚/βˆ‚z

Expand Down
35 changes: 20 additions & 15 deletions src/sage/manifolds/differentiable/tangent_space.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,28 +178,32 @@ class TangentSpace(FiniteRankFreeModule):
[0 1]
sage: W_Tp_xy = VectorSpace(SR, 2, inner_product_matrix=Q_Tp_xy)
sage: Tp.bases()[0]
Basis (βˆ‚/βˆ‚x,βˆ‚/βˆ‚y) on the Tangent space at Point p on the 2-dimensional differentiable manifold M
sage: phi_Tp_xy = Tp.isomorphism_with_fixed_basis(Tp.bases()[0], codomain=W_Tp_xy); phi_Tp_xy
Basis (βˆ‚/βˆ‚x,βˆ‚/βˆ‚y) on the Tangent space at Point p on the
2-dimensional differentiable manifold M
sage: phi_Tp_xy = Tp.isomorphism_with_fixed_basis(Tp.bases()[0], codomain=W_Tp_xy)
sage: phi_Tp_xy
Generic morphism:
From: Tangent space at Point p on the 2-dimensional differentiable manifold M
To: Ambient quadratic space of dimension 2 over Symbolic Ring
Inner product matrix:
[1 0]
[0 1]
From: Tangent space at Point p on the 2-dimensional differentiable manifold M
To: Ambient quadratic space of dimension 2 over Symbolic Ring
Inner product matrix:
[1 0]
[0 1]

sage: Q_Tp_uv = g[c_uv.frame(),:](*p.coordinates(c_uv)); Q_Tp_uv
[1/2 0]
[ 0 1/2]
sage: W_Tp_uv = VectorSpace(SR, 2, inner_product_matrix=Q_Tp_uv)
sage: Tp.bases()[1]
Basis (βˆ‚/βˆ‚u,βˆ‚/βˆ‚v) on the Tangent space at Point p on the 2-dimensional differentiable manifold M
sage: phi_Tp_uv = Tp.isomorphism_with_fixed_basis(Tp.bases()[1], codomain=W_Tp_uv); phi_Tp_uv
Basis (βˆ‚/βˆ‚u,βˆ‚/βˆ‚v) on the Tangent space at Point p on the
2-dimensional differentiable manifold M
sage: phi_Tp_uv = Tp.isomorphism_with_fixed_basis(Tp.bases()[1], codomain=W_Tp_uv)
sage: phi_Tp_uv
Generic morphism:
From: Tangent space at Point p on the 2-dimensional differentiable manifold M
To: Ambient quadratic space of dimension 2 over Symbolic Ring
Inner product matrix:
[1/2 0]
[ 0 1/2]
From: Tangent space at Point p on the 2-dimensional differentiable manifold M
To: Ambient quadratic space of dimension 2 over Symbolic Ring
Inner product matrix:
[1/2 0]
[ 0 1/2]

sage: t1, t2 = Tp.tensor((1,0)), Tp.tensor((1,0))
sage: t1[:] = (8, 15)
Expand All @@ -212,7 +216,8 @@ class TangentSpace(FiniteRankFreeModule):
541

sage: Tp_xy_to_uv = M.change_of_frame(c_xy.frame(), c_uv.frame()).at(p); Tp_xy_to_uv
Automorphism of the Tangent space at Point p on the 2-dimensional differentiable manifold M
Automorphism of the Tangent space at Point p on the
2-dimensional differentiable manifold M
sage: Tp.set_change_of_basis(Tp.bases()[0], Tp.bases()[1], Tp_xy_to_uv)
sage: t1[Tp.bases()[1],:]
[23, -7]
Expand Down
16 changes: 8 additions & 8 deletions src/sage/manifolds/differentiable/vector_bundle.py
Original file line number Diff line number Diff line change
Expand Up @@ -769,7 +769,7 @@ def set_change_of_frame(self, frame1, frame2, change_of_frame,
:class:`~sage.tensor.modules.free_module_automorphism.FreeModuleAutomorphism`
describing the automorphism `P` that relates the basis `(e_i)` to
the basis `(f_i)` according to `f_i = P(e_i)`
- ``compute_inverse`` (default: True) -- if set to True, the inverse
- ``compute_inverse`` (default: ``True``) -- if set to ``True``, the inverse
automorphism is computed and the change from basis `(f_i)` to `(e_i)`
is set to it in the internal dictionary ``self._frame_changes``

Expand Down Expand Up @@ -1477,7 +1477,7 @@ def ambient_domain(self):
sage: Phi.display()
Phi: R β†’ M
t ↦ (x, y) = (cos(t), sin(t))
sage: PhiT11 = R.tensor_bundle(1, 1, dest_map=Phi)
sage: PhiT11 = R.tensor_bundle(1, 1, dest_map=Phi)
sage: PhiT11.ambient_domain()
2-dimensional differentiable manifold M

Expand Down Expand Up @@ -1725,24 +1725,24 @@ def orientation(self):
[]
sage: T11.set_orientation([c_xy.frame(), c_uv.frame()])
sage: T11.orientation()
[Coordinate frame (U, (βˆ‚/βˆ‚x,βˆ‚/βˆ‚y)), Coordinate frame
(V, (βˆ‚/βˆ‚u,βˆ‚/βˆ‚v))]
[Coordinate frame (U, (βˆ‚/βˆ‚x,βˆ‚/βˆ‚y)),
Coordinate frame (V, (βˆ‚/βˆ‚u,βˆ‚/βˆ‚v))]

If the destination map is the identity, the orientation is
automatically set for the manifold, too::

sage: M.orientation()
[Coordinate frame (U, (βˆ‚/βˆ‚x,βˆ‚/βˆ‚y)), Coordinate frame
(V, (βˆ‚/βˆ‚u,βˆ‚/βˆ‚v))]
[Coordinate frame (U, (βˆ‚/βˆ‚x,βˆ‚/βˆ‚y)),
Coordinate frame (V, (βˆ‚/βˆ‚u,βˆ‚/βˆ‚v))]

Conversely, if one sets an orientation on the manifold,
the orientation on its tensor bundles is set accordingly::

sage: c_tz.<t,z> = U.chart()
sage: M.set_orientation([c_tz, c_uv])
sage: T11.orientation()
[Coordinate frame (U, (βˆ‚/βˆ‚t,βˆ‚/βˆ‚z)), Coordinate frame
(V, (βˆ‚/βˆ‚u,βˆ‚/βˆ‚v))]
[Coordinate frame (U, (βˆ‚/βˆ‚t,βˆ‚/βˆ‚z)),
Coordinate frame (V, (βˆ‚/βˆ‚u,βˆ‚/βˆ‚v))]

"""
if self._dest_map.is_identity():
Expand Down
Loading