This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
documentation:ref:invertindices [2015/11/20 19:33] poslavskysv [Examples] |
documentation:ref:invertindices [2015/11/21 12:33] (current) |
||
|---|---|---|---|
| Line 6: | Line 6: | ||
| ====Examples==== | ====Examples==== | ||
| ---- | ---- | ||
| - | Expand a power of a product: | + | Invert indices of some expression |
| <sxh groovy; gutter: false> | <sxh groovy; gutter: false> | ||
| - | def t = '(a*b*c)**d'.t | + | println InvertIndices >> 'A_mn'.t |
| - | println PowerExpand >> t | + | |
| </sxh> | </sxh> | ||
| <sxh plain; gutter: false> | <sxh plain; gutter: false> | ||
| - | > a**d*b**d*c**d | + | > A^mn |
| </sxh> | </sxh> | ||
| - | ---- | ||
| - | Expand with respect to ''a'': | ||
| <sxh groovy; gutter: false> | <sxh groovy; gutter: false> | ||
| - | def t = '(a*b*c)**d'.t | + | println InvertIndices >> 'A_mn*(p^m + q^m) + T_n'.t |
| - | println PowerExpand['a'] >> t | + | |
| </sxh> | </sxh> | ||
| <sxh plain; gutter: false> | <sxh plain; gutter: false> | ||
| - | > a**d*(b*c)**d | + | > A_m^n*(p^m + q^m) + T^n |
| </sxh> | </sxh> | ||
| + | |||
| ---- | ---- | ||
| - | Expand a square root: | + | Invert only indices of certain type: |
| <sxh groovy; gutter: false> | <sxh groovy; gutter: false> | ||
| - | def t = '(a*b)**(1/2)'.t | + | println InvertIndices[LatinLower] >> 'T_ABmn'.t |
| - | println PowerExpand >> t | + | |
| </sxh> | </sxh> | ||
| <sxh plain; gutter: false> | <sxh plain; gutter: false> | ||
| - | > a**(1/2) * b**(1/2) | + | > T_AB^mn |
| </sxh> | </sxh> | ||
| - | ---- | + | <sxh groovy; gutter: false> |
| + | println InvertIndices[GreekLower] >> 'A_{mn\\mu}*(p^m + q^m) + T_{n\\mu}'.t | ||
| + | </sxh> | ||
| + | <sxh plain; gutter: false> | ||
| + | > A_{mn}^{\\mu}*(p^m + q^m) + T_{n}^{\\mu} | ||
| + | </sxh> | ||
| + | |||
| + | ====See also==== | ||
| + | * Related guides: [[documentation:guide:applying_and_manipulating_transformations]], [[documentation:guide:list_of_transformations]], [[documentation:guide:programming_with_redberry|]] | ||