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

DiagrammaticComputation

Guides

  • DiagramConversion
  • DiagramDrawing
  • DiagramGrid
  • DiagramRewriting
  • Diagrams
  • DiagramSurgery
  • FeynmanDiagrams
  • Ports

Tech Notes

  • Diagram Examples
  • Introduction to Diagrammatic Computation
  • Rewriting Diagrams

Symbols

  • AnnihilationRule
  • CapDiagram
  • ColumnDiagram
  • CommutationRule
  • CopyDiagram
  • CupDiagram
  • DiagramArrange
  • DiagramAssignPorts
  • DiagramCases
  • DiagramComposition
  • DiagramCopySplit
  • DiagramDecompose
  • DiagramDelete
  • DiagramDraw
  • DiagramDual
  • DiagramExpressionReplace
  • DiagramExtract
  • DiagramFlip
  • DiagramFunction
  • DiagramGraphics
  • DiagramGraphSimplify
  • DiagramGridHeight
  • DiagramGrid
  • DiagramGridTree
  • DiagramGridWidthHeight
  • DiagramGridWidth
  • DiagramHypergraph
  • DiagramHypergraphRule
  • DiagramInsert
  • DiagramMapAt
  • DiagramMap
  • DiagramMatchPorts
  • Diagram
  • DiagramNestReplace
  • DiagramNetwork
  • DiagramPattern
  • DiagramPermute
  • DiagramPosition
  • DiagramPositions
  • DiagramProduct
  • DiagramQ
  • DiagramReplaceList
  • DiagramReplace
  • DiagramReplacePart
  • DiagramReverse
  • DiagramRightComposition
  • DiagramRule
  • DiagramsFreePorts
  • DiagramsGraph
  • DiagramsNetGraph
  • DiagramSplit
  • DiagramsPortGraph
  • DiagramSubdiagrams
  • DiagramSum
  • DiagramTensor
  • DuplicateAnnihilationRule
  • DuplicateEraserRule
  • EmptyDiagram
  • EmptyDiagramQ
  • EmptyPortQ
  • EraserAnnihilationRule
  • EraserDiagram
  • EraserRule
  • FeynArtsTopologyGraphics
  • FeynmanDiagram
  • GridInputPorts
  • GridOutputPorts
  • IdentityDiagram
  • MergeDiagram
  • PermutationDiagram
  • PortDual
  • PortMinus
  • Port
  • PortNeutral
  • PortPower
  • PortProduct
  • PortQ
  • PortSum
  • PropagationRule
  • RemoveDiagramRule
  • RowDiagram
  • SimplifyDiagram
  • SingletonDiagram
  • SpiderDiagram
  • TagPort
  • TensorDiagram
  • ToDiagram
  • ToDiagramNetwork
  • TopologyGraphics
  • TopologyGraph
  • TopologyGraphs
  • UntagPort
  • WigglyArcFunction
  • ZeroDiagram
  • ZeroPortQ
Wolfram`DiagrammaticComputation`
DiagramReplaceList
​
DiagramReplaceList
[d,srctgt]
returns a list of every possible single rewrite of
d
replacing a match of the diagram
src
with
tgt
.
​
​
DiagramReplaceList
[d,rule,n]
returns at most
n
rewrites.
​
​
DiagramReplaceList
[d,{
rule
1
,
rule
2
,…}]
enumerates rewrites for each of the given rules.
​
Details and Options
▪
Matching is performed on the hypergraph view of
d
, so each list entry corresponds to one match site of
src
in
d
.
▪
Formal symbols (or patterns) in the rule's ports are bound by the match, so a single rule can rewrite differently-wired occurrences of the same subdiagram.
▪
The following options can be given:
Option
Default
Description
"Return"
Automatic
return
"Rule"
,
"Hypergraph"
or
"Matches"
to inspect intermediate stages
"IgnoreArity"
True
match subdiagrams regardless of unconnected ports
Examples  
(0)
SeeAlso
DiagramReplace
 
▪
DiagramNestReplace
 
▪
DiagramRule
 
▪
ReplaceList
RelatedGuides
▪
DiagramRewriting
List both possible single replacements of
"A"
in a composition of two:
In[1]:=
DiagramReplaceList
​​
DiagramComposition

Diagram
["A",b,a],
Diagram
["A",c,b],​​
Diagram
"A",y.,x.
Diagram
"X",y.,x.​​
Out[1]=

,

""

© 2026 Wolfram. All rights reserved.

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