Skip to content

Unicode operators for sage.manifolds #30473

@mkoeppe

Description

@mkoeppe

Replacing

  • /\ by ∧ (U+2227)
  • * by ⊗ (U+2297) for tensor products
  • --> by → (U+2192), |--> by ↦ (U+21A6)
  • d/dx by ∂/∂x, etc. (U+2202)
  • R (real field) by ℝ (U+211D)
  • C (complex field) by ℂ (U+2102)

Some references:

With the code introduced in this ticket, we have

sage: M = Manifold(2, 'M')
sage: X.<x,y> = M.chart()
sage: M.identity_map().display()
Id_M: M → M
   (x, y) ↦ (x, y)
sage: M.zero_scalar_field().display()
zero: M → ℝ
   (x, y) ↦ 0
sage: v = M.vector_field(-y, x, name='v')
sage: v.display()
v = -y ∂/∂x + x ∂/∂y
sage: X.frame()
Coordinate frame (M, (∂/∂x,∂/∂y))
sage: v.wedge(X.frame()[0]).display()
v∧∂/∂x = -x ∂/∂x∧∂/∂y
sage: f = M.scalar_field(x^2 + y^2, name='f')
sage: f.display()
f: M → ℝ
   (x, y) ↦ x^2 + y^2
sage: diff(f).display()
df = 2*x dx + 2*y dy
sage: (v*diff(f)).display()
v⊗df = -2*x*y ∂/∂x⊗dx - 2*y^2 ∂/∂x⊗dy + 2*x^2 ∂/∂y⊗dx + 2*x*y ∂/∂y⊗dy

CC: @egourgoulhon @tscrim @mwageringel @fchapoton

Component: user interface

Author: Eric Gourgoulhon

Branch/Commit: f2ae50e

Reviewer: Matthias Koeppe

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions