#28564 closed enhancement (fixed)

Tensor Fields and Sections: Naming Consistencies

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: 34f2fa1 (Commits) Commit: 34f2fa1a4014bf5e3d7c5f54d83aa93216d6efef
Dependencies: Stopgaps:

Description (last modified by gh-DeRhamSource)

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

  • copies apply no 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 (49)

comment:1 Changed 14 months 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 14 months ago by gh-DeRhamSource

  • Branch set to u/gh-DeRhamSource/tensor_fields__consistent_naming

comment:3 Changed 14 months 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 14 months ago by gh-DeRhamSource

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

comment:5 Changed 14 months 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 14 months 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 14 months 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 14 months 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 14 months 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 14 months ago by egourgoulhon (previous) (diff)

comment:10 in reply to: ↑ 9 Changed 14 months 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 13 months 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 13 months ago by gh-DeRhamSource

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

comment:13 in reply to: ↑ 12 Changed 13 months 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 13 months 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 13 months ago by gh-DeRhamSource

  • Status changed from needs_info to needs_review

That should be it.

comment:16 Changed 13 months 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 13 months 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 13 months 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 13 months 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 13 months 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 13 months 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 13 months 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 13 months 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 13 months 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 13 months 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

comment:26 Changed 13 months ago by egourgoulhon

  • Status changed from needs_review to positive_review

Thanks.

comment:27 Changed 13 months ago by gh-DeRhamSource

  • Description modified (diff)

comment:28 Changed 13 months ago by vbraun

  • Status changed from positive_review to needs_work

Merge conflict

comment:29 Changed 13 months ago by git

  • Commit changed from 5b2eee2c3ef6f6d7613255b746e08beca7e99e23 to 38aa7f5c8cdf9d1ac3d79238071e44cf43fe90c7

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

38aa7f5Merge branch 'develop' into t/28564/tensor_fields__consistent_naming

comment:30 follow-up: Changed 13 months ago by gh-DeRhamSource

  • Status changed from needs_work to needs_review

That should be it. Please check.

comment:31 in reply to: ↑ 30 ; follow-up: Changed 13 months ago by tscrim

Replying to gh-DeRhamSource:

That should be it. Please check.

Did you get a merge conflict when merging in beta4? Otherwise, there is a merge conflict with the upcoming beta5.

comment:32 in reply to: ↑ 31 Changed 13 months ago by gh-DeRhamSource

Replying to tscrim:

Replying to gh-DeRhamSource:

That should be it. Please check.

Did you get a merge conflict when merging in beta4?

Yes.

comment:33 Changed 13 months ago by tscrim

  • Status changed from needs_review to positive_review

Great, thanks.

comment:34 Changed 13 months ago by vbraun

  • Status changed from positive_review to needs_work

Merge conflict, possibly #28578... just wait for beta5

comment:35 Changed 13 months ago by git

  • Commit changed from 38aa7f5c8cdf9d1ac3d79238071e44cf43fe90c7 to 9d39cb5ac1387653256b7fa684465dc816ed4efe

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

9d39cb5Merge branch 'develop' into t/28564/tensor_fields__consistent_naming

comment:36 Changed 13 months ago by gh-DeRhamSource

  • Status changed from needs_work to needs_review

comment:37 Changed 13 months ago by tscrim

  • Status changed from needs_review to positive_review

comment:38 Changed 13 months ago by fbissey

  • Status changed from positive_review to needs_work

Doctest failure

sage -t --long /usr/lib/python3.7/site-packages/sage/manifolds/differentiable/tensorfield.py
**********************************************************************
File "/usr/lib/python3.7/site-packages/sage/manifolds/differentiable/tensorfield.py", line 269, in sage.manifolds.differentiable.tensorfield.TensorField
Failed example:
    s = f*t.restrict(U); s
Expected:
    Tensor field of type (0,2) on the Open subset U of the 2-dimensional
     differentiable manifold S^2
Got:
    Tensor field f*t of type (0,2) on the Open subset U of the 2-dimensional differentiable manifold S^2

One such doctest was fixed in the same file at line 263 but this one was missed.

comment:39 Changed 13 months ago by git

  • Commit changed from 9d39cb5ac1387653256b7fa684465dc816ed4efe to 67e5cdc2b5414bd5f1d1accfbd5d7684de21b765

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

67e5cdcTrac #28564: One line doctest error fixed

comment:40 Changed 13 months ago by gh-DeRhamSource

  • Status changed from needs_work to needs_review

comment:41 Changed 13 months ago by tscrim

  • Status changed from needs_review to positive_review

comment:42 Changed 13 months ago by git

  • Commit changed from 67e5cdc2b5414bd5f1d1accfbd5d7684de21b765 to 5dd53b08816502d1b1ee00f911bc80f1b426fb00
  • Status changed from positive_review to needs_review

Branch pushed to git repo; I updated commit sha1 and set ticket back to needs_review. New commits:

5dd53b0Trac #28564: raw strings for LaTeX code

comment:43 Changed 13 months ago by gh-DeRhamSource

Now, everything must be fine, I guess.

comment:44 Changed 13 months ago by gh-DeRhamSource

Please give it a positive review, again. Sorry for this trivial mistake in the first place.

Last edited 13 months ago by gh-DeRhamSource (previous) (diff)

comment:45 Changed 13 months ago by egourgoulhon

  • Status changed from needs_review to positive_review

Thanks for the fix.

comment:46 Changed 13 months ago by git

  • Commit changed from 5dd53b08816502d1b1ee00f911bc80f1b426fb00 to 34f2fa1a4014bf5e3d7c5f54d83aa93216d6efef
  • Status changed from positive_review to needs_review

Branch pushed to git repo; I updated commit sha1 and set ticket back to needs_review. New commits:

34f2fa1Trac #28564: Merge branch 'develop' into t/28564/tensor_fields__consistent_naming

comment:47 Changed 13 months ago by gh-DeRhamSource

Please give it a positive review again...

comment:48 Changed 13 months ago by egourgoulhon

  • Status changed from needs_review to positive_review

The 9.0.beta6 patchbot is all green.

comment:49 Changed 13 months ago by vbraun

  • Branch changed from u/gh-DeRhamSource/tensor_fields__consistent_naming to 34f2fa1a4014bf5e3d7c5f54d83aa93216d6efef
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.