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`
TensorNetworkRemoveCycles
​
TensorNetworkRemoveCycles
[graph]
returns an acyclic
Graph
by inserting one cup/cap pair of identity tensors for each cycle in the directed input
graph
.
​
Details and Options
Examples  
(5)
Scope  
(3)
Unannotated directed graph  
(1)
Unannotated directed graph. A raw cyclic Graph gets cup/cap vertices and untagged DirectedEdges:
In[1]:=
gU=Graph[{12,23,31}];
In[2]:=
EdgeList
TensorNetworkRemoveCycles
[gU]
The new vertices carry the labels "Cup" and "Cap":
In[3]:=
AnnotationValue
TensorNetworkRemoveCycles
[gU],VertexList
TensorNetworkRemoveCycles
[gU],VertexLabels
​
Annotated TN graph  
(1)

Multi-cycle graph  
(1)

Applications  
(1)

Properties & Relations  
(1)

SeeAlso
ToTensorNetworkGraph
 
▪
TensorNetworkGraphQ
 
▪
TensorNetworkIndexGraph
 
▪
BinaryTensorNetwork
 
▪
FindCycle
 
▪
DirectedGraphQ
 
▪
AcyclicGraphQ
 
▪
VertexAdd
 
▪
EdgeDelete
TechNotes
▪
Building Tensor Networks
RelatedGuides
▪
TensorNetworks
A simple directed 3-cycle is broken by inserting one cup/cap pair:
In[1]:=
g=Graph[{12,23,31}];
In[2]:=
TensorNetworkRemoveCycles
[g]
The result is acyclic:
In[3]:=
AcyclicGraphQ
TensorNetworkRemoveCycles
[g]
Each cycle adds two vertices (a cup and a cap) to the input:
In[4]:=
VertexCount[g],VertexCount
TensorNetworkRemoveCycles
[g]
The cup and cap carry a flattened identity matrix as their tensor:
In[5]:=
res=
TensorNetworkRemoveCycles
[g];
In[6]:=
AnnotationValue[{res,VertexList[res]},VertexLabels]
""

© 2026 Wolfram. All rights reserved.

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