Wolfram Language Paclet Repository

Community-contributed installable additions to the Wolfram Language

Primary Navigation

    • Cloud & Deployment
    • Core Language & Structure
    • Data Manipulation & Analysis
    • Engineering Data & Computation
    • External Interfaces & Connections
    • Financial Data & Computation
    • Geographic Data & Computation
    • Geometry
    • Graphs & Networks
    • Higher Mathematical Computation
    • Images
    • Knowledge Representation & Natural Language
    • Machine Learning
    • Notebook Documents & Presentation
    • Scientific and Medical Data & Computation
    • Social, Cultural & Linguistic Data
    • Strings & Text
    • Symbolic & Numeric Computation
    • System Operation & Setup
    • Time-Related Computation
    • User Interface Construction
    • Visualization & Graphics
    • Random Paclet
    • Alphabetical List
  • Using Paclets
    • Get Started
    • Download Definition Notebook
  • Learn More about Wolfram Language

TensorNetworks

Guides

  • TensorNetworks

Tech Notes

  • Building Tensor Networks
  • Contraction Paths and Execution
  • Matrix Product States
  • A Working Tour of the Symmetry Functions
  • Tensor Networks Overview
  • Young Tableaux and Tensor Symmetries

Symbols

  • ActivateTensors
  • BinaryTensorNetwork
  • BinaryTensorNetworkQ
  • CanonicalPath
  • CanonicalPathQ
  • ContractIndices
  • ContractionTree
  • EinsteinSummation
  • GreedyContractionPath
  • HookFactor
  • HookLength
  • HookLengths
  • IndexedMultiply
  • InitializeTensorNetwork
  • MetricTensor
  • MetricTensorQ
  • MPSCanonicalForm
  • MPSCanonicalQ
  • MPSEntanglementEntropy
  • MPSNormalize
  • MPSNorm
  • MPSOverlap
  • MPSSchmidtValues
  • MPSTruncate
  • OptimalContractionPath
  • PartitionQ
  • PathIndexContractions
  • PathQ
  • PathToTreePath
  • RandomTensorNetwork
  • SchurDimension
  • SparseTensorNetwork
  • TableauColumns
  • TableauDimension
  • TableauRows
  • TableauShape
  • TableauSize
  • TableauWeylDimension
  • TensorNetworkAdd
  • TensorNetworkContraction
  • TensorNetworkContractions
  • TensorNetworkContract
  • TensorNetworkData
  • TensorNetworkDelete
  • TensorNetworkFreeIndices
  • TensorNetworkGraphData
  • TensorNetworkGraphQ
  • TensorNetworkIndexDimensions
  • TensorNetworkIndexGraph
  • TensorNetworkIndices
  • TensorNetwork
  • TensorNetworkQ
  • TensorNetworkRemoveCycles
  • TensorNetworkReplaceIndices
  • TensorNetworkSize
  • TensorNetworkTensors
  • TensorNetworkToNetGraph
  • ToTensorNetworkGraph
  • TransposePartition
  • TreePathQ
  • TreePathToPath
  • YoungProject
  • YoungSymmetrize
  • YoungTableau
  • YoungTableauQ
Wolfram`TensorNetworks`
ActivateTensors
​
ActivateTensors
[expr]
activates
Inactive
[
TensorProduct
]
,
Inactive
[
TensorContract
]
, and
Inactive
[
Transpose
]
in
expr
, returning the evaluated tensor.
​
Details and Options
▪
ActivateTensors
runs the activation in two passes. The inner pass activates
TensorContract
only; the outer pass activates remaining heads, including
TensorProduct
and
Transpose
. Two passes are required because activating the outer
TensorProduct
can expose new
TensorContract
heads inside.
▪
Before activation the expression is rewritten by two replacement rules.
GeneralizedPower[
TensorProduct
,t,n]
expands to a
TensorProduct
of
n
copies of
t
. This pattern arises in
EinsteinSummation
when an output index appears more times than in any input — the multiplicity broadcasting case.
▪
SymbolicIdentityArray
and
SymbolicDeltaProductArray
are converted via
Normal
before activation. Those symbolic forms are not numerically evaluable, so the contraction primitives cannot reduce them in place.
BinaryTensorNetwork
introduces
SymbolicDeltaProductArray
spider tensors at every hyper-edge.
▪
Use
ActivateTensors
to collapse the symbolic contraction tree returned by
TensorNetworkContraction
into a numerical tensor. The shortcut
TensorNetworkContract
is
TensorNetworkContraction
[…,"Inactive"
False
]
, which is equivalent to
ActivateTensors
[
TensorNetworkContraction
[…]]
.
▪
Expressions with no
Inactive
heads pass through unchanged.
​
Examples  
(9)
Basic Examples  
(2)
Activate inactive tensor operations in an expression:
In[1]:=
A=RandomReal[{-1,1},{2,3}];​​B=RandomReal[{-1,1},{3,4}];expr=Inactive[TensorContract][Inactive[TensorProduct][A,B],{{2,3}}]
Out[1]=
TensorContract[{{0.763892,0.554565,0.0827398},{-0.806229,0.608086,-0.554211}}{{0.325347,0.756967,-0.891212,-0.140357},{-0.140566,0.417286,0.818867,0.816652},{-0.117338,-0.571961,-0.797053,0.468545}},{{2,3}}]
Evaluate the inactive expression:
In[2]:=
ActivateTensors
[expr]
Out[2]=
{{0.160868,0.762329,-0.292622,0.384436},{-0.282751,-0.0395562,1.6582,0.350082}}
​
Activate a transpose of an inactive contraction:
In[1]:=
ActivateTensors
[Inactive[Transpose][Inactive[TensorContract][Inactive[TensorProduct][A,B],{{2,3}}],Cycles[{{1,2}}]]]
Out[1]=
{{0.160868,-0.282751},{0.762329,-0.0395562},{-0.292622,1.6582},{0.384436,0.350082}}
Scope  
(4)

Applications  
(1)

Properties & Relations  
(2)

SeeAlso
TensorNetworkContract
 
▪
TensorNetworkContraction
 
▪
EinsteinSummation
 
▪
IndexedMultiply
 
▪
Activate
 
▪
Inactive
 
▪
Normal
TechNotes
▪
Contraction Paths and Execution
RelatedGuides
▪
TensorNetworks
""

© 2026 Wolfram. All rights reserved.

  • Legal & Privacy Policy
  • Contact Us
  • WolframAlpha.com
  • WolframCloud.com