This shows you the differences between two versions of the page.
documentation:guide:list_of_transformations [2015/11/21 10:57] poslavskysv [DiracTrace] |
documentation:guide:list_of_transformations [2015/11/21 12:33] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== List of transformations ====== | ||
- | <html> | ||
- | <div class="text-right" style="font-size: 15px; "> | ||
- | </html> | ||
- | Next topic: [[documentation:guide:overview_of_hep_features]] | ||
- | <html> | ||
- | <span class="glyphicon glyphicon-arrow-right"></span> | ||
- | </div> | ||
- | </html> | ||
- | ---- | ||
- | Here is a list of basic transformations available in Redberry: | ||
- | |||
- | |||
- | |||
- | <html><hr style="border:dashed #555555; border-width:1px 0 0; height:0;"></html> | ||
- | ====Apply index mapping==== | ||
- | applies mapping of indices to tensors: | ||
- | <sxh groovy; gutter: false> | ||
- | println '{m -> b, n -> a}'.mapping >> 't_mn'.t | ||
- | </sxh> | ||
- | <sxh plain; gutter: false> | ||
- | > t_ba | ||
- | </sxh> | ||
- | See [[documentation:guide:Mappings of indices]]. | ||
- | |||
- | <html><hr style="border:dashed #555555; border-width:1px 0 0; height:0;"></html> | ||
- | ====Collect==== | ||
- | collects terms by patterns: | ||
- | <sxh groovy; gutter: false> | ||
- | def t = 'A_m*B_n + A_n*C_m'.t | ||
- | println Collect['A_m'.t] >> t | ||
- | </sxh> | ||
- | <sxh plain; gutter: false> | ||
- | > A_i*(d^i_m*B_n + d^i_n*C_m) | ||
- | </sxh> | ||
- | See [[documentation:ref:Collect]] . | ||
- | |||
- | <html><hr style="border:dashed #555555; border-width:1px 0 0; height:0;"></html> | ||
- | ====CollectScalars==== | ||
- | collects similar scalar factors in products: | ||
- | <sxh groovy;gutter:false> | ||
- | println CollectScalars >> 'A_m*A^m*A_n*A^n'.t | ||
- | </sxh> | ||
- | <sxh plain; gutter: false> | ||
- | > (A_{m}*A^{m})**2 | ||
- | </sxh> | ||
- | See [[documentation:ref:CollectScalars]]. | ||
- | |||
- | <html><hr style="border:dashed #555555; border-width:1px 0 0; height:0;"></html> | ||
- | ====CollectNonScalars==== | ||
- | collects terms in sums with same tensorial parts: | ||
- | <sxh groovy; gutter: false> | ||
- | println CollectNonScalars >> 'A_m*A^m*A_n + A_n'.t | ||
- | </sxh> | ||
- | <sxh plain; gutter: false> | ||
- | > (1+A_{m}*A^{m})*A_{n} | ||
- | </sxh> | ||
- | See [[documentation:ref:CollectNonScalars]]. | ||
- | |||
- | <html><hr style="border:dashed #555555; border-width:1px 0 0; height:0;"></html> | ||
- | ====Conjugate==== | ||
- | replaces complex numbers in the expression with their complex conjugations: | ||
- | <sxh groovy; gutter: false> | ||
- | println Conjugate >> 'a + I*b'.t | ||
- | </sxh> | ||
- | <sxh plain; gutter: false> | ||
- | > a - I*b | ||
- | </sxh> | ||
- | See [[documentation:ref:Conjugate]]. | ||
- | |||
- | <html><hr style="border:dashed #555555; border-width:1px 0 0; height:0;"></html> | ||
- | ====Denominator==== | ||
- | gives the denominator of expression: | ||
- | <sxh groovy; gutter: false> | ||
- | println Denominator >> '(a + b)/(c + d)'.t | ||
- | </sxh> | ||
- | <sxh plain; gutter: false> | ||
- | > c + d | ||
- | </sxh> | ||
- | See [[documentation:ref:Denominator]]. | ||
- | |||
- | <html><hr style="border:dashed #555555; border-width:1px 0 0; height:0;"></html> | ||
- | ====Differentiate==== | ||
- | differentiates expressions with respect to specified variables: | ||
- | <sxh groovy; gutter: false> | ||
- | println Differentiate['x_a'] >> 'x_a*x^a - Sin[x_a*x^a]'.t | ||
- | </sxh> | ||
- | <sxh plain; gutter: false> | ||
- | > (2 - 2*Cos[x_{b}*x^{b}])*x^{a} | ||
- | </sxh> | ||
- | See [[documentation:ref:Differentiate]]. | ||
- | |||
- | <html><hr style="border:dashed #555555; border-width:1px 0 0; height:0;"></html> | ||
- | |||
- | ====DiracSimplify==== | ||
- | simplifies products of gamma matrices: | ||
- | <sxh groovy; gutter: false> | ||
- | defineMatrices 'G_a', 'G5', Matrix1.matrix | ||
- | println DiracSimplify >> 'G5*G_a*G5*G_b*G^a*G^b'.t | ||
- | </sxh> | ||
- | <sxh plain; gutter: false> | ||
- | > -8 | ||
- | </sxh> | ||
- | See [[documentation:ref:DiracSimpllify]]. | ||
- | |||
- | <html><hr style="border:dashed #555555; border-width:1px 0 0; height:0;"></html> | ||
- | |||
- | ====DiracOrder==== | ||
- | order products of gamma matrices: | ||
- | <sxh groovy; gutter: false> | ||
- | defineMatrices 'G_a', 'G5', Matrix1.matrix | ||
- | println DiracOrder >> 'G5*G_c*G_b*G_a'.t | ||
- | </sxh> | ||
- | <sxh plain; gutter: false> | ||
- | > G_{a}*G_{b}*G_{c}*G5+2*G_{b}*G5*g_{ca}-2*G_{c}*G5*g_{ba}-2*G_{a}*G5*g_{cb} | ||
- | </sxh> | ||
- | See [[documentation:ref:DiracOrder]]. | ||
- | |||
- | <html><hr style="border:dashed #555555; border-width:1px 0 0; height:0;"></html> | ||
- | |||
- | ====DiracTrace==== | ||
- | evaluates trace of gamma matrices: | ||
- | <sxh groovy; gutter: false> | ||
- | defineMatrices 'G_m', 'G5', Matrix1.matrix | ||
- | println DiracTrace[[Gamma: 'G_m']] >> 'Tr[G_m*G_n]'.t | ||
- | </sxh> | ||
- | <sxh plain; gutter: false> | ||
- | > 4*g_{mn} | ||
- | </sxh> | ||
- | See [[documentation:ref:DiracTrace]]. | ||
- | |||
- | <html><hr style="border:dashed #555555; border-width:1px 0 0; height:0;"></html> | ||
- | ====EliminateDueSymmetries==== | ||
- | removes parts of expressions, which are zero because of the symmetries (symmetric and antisymmetric at the same time): | ||
- | <sxh groovy; gutter: false> | ||
- | println EliminateDueSymmetries >> '(A_mn - A_nm)*(A^mn + A^nm)'.t | ||
- | </sxh> | ||
- | <sxh plain; gutter: false> | ||
- | > 0 | ||
- | </sxh> | ||
- | See [[documentation:ref:EliminateDueSymmetries]]. | ||
- | |||
- | <html><hr style="border:dashed #555555; border-width:1px 0 0; height:0;"></html> | ||
- | ====EliminateMetrics==== | ||
- | eliminates metric tensors and kronecker deltas: | ||
- | <sxh groovy; gutter: false> | ||
- | println EliminateMetric >> 'g_mn*A^m + d_n^a*B_a'.t | ||
- | </sxh> | ||
- | <sxh plain; gutter: false> | ||
- | > A_n + B_n | ||
- | </sxh> | ||
- | See [[documentation:ref:EliminateMetrics]]. | ||
- | |||
- | <html><hr style="border:dashed #555555; border-width:1px 0 0; height:0;"></html> | ||
- | ====ExpandAndEliminate==== | ||
- | expands out product of sums and positive integer powers and permanently eliminates metric and kronecker deltas: | ||
- | <sxh groovy; gutter: false> | ||
- | println ExpandAndEliminate >> '(g_mn - A_nm)*(A^mn + g^nm)'.t | ||
- | </sxh> | ||
- | <sxh plain; gutter: false> | ||
- | > -A^{mn}*A_{nm}+d^{n}_{n} | ||
- | </sxh> | ||
- | See [[documentation:ref:ExpandAndEliminate]]. | ||
- | |||
- | <html><hr style="border:dashed #555555; border-width:1px 0 0; height:0;"></html> | ||
- | ====Expand==== | ||
- | expands out products and positive integer powers: | ||
- | <sxh groovy; gutter: false> | ||
- | println Expand >> '(g_mn - A_nm)*(A^mn + g^nm)'.t | ||
- | </sxh> | ||
- | <sxh plain; gutter: false> | ||
- | > -A^{mn}*A_{nm}+g^{nm}*g_{mn} | ||
- | </sxh> | ||
- | See [[documentation:ref:Expand]]. | ||
- | |||
- | <html><hr style="border:dashed #555555; border-width:1px 0 0; height:0;"></html> | ||
- | ====ExpandAll==== | ||
- | expands out all products and integer powers in any part of expression: | ||
- | <sxh groovy; gutter: false> | ||
- | println ExpandAll >> '1/((g_mn - A_nm)*(A^mn + g^nm)').t | ||
- | </sxh> | ||
- | <sxh plain; gutter: false> | ||
- | > 1/(-A^{mn}*A_{nm}+g^{nm}*g_{mn}) | ||
- | </sxh> | ||
- | See [[documentation:ref:ExpandAll]]. | ||
- | |||
- | <html><hr style="border:dashed #555555; border-width:1px 0 0; height:0;"></html> | ||
- | ====ExpandDenominator==== | ||
- | expands out products and powers that appear in the numerator: | ||
- | <sxh groovy; gutter: false> | ||
- | println ExpandDenominator >> '(a + b)**2/(c + d)**2'.t | ||
- | </sxh> | ||
- | <sxh plain; gutter: false> | ||
- | > (a+b)**2/(c**2+d**2+2*d*c) | ||
- | </sxh> | ||
- | See [[documentation:ref:ExpandDenominator]]. | ||
- | |||
- | <html><hr style="border:dashed #555555; border-width:1px 0 0; height:0;"></html> | ||
- | ====ExpandNumerator==== | ||
- | expands out products and powers that appear as numerators: | ||
- | <sxh groovy; gutter: false> | ||
- | println ExpandNumerator >> '(a + b)**2/(c + d)**2'.t | ||
- | </sxh> | ||
- | <sxh plain; gutter: false> | ||
- | > (a**2+2*a*b+b**2)/(c+d)**2 | ||
- | </sxh> | ||
- | See [[documentation:ref:ExpandNumerator]]. | ||
- | |||
- | <html><hr style="border:dashed #555555; border-width:1px 0 0; height:0;"></html> | ||
- | |||
- | ====ExpandTensors==== | ||
- | expands only indexed parts: | ||
- | <sxh groovy; gutter: false> | ||
- | println ExpandTensors >> '(a + b)**2*(A_a + B_a)*(A^a + B^a)'.t | ||
- | </sxh> | ||
- | <sxh plain; gutter: false> | ||
- | > (a+b)**2*A^{a}*A_{a}+2*(a+b)**2*A^{a}*B_{a}+(a+b)**2*B^{a}*B_{a} | ||
- | </sxh> | ||
- | See [[documentation:ref:ExpandTensors]]. | ||
- | |||
- | <html><hr style="border:dashed #555555; border-width:1px 0 0; height:0;"></html> | ||
- | ====FullyAntiSymmetrize==== | ||
- | symmetrizes expression with respect to all free indices | ||
- | <sxh groovy; gutter: false> | ||
- | println FullyAntiSymmetrize >> 'f_abc'.t | ||
- | </sxh> | ||
- | <sxh plain; gutter: false> | ||
- | > -(1/6)*f_{bac}+(1/6)*f_{bca}+(1/6)*f_{cab}-(1/6)*f_{acb}+(1/6)*f_{abc}-(1/6)*f_{cba} | ||
- | </sxh> | ||
- | See [[documentation:ref: FullyAntiSymmetrize]]. | ||
- | |||
- | <html><hr style="border:dashed #555555; border-width:1px 0 0; height:0;"></html> | ||
- | |||
- | ====FullySymmetrize==== | ||
- | symmetrizes expression with respect to all free indices | ||
- | <sxh groovy; gutter: false> | ||
- | println FullySymmetrize >> 'f_abc'.t | ||
- | </sxh> | ||
- | <sxh plain; gutter: false> | ||
- | > (1/6)*f_{cba}+(1/6)*f_{bca}+(1/6)*f_{abc}+(1/6)*f_{acb}+(1/6)*f_{bac}+(1/6)*f_{cab} | ||
- | </sxh> | ||
- | See [[documentation:ref: FullySymmetrize]]. | ||
- | |||
- | <html><hr style="border:dashed #555555; border-width:1px 0 0; height:0;"></html> | ||
- | |||
- | ====Factor==== | ||
- | factors a polynomial over the integers: | ||
- | <sxh groovy; gutter: false> | ||
- | println Factor >> 'x**2 - 2*x*y + y**2'.t | ||
- | </sxh> | ||
- | <sxh plain; gutter: false> | ||
- | > (x - y)**2 | ||
- | </sxh> | ||
- | See [[documentation:ref:Factor]]. | ||
- | |||
- | <html><hr style="border:dashed #555555; border-width:1px 0 0; height:0;"></html> | ||
- | ====Identity==== | ||
- | just identity: | ||
- | <sxh groovy; gutter: false> | ||
- | def expr = 'A_mn*(p^m + q^m) + T_n'.t | ||
- | assert Identity >> expr == expr | ||
- | </sxh> | ||
- | |||
- | <html><hr style="border:dashed #555555; border-width:1px 0 0; height:0;"></html> | ||
- | |||
- | ====InvertIndices==== | ||
- | inverts indices of expression: | ||
- | <sxh groovy; gutter: false> | ||
- | println InvertIndices >> 'A_mn*(p^m + q^m) + T_n'.t | ||
- | </sxh> | ||
- | <sxh plain; gutter: false> | ||
- | > A_m^n*(p^m + q^m) + T^n | ||
- | </sxh> | ||
- | See [[documentation:ref: InvertIndices]]. | ||
- | |||
- | <html><hr style="border:dashed #555555; border-width:1px 0 0; height:0;"></html> | ||
- | ====LeviCivitaSimplify==== | ||
- | simplifies combinations with Levi-Civita tensors: | ||
- | <sxh groovy; gutter: false> | ||
- | println LeviCivitaSimplify.minkowski['e_abcd'.t] >> 'e_abcm*e^abcn'.t | ||
- | </sxh> | ||
- | <sxh plain; gutter: false> | ||
- | > -6*d_{m}^{n} | ||
- | </sxh> | ||
- | See [[documentation:ref: LeviCivitaSimplify]]. | ||
- | |||
- | <html><hr style="border:dashed #555555; border-width:1px 0 0; height:0;"></html> | ||
- | ====Numerator==== | ||
- | gives the numerator of expression: | ||
- | <sxh groovy; gutter: false> | ||
- | println Numerator >> '(a + b)/(c + d)'.t | ||
- | </sxh> | ||
- | <sxh plain; gutter: false> | ||
- | > a + b | ||
- | </sxh> | ||
- | See [[documentation:ref:Numerator]]. | ||
- | |||
- | <html><hr style="border:dashed #555555; border-width:1px 0 0; height:0;"></html> | ||
- | ====Numeric==== | ||
- | gives the numerical value of expression: | ||
- | <sxh groovy; gutter: false> | ||
- | println Numeric >> 'Sin[2]'.t | ||
- | </sxh> | ||
- | <sxh plain; gutter: false> | ||
- | > 0.9092974268256817 | ||
- | </sxh> | ||
- | See [[documentation:ref:Numeric]]. | ||
- | |||
- | <html><hr style="border:dashed #555555; border-width:1px 0 0; height:0;"></html> | ||
- | ====PowerExpand==== | ||
- | expands all powers of products and powers with respect to specified variables: | ||
- | <sxh groovy; gutter: false> | ||
- | println PowerExpand >> '(a*b*c)**d'.t | ||
- | </sxh> | ||
- | <sxh plain; gutter: false> | ||
- | > a**d*b**d*c**d | ||
- | </sxh> | ||
- | See [[documentation:ref:PowerExpand]]. | ||
- | |||
- | <html><hr style="border:dashed #555555; border-width:1px 0 0; height:0;"></html> | ||
- | ====PowerUnfold==== | ||
- | expands all powers of products and powers with respect to specified variables and unfolds powers of indexed arguments into products: | ||
- | <sxh groovy; gutter: false> | ||
- | println PowerUnfold >> '(A_m*A^m)**2'.t | ||
- | </sxh> | ||
- | <sxh plain; gutter: false> | ||
- | > A_{m}*A^{m}*A_{a}*A^{a} | ||
- | </sxh> | ||
- | See [[documentation:ref:PowerUnfold]]. | ||
- | |||
- | <html><hr style="border:dashed #555555; border-width:1px 0 0; height:0;"></html> | ||
- | ====Reverse==== | ||
- | reverses the order of matrices of specified matrix type: | ||
- | <sxh groovy; gutter: false> | ||
- | defineMatrices 'A', 'B', 'C', Matrix1.matrix | ||
- | println Reverse[Matrix1] >> 'A*B*C'.t | ||
- | </sxh> | ||
- | <sxh plain; gutter: false> | ||
- | > C*B*A | ||
- | </sxh> | ||
- | See [[documentation:ref:Reverse]]. | ||
- | |||
- | <html><hr style="border:dashed #555555; border-width:1px 0 0; height:0;"></html> | ||
- | ====Symmetrize==== | ||
- | gives a symmetrization of tensor with respect to specified indices under the specified symmetries: | ||
- | <sxh groovy; gutter: false> | ||
- | def indices = '_abc'.si | ||
- | indices.symmetries.setSymmetric() | ||
- | println Symmetrize[indices] >> 't_abc'.t | ||
- | </sxh> | ||
- | <sxh plain; gutter: false> | ||
- | > (1/6)*(t_{cab} + t_{acb} + t_{bca} + t_{cba} + t_{abc} + t_{bac}) | ||
- | </sxh> | ||
- | See [[documentation:ref:Symmetrize]]. | ||
- | |||
- | <html><hr style="border:dashed #555555; border-width:1px 0 0; height:0;"></html> | ||
- | ====Together==== | ||
- | puts terms in a sum over a common denominator, and cancels factors in the result: | ||
- | <sxh groovy; gutter: false> | ||
- | println Together >> '1/a + 1/b'.t | ||
- | </sxh> | ||
- | <sxh plain; gutter: false> | ||
- | > (a + b)/(a*b) | ||
- | </sxh> | ||
- | See [[documentation:ref:Together]]. | ||
- | |||
- | <html><hr style="border:dashed #555555; border-width:1px 0 0; height:0;"></html> | ||
- | |||
- | ====UnitarySimplify==== | ||
- | simplifies combinations of unitary matrices and SU(N) structural and $d$-constants | ||
- | <sxh groovy; gutter: false> | ||
- | defineMatrices 'T_A', Matrix2.matrix | ||
- | println UnitarySimplify[[Matrix: 'T_A']] >> 'T_A*T^A'.t | ||
- | </sxh> | ||
- | <sxh plain; gutter: false> | ||
- | > (1/2)*N**(-1)*(N**2-1) | ||
- | </sxh> | ||
- | See [[documentation:ref:UnitarySimplify]]. | ||
- | |||
- | <html><hr style="border:dashed #555555; border-width:1px 0 0; height:0;"></html> | ||
- | ====UnitaryTrace==== | ||
- | evaluates trace of unitary matrices: | ||
- | <sxh groovy; gutter: false> | ||
- | defineMatrices 'T_A', Matrix2.matrix | ||
- | println UnitaryTrace[[Matrix: 'T_A']] >> 'Tr[T_A*T_B]'.t | ||
- | </sxh> | ||
- | <sxh plain; gutter: false> | ||
- | > (1/2)*g_{BA} | ||
- | </sxh> | ||
- | See [[documentation:ref: UnitaryTrace]]. | ||
- | |||
- | <html><hr style="border:dashed #555555; border-width:1px 0 0; height:0;"></html> |