Documentation of 'cc.redberry.core.solver.InverseTensor' Java class
InverseTensor
cc.redberry.core.solver

Class InverseTensor



  • public final class InverseTensor
    extends java.lang.Object
    This class provides opportunities to find inverse of tensor. In other words it can be used to solve the the equation of the form
         T^{ij..}_{kp..}*Tinv^{kp..}_{mn..} = d^{i}_{m}*d^{j}_{m}*.. + ... (combinations of kroneckers),
     
    where T is specified tensor, Tinv is unknown tensor and d - kronecker delta.

    The main goal of this class is to create the tensor Tinv of the most general form with unknown coefficients, and produce a system of linear equations on these coefficients. The resulting equations can then be solved and coefficients values substituted in generated Tinv tensor.


    The following example demonstrates the usage of the InverseTensor to find out the photon propagator in Lorentz gauge:

          ...
          //expression specifies tensor, which need to inverse
          Expression toInverse = Tensors.parseExpression("D_mn = k_m*k_n-(1/a)*k_i*k^i*g_mn");
          //linear equation on the unknown tensor K
          Expression equation = Tensors.parseExpression("D_ab*K^ac=d_b^c");
          //samples from which inverse should be formed
          Tensor[] samples = {Tensors.parse("g_mn"), Tensors.parse("g^mn"), Tensors.parse("d_m^n"), Tensors.parse("k_m"), Tensors.parse("k^b")};
    
          InverseTensor inverseTensor = new InverseTensor(toInverse,equation,samples);
          System.out.println(inverseTensor.getGeneralInverseForm());
          System.out.println(Arrays.toString(inverseTensor.getEquations()));
     

    The above code displays the inverse of specified tensor
         K^{ac} = a1*g^{ac}+a0*k^{a}*k^{c}
     
    and a system of equations on its coefficients
         [(-a**(-1)*a0+a0)*k^{i}*k_{i}+a1 = 0, -a**(-1)*a1*k_{i}*k^{i} = 1]
     

    Since:
    1.0
    See Also:
    findInverseWithMaple(cc.redberry.core.tensor.Expression, cc.redberry.core.tensor.Expression, cc.redberry.core.tensor.Tensor[], boolean, boolean, cc.redberry.core.transformations.Transformation[], String, String)
    • Constructor Detail

      • InverseTensor

        public InverseTensor(Expression toInverse,
                             Expression equation,
                             Tensor[] samples)
        Creates the InverseTensor instance from the equation.
        Parameters:
        toInverse - expression specifies tensor, which need to inverse
        equation - linear equation on the unknown tensor in the form T^{..}_{...}*Tinv^{...}_{...} = ...
        samples - samples from which inverse should be formed into account when forming a system of linear equations
      • InverseTensor

        public InverseTensor(Expression toInverse,
                             Expression equation,
                             Tensor[] samples,
                             boolean symmetricForm,
                             Transformation[] transformations)
        Creates the InverseTensor instance from the equation.
        Parameters:
        toInverse - expression specifies tensor, which need to inverse
        equation - linear equation on the unknown tensor in the form T^{..}_{...}*Tinv^{...}_{...} = ...
        samples - samples from which inverse should be formed
        symmetricForm - specifies whether inverse tensor should be symmetric
        transformations - additional simplification rules, which can be taken into account when forming a system of linear equations
    • Method Detail

      • getEquations

        public Expression[] getEquations()
        Return the resulting equations on the unknown coefficients.
        Returns:
        the resulting equations on the unknown coefficients
      • getGeneralInverseForm

        public Expression getGeneralInverseForm()
        Returns the inverse of the tensor with unknown coefficients.
        Returns:
        the inverse of the tensor with unknown coefficients
      • getUnknownCoefficients

        public SimpleTensor[] getUnknownCoefficients()
        Returns the array of the unknown coefficients.
        Returns:
        the array of the unknown coefficients
      • findInverseWithMaple

        public static Expression findInverseWithMaple(Expression toInverse,
                                                      Expression equation,
                                                      Tensor[] samples,
                                                      boolean symmetricForm,
                                                      Transformation[] transformations,
                                                      java.lang.String mapleBinDir,
                                                      java.lang.String path)
                                               throws java.io.IOException,
                                                      java.lang.InterruptedException
        This method calculates the tensor inverse to the specified tensor according to the specified equation using the Maple facilities to solve the system of linear equations. The Maple code will be placed in the specified temporary directory in equations.maple file. The solution of the linear system, produced by Maple, will be placed in the specified temporary directory in equations.mapleOut file.


        The following example demonstrates the usage of this method to find out the photon propagator in Lorentz gauge:

              ...
              //expression specifies tensor, which need to inverse
              Expression toInverse = Tensors.parseExpression("D_mn = k_m*k_n-(1/a)*k_i*k^i*g_mn");
              //linear equation on the unknown tensor K
              Expression equation = Tensors.parseExpression("D_ab*K^ac=d_b^c");
              //samples from which inverse should be formed
              Tensor[] samples = {Tensors.parse("g_mn"), Tensors.parse("g^mn"), Tensors.parse("d_m^n"), Tensors.parse("k_m"), Tensors.parse("k^b")};
        
              Tensor inverse = InverseTensor.findInverseWithMaple(toInverse, equation, samples, false, new Transformation[0], mapleBinDir, temporaryDir);
              System.out.println(inverse);
         

        The above code displays the inverse of specified tensor
             K^ac=-a*g^ac*(k_i*k^i)**(-1)+a**2/(a-1)*k^a*k^c*(k_i*k^i)**(-2)
         

        Parameters:
        toInverse - expression specifies tensor, which need to inverse
        equation - linear equation on the unknown tensor in the form T^{..}_{...}*Tinv^{...}_{...} = ...
        samples - samples from which inverse should be formed
        symmetricForm - specifies whether inverse tensor should be symmetric
        transformations - additional simplification rules, which can be taken into account when forming a system of linear equations
        mapleBinDir - path to Maple bin directory (e.g. "/home/user/maple14/bin")
        path - path to your temporary folder
        Returns:
        tensor inverse to the specified tensor according to the specified equation and null if inverse does not exist
        Throws:
        java.io.IOException
        java.lang.InterruptedException - when Maple fails to run
      • findInverseWithMaple

        public static Expression findInverseWithMaple(Expression toInverse,
                                                      Expression equation,
                                                      Tensor[] samples,
                                                      boolean symmetricForm,
                                                      boolean keepFreeParameters,
                                                      Transformation[] transformations,
                                                      java.lang.String mapleBinDir,
                                                      java.lang.String path)
                                               throws java.io.IOException,
                                                      java.lang.InterruptedException
        This method calculates the tensor inverse to the specified tensor according to the specified equation using the Maple facilities to solve the system of linear equations. The Maple code will be placed in the specified temporary directory in equations.maple file. The solution of the linear system, produced by Maple, will be placed in the specified temporary directory in equations.mapleOut file.


        The following example demonstrates the usage of this method to find out the photon propagator in Lorentz gauge:

              ...
              //expression specifies tensor, which need to inverse
              Expression toInverse = Tensors.parseExpression("D_mn = k_m*k_n-(1/a)*k_i*k^i*g_mn");
              //linear equation on the unknown tensor K
              Expression equation = Tensors.parseExpression("D_ab*K^ac=d_b^c");
              //samples from which inverse should be formed
              Tensor[] samples = {Tensors.parse("g_mn"), Tensors.parse("g^mn"), Tensors.parse("d_m^n"), Tensors.parse("k_m"), Tensors.parse("k^b")};
        
              Tensor inverse = InverseTensor.findInverseWithMaple(toInverse, equation, samples, false, new Transformation[0], false, mapleBinDir, temporaryDir);
              System.out.println(inverse);
         

        The above code displays the inverse of specified tensor
             K^ac=-a*g^ac*(k_i*k^i)**(-1)+a**2/(a-1)*k^a*k^c*(k_i*k^i)**(-2)
         

        If the produced system of linear equations have infinitely many solutions, some of the coefficient cannot be determined exactly and remain as free parameters. The flag keepFreeParameters specifies whether this free parameters should be zeroed.

        Parameters:
        toInverse - expression specifies tensor, which need to inverse
        equation - linear equation on the unknown tensor in the form T^{..}_{...}*Tinv^{...}_{...} = ...
        samples - samples from which inverse should be formed
        symmetricForm - specifies whether inverse tensor should be symmetric
        transformations - additional simplification rules, which can be taken into account when forming a system of linear equations
        keepFreeParameters - specifies whether the free parameters remaining from solution of linear system should be zeroed
        mapleBinDir - path to Maple bin directory (e.g. "/home/user/maple14/bin")
        path - path to your temporary folder
        Returns:
        tensor inverse to the specified tensor according to the specified equation and null if inverse does not exist
        Throws:
        java.io.IOException
        java.lang.InterruptedException - when Maple fails to run
      • findInverseWithMathematica

        public static Expression findInverseWithMathematica(Expression toInverse,
                                                            Expression equation,
                                                            Tensor[] samples,
                                                            boolean symmetricForm,
                                                            Transformation[] transformations,
                                                            java.lang.String mathematicaBinDir,
                                                            java.lang.String path)
                                                     throws java.io.IOException,
                                                            java.lang.InterruptedException
        This method calculates the tensor inverse to the specified tensor according to the specified equation using the Wolfram Mathematica facilities to solve the system of linear equations. The Wolfram Mathematica code will be placed in the specified temporary directory in equations.mathematica file. The solution of the linear system, produced by Wolfram Mathematica, will be placed in the specified temporary directory in equations.mathematicaOut file.


        The following example demonstrates the usage of this method to find out the photon propagator in Lorentz gauge:

              ...
              //expression specifies tensor, which need to inverse
              Expression toInverse = Tensors.parseExpression("D_mn = k_m*k_n-(1/a)*k_i*k^i*g_mn");
              //linear equation on the unknown tensor K
              Expression equation = Tensors.parseExpression("D_ab*K^ac=d_b^c");
              //samples from which inverse should be formed
              Tensor[] samples = {Tensors.parse("g_mn"), Tensors.parse("g^mn"), Tensors.parse("d_m^n"), Tensors.parse("k_m"), Tensors.parse("k^b")};
        
              Tensor inverse = InverseTensor.findInverseWithmathematica(toInverse, equation, samples, false, new Transformation[0], mapleBinDir, temporaryDir);
              System.out.println(inverse);
         

        The above code displays the inverse of specified tensor
             K^ac=-a*g^ac*(k_i*k^i)**(-1)+a**2/(a-1)*k^a*k^c*(k_i*k^i)**(-2)
         

        Parameters:
        toInverse - expression specifies tensor, which need to inverse
        equation - linear equation on the unknown tensor in the form T^{..}_{...}*Tinv^{...}_{...} = ...
        samples - samples from which inverse should be formed
        symmetricForm - specifies whether inverse tensor should be symmetric
        transformations - additional simplification rules, which can be taken into account when forming a system of linear equations
        mathematicaBinDir - path to Mathematica bin directory (e.g. "/home/user/maple14/bin")
        path - path to your temporary folder
        Returns:
        tensor inverse to the specified tensor according to the specified equation and null if inverse does not exist
        Throws:
        java.io.IOException
        java.lang.InterruptedException - when Mathematica fails to run
      • findInverseWithMathematica

        public static Expression findInverseWithMathematica(Expression toInverse,
                                                            Expression equation,
                                                            Tensor[] samples,
                                                            boolean symmetricForm,
                                                            boolean keepFreeParameters,
                                                            Transformation[] transformations,
                                                            java.lang.String mathematicaBinDir,
                                                            java.lang.String path)
                                                     throws java.io.IOException,
                                                            java.lang.InterruptedException
        This method calculates the tensor inverse to the specified tensor according to the specified equation using the Wolfram Mathematica facilities to solve the system of linear equations. The Wolfram Mathematica code will be placed in the specified temporary directory in equations.mathematica file. The solution of the linear system, produced by Wolfram Mathematica, will be placed in the specified temporary directory in equations.mathematicaOut file.


        The following example demonstrates the usage of this method to find out the photon propagator in Lorentz gauge:

              ...
              //expression specifies tensor, which need to inverse
              Expression toInverse = Tensors.parseExpression("D_mn = k_m*k_n-(1/a)*k_i*k^i*g_mn");
              //linear equation on the unknown tensor K
              Expression equation = Tensors.parseExpression("D_ab*K^ac=d_b^c");
              //samples from which inverse should be formed
              Tensor[] samples = {Tensors.parse("g_mn"), Tensors.parse("g^mn"), Tensors.parse("d_m^n"), Tensors.parse("k_m"), Tensors.parse("k^b")};
        
              Tensor inverse = InverseTensor.findInverseWithmathematica(toInverse, equation, samples, false, new Transformation[0], mapleBinDir, temporaryDir);
              System.out.println(inverse);
         

        The above code displays the inverse of specified tensor
             K^ac=-a*g^ac*(k_i*k^i)**(-1)+a**2/(a-1)*k^a*k^c*(k_i*k^i)**(-2)
         

        Parameters:
        toInverse - expression specifies tensor, which need to inverse
        equation - linear equation on the unknown tensor in the form T^{..}_{...}*Tinv^{...}_{...} = ...
        samples - samples from which inverse should be formed
        symmetricForm - specifies whether inverse tensor should be symmetric
        keepFreeParameters - specifies whether the free parameters remaining from solution of linear system should be zeroed
        transformations - additional simplification rules, which can be taken into account when forming a system of linear equations
        mathematicaBinDir - path to Mathematica bin directory (e.g. "/home/user/maple14/bin")
        path - path to your temporary folder
        Returns:
        tensor inverse to the specified tensor according to the specified equation and null if inverse does not exist
        Throws:
        java.io.IOException
        java.lang.InterruptedException - when Mathematica fails to run

DataMelt 3.0 © DataMelt by jWork.ORG

Ads help maintain this website.