#15916: Tensors on free modules of finite rank
-------------------------------------+-------------------------------------
       Reporter:  egourgoulhon       |        Owner:
           Type:  enhancement        |       Status:  needs_review
       Priority:  major              |    Milestone:  sage-6.4
      Component:  linear algebra     |   Resolution:
       Keywords:  free module,       |    Merged in:
  tensor, tensor product             |    Reviewers:
        Authors:  Eric Gourgoulhon,  |  Work issues:
  Michal Bejger                      |       Commit:
Report Upstream:  N/A                |  d8f518ff48c8be2ea73f2b51e067af9e6c87b4bf
         Branch:                     |     Stopgaps:
  u/egourgoulhon/tensor_modules      |
   Dependencies:                     |
-------------------------------------+-------------------------------------

Comment (by egourgoulhon):

 Replying to [comment:20 vbraun]:
 > Doctest coverage: `sage -coverage src/sage/tensor/`

 OK I see: most private methods appear to have no doctest because their
 doctests have been put in the docstring of the class itself: this is the
 only way for them to appear in the generated html documentation. This is
 particularly true for the `__init__` methods (there are actually a lot of
 doctests for them). Shall the doctests be repeated in the docstring of the
 private methods ? What is the general policy for this ?

 > I don't think the string notation is very user friendly,
 `A['^{ab}_{cd}']*B['^d_a']` looks more like line noise. How about
 recognizing symbolic variables and the built-in function `any` as special:
 >
 >     sage: var('a, d')
 >     sage: A[a, any, any, d] * B[d, a]
 >

 Your suggestion for `any` is quite compeling, thanks. Note that, in the
 present version, it is already possible to replace unrelevant indices with
 dots, which decreases the noise:
 sage: S = A['^{a.}_{.d}']*B['^d_a']


 > Or, perhaps better in the long run: Define your own index class that
 knows about whether indices are upper or lower. Then we can also check
 that you don't contract two upper indices, and/or automatically insert the
 metric there:
 >
 >     sage: a, b, c, d = A.indices()
 >     sage: a
 >     Upper index
 >     sage: A[a, b, c, d] * B[d, a]

 You are right: in the long run, we should probably introduce an indice
 class to get rid of the strings. The only advantage of the present
 notation is that we do not have to spoil some variable names to denote
 indices: they can be set on the fly, to denote an operation like
 contraction where index notation is more clear, most operations being
 performed in an index-free setting.

--
Ticket URL: <http://trac.sagemath.org/ticket/15916#comment:21>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to