Created
December 1, 2017 10:26
-
-
Save onionmk2/0cee7fcba59c759a60e93186e2c20e38 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sympy.tensor.tensor import TensorIndexType, tensor_indices, tensorhead, TensorManager | |
Lorentz = TensorIndexType('Lorentz') | |
i0, i1, i2, i3, i4 = tensor_indices('i0:5', Lorentz) | |
A = tensorhead('A', [Lorentz], [[1]]) | |
G = tensorhead('G', [Lorentz], [[1]], 'Gcomm') | |
GH = tensorhead('GH', [Lorentz], [[1]], 'GHcomm') | |
TensorManager.set_comm('Gcomm', 'GHcomm', 0) | |
(GH(i1) * G(i0)).canon_bp() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
get_comm(i, j)
Return the commutation parameter for commutation group numbers i, j
see _TensorManager.set_comm
set_comm(i, j, c)
i, j can be symbols, strings or numbers, apart from 0, 1 and 2 which are reserved respectively for commuting, anticommuting tensors and tensors not commuting with any other group apart with the commuting tensors.