Opened 3 years ago

Last modified 3 years ago

#28564 closed enhancement

Tensor Fields and Sections: Naming Consistencies — at Version 25

Reported by: gh-DeRhamSource Owned by:
Priority: major Milestone: sage-9.0
Component: geometry Keywords: manifolds, tensor fields, scalar fields
Cc: tscrim, egourgoulhon Merged in:
Authors: Michael Jung Reviewers: Eric Gourgoulhon, Travis Scrimshaw
Report Upstream: N/A Work issues:
Branch: u/gh-DeRhamSource/tensor_fields__consistent_naming (Commits, GitHub, GitLab) Commit: 5b2eee2c3ef6f6d7613255b746e08beca7e99e23
Dependencies: Stopgaps:

Status badges

Description (last modified by gh-DeRhamSource)

This ticket is part of the metaticket #28519 and consists of:

  • copies apply the name from the original in any case
  • copy method with individual naming
  • (right) multiplication with a scalar field f yields to the name f*a and the LaTeX name f \cdot a for any tensor/section (or scalar) field a

Change History (25)

comment:1 Changed 3 years ago by gh-DeRhamSource

  • Authors set to Michael Jung
  • Cc tscrim egourgoulhon added
  • Component changed from PLEASE CHANGE to geometry
  • Description modified (diff)
  • Keywords manifolds tensor fields scalar fields added
  • Type changed from PLEASE CHANGE to enhancement

comment:2 Changed 3 years ago by gh-DeRhamSource

  • Branch set to u/gh-DeRhamSource/tensor_fields__consistent_naming

comment:3 Changed 3 years ago by git

  • Commit set to 99c392c7f0bec8145544a2048d00c05eb73b0e79

Branch pushed to git repo; I updated commit sha1. New commits:

99c392cCopy and multiplication names

comment:4 Changed 3 years ago by gh-DeRhamSource

  • Reviewers set to Eric Gourgoulhon, Travis Scrimshaw
  • Status changed from new to needs_review

comment:5 Changed 3 years ago by git

  • Commit changed from 99c392c7f0bec8145544a2048d00c05eb73b0e79 to b3e04682ae022ce8417f99f7d9145fb8a2782676

Branch pushed to git repo; I updated commit sha1. New commits:

b3e0468MixedForm copies apply names

comment:6 follow-up: Changed 3 years ago by gh-DeRhamSource

  • Status changed from needs_review to needs_info

Actually, what do you prefer? Should copies apply the names from the original or not?

I think, at least it must be consistent...

comment:7 in reply to: ↑ 6 ; follow-up: Changed 3 years ago by egourgoulhon

Replying to gh-DeRhamSource:

Actually, what do you prefer? Should copies apply the names from the original or not?

I don't have a strong opinion on that. Travis?

comment:8 in reply to: ↑ 7 ; follow-up: Changed 3 years ago by tscrim

Replying to egourgoulhon:

Replying to gh-DeRhamSource:

Actually, what do you prefer? Should copies apply the names from the original or not?

I don't have a strong opinion on that. Travis?

I might say no just because copies are meant to be modified, so they should have different names. However, like Eric, this is not a strong opinion. Actually, is there a mechanism to change the name?

comment:9 in reply to: ↑ 8 ; follow-up: Changed 3 years ago by egourgoulhon

Replying to tscrim:

Replying to egourgoulhon:

I might say no just because copies are meant to be modified, so they should have different names. However, like Eric, this is not a strong opinion.

Thanks for your answer.

Actually, is there a mechanism to change the name?

Yes there is the method set_name(). One could also pass the (possible) new name as an argument to copy(). There are a few examples (2 actually) of copy() taking some arguments in Sage library.

Last edited 3 years ago by egourgoulhon (previous) (diff)

comment:10 in reply to: ↑ 9 Changed 3 years ago by tscrim

Replying to egourgoulhon:

Replying to tscrim:

Actually, is there a mechanism to change the name?

Yes there is the method set_name(). One could also pass the (possible) new name as an argument to copy(). There are a few examples (2 actually) of copy() taking some arguments in Sage library.

Hmm...in that case I probably would say to not copy the name (with a .. WARNING:: (perhaps .. NOTE::) block about that) and have copy() take an optional argument for the (latex) name.

comment:11 Changed 3 years ago by git

  • Commit changed from b3e04682ae022ce8417f99f7d9145fb8a2782676 to f55b881b1126c44b11f5cb0b6b5157721cd75983

Branch pushed to git repo; I updated commit sha1. New commits:

e4470b5Merge branch 'develop' into t/28564/tensor_fields__consistent_naming
47e2f51copy method with naming
f55b881Doctest adapted

comment:12 follow-up: Changed 3 years ago by gh-DeRhamSource

That's strange. I cannot observe merge conflicts. What's the matter?

comment:13 in reply to: ↑ 12 Changed 3 years ago by egourgoulhon

Replying to gh-DeRhamSource:

