Loading [MathJax]/jax/output/HTML-CSS/jax.js
Ask Your Question
0

latex_name and derivatives in sagemanifolds

asked 4 years ago

cav_rt gravatar image

updated 4 years ago

Hi,

I think there is a small bug on displaying derivatives of tensors w.r.t a parameter with latex_name.

For symbolic expressions,

from sage.manifolds.utilities import ExpressionNice
var('t')
dq1 = function('dq_1', latex_name=r'\dot{q}_1')(t)
L = function('L')(dq1)
ExpressionNice(diff(L,t))

works nicely. However, when I define the same L as a scalar field (or any tensor),

M = manifolds.Minkowski()
L1 = M.scalar_field(L)
L1.derivative().display()

the latex_name is ignored and dq_1 is used instead. The problem does not occur when there is no index in dq.

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
1

answered 4 years ago

eric_g gravatar image

I cannot reproduce the issue with Sage 9.2. Typing the following code

%display latex
var('t')
dq1 = function('dq_1', latex_name=r'\dot{q}_1')(t)
L = function('L')(dq1)
M = manifolds.Minkowski()
L1 = M.scalar_field(L)
L1.derivative().display()

in a Jupyter notebook yields

L(˙q1(t))˙q1tdt

Preview: (hide)
link

Comments

You are right, probably I was messing up variables and names. Thank you!

cav_rt gravatar imagecav_rt ( 4 years ago )

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 4 years ago

Seen: 365 times

Last updated: Feb 02 '21