Package cc.redberry.core.tensor

Examples of cc.redberry.core.tensor.Expression


        for (i = 0; i < matrixIndicesCount / 2; ++i) {
            upper[i] = IndicesUtils.createIndex(130 + i, IndexType.LatinLower, true);//30
            lower[i] = IndicesUtils.createIndex(130 + i + matrixIndicesCount / 2, IndexType.LatinLower, false);
        }

        Expression Flat, WR, SR, SSR, FF, FR, RR, DELTA_1, DELTA_2, DELTA_3, DELTA_4, ACTION;

        //preprocessor for Flat, WR, SR, SSR, FF, FR, RR, counterterms
        IndicesInsertion termIndicesInsertion = new IndicesInsertion(
                IndicesFactory.createSimple(null, upper),
                IndicesFactory.createSimple(null, IndicesUtils.getIndicesNames(upper)),
                matricesIndicator);

        Flat = (Expression) Tensors.parse(Flat_, termIndicesInsertion);
        WR = (Expression) Tensors.parse(WR_, termIndicesInsertion);
        SR = (Expression) Tensors.parse(SR_, termIndicesInsertion);
        SSR = (Expression) Tensors.parse(SSR_, termIndicesInsertion);
        FF = (Expression) Tensors.parse(FF_, termIndicesInsertion);
        FR = (Expression) Tensors.parse(FR_, termIndicesInsertion);
        RR = (Expression) Tensors.parse(RR_, termIndicesInsertion);
        ACTION = (Expression) Tensors.parse(ACTION_, termIndicesInsertion);
        Expression[] terms = new Expression[]{Flat, WR, SR, SSR, FF, FR, RR};

        //preprocessor for DELTA_1,2,3,4
        IndicesInsertion deltaIndicesInsertion = new IndicesInsertion(
                IndicesFactory.createSimple(null, upper),
                IndicesFactory.createSimple(null, lower),
                matricesIndicator);

        DELTA_1 = (Expression) Tensors.parse(DELTA_1_, deltaIndicesInsertion);
        DELTA_2 = (Expression) Tensors.parse(DELTA_2_, deltaIndicesInsertion);
        DELTA_3 = (Expression) Tensors.parse(DELTA_3_, deltaIndicesInsertion);
        DELTA_4 = (Expression) Tensors.parse(DELTA_4_, deltaIndicesInsertion);
        Expression[] deltaExpressions = new Expression[]{DELTA_1, DELTA_2, DELTA_3, DELTA_4};

        Expression FSubstitution = input.getF();
        for (Transformation background : input.getRiemannBackground())
            FSubstitution = (Expression) background.transform(FSubstitution);

        //Calculations       
        Expression[] riemansSubstitutions = new Expression[]{
                FSubstitution,
                Tensors.parseExpression("R_{l m}^{l}_{a} = R_{ma}"),
                Tensors.parseExpression("R_{lm}^{a}_{a}=0"),
                Tensors.parseExpression("F_{l}^{l}^{a}_{b}=0"),
                Tensors.parseExpression("R_{lmab}*R^{lamb}=(1/2)*R_{lmab}*R^{lmab}"),
                Tensors.parseExpression("R_{lmab}*R^{lmab}=4*R_{lm}*R^{lm}-R*R"),
                Tensors.parseExpression("R_{l}^{l}= R")
        };


        Expression kronecker = (Expression) Tensors.parse("d_{l}^{l}=4");
        Transformation n2 = new SqrSubs(Tensors.parseSimple("n_l")), n2Transformer = new Transformer(TraverseState.Leaving, new Transformation[]{n2});
        Transformation[] common = new Transformation[]{EliminateMetricsTransformation.ELIMINATE_METRICS, n2Transformer, kronecker};
        Transformation[] all = ArraysUtils.addAll(common, riemansSubstitutions);
        Tensor temp;

View Full Code Here


        //all symbols will have names scalar1,scalar2, etc.

        //processing equations
        int i;
        for (i = 0; i < equations.length; ++i) {
            Expression eq = equations[i];
            //iterating over the whole equation
            FromChildToParentIterator iterator = new FromChildToParentIterator(eq);
            Tensor t;
            while ((t = iterator.next()) != null) {
                if (!(t instanceof Product) || t.getIndices().size() == 0)
View Full Code Here

    }

    @Override
    public Tensor transform(Tensor tensor) {
        if (tensor instanceof Expression) {
            Expression e = (Expression) tensor;
            return new Expression(transform(e.left()), e.right());
        }
        return transform(tensor, createIndexGenerator(tensor), indices);
    }
View Full Code Here

        if (expression.indexOf('=') != expression.lastIndexOf('='))
            throw new ParserException("Several '=' symbols.");
        String[] parts = expression.split("=");
        Tensor t0 = parser.parse(parts[0]);
        Tensor t1 = parser.parse(parts[1]);
        return new Expression(t0, t1);
    }
