This shows you the differences between two versions of the page.
documentation:ref:symmetrize [2015/11/21 10:47] poslavskysv [See also] |
documentation:ref:symmetrize [2015/11/21 12:33] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Symmetrize ====== | ||
- | ---- | ||
- | ====Description==== | ||
- | * ''Symmetrize[indices]'' makes expression symmetries same to the symmetries of ''indices'' | ||
- | |||
- | * ''Symmetrize[indices]'' makes expression symmetric only with respect to specified indices | ||
- | |||
- | * ''Symmetrize[indices]'' will also multiply the result on the symmetric factor | ||
- | |||
- | ====Examples==== | ||
- | ---- | ||
- | Symmetrize indices ''a'' and ''b'' in expression: | ||
- | <sxh groovy; gutter: false> | ||
- | def indices = '_ab'.si | ||
- | indices.symmetries.setSymmetric() | ||
- | println Symmetrize[indices] >> 'T_ab'.t | ||
- | </sxh> | ||
- | <sxh plain; gutter: false> | ||
- | > T_{ab}/2 + T_{ba}/2 | ||
- | </sxh> | ||
- | |||
- | Antisymmetrize indices ''a'' and ''b'' in expression: | ||
- | <sxh groovy; gutter: false> | ||
- | def indices = '_ab'.si | ||
- | indices.symmetries.setAntiSymmetric() | ||
- | println Symmetrize[indices] >> 'T_ab'.t | ||
- | </sxh> | ||
- | <sxh plain; gutter: false> | ||
- | > T_{ab}/2 - T_{ba}/2 | ||
- | </sxh> | ||
- | |||
- | ---- | ||
- | Symmetrize a complicated expression | ||
- | <sxh groovy; gutter: false> | ||
- | def indices = '_ab'.si | ||
- | indices.symmetries.setAntiSymmetric() | ||
- | println Symmetrize[indices] >> 'T_ac*F^c_b - F_bc*T^c_a'.t | ||
- | </sxh> | ||
- | <sxh plain; gutter: false> | ||
- | > T_{ac}*F^{c}_{b}/2-T_{bc}*F^{c}_{a}/2-T^{c}_{a}*F_{bc}/2+T^{c}_{b}*F_{ac}/2 | ||
- | </sxh> | ||
- | |||
- | ---- | ||
- | Symmetrize part of indices | ||
- | <sxh groovy; gutter: false> | ||
- | def indices = '_abc'.si | ||
- | indices.symmetries.setSymmetric() | ||
- | println Symmetrize[indices] >> 'T_abcde'.t | ||
- | </sxh> | ||
- | <sxh plain; gutter: false> | ||
- | > T_{bcade}/6+T_{cabde}/6+T_{cbade}/6+T_{abcde}/6+T_{acbde}/6+T_{bacde}/6 | ||
- | </sxh> | ||
- | |||
- | ---- | ||
- | Make symmetries equal to specified permutation group | ||
- | <sxh groovy; gutter: false> | ||
- | def indices = '_abcd'.si | ||
- | indices.symmetries.add(-[1, 0].p) | ||
- | indices.symmetries.add([2, 3, 0, 1].p) | ||
- | println Symmetrize[indices] >> '8*R_abcd'.t | ||
- | </sxh> | ||
- | <sxh plain; gutter: false> | ||
- | > -R_{abdc}-R_{dcab}-R_{cdba}+R_{badc}+R_{dcba}+R_{cdab}+R_{abcd}-R_{bacd} | ||
- | </sxh> | ||
- | |||
- | ---- | ||
- | ''Symmetrize'' will have no effect if tensor already has such symmetries: | ||
- | <sxh groovy; gutter: false> | ||
- | setSymmetric 'F_abcd' | ||
- | def indices = '_bcd'.si | ||
- | indices.symmetries.add([1, 0, 2].p) | ||
- | println Symmetrize[indices] >> 'F_abcd'.t | ||
- | </sxh> | ||
- | <sxh plain; gutter: false> | ||
- | > F_{abdc} | ||
- | </sxh> | ||
- | |||
- | ---- | ||
- | ====Details==== | ||
- | ---- | ||
- | Symmetries are defined relatively to the specified indices: | ||
- | <sxh groovy; gutter: true> | ||
- | def indices = '_abc'.si | ||
- | indices.symmetries.add([1, 0, 2].p) | ||
- | println Symmetrize[indices] >> 'F_abc'.t | ||
- | </sxh> | ||
- | <sxh plain; gutter: false> | ||
- | > (1/2)*F_{bac}+(1/2)*F_{abc} | ||
- | </sxh> | ||
- | <sxh groovy; gutter: true; first-line: 4> | ||
- | indices = '_cab'.si | ||
- | indices.symmetries.add([1, 0, 2].p) | ||
- | println Symmetrize[indices] >> 'F_abc'.t | ||
- | </sxh> | ||
- | <sxh plain; gutter: false> | ||
- | > (1/2)*F_{abc}+(1/2)*F_{cba} | ||
- | </sxh> | ||
- | ---- | ||
- | Implement transformation that makes expression fully symmetric with respect to all indices: | ||
- | <sxh groovy; gutter: false> | ||
- | def Symmetric = { expr -> | ||
- | def indices = expr.indices.si //convert indices of expr to simple indices | ||
- | indices.symmetries.setSymmetric() | ||
- | return Symmetrize[indices] >> expr | ||
- | } as Transformation | ||
- | |||
- | println Symmetric >> '6*f_abc'.t | ||
- | </sxh> | ||
- | <sxh plain; gutter: false> | ||
- | > f_{cab}+f_{acb}+f_{abc}+f_{cba}+f_{bac}+f_{bca} | ||
- | </sxh> | ||
- | |||
- | Same for fully antisymmetric transformation: | ||
- | <sxh groovy; gutter: false> | ||
- | def AntiSymmetric = { expr -> | ||
- | def indices = expr.indices.si //convert indices of expr to simple indices | ||
- | indices.symmetries.setAntiSymmetric() | ||
- | return Symmetrize[indices] >> expr | ||
- | } as Transformation | ||
- | |||
- | println AntiSymmetric >> '6*f_abc'.t | ||
- | </sxh> | ||
- | <sxh plain; gutter: false> | ||
- | > f_{bca}+f_{cab}-f_{cba}-f_{bac}+f_{abc}-f_{acb} | ||
- | </sxh> | ||
- | |||
- | ---- | ||
- | ====See also==== | ||
- | * Related guides: [[documentation:guide:applying_and_manipulating_transformations]], [[documentation:guide:symmetries_of_tensors]], [[documentation:guide:tensors_and_indices]], [[documentation:guide:list_of_transformations]] | ||
- | * Related transformations: [[documentation:ref:fullysymmetrize]], [[documentation:ref:fullyantisymmetrize]] | ||
- | * JavaDocs: [[http://api.redberry.cc/redberry/1.1.8/java-api/cc/redberry/core/transformations/symmetrization/SymmetrizeTransformation.html| SymmetrizeTransformation]] | ||
- | * Source code: [[https://bitbucket.org/redberry/redberry/src/tip/core/src/main/java/cc/redberry/core/transformations/symmetrization/SymmetrizeTransformation.java|SymmetrizeTransformation.java]] |