Install
Install
In[]:=
PacletInstall["https://www.wolframcloud.com/obj/nikm/ProcessTheoryLoader.paclet",ForceVersionInstall->True]
Out[]=
PacletObject
In[]:=
<<ProcessTheoryLoader`
Updates
Updates
* Diagram port frames
* Port mutation: DiagramSplit, DiagramPermute, DiagramAssignPorts
* DiagramCases, DiagramPattern
* SimplifyDiagram
* DiagramFunction
* TensorDiagram/DiagramTensor
* SingletonDiagram
* Neutral and Power ports
* Port mutation: DiagramSplit, DiagramPermute, DiagramAssignPorts
* DiagramCases, DiagramPattern
* SimplifyDiagram
* DiagramFunction
* TensorDiagram/DiagramTensor
* SingletonDiagram
* Neutral and Power ports
Port
Port
In[]:=
Port[a]
Out[]=
a
In[]:=
Port[a⊗b]
Out[]=
a⊗b
In[]:=
Port[a⊕b]
Out[]=
a⊕b
In[]:=
Port[a⊕]
*
b
Out[]=
a⊕
*
b
Diagrams
Diagrams
Name (Function/Data/Layer/SystemModel/...) + Inputs + Outputs:
In[]:=
Diagram[A,x,y]
Out[]=
In[]:=
PortDual@PortDual[a]
Out[]=
a
In[]:=
Diagram[A,{,b},{x,y,z}]
*
a
Out[]=
Port,
*
b
*
T.
Port[y]
Port overwriting:
In[]:=
Diagram[Diagram[A,a,b],{1,2,3},{x,y}]
Out[]=
Customizable graphics:
In[]:=
Diagram[A,x,y,"Shape"->"Circle","PortLabels"->{Placed["X",{-0.5,1}],"Y"},"PortArrows"->{Placed[Red,Left],Automatic},"Width"->1,"Height"->2,"Angle"->Pi/4,"Outline"->True,"ShowLabel"->False,"LabelFunction"->(Style[#["Name"],Bold]&)]
Out[]=
In[]:=
Diagram[A,x,y,"Shape"->"Wire","PortLabels"->{Placed["X",{-0.5,1}],"Y"},"PortArrows"->{Placed[Red,Left],Automatic},"Width"->1,"Height"->2,"Angle"->Pi/4,"Outline"->True,"ShowLabel"->False,"LabelFunction"->(Style[#["Name"],Bold]&)]
Out[]=
DiagramComposition[Diagram[B,y,z],Diagram[A,x,y,"Shape"->"Wire","PortLabels"->{Placed["X",{-0.5,1}],"Y"},"PortArrows"->{Placed[Red,Left],Automatic},"Width"->1,"Height"->2,"Angle"->Pi/4,"Outline"->False,"ShowLabel"->False,"LabelFunction"->(Style[#["Name"],Bold]&)]]
Out[]=
Unary operations
Unary operations
In[]:=
Diagram[A,{x,y},z]
Out[]=
In[]:=
DiagramFlip[Diagram[A,{x,y},z]]
Out[]=
In[]:=
DiagramReverse[Diagram[A,{a,b},{c,d}]]
Out[]=
In[]:=
DiagramDual[Diagram[A,{a,b},{c,d}]]
Out[]=
Diagram composition
Diagram composition
Monoidal product ⊗ (horizontal composition):
In[]:=
DiagramProduct[Diagram[A,a,b],Diagram[B,x]]
Out[]=
Categorical composition (vertical composition):
Diagram sum:
Network:
“PortFunction” specifies how ports should be connected when composed:
“PortFunction” is used to identify ports and can be used to define general connections (should only return HoldForm for now):
ColumnDiagram, RowDiagram and DiagramGrid
ColumnDiagram, RowDiagram and DiagramGrid
ColumnDiagram and RowDiagram arranges diagrams into a grid by introducing wire nodes:
Alignment- Right | Left | Center | Scaled | “Circuit” | x
Dividers - True | False | All
“Outline” - True | False
“Rotate” - Left | Right | Up | Down | angle
“VerticalGapSize”
“HorizontalGapSize”
“Width”
“Height”
“Frames”
Dividers - True | False | All
“Outline” - True | False
“Rotate” - Left | Right | Up | Down | angle
“VerticalGapSize”
“HorizontalGapSize”
“Width”
“Height”
“Frames”
Frames (unmatched ports displayed as wrapping frame automatically):
DiagramCases
DiagramCases
SimplifyDiagram
SimplifyDiagram
Turning network diagram to grid arranged diagrams and back introduces extra wire nodes:
SimplifyDiagram removes wire nodes:
Network options
Network options
“BinarySpiders” - True | False | All
“UnarySpiders”
“RemoveCycles”
“ShowPortLabels”
“ShowWireLabels”
“Scale”
“ArrowSize”
“SpiderRadius”
“Orientation”
“UnarySpiders”
“RemoveCycles”
“ShowPortLabels”
“ShowWireLabels”
“Scale”
“ArrowSize”
“SpiderRadius”
“Orientation”
Grid + Network
Grid + Network
DiagramDraw
DiagramDraw
ToDiagram
ToDiagram
Graph:
Hypergraph:
DiagramTensor
DiagramTensor
TensorDiagram
TensorDiagram
DiagramFunction
DiagramFunction
() : ()
HVM
HVM