Re: ctensor - components as a matrix
"Viktor T. Toth" <[email protected]>
| Newsgroups | gmane.comp.mathematics.maxima.general |
|---|---|
| Message-ID | <[email protected]> |
Well, sure. For a mixed-index rank-2 tensor, the trace is just the sum of its diagonal components, and the representation of the tensor is invariant under a change of coordinates. I just wanted to show you a simple, transparent example of what a component-wise representation of a tensor in itensor could be used for. But as I said, the very idea of assigning a component-wise representation is at odds with the core value of itensor, which is about the coordinate-free, abstract index formalism. Since you mentioned ctensor, however, I should caution against careless use. For instance, load(ctensor); ct_coordsys(exteriorschwarzschild); mat_trace(lg); does NOT give you the trace of the Schwarzschild metric. That would be given by cmetric(); mat_trace(lg.ug); In other words, we need to form the "mixed index metric g^m_n (that, of course, is just the Kronecker-delta) and take its trace (which would of course be just the dimensionality of the manifold.) Viktor On 2026-04-13 18:27, Daniel Volinski via Maxima-discuss wrote: > Hi Viktor, > > Thank you for your answer, nice example. > > Of course, you can obtain the same result with: > * > * > *mat_trace(diag_matrix(ρ,-p,-p,-p));* > > and you don't need "ctensor" for that. > > Daniel Volinski. > > En martes, 7 de abril de 2026, 22:42:30 GMT+3, Viktor T. Toth > <[email protected]> escribió: > > > Dear Daniel, > > On the face of it, the component-wise definition of a tensor is indeed > fundamentally at odds, philosophically, with the abstract index > formalism that itensor aims to represent. > > Having said that, I could think of a few legitimate use cases, > including, e.g., mixed-index rank-2 tensors in particular, which are > unchanged under a change of coordinates. Having said that, it's not a > construct I ever used much myself. > > Still, here's a silly but valid example (trace of the perfect fluid > stress-energy tensor): > > load(itensor); > imetric(g); > components(T([m],[n]),diag_matrix(rho,-p,-p,-p)); > ishow(g([m,n],[])*T([],[m,n]))$ > ishow(contract(%))$ > sum(%,n,1,dim),eval; > > Viktor > > > > On 2026-04-06 02:27, Daniel Volinski via Maxima-discuss wrote: > Hi all, > > In the package "ctensor" I can define the components of a tensor in 4 > ways, > The second is to define the components as a matrix, like this: > lg:-ident(4)$lg[1,1]:1$lg; > components(g([i,j],[]),lg); > ishow(g([i,j],[]))$ > I've never found a usage for that. Do you know of any usage of this > construct? > i.e. something that will be useful for further calculations. > > Thank you, > > Daniel Volinski > > > > _______________________________________________ > Maxima-discuss mailing list > [email protected] <mailto:[email protected]> > https://lists.sourceforge.net/lists/listinfo/maxima-discuss <https://lists.sourceforge.net/lists/listinfo/maxima-discuss> > > > _______________________________________________ > Maxima-discuss mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/maxima-discuss _______________________________________________ Maxima-discuss mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/maxima-discuss