Related

diag_matrix-matrix

diag([diag_matrix(1,2...

diag_matrix(p,q);

Calculate

diag_matrix-genmatrix-invert-lambda-transpose

A: genmatrix(lambda([...

B: matrix([1,0], [2,7...

P: diag_matrix(1/2,1/2);

Calculate

diag_matrix-invert-matrix

A: diag_matrix(1,1,1,1);

invert(A);

Calculate

diag_matrix-exp-matrix-sin

diag_matrix(-exp(2*n)...

Calculate

diag_matrix-eigenvectors-matrix-transpose

A:matrix([3,2,3,0],[-...

eigenvectors(A);

diag_matrix(A);

Calculate

diag_matrix-genmatrix-invert-lambda-transpose

A: genmatrix(lambda([...

B: matrix([1,0], [2,7...

P: diag_matrix(1/2,1/2);

Calculate

diag_matrix-eigenvectors-matrix-transpose

A:matrix([6,-2,2],[-2...

eigenvectors(A);

diag_matrix(A);

Calculate

m:matrix([1,0,0,0],[0...

simtran(m);

Calculate

diag_matrix-matrix-transpose

a:matrix([-1,2,0,-1],...

a.transpose(a);

a.diag_matrix(2,4,2,1...

Calculate

diag_matrix-eigenvectors-matrix-transpose

A:matrix([-1,4,-2],[-...

eigenvectors(A);

diag_matrix(A);

Calculate

diag_matrix

Run Example
```(%i1)load(ctensor);
(%o1)          /usr/share/maxima/5.21.1/share/tensor/ctensor.mac
(%i2) (cframe_flag:false,gcd:spmod,ctrgsimp:true,ratfac:true);
(%o2)                                true
(%i3) lg:diag_matrix(1,-r^2,-r^2,-r^2);
[ 1   0     0     0   ]
[                     ]
[       2             ]
[ 0  - r    0     0   ]
(%o3)                       [                     ]
[             2       ]
[ 0   0    - r    0   ]
[                     ]
[                   2 ]
[ 0   0     0    - r  ]
(%i4) ct_coords:[t,r,th,ph];
(%o4)                           [t, r, th, ph]
(%i5) cmetric(false);
(%o5)                                done
(%i6) christof(mcs);
1
(%t6)                           mcs        = -
2, 2, 2   r

1
(%t7)                           mcs        = -
2, 3, 3   r

1
(%t8)                           mcs        = -
2, 4, 4   r

1
(%t9)                          mcs        = - -
3, 3, 2     r

1
(%t10)                         mcs        = - -
4, 4, 2     r

(%o10)                               done
(%i11)  riemann(true);
1
(%t11)                       riem           = - --
2, 3, 2, 3      2
r

1
(%t12)                       riem           = - --
2, 4, 2, 4      2
r

1
(%t13)                        riem           = --
3, 3, 2, 2    2
r

1
(%t14)                        riem           = --
3, 4, 3, 4    2
r

1
(%t15)                        riem           = --
4, 4, 2, 2    2
r

1
(%t16)                       riem           = - --
4, 4, 3, 3      2
r

(%o16)                               done
(%i17) ricci(true);
2
(%t17)                           ric     = --
2, 2    2
r

(%o17)                               done
(%i18) ```
Run Example
```load(ctensor);
(%o1)          /usr/share/maxima/5.21.1/share/tensor/ctensor.mac
(%i2) (cframe_flag:false,gcd:spmod,ctrgsimp:true,ratfac:true);
(%o2)                                true
(%i3) lg:diag_matrix(1,-r^2,-r^2,-(r^2));
[ 1   0     0     0   ]
[                     ]
[       2             ]
[ 0  - r    0     0   ]
(%o3)                       [                     ]
[             2       ]
[ 0   0    - r    0   ]
[                     ]
[                   2 ]
[ 0   0     0    - r  ]
(%i4) ct_coords:[t,r,th,ph];
(%o4)                           [t, r, th, ph]
(%i5) cmetric(false);
(%o5)                                done
(%i6) christof(mcs);
1
(%t6)                           mcs        = -
2, 2, 2   r

1
(%t7)                           mcs        = -
2, 3, 3   r

1
(%t8)                           mcs        = -
2, 4, 4   r

1
(%t9)                          mcs        = - -
3, 3, 2     r

1
(%t10)                         mcs        = - -
4, 4, 2     r

(%o10)                               done
(%i11)  riemann(true);
1
(%t11)                       riem           = - --
2, 3, 2, 3      2
r

1
(%t12)                       riem           = - --
2, 4, 2, 4      2
r

1
(%t13)                        riem           = --
3, 3, 2, 2    2
r

1
(%t14)                        riem           = --
3, 4, 3, 4    2
r

1
(%t15)                        riem           = --
4, 4, 2, 2    2
r

1
(%t16)                       riem           = - --
4, 4, 3, 3      2
r

(%o16)                               done
(%i17) ricci(true);
2
(%t17)                           ric     = --
2, 2    2
r

(%o17)                               done
(%i18) ```
Run Example
```load(ctensor);
(%o1)          /usr/share/maxima/5.21.1/share/tensor/ctensor.mac
(%i2) (cframe_flag:false,gcd:spmod,ctrgsimp:true,ratfac:true);
(%o2)                                true
(%i3) lg:diag_matrix(-1,2,r^2,(sin(%theta)*r)^2);
[ - 1  0  0          0        ]
[                             ]
[  0   2  0          0        ]
[                             ]
(%o3)                   [          2                  ]
[  0   0  r          0        ]
[                             ]
[                2          2 ]
[  0   0  0   sin (%theta) r  ]
(%i4) ct_coords:[t,r,%theta,%phi];
(%o4)                        [t, r, %theta, %phi]
(%i5) depends(%nu,[r,t],%lambda,[r,t]);
(%o5)                     [%nu(r, t), %lambda(r, t)]
(%i6) cmetric(false);
(%o6)                                done
(%i7) christof(mcs);
1
(%t7)                           mcs        = -
2, 3, 3   r

1
(%t8)                           mcs        = -
2, 4, 4   r

r
(%t9)                          mcs        = - -
3, 3, 2     2

cos(%theta)
(%t10)                     mcs        = -----------
3, 4, 4   sin(%theta)

2
sin (%theta) r
(%t11)                   mcs        = - --------------
4, 4, 2           2

(%t12)              mcs        = - cos(%theta) sin(%theta)
4, 4, 3

(%o12)                               done
(%i13)  riemann(true);
1
(%t13)                       riem           = - -
3, 4, 3, 4     2

2
sin (%theta)
(%t14)                   riem           = ------------
4, 4, 3, 3        2

(%o14)                               done
(%i15) ricci(true);
1
(%t15)                            ric     = -
3, 3   2

2
sin (%theta)
(%t16)                      ric     = ------------
4, 4        2

(%o16)                               done
(%i17) R:scurvature();
1
(%o17)                                --
2
r
(%i18) ```

Related Help

Help for Diag_matrix