Table of Contents

Reduce


Description

Examples

Reduce a system of tensorial equations:

def eq1 = 'F_mn + F_nm + A_mn + A_nm = 0'.t
def eq2 = 'F_mn/2 + A_nm/2 = F_nm + A_mn '.t
def reduced = Reduce([eq1, eq2], ['F_mn'])
println reduced
   > [F_{mn} = C[0]*g_{mn}+C[1]*A_{mn}+C[2]*A_{nm}, 1+C[1]+C[2] = 0,
       1+C[1]+C[2] = 0, 2*C[0] = 0, -1-C[2]+(1/2)*C[1] = 0,
       1/2-C[1]+(1/2)*C[2] = 0, -(1/2)*C[0] = 0]

Solve it using Wolfram Mathematica:

def options = [ExternalSolver: [Solver: 'Mathematica', Path: '/usr/local/bin']]
println Reduce([eq1, eq2], ['F_mn'], options)
   > [[F_{mn} = -A_{nm}]]


Solve a system of equations with special symmetries of unknown tensor: \[ \left\{ \begin{array}{l} T^{abe}{}_{rba}-x\,T^{bea}{}_{rba} = 8\,d_{r}^{e}\\ T^{pqr}{}_{klm} T^{abc}{}_{pqr} = d^{a}_{m}\,g^{bc}\,g_{lk} \end{array} \right. \] where \(x\) and \(T^{abe}{}_{rba}\) are unknown variables and the last one has symmetry [1, 5, 0, 4, 3, 2] (in one-line notation).

Redberry code:

//setting up symmetries
addSymmetry 'T^abc_pqr', [1, 5, 0, 4, 3, 2].p

def eq1 = 'T^{abe}_{rba}-x*T^{bea}_{rba} = 8*d_{r}^{e}'.t
def eq2 = 'T^{pqr}_{klm}*T^{abc}_{pqr} = d^{a}_{m}*g^{bc}*g_{lk}'

def options = [Transformations: 'd_n^n = 4'.t, ExternalSolver:
                  [Solver: 'Mathematica',
                   Path: '/usr/local/bin']]

def s = Reduce([eq1, eq2], ['T^abc_pqr', 'x'], options)
println s
   > [[T^{abc}_{pqr} = -d^{a}_{r}*g^{cb}*g_{qp}, x = 12],
      [T^{abc}_{pqr} = d^{a}_{r}*g^{cb}*g_{qp}, x = -4]]


Generate and find projection operator: \[ \left\{ \begin{array}{l} J_{ab cd}\,J^{ab pq} = J_{ab}{}^{pq}\\ J_{abcd}\,J^{acbd} = \frac{1}{2}\,J^a{}_{ba}{}^b\\ J_a{}^{abc} = 0 \end{array} \right. \] with symmetries \[J_{abcd} = J_{cd ab} \quad \mbox{and} \quad J_{ab cd} = J_{ba cd}\]

Redberry code:

//setting up symmetries of tensors
addSymmetry 'J_abcd', 1, 0, 2, 3
addSymmetry 'J_abcd', 2, 3, 0, 1

//generate solution of the most general tensorial form
// and store the coefficients
def coefs = []
def genTensor =
    GenerateTensor('_{ab cd}'.si, ['g_mn', 'k_m'],
     [GeneratedParameters: { i -> coefs << "C$i".t; "C$i".t }])

def equations = [
   'J_{ab cd}*J^{ab pq} = J_{cd}^{pq}',
   'J_abcd*J^acbd = J^a_ba^b/2',
   'J_a^acd = 0',  
   'J_abcd'.eq(genTensor)] 

def options = [
    Transformations: 'd_m^m = 4'.t & 'k_m*k^m = M**2'.t, //additional simplifications
    ExternalSolver: [
        Solver: 'Maple',
        Path: '/home/stas/maple13/bin']]

def s = Reduce(equations, ['J_abcd'.t, * coefs], options)
def result = s.collect { it[0] }
println result
   > [J_{abcd} = 0, 
          J_{abcd} = -2*M**(-4)*k_{a}*k_{b}*k_{c}*k_{d} 
           +(1/2)*M**(-2)*g_{bc}*k_{a}*k_{d}
           +(1/2)*M**(-2)*g_{ac}*k_{b}*k_{d}
           +(1/2)*M**(-2)*g_{ad}*k_{b}*k_{c}
           +(1/2)*M**(-2)*g_{bd}*k_{a}*k_{c}]

Options

   > [[dim = 9, J_{ab} = -g_{ab}],
           [dim = 3, J_{ab} = -2*g_{ab}+(k^{c}*k_{c})**(-1)*k_{a}*k_{b}]]

   > [[J_{abcd} = 
            (3/8)*(g_{ad}*g_{bc}+g_{ab}*g_{cd}+g_{ac}*g_{bd})]]

println Reduce(['F_mn + F_nm + A_mn + A_nm= 0'],
            ['F_mn'], [GeneratedParameters: { i -> "X$i" }])
   > [F_{mn} = X0*g_{mn}+X1*A_{mn}+X2*A_{nm},
            2*X0 = 0, X2+X1+1 = 0, X2+X1+1 = 0]

See also