View Full Code Here

        for (i = 0; i < matrixIndicesCount / 2; ++i) {
            upper[i] = IndicesUtils.createIndex(130 + i, IndexType.LatinLower, true);//30
            lower[i] = IndicesUtils.createIndex(130 + i + matrixIndicesCount / 2, IndexType.LatinLower, false);
        }

        Expression Flat, WR, SR, SSR, FF, FR, RR, DELTA_1, DELTA_2, DELTA_3, DELTA_4, ACTION;

        //preprocessor for Flat, WR, SR, SSR, FF, FR, RR, counterterms
        IndicesInsertion termIndicesInsertion = new IndicesInsertion(
                IndicesFactory.createSimple(null, upper),
                IndicesFactory.createSimple(null, IndicesUtils.getIndicesNames(upper)),
                matricesIndicator);

        Flat = (Expression) Tensors.parse(Flat_, termIndicesInsertion);
        WR = (Expression) Tensors.parse(WR_, termIndicesInsertion);
        SR = (Expression) Tensors.parse(SR_, termIndicesInsertion);
        SSR = (Expression) Tensors.parse(SSR_, termIndicesInsertion);
        FF = (Expression) Tensors.parse(FF_, termIndicesInsertion);
        FR = (Expression) Tensors.parse(FR_, termIndicesInsertion);
        RR = (Expression) Tensors.parse(RR_, termIndicesInsertion);
        ACTION = (Expression) Tensors.parse(ACTION_, termIndicesInsertion);
        Expression[] terms = new Expression[]{Flat, WR, SR, SSR, FF, FR, RR};

        //preprocessor for DELTA_1,2,3,4
        IndicesInsertion deltaIndicesInsertion = new IndicesInsertion(
                IndicesFactory.createSimple(null, upper),
                IndicesFactory.createSimple(null, lower),
                matricesIndicator);

        DELTA_1 = (Expression) Tensors.parse(DELTA_1_, deltaIndicesInsertion);
        DELTA_2 = (Expression) Tensors.parse(DELTA_2_, deltaIndicesInsertion);
        DELTA_3 = (Expression) Tensors.parse(DELTA_3_, deltaIndicesInsertion);
        DELTA_4 = (Expression) Tensors.parse(DELTA_4_, deltaIndicesInsertion);
        Expression[] deltaExpressions = new Expression[]{DELTA_1, DELTA_2, DELTA_3, DELTA_4};

        Expression FSubstitution = input.getF();
        for (Transformation background : input.getRiemannBackground())
            FSubstitution = (Expression) background.transform(FSubstitution);

        //Calculations       
        Expression[] riemansSubstitutions = new Expression[]{
                FSubstitution,
                Tensors.parseExpression("R_{l m}^{l}_{a} = R_{ma}"),
                Tensors.parseExpression("R_{lm}^{a}_{a}=0"),
                Tensors.parseExpression("F_{l}^{l}^{a}_{b}=0"),
                Tensors.parseExpression("R_{lmab}*R^{lamb}=(1/2)*R_{lmab}*R^{lmab}"),
                Tensors.parseExpression("R_{lmab}*R^{lmab}=4*R_{lm}*R^{lm}-R*R"),
                Tensors.parseExpression("R_{l}^{l}= R")
        };


        Expression kronecker = (Expression) Tensors.parse("d_{l}^{l}=4");
        Transformation n2 = new SqrSubs(Tensors.parseSimple("n_l")), n2Transformer = new Transformer(TraverseState.Leaving, new Transformation[]{n2});
        Transformation[] common = new Transformation[]{EliminateMetricsTransformation.ELIMINATE_METRICS, n2Transformer, kronecker};
        Transformation[] all = ArraysUtils.addAll(common, riemansSubstitutions);
        Tensor temp;

View Full Code Here

     * This method calculates one-loop counterterms of the vector field in the
     * non-minimal gauge.
     */
    public static void testVectorField() {

        Expression iK = Tensors.parseExpression("iK_a^b=d_a^b+c*n_a*n^b");
        Expression K = Tensors.parseExpression("K^{lm}_a^{b}=g^{lm}*d_{a}^{b}-k/2*(g^{lb}*d_a^m+g^{mb}*d_a^l)");
        Expression S = Tensors.parseExpression("S^p^l_m=0");
        Expression W = Tensors.parseExpression("W^{a}_{b}=P^{a}_{b}+(k/2)*R^a_b");
        Expression F = Tensors.parseExpression("F_lmab=R_lmab");


        Expression lambda = Tensors.parseExpression("k=gamma/(1+gamma)");
        Expression gamma = Tensors.parseExpression("c=gamma");
        iK = (Expression) gamma.transform(lambda.transform(iK));
        K = (Expression) gamma.transform(lambda.transform(K));
        S = (Expression) gamma.transform(lambda.transform(S));
        W = (Expression) gamma.transform(lambda.transform(W));

        OneLoopInput input = new OneLoopInput(2, iK, K, S, W, null, null, F);

        OneLoopCounterterms action = OneLoopCounterterms.calculateOneLoopCounterterms(input);
    }
