# Tensor

class adcc.Tensor(sym_or_mo, space=None, permutations=None, spin_block_maps=None, spin_blocks_forbidden=None)

Bases: `libadcc.Tensor`

Construct an uninitialised Tensor from an `MoSpaces` or a `Symmetry` object.

More information about the last four, symmetry-related parameters see the documentation of the `Symmetry` object.

Parameters
• sym_or_mo – Symmetry or MoSpaces object

• spaces (str, optional) – Space of the tensor, can be None if the first argument is a `Symmetry` object.

• permutations (list, optional) – List of permutational symmetries of the Tensor.

• spin_block_maps (list, optional) – List of mappings between spin blocks

• spin_blocks_forbidden (list, optional) – List of forbidden (i.e. forced-to-zero) spin blocks.

Notes

An `MoSpaces` object is contained in many datastructures of adcc, including the `AdcMatrix`, the `LazyMp`, the `ReferenceState` and any solver or ADC results state.

Examples

Construct a symmetric tensor in the “o1o1” (occupied-occupied) spaces:

```>>> Tensor(mospaces, "o1o1", permutations=["ij", "ji"])
```

Construct an anti-symmetric tensor in the “v1v1” spaces:

```>>> Tensor(mospaces, "v1v1", permutations=["ab", "-ba"])
```

Construct a tensor in “o1v1”, which maps the alpha-alpha block anti-symmetrically to the beta-beta block and which has the other spin blocks set to zero:

```>>> Tensor(mospaces, "o1v1", spin_block_maps=[("aa", "bb", -1)],
...        spin_blocks_forbidden=["ab", "ba"])
```

Methods Summary

 `select_below_absmax`(tolerance) Select the absolute maximal values in the tensor, which are below the given tolerance.

Methods Documentation

select_below_absmax(tolerance)

Select the absolute maximal values in the tensor, which are below the given tolerance.
{"ft_lang_label":"__label__en","ft_lang_prob":0.70522237,"math_prob":0.7874326,"size":1670,"snap":"2022-40-2023-06","text_gpt3_token_len":416,"char_repetition_ratio":0.13085234,"word_repetition_ratio":0.120192304,"special_character_ratio":0.23293413,"punctuation_ratio":0.17343174,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9873739,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2022-09-26T09:13:20Z\",\"WARC-Record-ID\":\"<urn:uuid:528a2248-5133-45b0-8c5c-6d197b8a33df>\",\"Content-Length\":\"16327\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:1571eb6c-6134-45b4-a1fd-c5e565198a22>\",\"WARC-Concurrent-To\":\"<urn:uuid:f7475818-be5e-4bcc-8249-4de813ef464a>\",\"WARC-IP-Address\":\"188.68.51.89\",\"WARC-Target-URI\":\"https://adc-connect.org/v0.15.13/api/adcc.Tensor.html\",\"WARC-Payload-Digest\":\"sha1:XWYZ36GSMMJE3DMAVJHGAXHLLZWU4Z6C\",\"WARC-Block-Digest\":\"sha1:AMSWCDU4GXVQOE636NNPZO7M4GJLS2HD\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2022/CC-MAIN-2022-40/CC-MAIN-2022-40_segments_1664030334855.91_warc_CC-MAIN-20220926082131-20220926112131-00725.warc.gz\"}"}