Skip to main content

Module contract

Module contract 

Source
Expand description

Multi-tensor contraction with optimal contraction order.

This module provides functions to contract multiple tensors efficiently using einsum optimization via the tensorbackend (tenferro-backed implementation).

This module works with concrete types (DynIndex, IdxTensor) only.

§Main Functions

§Structured Tensor Handling

Diagonal and structured tensors contract through their compact payload and equality metadata. Logical dense materialization is reserved for APIs that explicitly request dense values; contraction itself preserves compact representation whenever the result remains structured.

Structs§

ContractionOptions
Options for multi-tensor contraction.
PairwiseContractionOptions
Options for pairwise tensor contraction.

Functions§

contract
Contract a connected tensor network with the default semantics.
contract_owned
Contract owned tensors with the default connected-network semantics.
contract_owned_with_options
Contract owned tensors with advanced connected-network options.
contract_pair
Contract two tensors with the default pairwise semantics.
contract_pair_with_operand_options
Contract two tensors with operand-level conjugation options.
contract_pair_with_options
Contract two tensors with explicit contraction options.
contract_with_options
Contract a connected tensor network with advanced options.
outer_product
Compute the outer product of two tensors.
print_and_reset_contract_profile
Print and clear the aggregated multi-tensor contraction profile.
reset_contract_profile
Reset the aggregated multi-tensor contraction profile.
tensordot
Contract two tensors along explicitly specified index pairs.