# Antisymmetrize a rank 4 tensor

Suppose I have a rank 4 tensor $T_{abcd}$, I can build a SparseArray to input some initial values like $T_{1435}=1$ (a huge amounts of elements are equal to 1) etc. Now I want to antisymmetrize this tensor, then automatically diagonal terms are all 0, and $T_{4135}=T_{1453}=T_{1345}=T_{3415}=T_{5431}=T_{1534}=-1$ and $T_{4153}=1$ etc. How can I achieve this?

PS: I have tried SymmetrizedArray, but it can not do something like {{1,2,3,4},{2,1,4,2}} -> 1.

## 1 Answer

You're almost there. You just need to add Antisymmetric[{1, 2, 3, 4}]:

sa = SymmetrizedArray[
{{1, 4, 3, 5} -> 1},
{5, 5, 5, 5},
Antisymmetric[{1, 2, 3, 4}]
]


Then you can simply visually check with

Normal[sa] // MatrixForm


that by specifying just $T_{1435} = 1$ above, you automatically get $T_{4135}=T_{1453}=T_{1345}=T_{3415}=T_{5431}=T_{1534}=-1$ and $T_{4153}=1$ etc.

• Thank you for your answer. One problem I am having with this method is that I have created a huge amount of list contains the position of 1s. But SymmetrizedArray does not allow operation like list->1, and I am not sure how to assign each element in the list to 1 in this case (because there are too many).
– lol
Aug 26, 2017 at 3:17
• @lol Suppose your list is list = {{1,2,3,4},{2,1,4,2}}. Use the following as the first argument of SymmetrizedArray: # -> 1 & /@ list. Aug 26, 2017 at 3:29
{"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "url": "https://mathematica.stackexchange.com/questions/154529/antisymmetrize-a-rank-4-tensor", "fetch_time": 1701311426000000000, "content_mime_type": "text/html", "warc_filename": "crawl-data/CC-MAIN-2023-50/segments/1700679100164.15/warc/CC-MAIN-20231130000127-20231130030127-00709.warc.gz", "warc_record_offset": 458500559, "warc_record_length": 41290, "token_count": 491, "char_count": 1379, "score": 3.53125, "int_score": 4, "crawl": "CC-MAIN-2023-50", "snapshot_type": "longest", "language": "en", "language_score": 0.8389476537704468, "file_path": "/sailhome/yjruan/project/latent-lm/data/processed/finemath-4plus/finemath-4plus/train-00011-of-00064.parquet"}