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

  • Diagrams

Tech Notes

  • Introduction to Diagrammatic Computation

Symbols

  • ColumnDiagram
  • DiagramComposition
  • DiagramDraw
  • DiagramDual
  • DiagramFlip
  • DiagramGraphics
  • DiagramGrid
  • Diagram
  • DiagramNetwork
  • DiagramProduct
  • DiagramReverse
  • DiagramSum
  • IdentityDiagram
  • PermutationDiagram
  • PortDual
  • Port
  • PortProduct
  • RowDiagram
  • ToDiagram
Introduction to Diagrammatic Computation
The first diagram:
In[2]:=
Diagram
["f",x,y]
Out[2]=
In[3]:=
DiagramFunction

Diagram
[Plus,{x,y},{z}]//InputForm
Out[3]//InputForm=
(Sequence @@ {Indexed[#1, {1}]} & ) @* HoldForm[Plus]
In[4]:=
DiagramTensor

Diagram
[Plus,{x,y},{z}]
Out[4]=
3
Plus
In[5]:=
DiagramNetwork

Diagram
[A,b,c],
Diagram
[B,b,a],
Diagram
[C,a,b]
Out[5]=
In[6]:=
f=
Diagram
[Annotation["(2*)","Function"({2#,#+1}&)],x,{"2x","x+1"}]
Out[6]=
In[7]:=
DiagramFunction
[f][x]
Out[7]=
Sequence[2x,1+x]
In[8]:=
g=
Diagram
[Annotation["+","Function"({#1+#2,#1/#2}&)],{x,y},{"x+y","x/y"}]
Out[8]=
In[9]:=
DiagramFunction
[g][2,3]
Out[9]=
Sequence5,
2
3

In[10]:=
fg=
ColumnDiagram

PermutationDiagram
[{y,x}],g,
Diagram
[f,"x+y",{"2(x+y)","1+x+y"}]
Out[10]=
In[11]:=
DiagramFunction
[fg]
Out[11]=
Apply[Sequence][{(Sequence@@{
#1
1
,
#1
2
}&@*({2#1,#1+1}&))[#1],(Sequence@@{
#1
1
}&@*({#1}&))[#2]}]&@*(Sequence@@{
#1
1
,
#1
2
}&)@*#1+#2,
#1
#2
&@*(Sequence@@{
#1
1
,
#1
2
}&)@*(Permute[#1,Cycles[{{1,2}}]]&)@*({#1,#2}&)
In[12]:=
​​egg=
Diagram
["Crack Egg","egg",{"white","yolk"}],beat=
Diagram
["Beat",{"yolk","yolk","sugar"},"yolky paste"],​​whisk=
Diagram
["Whisk",{"white","white"},"whisked whites"],​​stir=
Diagram
["Stir",{"yolky paste","mascarpone"},"thick paste"],​​fold=
Diagram
["Fold",{"whisked whites","thick paste"},"crema di mascarpone"]​​
Out[12]=

,
,
,
,

In[13]:=
ColumnDiagram

RowDiagram
egg,egg,
IdentityDiagram
["sugar"],
RowDiagram
[{whisk,beat}]
Out[13]=
In[14]:=
ColumnDiagram

RowDiagram
[{egg,egg}],
RowDiagram
[{whisk,beat}],stir,fold
Out[14]=
""

© 2025 Wolfram. All rights reserved.

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