View Full Code Here

     * This method calculates one-loop counterterms of the squared vector field
     * in the non-minimal gauge.
     */
    public static void testSquaredVectorField() {

        Expression iK = Tensors.parseExpression("iK_a^b=d_a^b+(2*c+Power[c,2])*n_a*n^b");
        Expression K = Tensors.parseExpression("K^{lmcd}_a^{b}="
                + "d_a^b*1/3*(g^{lm}*g^{cd}+ g^{lc}*g^{md}+ g^{ld}*g^{mc})"
                + "+1/12*(-2*k+Power[k,2])*("
                + "g^{lm}*d_a^c*g^{bd}"
                + "+g^{lm}*d_a^d*g^{bc}"
                + "+g^{lc}*d_a^m*g^{bd}"
                + "+g^{lc}*d_a^d*g^{bm}"
                + "+g^{ld}*d_a^m*g^{bc}"
                + "+g^{ld}*d_a^c*g^{bm}"
                + "+g^{mc}*d_a^l*g^{bd}"
                + "+g^{mc}*d_a^d*g^{bl}"
                + "+g^{md}*d_a^l*g^{bc}"
                + "+g^{md}*d_a^c*g^{bl}"
                + "+g^{cd}*d_a^l*g^{bm}"
                + "+g^{cd}*d_a^m*g^{bl})");
        Expression S = Tensors.parseExpression("S^lmpab=0");
        //W^{l m }_{a }^{b } = d^{m }_{a }*R^{b l }+d^{l }_{a }*R^{b m }+g^{l b }*R_{a }^{m }+2*P_{a }^{b }*g^{l m }+-2/3*d_{a }^{b }*R^{l m }
        Expression W = Tensors.parseExpression("W^{lm}_a^b="
                + "2*P_{a}^{b}*g^{lm}-2/3*R^lm*d_a^b"
                + "-k/2*P_a^l*g^mb"
                + "-k/2*P_a^m*g^lb"
                + "-k/2*P^bl*d^m_a"
                + "-k/2*P^bm*d^l_a"
                + "+1/6*(k-2*Power[k,2])*("
                + "R_a^l*g^mb"
                + "+R_a^m*g^lb"
                + "+R^bl*d^m_a"
                + "+R^bm*d^l_a)"
                + "+1/6*(2*k-Power[k,2])*"
                + "(R_a^lbm+R_a^mbl)"
                + "+1/2*(2*k-Power[k,2])*g^lm*R_a^b");
        Expression N = Tensors.parseExpression("N^pab=0");
        Expression M = Tensors.parseExpression("M_a^b = "
                + "P_al*P^lb-1/2*R_lmca*R^lmcb"
                + "+k/2*P_al*R^lb"
                + "+k/2*P_lm*R^l_a^mb"
                + "+1/6*(k-2*Power[k,2])*R_al*R^lb"
                + "+1/12*(4*k+7*Power[k,2])*R_lam^b*R^lm"
                + "+1/4*(2*k-Power[k,2])*R_almc*R^clmb");
        Expression F = Tensors.parseExpression("F_lmab=R_lmab");


        Expression lambda = Tensors.parseExpression("k=gamma/(1+gamma)");
        Expression gamma = Tensors.parseExpression("c=gamma");
        iK = (Expression) gamma.transform(lambda.transform(iK));
        K = (Expression) gamma.transform(lambda.transform(K));
        S = (Expression) gamma.transform(lambda.transform(S));
        W = (Expression) gamma.transform(lambda.transform(W));
        M = (Expression) gamma.transform(lambda.transform(M));

        OneLoopInput input = new OneLoopInput(4, iK, K, S, W, N, M, F);
        OneLoopCounterterms action = OneLoopCounterterms.calculateOneLoopCounterterms(input);
    }
