full name: tenpy.algorithms.network_contractor.ncon
ncon(tensor_list, leg_links, sequence)¶
ncon.mfor TeNPy Arrays.
tensor_list (list of :class:'Array') – Tensors to be contracted.
leg_links (list of list of int) – Each entry of leg_links describes the connectivity of the corresponding tensor in tensor_list. Each entry is a list that has an entry for each leg of the corresponding tensor. Values
0,1,2,...are labels of contracted legs and should appear exactly twice in leg_links. Values
-1,-2,-3,...are labels of uncontracted legs and indicate the final ordering (
-1is first axis).
sequence (list of int) – The order in which the contractions are to be performed. An entry of network_contractor.outer_product indicates performing an outer product. This corresponds to the zero-in-sequence convention of arXiv:1304.6112
result – The number or tensor resulting from the contraction.
- Return type