That's strange. I cannot observe merge conflicts. What's the matter?

It's because your develop branch is still 9.0.beta2 (this is what I see from the commit e4470b5). You should update to 9.0.beta3.

comment:14 Changed 3 years ago by git

  • Commit changed from f55b881b1126c44b11f5cb0b6b5157721cd75983 to f85de87a572fb6dc088e47518cd0acf163cbff41

Branch pushed to git repo; I updated commit sha1. New commits:

f85de87Merge branch 'develop' into t/28564/tensor_fields__consistent_naming

comment:15 Changed 3 years ago by gh-DeRhamSource

  • Status changed from needs_info to needs_review

That should be it.

comment:16 Changed 3 years ago by egourgoulhon

  • Status changed from needs_review to needs_work

As revealed by the patchbot, there is one failed doctest:

sage -t --long src/sage/manifolds/differentiable/tensorfield.py
**********************************************************************
File "src/sage/manifolds/differentiable/tensorfield.py", line 260, in sage.manifolds.differentiable.tensorfield.TensorField
Failed example:
    s = f*t; s  # long time
Expected:
    Tensor field of type (0,2) on the 2-dimensional differentiable
     manifold S^2
Got:
    Tensor field f*t of type (0,2) on the 2-dimensional differentiable manifold S^2

comment:17 follow-up: Changed 3 years ago by egourgoulhon

Another point: the introduction of the treatment of the names in FreeModuleTensor._rmul_() is a valuable enhancement, thanks. However, I wonder about the \cdot in the LaTeX output: _rmul_() deals with the left multiplication of a module element by an element of the base ring and in most textbooks, this is denoted without any multiplication symbol, i.e. as \lambda x, where \lambda is the ring element and x is the module element. This is certainly true in the two textbooks that we quote regarding free modules:

  • R. Godement : *Algebra* [God1968]_
  • S. Lang : *Algebra* [Lan2002]_

Granted: Wikipedia article uses the dot...

comment:18 Changed 3 years ago by git

  • Commit changed from f85de87a572fb6dc088e47518cd0acf163cbff41 to eb92e6aa9a646360ea7a33c2bc27055c7386dc08

Branch pushed to git repo; I updated commit sha1. New commits:

eb92e6aDoctest fixed

comment:19 Changed 3 years ago by gh-DeRhamSource

Mhm. I partially agree with you. In practice, the notation is certainly inconvenient and everything is clear by choosing correct letters, but in this case I guess everything has to be rigorous. The \cdot makes unambiguously clear that an operation was performed on both elements.

The doctest is fixed. This is indeed a doctest error, but strangely it didn't occur to me in the first place.

comment:20 in reply to: ↑ 17 ; follow-up: Changed 3 years ago by egourgoulhon

Replying to egourgoulhon:

Granted: Wikipedia article uses the dot...

On the other hand, the dot-free notation is used in Wikipedia article 'Vector space'.

Travis, do you have an opinion on that? In particular, do we have other modules in Sage with named elements? If so, what is the adopted convention? (I think we should be consistent there).

comment:21 in reply to: ↑ 20 ; follow-up: Changed 3 years ago by tscrim

Replying to egourgoulhon:

Replying to egourgoulhon:

Granted: Wikipedia article uses the dot...

On the other hand, the dot-free notation is used in Wikipedia article 'Vector space'.

Travis, do you have an opinion on that? In particular, do we have other modules in Sage with named elements? If so, what is the adopted convention? (I think we should be consistent there).

I don't know of any other place in Sage where we do something like this. Although at \cdot is much better than a period for an action IMO ^^;;.

comment:22 in reply to: ↑ 21 Changed 3 years ago by egourgoulhon

Replying to tscrim:

Replying to egourgoulhon:

Replying to egourgoulhon:

Granted: Wikipedia article uses the dot...

On the other hand, the dot-free notation is used in Wikipedia article 'Vector space'.

Travis, do you have an opinion on that? In particular, do we have other modules in Sage with named elements? If so, what is the adopted convention? (I think we should be consistent there).

I don't know of any other place in Sage where we do something like this. Although at \cdot is much better than a period for an action IMO ^^;;.

OK. Let us keep the \cdot then...

comment:23 Changed 3 years ago by egourgoulhon

We are almost done here I think. One very last thing: you should modify the ticket description, to take into account the change in copy().

comment:24 Changed 3 years ago by git

  • Commit changed from eb92e6aa9a646360ea7a33c2bc27055c7386dc08 to 5b2eee2c3ef6f6d7613255b746e08beca7e99e23

Branch pushed to git repo; I updated commit sha1. New commits:

5b2eee2'copy' with individual naming

comment:25 Changed 3 years ago by gh-DeRhamSource

  • Description modified (diff)
  • Status changed from needs_work to needs_review
  • Summary changed from Tensor Fields: Consistent Naming to Tensor Fields and Sections: Naming Consistencies

New commits:

5b2eee2'copy' with individual naming
Note: See TracTickets for help on using tickets.