View Full Code Here

     *  &nbsp;&nbsp;&nbsp;&nbsp; \chi^\mu = 1/\sqrt{1+\lambda} (g^{\mu\alpha} \nabla^\beta h_{\alpha\beta}-1/2 g^{\alpha\beta} \nabla^\mu h_{\alpha\beta})
     * </pre>
     */
    public static void testGravityGhosts() {

        Expression iK = Tensors.parseExpression("iK_a^b=d_a^b+gamma*n_a*n^b");
        Expression K = Tensors.parseExpression("K^{lm}_a^{b}=d_a^b*g^lm-1/2*beta*(d_a^l*g^mb+d_a^m*g^lb)");
        Expression S = Tensors.parseExpression("S^p^l_m=0");
        Expression W = Tensors.parseExpression("W^{a}_{b}=(1+beta/2)*R^a_b");
        Expression F = Tensors.parseExpression("F_lmab=R_lmab");


        Expression beta = Tensors.parseExpression("beta=gamma/(1+gamma)");
        iK = (Expression) beta.transform(iK);
        K = (Expression) beta.transform(K);
        S = (Expression) beta.transform(S);
        W = (Expression) beta.transform(W);

        OneLoopInput input = new OneLoopInput(2, iK, K, S, W, null, null, F);

        OneLoopCounterterms action = OneLoopCounterterms.calculateOneLoopCounterterms(input);
    }
View Full Code Here

     *  &nbsp;&nbsp;&nbsp;&nbsp; \chi^\mu = 1/\sqrt{1+\lambda} (g^{\mu\alpha} \nabla^\beta h_{\alpha\beta}-1/2 g^{\alpha\beta} \nabla^\mu h_{\alpha\beta})
     * </pre>
     */
    public static void testLambdaGaugeGravity() {

        Expression iK = Tensors.parseExpression("iK_ab^cd = "
                + "(d_a^c*d_b^d+d_b^c*d_a^d)/2+"
                + "la/2*("
                + "d_a^c*n_b*n^d"
                + "+d_a^d*n_b*n^c"
                + "+d_b^c*n_a*n^d"
                + "+d_b^d*n_a*n^c)"
                + "-la*g^cd*n_a*n_b");
        Expression K = Tensors.parseExpression("K^lm_ab^cd = "
                + "g^lm*(d_a^c*d_b^d+d_b^c*d_a^d)/2"
                + "-la/(4*(1+la))*("
                + "d_a^c*d_b^l*g^dm"
                + "+d_a^c*d_b^m*g^dl"
                + "+d_a^d*d_b^l*g^cm"
                + "+d_a^d*d_b^m*g^cl"
                + "+d_b^c*d_a^l*g^dm"
                + "+d_b^c*d_a^m*g^dl"
                + "+d_b^d*d_a^l*g^cm"
                + "+d_b^d*d_a^m*g^cl)"
                + "+la/(2*(1+la))*g^cd*(d_a^l*d_b^m+d_a^m*d_b^l)");
        Expression S = Tensors.parseExpression("S^p_{ab}^{cd}=0");
        Expression W = Tensors.parseExpression("W_{ab}^{cd}=P_ab^cd"
                + "-la/(2*(1+la))*(R_a^c_b^d+R_a^d_b^c)"
                + "+la/(4*(1+la))*("
                + "d_a^c*R_b^d"
                + "+d_a^d*R_b^c"
                + "+d_b^c*R_a^d"
                + "+d_b^d*R_a^c)");
        Expression P = Tensors.parseExpression("P_cd^lm = "
                + "R_c^l_d^m+R_c^m_d^l"
                + "+1/2*("
                + "d_c^l*R_d^m"
                + "+d_c^m*R_d^l"
                + "+d_d^l*R_c^m"
                + "+d_d^m*R_c^l)"
                + "-g^lm*R_cd"
                + "-R^lm*g_cd"
                + "+(-d_c^l*d_d^m-d_c^m*d_d^l+g^lm*g_cd)*R/2");
        W = (Expression) P.transform(W);
        Expression F = Tensors.parseExpression("F_lm^kd_pr = "
                + "R^k_plm*d^d_r+R^d_rlm*d^k_p");

        OneLoopInput input = new OneLoopInput(2, iK, K, S, W, null, null, F);

        OneLoopCounterterms action = OneLoopCounterterms.calculateOneLoopCounterterms(input);
View Full Code Here

     * operator.
     */
    public static void testMinimalSecondOrderOperator() {
        //TIME = 6.1 s

        Expression iK = Tensors.parseExpression("iK_a^b=d_a^b");
        Expression K = Tensors.parseExpression("K^lm_a^b=d_a^b*g^{lm}");
        Expression S = Tensors.parseExpression("S^lab=0");
        Expression W = Tensors.parseExpression("W_a^b=W_a^b");
        Expression F = Tensors.parseExpression("F_lmab=F_lmab");

        OneLoopInput input = new OneLoopInput(2, iK, K, S, W, null, null, F);

        OneLoopCounterterms action = OneLoopCounterterms.calculateOneLoopCounterterms(input);
    }
View Full Code Here

TOP

Related Classes of cc.redberry.core.tensor.Expression

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.