Maxima – 153 – itensor – 12

E-Bo-Oman

E. Bo – Oman

Continuo da qui, copio dal Reference Manual, PDF scaricabile da qui, sono a p.458.

Esportare espressioni in TeX

The itensor package provides limited support for exporting tensor expressions to TeX. Since itensor expressions appear as function calls, the regular Maxima tex command will not produce the expected output. You can try instead the tentex command, which attempts to translate tensor expressions into appropriately indexed TeX objects.

tentex (expr)
To use the tentex function, you must first load tentex, as in the following example:

(%i1) load(itensor)$

(%i2) load(tentex)$

(%i3) idummyx:m;
(%o3)                                  m
(%i4) ishow(icurvature([j,k,l],[i]))$
            m1       i           m1       i           i            i
(%t4)  ichr2    ichr2     - ichr2    ichr2     - ichr2      + ichr2
            j k      m1 l        j l      m1 k        j l,k        j k,l
(%i5) tentex(%)$
$$\Gamma_{j\,k}^{m_{1}}\,\Gamma_{l\,m_{1}}^{i}-\Gamma_{j\,l}^{m_{1}}
 \,\Gamma_{k\,m_{1}}^{i}-\Gamma_{j\,l,k}^{i}+\Gamma_{j\,k,l}^{i}$$

153-0

Note the use of the idummyx assignment, to avoid the appearance of the percent sign in the TeX expression, which may lead to compile errors.

NB: This version of the tentex function is somewhat experimental.

Interfacciamento con ctensor

The itensor package has the ability to generate Maxima code that can then be executed in the context of the ctensor package. The function that performs this task is ic_convert.

ic_convert (eqn)
Converts the itensor equation eqn to a ctensor assignment statement. Implied sums over dummy indices are made explicit while indexed objects are transformed into arrays (the array subscripts are in the order of covariant followed by contravariant indices of the indexed objects). The derivative of an indexed object will be replaced by the noun form of diff taken with respect to ct_coords subscripted by the derivative index. The Christoffel symbols ichr1 and ichr2 will be translated to lcs and mcs, respectively and if metricconvert is true then all occurrences of the metric with two covariant (contravariant) indices will be renamed to lg (ug). In addition, do loops will be introduced summing over all free indices so that the transformed assignment statement can be evaluated by just doing ev. The following examples demonstrate the features of this function.

(%i6) eqn:ishow(t([i,j],[k])=f([],[])*g([l,m],[])*a([],[m],j)*b([i],[l,k]))$
                             k        m   l k
(%t6)                       t    = f a   b    g
                             i j      ,j  i    l m
(%i7) ic_convert(eqn);
(%o7) for i thru dim do (for j thru dim do (
       for k thru dim do
        t        : f sum(sum(diff(a , ct_coords ) b
         i, j, k                   m           j   i, l, k
 g    , l, 1, dim), m, 1, dim)))
  l, m
(%i8) imetric(g);
(%o8)                                done
(%i9) metricconvert:true;
(%o9)                                true
(%i10) ic_convert(eqn);
(%o10) for i thru dim do (for j thru dim do (
        for k thru dim do
         t        : f sum(sum(diff(a , ct_coords ) b
          i, j, k                   m           j   i, l, k
 lg    , l, 1, dim), m, 1, dim)))
   l, m

Parole riservate

The following Maxima words are used by the itensor package internally and should not be redefined:

indices2() Internal version of indices()
conti Lists contravariant indices
covi Lists covariant indices of a indexed object
deri Lists derivative indices of an indexed object
name Returns the name of an indexed object
concan
irpmon
lc0
_lc2kdt0
_lcprod
_extlc

Posta un commento o usa questo indirizzo per il trackback.

Trackback

Rispondi

Inserisci i tuoi dati qui sotto o clicca su un'icona per effettuare l'accesso:

Logo di WordPress.com

Stai commentando usando il tuo account WordPress.com. Chiudi sessione /  Modifica )

Google photo

Stai commentando usando il tuo account Google. Chiudi sessione /  Modifica )

Foto Twitter

Stai commentando usando il tuo account Twitter. Chiudi sessione /  Modifica )

Foto di Facebook

Stai commentando usando il tuo account Facebook. Chiudi sessione /  Modifica )

Connessione a %s...

Questo sito utilizza Akismet per ridurre lo spam. Scopri come vengono elaborati i dati derivati dai commenti.

%d blogger hanno fatto clic su Mi Piace per questo: