<?xml version="1.0" encoding="UTF-8" standalone="yes"?><oembed><version><![CDATA[1.0]]></version><provider_name><![CDATA[Azimuth]]></provider_name><provider_url><![CDATA[https://johncarlosbaez.wordpress.com]]></provider_url><author_name><![CDATA[John Baez]]></author_name><author_url><![CDATA[https://johncarlosbaez.wordpress.com/author/johncarlosbaez/]]></author_url><title><![CDATA[A Compositional Framework for Passive Linear&nbsp;Networks]]></title><type><![CDATA[link]]></type><html><![CDATA[<p>Here&#8217;s a new paper on network theory:</p>
<p>&bull; John Baez and Brendan Fong, <a href="http://arxiv.org/abs/1504.05625">A compositional framework for passive linear networks</a>.</p>
<p>While <a href="https://johncarlosbaez.wordpress.com/2015/04/23/categories-in-control-2/"> my paper with Jason Erbele</a> studies <i>signal flow diagrams</i>, this one focuses on <i>circuit diagrams</i>.  The two are different, but closely related.</p>
<p>I&#8217;ll explain their relation at the <a href="https://johncarlosbaez.wordpress.com/2015/04/04/categorical-foundations-of-network-theory/">Turin workshop</a> in May.  For now, let me just talk about this paper with Brendan.  There&#8217;s a lot in here, but let me just try to explain the main result.  It&#8217;s all about &#8216;black boxing&#8217;: hiding the details of a circuit and only remembering its behavior as seen from outside.</p>
<h3> The idea </h3>
<p>In late 1940s, just as Feynman was developing his diagrams for processes in particle physics, Eilenberg and Mac Lane initiated their work on category theory.  Over the subsequent decades, and especially in the work of Joyal and Street in the 1980s, it became clear that these developments were profoundly linked: monoidal categories have a precise graphical representation in terms of string diagrams, and conversely monoidal categories provide an algebraic foundation for the intuitions behind Feynman diagrams.  The key insight is the use of categories where morphisms describe physical processes, rather than structure-preserving maps between mathematical objects.</p>
<p>In work on fundamental physics, the cutting edge has moved from categories to higher categories.  But the same techniques have filtered into more immediate applications, particularly in computation and quantum computation.   Our paper is part of a new program of applying string diagrams to engineering, with the aim of giving diverse diagram languages a unified foundation based on category theory.</p>
<p>Indeed, even before physicists began using Feynman diagrams, various branches of engineering were using diagrams that in retrospect are closely related.   Foremost among these are the ubiquitous electrical circuit diagrams. Although less well-known, similar diagrams are used to describe networks consisting of mechanical, hydraulic, thermodynamic and chemical systems.   Further work, pioneered in particular by <a href="http://en.wikipedia.org/wiki/Jay_Wright_Forrester">Forrester</a> and <a href="http://en.wikipedia.org/wiki/Howard_T._Odum">Odum</a>, applies similar diagrammatic methods to biology, ecology, and economics.</p>
<p>As discussed in detail by <a href="https://archive.org/details/DynamicalAnalogies">Olsen</a>, <a href="http://en.wikipedia.org/wiki/Henry_Paynter">Paynter</a> and others, there are mathematically precise analogies between these different systems.  In each case, the system&#8217;s state is described by variables that come in pairs, with one variable in each pair playing the role of  &#8216;displacement&#8217; and the other playing the role of &#8216;momentum&#8217;.  In engineering, the time derivatives of these variables are sometimes called &#8216;flow&#8217; and &#8216;effort&#8217;.</p>
<table border="1" align="center">
<tr>
<td> </td>
<td><b>displacement</b>: &nbsp;&nbsp; <img src='https://s0.wp.com/latex.php?latex=q&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='q' title='q' class='latex' /></td>
<td><b>flow</b>: &nbsp; &nbsp;&nbsp; <img src='https://s0.wp.com/latex.php?latex=%5Cdot+q&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;dot q' title='&#92;dot q' class='latex' />  </td>
<td><b>momentum</b>: &nbsp;&nbsp;&nbsp;&nbsp; <img src='https://s0.wp.com/latex.php?latex=p&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='p' title='p' class='latex' /> </td>
<td><b>effort</b>: &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp; <img src='https://s0.wp.com/latex.php?latex=%5Cdot+p&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;dot p' title='&#92;dot p' class='latex' /></td>
</tr>
<tr>
<td><b>Mechanics: translation</b></td>
<td> position</td>
<td> velocity </td>
<td> momentum </td>
<td> force </td>
</tr>
<tr>
<td><b>Mechanics: rotation</b></td>
<td> angle</td>
<td> angular velocity </td>
<td> angular momentum </td>
<td> torque </td>
</tr>
<tr>
<td><b>Electronics</b></td>
<td> charge </td>
<td> current </td>
<td> flux linkage </td>
<td> voltage </td>
</tr>
<td><b>Hydraulics</b></td>
<td> volume </td>
<td> flow </td>
<td> pressure momentum </td>
<td> pressure </td>
<tr>
<td><b>Thermal Physics</b></td>
<td> entropy </td>
<td> entropy flow </td>
<td> temperature momentum </td>
<td> temperature </td>
</tr>
<tr>
<td><b>Chemistry</b></td>
<td> moles </td>
<td> molar flow </td>
<td> chemical momentum </td>
<td> chemical potential </td>
</tr>
</table>
<p>In classical mechanics, this pairing of variables is well understood using <a href="http://en.wikipedia.org/wiki/Symplectic_geometry">symplectic geometry</a>.  Thus, any mathematical formulation of the diagrams used to describe networks in engineering needs to take symplectic geometry as well as category theory into account.</p>
<p>While diagrams of networks have been independently introduced in many disciplines, we do not expect formalizing these diagrams to immediately help the practitioners of these disciplines.  At first the flow of information will mainly go in the other direction: by translating ideas from these disciplines into the language of modern mathematics, we can provide mathematicians with food for thought and interesting new problems to solve.  We hope that in the long run mathematicians can return the favor by bringing new insights to the table.</p>
<p>Although we keep the broad applicability of network diagrams in the back of our minds, our paper talks in terms of electrical circuits, for the sake of familiarity.  We also consider a somewhat limited class of circuits.  We only study circuits built from &#8216;passive&#8217; components: that is, those that do not produce energy.  Thus, we exclude batteries and current sources.  We only consider components that respond linearly to an applied voltage.   Thus, we exclude components such as nonlinear resistors or diodes.  Finally, we only consider components with one input and one output, so that a circuit can be described as a graph with edges labeled by components.  Thus, we also exclude transformers.  The most familiar components our framework covers are linear resistors, capacitors and inductors.</p>
<p>While we want to expand our scope in future work, the class of circuits made from these components has appealing mathematical properties, and is worthy of deep study.  Indeed, these circuits has been studied intensively for many decades by electrical engineers.  Even circuits made exclusively of resistors have inspired work by mathematicians of the caliber of <a href="http://math.ucr.edu/home/baez/weyl1923.pdf">Weyl</a> and <a href="https://projecteuclid.org/euclid.bams/1183548217">Smale</a>!</p>
<p>Our work relies on this research.  All we are adding is an emphasis on symplectic geometry and an explicitly &#8216;compositional&#8217; framework, which clarifies the way a larger circuit can be built from smaller pieces.  This is where monoidal categories become important: the main operations for building circuits from pieces are composition and tensoring.</p>
<p>Our strategy is most easily illustrated for circuits made of linear resistors.  Such a resistor dissipates power, turning useful energy into heat at a rate determined by the voltage across the resistor.  However, a remarkable fact is that a circuit made of these resistors always acts to <i>minimize</i> the power dissipated this way.  This &#8216;principle of minimum power&#8217; can be seen as the reason symplectic geometry becomes important in understanding circuits made of resistors, just as the principle of least action leads to the role of symplectic geometry in classical mechanics.</p>
<p>Here is a circuit made of linear resistors:</p>
<div align="center">
<img width="450" src="https://i2.wp.com/math.ucr.edu/home/baez/networks/circuits/circuit.jpg" />
</div>
<p>The wiggly lines are resistors, and their resistances are written beside them: for example, <img src='https://s0.wp.com/latex.php?latex=3%5COmega&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='3&#92;Omega' title='3&#92;Omega' class='latex' /> means 3 ohms, an &#8216;ohm&#8217; being a unit of resistance.  To formalize this, define a circuit of linear resistors to consist of:</p>
<p>&bull; a set <img src='https://s0.wp.com/latex.php?latex=N&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='N' title='N' class='latex' /> of <b>nodes</b>,<br />
&bull; a set <img src='https://s0.wp.com/latex.php?latex=E&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='E' title='E' class='latex' /> of <b>edges</b>,<br />
&bull; maps <img src='https://s0.wp.com/latex.php?latex=s%2Ct+%3A+E+%5Cto+N&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='s,t : E &#92;to N' title='s,t : E &#92;to N' class='latex' /> sending each edge to its <b>source</b> and <b>target</b> node,<br />
&bull; a map <img src='https://s0.wp.com/latex.php?latex=r%3A+E+%5Cto+%280%2C%5Cinfty%29&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='r: E &#92;to (0,&#92;infty)' title='r: E &#92;to (0,&#92;infty)' class='latex' /> specifying the <b>resistance</b> of the resistor<br />
labelling each edge,<br />
&bull; maps <img src='https://s0.wp.com/latex.php?latex=i+%3A+X+%5Cto+N%2C&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='i : X &#92;to N,' title='i : X &#92;to N,' class='latex' /> <img src='https://s0.wp.com/latex.php?latex=o+%3A+Y+%5Cto+N&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='o : Y &#92;to N' title='o : Y &#92;to N' class='latex' /> specifying the <b>inputs</b> and outputs of the circuit.</p>
<p>When we run electric current through such a circuit, each node <img src='https://s0.wp.com/latex.php?latex=n+%5Cin+N&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='n &#92;in N' title='n &#92;in N' class='latex' /> gets a <b>potential</b> <img src='https://s0.wp.com/latex.php?latex=%5Cphi%28n%29.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;phi(n).' title='&#92;phi(n).' class='latex' />  The <b>voltage</b> across an edge <img src='https://s0.wp.com/latex.php?latex=e+%5Cin+E&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='e &#92;in E' title='e &#92;in E' class='latex' /> is defined as the change in potential as we move from to the source of <img src='https://s0.wp.com/latex.php?latex=e&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='e' title='e' class='latex' /> to its target, <img src='https://s0.wp.com/latex.php?latex=%5Cphi%28t%28e%29%29+-+%5Cphi%28s%28e%29%29.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;phi(t(e)) - &#92;phi(s(e)).' title='&#92;phi(t(e)) - &#92;phi(s(e)).' class='latex' />  The <b>power</b> dissipated by the resistor on this edge is then</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cdisplaystyle%7B+%5Cfrac%7B1%7D%7Br%28e%29%7D%5Cbig%28%5Cphi%28t%28e%29%29-%5Cphi%28s%28e%29%29%5Cbig%29%5E2+%7D&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;displaystyle{ &#92;frac{1}{r(e)}&#92;big(&#92;phi(t(e))-&#92;phi(s(e))&#92;big)^2 }' title='&#92;displaystyle{ &#92;frac{1}{r(e)}&#92;big(&#92;phi(t(e))-&#92;phi(s(e))&#92;big)^2 }' class='latex' /></p>
<p>The total power dissipated by the circuit is therefore twice</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cdisplaystyle%7B+P%28%5Cphi%29+%3D+%5Cfrac%7B1%7D%7B2%7D%5Csum_%7Be+%5Cin+E%7D+%5Cfrac%7B1%7D%7Br%28e%29%7D%5Cbig%28%5Cphi%28t%28e%29%29-%5Cphi%28s%28e%29%29%5Cbig%29%5E2+%7D&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;displaystyle{ P(&#92;phi) = &#92;frac{1}{2}&#92;sum_{e &#92;in E} &#92;frac{1}{r(e)}&#92;big(&#92;phi(t(e))-&#92;phi(s(e))&#92;big)^2 }' title='&#92;displaystyle{ P(&#92;phi) = &#92;frac{1}{2}&#92;sum_{e &#92;in E} &#92;frac{1}{r(e)}&#92;big(&#92;phi(t(e))-&#92;phi(s(e))&#92;big)^2 }' class='latex' /></p>
<p>The factor of <img src='https://s0.wp.com/latex.php?latex=%5Cfrac%7B1%7D%7B2%7D&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;frac{1}{2}' title='&#92;frac{1}{2}' class='latex' /> is convenient in some later calculations.</p>
<p>Note that <img src='https://s0.wp.com/latex.php?latex=P&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='P' title='P' class='latex' /> is a nonnegative quadratic form on the vector space <img src='https://s0.wp.com/latex.php?latex=%5Cmathbb%7BR%7D%5EN.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mathbb{R}^N.' title='&#92;mathbb{R}^N.' class='latex' />  However, not every nonnegative definite quadratic form on <img src='https://s0.wp.com/latex.php?latex=%5Cmathbb%7BR%7D%5EN&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mathbb{R}^N' title='&#92;mathbb{R}^N' class='latex' /> arises in this way from some circuit of linear resistors with <img src='https://s0.wp.com/latex.php?latex=N&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='N' title='N' class='latex' /> as its set of nodes.  The quadratic forms that do arise are called <b>Dirichlet forms</b>.  They have been extensively investigated, and they play a major role in our work.</p>
<p>We write</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cpartial+N+%3D+i%28X%29+%5Ccup+o%28Y%29&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;partial N = i(X) &#92;cup o(Y)' title='&#92;partial N = i(X) &#92;cup o(Y)' class='latex' /></p>
<p>for the set of <b>terminals</b>: that is, nodes corresponding to inputs or outputs.  The principle of minimum power says that if we fix the potential at the terminals, the circuit will choose the potential at other nodes to minimize the total power dissipated.    An element <img src='https://s0.wp.com/latex.php?latex=%5Cpsi&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;psi' title='&#92;psi' class='latex' /> of the vector space <img src='https://s0.wp.com/latex.php?latex=%5Cmathbb%7BR%7D%5E%7B%5Cpartial+N%7D&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mathbb{R}^{&#92;partial N}' title='&#92;mathbb{R}^{&#92;partial N}' class='latex' /> assigns a potential to each terminal.   Thus, if we fix <img src='https://s0.wp.com/latex.php?latex=%5Cpsi%2C&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;psi,' title='&#92;psi,' class='latex' /> the total power dissipated will be twice</p>
<p><img src='https://s0.wp.com/latex.php?latex=Q%28%5Cpsi%29+%3D+%5Cmin_%7B%5Csubstack%7B+%5Cphi+%5Cin+%5Cmathbb%7BR%7D%5EN+%5C%5C+%5Cphi%5Cvert_%7B%5Cpartial+N%7D+%3D+%5Cpsi%7D%7D+%5C%3B+P%28%5Cphi%29&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='Q(&#92;psi) = &#92;min_{&#92;substack{ &#92;phi &#92;in &#92;mathbb{R}^N &#92;&#92; &#92;phi&#92;vert_{&#92;partial N} = &#92;psi}} &#92;; P(&#92;phi)' title='Q(&#92;psi) = &#92;min_{&#92;substack{ &#92;phi &#92;in &#92;mathbb{R}^N &#92;&#92; &#92;phi&#92;vert_{&#92;partial N} = &#92;psi}} &#92;; P(&#92;phi)' class='latex' /></p>
<p>The function <img src='https://s0.wp.com/latex.php?latex=Q+%3A+%5Cmathbb%7BR%7D%5E%7B%5Cpartial+N%7D+%5Cto+%5Cmathbb%7BR%7D&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='Q : &#92;mathbb{R}^{&#92;partial N} &#92;to &#92;mathbb{R}' title='Q : &#92;mathbb{R}^{&#92;partial N} &#92;to &#92;mathbb{R}' class='latex' /> is again a Dirichlet form.  We call it the <b>power functional</b> of the circuit.</p>
<p>Now, suppose we are unable to see the internal workings of a circuit, and can only observe its &#8216;external behavior&#8217;: that is, the potentials at its terminals and the currents flowing into or out of these terminals.   Remarkably, this behavior is completely determined by the power functional <img src='https://s0.wp.com/latex.php?latex=Q.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='Q.' title='Q.' class='latex' />  The reason is that the current at any terminal can be obtained by differentiating <img src='https://s0.wp.com/latex.php?latex=Q&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='Q' title='Q' class='latex' /> with respect to the potential at this terminal, and relations of this form are <i>all</i> the relations that hold between potentials and currents at the terminals.</p>
<p>The Laplace transform allows us to generalize this immediately to circuits that can also contain linear inductors and capacitors, simply by changing the field we work over, replacing <img src='https://s0.wp.com/latex.php?latex=%5Cmathbb%7BR%7D&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mathbb{R}' title='&#92;mathbb{R}' class='latex' /> by the field <img src='https://s0.wp.com/latex.php?latex=%5Cmathbb%7BR%7D%28s%29&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mathbb{R}(s)' title='&#92;mathbb{R}(s)' class='latex' /> of rational functions of a single real variable, and talking of <b>impedance</b> where we previously talked of resistance.  We obtain a category <img src='https://s0.wp.com/latex.php?latex=%5Cmathrm%7BCirc%7D&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mathrm{Circ}' title='&#92;mathrm{Circ}' class='latex' /> where an object is a finite set, a morphism <img src='https://s0.wp.com/latex.php?latex=f+%3A+X+%5Cto+Y&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='f : X &#92;to Y' title='f : X &#92;to Y' class='latex' /> is a circuit with input set <img src='https://s0.wp.com/latex.php?latex=X&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='X' title='X' class='latex' /> and output set <img src='https://s0.wp.com/latex.php?latex=Y%2C&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='Y,' title='Y,' class='latex' /> and composition is given by identifying the outputs of one circuit with the inputs of the next, and taking the resulting union of labelled graphs.  Each such circuit gives rise to a Dirichlet form, now defined over <img src='https://s0.wp.com/latex.php?latex=%5Cmathbb%7BR%7D%28s%29%2C&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mathbb{R}(s),' title='&#92;mathbb{R}(s),' class='latex' /> and this Dirichlet form completely describes the externally observable behavior of the circuit.</p>
<p>We can take equivalence classes of circuits, where two circuits count as the same if they have the same Dirichlet form.  We wish for these equivalence classes of circuits to form a category. Although there is a notion of composition for Dirichlet forms, we find that it lacks identity morphisms or, equivalently, it lacks morphisms representing ideal wires of zero impedance. To address this we turn to <a href="http://en.wikipedia.org/wiki/Symplectic_vector_space#Subspaces">Lagrangian subspaces</a> of <a href="http://en.wikipedia.org/wiki/Symplectic_vector_space">symplectic vector spaces</a>.  These generalize quadratic forms via the map</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5CBig%28Q%3A+%5Cmathbb%7BF%7D%5E%7B%5Cpartial+N%7D+%5Cto+%5Cmathbb%7BF%7D%5CBig%29+%5Clongmapsto+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;Big(Q: &#92;mathbb{F}^{&#92;partial N} &#92;to &#92;mathbb{F}&#92;Big) &#92;longmapsto ' title='&#92;Big(Q: &#92;mathbb{F}^{&#92;partial N} &#92;to &#92;mathbb{F}&#92;Big) &#92;longmapsto ' class='latex' /></p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cmathrm%7BGraph%7D%28dQ%29+%3D++++%5C%7B%28%5Cpsi%2C+dQ_%5Cpsi%29+%5Cmid+%5Cpsi+%5Cin+%5Cmathbb%7BF%7D%5E%7B%5Cpartial+N%7D+%5C%7D+%5C%3B+%5Csubseteq+%5C%3B+%5Cmathbb%7BF%7D%5E%7B%5Cpartial+N%7D+%5Coplus+%28%5Cmathbb%7BF%7D%5E%7B%5Cpartial+N%7D%29%5E%5Cast+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mathrm{Graph}(dQ) =    &#92;{(&#92;psi, dQ_&#92;psi) &#92;mid &#92;psi &#92;in &#92;mathbb{F}^{&#92;partial N} &#92;} &#92;; &#92;subseteq &#92;; &#92;mathbb{F}^{&#92;partial N} &#92;oplus (&#92;mathbb{F}^{&#92;partial N})^&#92;ast ' title='&#92;mathrm{Graph}(dQ) =    &#92;{(&#92;psi, dQ_&#92;psi) &#92;mid &#92;psi &#92;in &#92;mathbb{F}^{&#92;partial N} &#92;} &#92;; &#92;subseteq &#92;; &#92;mathbb{F}^{&#92;partial N} &#92;oplus (&#92;mathbb{F}^{&#92;partial N})^&#92;ast ' class='latex' /></p>
<p>taking a quadratic form <img src='https://s0.wp.com/latex.php?latex=Q&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='Q' title='Q' class='latex' /> on the vector space <img src='https://s0.wp.com/latex.php?latex=%5Cmathbb%7BF%7D%5E%7B%5Cpartial+N%7D&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mathbb{F}^{&#92;partial N}' title='&#92;mathbb{F}^{&#92;partial N}' class='latex' /> over the field <img src='https://s0.wp.com/latex.php?latex=%5Cmathbb%7BF%7D&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mathbb{F}' title='&#92;mathbb{F}' class='latex' /> to the graph of its differential <img src='https://s0.wp.com/latex.php?latex=dQ.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='dQ.' title='dQ.' class='latex' /> Here we think of the symplectic vector space <img src='https://s0.wp.com/latex.php?latex=%5Cmathbb%7BF%7D%5E%7B%5Cpartial+N%7D+%5Coplus+%28%5Cmathbb%7BF%7D%5E%7B%5Cpartial+N%7D%29%5E%5Cast&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mathbb{F}^{&#92;partial N} &#92;oplus (&#92;mathbb{F}^{&#92;partial N})^&#92;ast' title='&#92;mathbb{F}^{&#92;partial N} &#92;oplus (&#92;mathbb{F}^{&#92;partial N})^&#92;ast' class='latex' /> as the state space of the circuit, and the subspace <img src='https://s0.wp.com/latex.php?latex=%5Cmathrm%7BGraph%7D%28dQ%29&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mathrm{Graph}(dQ)' title='&#92;mathrm{Graph}(dQ)' class='latex' /> as the subspace of attainable states, with <img src='https://s0.wp.com/latex.php?latex=%5Cpsi+%5Cin+%5Cmathbb%7BF%7D%5E%7B%5Cpartial+N%7D&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;psi &#92;in &#92;mathbb{F}^{&#92;partial N}' title='&#92;psi &#92;in &#92;mathbb{F}^{&#92;partial N}' class='latex' /> describing the potentials at the terminals, and <img src='https://s0.wp.com/latex.php?latex=dQ_%5Cpsi+%5Cin+%28%5Cmathbb%7BF%7D%5E%7B%5Cpartial+N%7D%29%5E%5Cast&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='dQ_&#92;psi &#92;in (&#92;mathbb{F}^{&#92;partial N})^&#92;ast' title='dQ_&#92;psi &#92;in (&#92;mathbb{F}^{&#92;partial N})^&#92;ast' class='latex' /> the currents.</p>
<p>This construction is well-known in classical mechanics, where the principle of least action plays a role analogous to that of the principle of minimum power here.   The set of Lagrangian subspaces is actually an algebraic variety, the <b><a href="http://en.wikipedia.org/wiki/Lagrangian_Grassmannian">Lagrangian Grassmannian</a></b>, which serves as a compactification of the space of quadratic forms.  The Lagrangian Grassmannian has already played a role in <a href="http://arxiv.org/abs/math-ph/0304015">Sabot&#8217;s work</a> on circuits made of resistors. For us, its importance it that we can find identity morphisms for the composition of Dirichlet forms by taking circuits made of parallel resistors and letting their resistances tend to zero: the limit is not a Dirichlet form, but it exists in the Lagrangian Grassmannian.</p>
<p>Indeed, there exists a category <img src='https://s0.wp.com/latex.php?latex=%5Cmathrm%7BLagrRel%7D&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mathrm{LagrRel}' title='&#92;mathrm{LagrRel}' class='latex' /> with finite dimensional symplectic vector spaces as objects and <b>Lagrangian relations</b> as morphisms: that is, linear relations from <img src='https://s0.wp.com/latex.php?latex=V&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='V' title='V' class='latex' /> to <img src='https://s0.wp.com/latex.php?latex=W&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='W' title='W' class='latex' /> that are given by Lagrangian subspaces of <img src='https://s0.wp.com/latex.php?latex=%5Coverline%7BV%7D+%5Coplus+W%2C&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;overline{V} &#92;oplus W,' title='&#92;overline{V} &#92;oplus W,' class='latex' /> where <img src='https://s0.wp.com/latex.php?latex=%5Coverline%7BV%7D&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;overline{V}' title='&#92;overline{V}' class='latex' /> is the symplectic vector space <b>conjugate</b> to <img src='https://s0.wp.com/latex.php?latex=V&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='V' title='V' class='latex' />&#8212;that is, with the sign of the symplectic structure switched.</p>
<p>To move from the Lagrangian subspace defined by the graph of the differential of the power functional to a morphism in the category <img src='https://s0.wp.com/latex.php?latex=%5Cmathrm%7BLagrRel%7D&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mathrm{LagrRel}' title='&#92;mathrm{LagrRel}' class='latex' />&#8212;that is, to a Lagrangian relation&#8212; we must treat seriously the input and output functions of the circuit. These express the circuit as built upon a <a href="http://ncatlab.org/nlab/show/cospan">cospan</a>:</p>
<div align="center">
<img src="https://i1.wp.com/math.ucr.edu/home/baez/networks/circuits/cospan.jpg" />
</div>
<p>Applicable far more broadly than this present formalization of circuits, cospans model systems with two &#8216;ends&#8217;, an input and output end, albeit without any connotation of directionality: we might just as well exchange the role of the inputs and outputs by taking the mirror image of the above diagram. The role of the input and output functions, as we have discussed, is to mark the terminals we may glue onto the terminals of another circuit, and the pushout of cospans gives formal precision to this gluing construction.</p>
<p>One upshot of this cospan framework is that we may consider circuits with elements of <img src='https://s0.wp.com/latex.php?latex=N&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='N' title='N' class='latex' /> that are both inputs and outputs, such as this one:</p>
<div align="center">
<img src="https://i2.wp.com/math.ucr.edu/home/baez/networks/circuits/identity_circuit.jpg" />
</div>
<p>This corresponds to the identity morphism on the finite set with two elements. Another is that some points may be considered an input or output multiple times, like here:</p>
<div align="center">
<img src="https://i1.wp.com/math.ucr.edu/home/baez/networks/circuits/degenerate_circuit.jpg" />
</div>
<p>This lets to connect two distinct outputs to the above double input.</p>
<p>Given a set <img src='https://s0.wp.com/latex.php?latex=X&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='X' title='X' class='latex' /> of inputs or outputs, we understand the electrical behavior on this set  by considering the symplectic vector space <img src='https://s0.wp.com/latex.php?latex=%5Cmathbb%7BF%7D%5EX+%5Coplus+%7B%28%5Cmathbb%7BF%7D%5EX%29%7D%5E%5Cast%2C&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mathbb{F}^X &#92;oplus {(&#92;mathbb{F}^X)}^&#92;ast,' title='&#92;mathbb{F}^X &#92;oplus {(&#92;mathbb{F}^X)}^&#92;ast,' class='latex' /> the direct sum of the space <img src='https://s0.wp.com/latex.php?latex=%5Cmathbb%7BF%7D%5EX&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mathbb{F}^X' title='&#92;mathbb{F}^X' class='latex' /> of potentials and the space <img src='https://s0.wp.com/latex.php?latex=%7B%28%5Cmathbb%7BF%7D%5EX%29%7D%5E%5Cast&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='{(&#92;mathbb{F}^X)}^&#92;ast' title='{(&#92;mathbb{F}^X)}^&#92;ast' class='latex' /> of currents at these points. A Lagrangian relation specifies which states of the output space <img src='https://s0.wp.com/latex.php?latex=%5Cmathbb%7BF%7D%5EY+%5Coplus+%7B%28%5Cmathbb%7BF%7D%5EY%29%7D%5E%5Cast&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mathbb{F}^Y &#92;oplus {(&#92;mathbb{F}^Y)}^&#92;ast' title='&#92;mathbb{F}^Y &#92;oplus {(&#92;mathbb{F}^Y)}^&#92;ast' class='latex' /> are allowed for each state of the input space <img src='https://s0.wp.com/latex.php?latex=%5Cmathbb%7BF%7D%5EX+%5Coplus+%7B%28%5Cmathbb%7BF%7D%5EX%29%7D%5E%5Cast.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mathbb{F}^X &#92;oplus {(&#92;mathbb{F}^X)}^&#92;ast.' title='&#92;mathbb{F}^X &#92;oplus {(&#92;mathbb{F}^X)}^&#92;ast.' class='latex' /> Turning the Lagrangian subspace <img src='https://s0.wp.com/latex.php?latex=%5Cmathrm%7BGraph%7D%28dQ%29&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mathrm{Graph}(dQ)' title='&#92;mathrm{Graph}(dQ)' class='latex' /> of a circuit into this information requires that we understand the &#8216;symplectification&#8217;</p>
<p><img src='https://s0.wp.com/latex.php?latex=Sf%3A+%5Cmathbb%7BF%7D%5EB+%5Coplus+%7B%28%5Cmathbb%7BF%7D%5EB%29%7D%5E%5Cast+%5Cto+%5Cmathbb%7BF%7D%5EA+%5Coplus+%7B%28%5Cmathbb%7BF%7D%5EA%29%7D%5E%5Cast&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='Sf: &#92;mathbb{F}^B &#92;oplus {(&#92;mathbb{F}^B)}^&#92;ast &#92;to &#92;mathbb{F}^A &#92;oplus {(&#92;mathbb{F}^A)}^&#92;ast' title='Sf: &#92;mathbb{F}^B &#92;oplus {(&#92;mathbb{F}^B)}^&#92;ast &#92;to &#92;mathbb{F}^A &#92;oplus {(&#92;mathbb{F}^A)}^&#92;ast' class='latex' /></p>
<p>and &#8216;twisted symplectification&#8217;</p>
<p><img src='https://s0.wp.com/latex.php?latex=S%5Etf%3A+%5Cmathbb%7BF%7D%5EB+%5Coplus+%7B%28%5Cmathbb%7BF%7D%5EB%29%7D%5E%5Cast+%5Cto+%5Coverline%7B%5Cmathbb%7BF%7D%5EA+%5Coplus+%7B%28%5Cmathbb%7BF%7D%5EA%29%7D%5E%5Cast%7D&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='S^tf: &#92;mathbb{F}^B &#92;oplus {(&#92;mathbb{F}^B)}^&#92;ast &#92;to &#92;overline{&#92;mathbb{F}^A &#92;oplus {(&#92;mathbb{F}^A)}^&#92;ast}' title='S^tf: &#92;mathbb{F}^B &#92;oplus {(&#92;mathbb{F}^B)}^&#92;ast &#92;to &#92;overline{&#92;mathbb{F}^A &#92;oplus {(&#92;mathbb{F}^A)}^&#92;ast}' class='latex' /></p>
<p>of a function <img src='https://s0.wp.com/latex.php?latex=f%3A+A+%5Cto+B&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='f: A &#92;to B' title='f: A &#92;to B' class='latex' /> between finite sets. In particular we need to understand how these apply to the input and output functions with codomain restricted to <img src='https://s0.wp.com/latex.php?latex=%5Cpartial+N&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;partial N' title='&#92;partial N' class='latex' />; abusing notation, we also write these <img src='https://s0.wp.com/latex.php?latex=i%3A+X+%5Cto+%5Cpartial+N&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='i: X &#92;to &#92;partial N' title='i: X &#92;to &#92;partial N' class='latex' /> and <img src='https://s0.wp.com/latex.php?latex=o%3A+Y+%5Cto+%5Cpartial+N.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='o: Y &#92;to &#92;partial N.' title='o: Y &#92;to &#92;partial N.' class='latex' /></p>
<p>The <b>symplectification</b> <img src='https://s0.wp.com/latex.php?latex=Sf&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='Sf' title='Sf' class='latex' /> is a Lagrangian relation, and the catch phrase is that it &#8216;copies voltages&#8217; and &#8216;splits currents&#8217;. More precisely, for any given potential-current pair <img src='https://s0.wp.com/latex.php?latex=%28%5Cpsi%2C%5Ciota%29&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='(&#92;psi,&#92;iota)' title='(&#92;psi,&#92;iota)' class='latex' /> in <img src='https://s0.wp.com/latex.php?latex=%5Cmathbb%7BF%7D%5EB+%5Coplus+%7B%28%5Cmathbb%7BF%7D%5EB%29%7D%5E%5Cast%2C&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mathbb{F}^B &#92;oplus {(&#92;mathbb{F}^B)}^&#92;ast,' title='&#92;mathbb{F}^B &#92;oplus {(&#92;mathbb{F}^B)}^&#92;ast,' class='latex' /> its image under <img src='https://s0.wp.com/latex.php?latex=Sf&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='Sf' title='Sf' class='latex' /> consists of all elements of <img src='https://s0.wp.com/latex.php?latex=%28%5Cpsi%27%2C+%5Ciota%27%29&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='(&#92;psi&#039;, &#92;iota&#039;)' title='(&#92;psi&#039;, &#92;iota&#039;)' class='latex' /> in <img src='https://s0.wp.com/latex.php?latex=%5Cmathbb%7BF%7D%5EA+%5Coplus+%7B%28%5Cmathbb%7BF%7D%5EA%29%7D%5E%5Cast&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mathbb{F}^A &#92;oplus {(&#92;mathbb{F}^A)}^&#92;ast' title='&#92;mathbb{F}^A &#92;oplus {(&#92;mathbb{F}^A)}^&#92;ast' class='latex' />  such that the potential at <img src='https://s0.wp.com/latex.php?latex=a+%5Cin+A&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='a &#92;in A' title='a &#92;in A' class='latex' /> is equal to the potential at <img src='https://s0.wp.com/latex.php?latex=f%28a%29+%5Cin+B%2C&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='f(a) &#92;in B,' title='f(a) &#92;in B,' class='latex' /> and such that, for each fixed <img src='https://s0.wp.com/latex.php?latex=b+%5Cin+B%2C&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='b &#92;in B,' title='b &#92;in B,' class='latex' /> collectively the currents at the <img src='https://s0.wp.com/latex.php?latex=a+%5Cin+f%5E%7B-1%7D%28b%29&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='a &#92;in f^{-1}(b)' title='a &#92;in f^{-1}(b)' class='latex' /> sum to the current at <img src='https://s0.wp.com/latex.php?latex=b.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='b.' title='b.' class='latex' />  We use the symplectification <img src='https://s0.wp.com/latex.php?latex=So&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='So' title='So' class='latex' /> of the output function to relate the state on <img src='https://s0.wp.com/latex.php?latex=%5Cpartial+N&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;partial N' title='&#92;partial N' class='latex' /> to that on the outputs <img src='https://s0.wp.com/latex.php?latex=Y.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='Y.' title='Y.' class='latex' /></p>
<p>As our current framework is set up to report the current <i>out</i> of each node, to describe input currents we define the <b>twisted symplectification</b>:</p>
<p><img src='https://s0.wp.com/latex.php?latex=S%5Etf%3A+%5Cmathbb%7BF%7D%5EB+%5Coplus+%7B%28%5Cmathbb%7BF%7D%5EB%29%7D%5E%5Cast+%5Cto+%5Coverline%7B%5Cmathbb%7BF%7D%5EA+%5Coplus+%7B%28%5Cmathbb%7BF%7D%5EA%29%7D%5E%5Cast%7D&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='S^tf: &#92;mathbb{F}^B &#92;oplus {(&#92;mathbb{F}^B)}^&#92;ast &#92;to &#92;overline{&#92;mathbb{F}^A &#92;oplus {(&#92;mathbb{F}^A)}^&#92;ast}' title='S^tf: &#92;mathbb{F}^B &#92;oplus {(&#92;mathbb{F}^B)}^&#92;ast &#92;to &#92;overline{&#92;mathbb{F}^A &#92;oplus {(&#92;mathbb{F}^A)}^&#92;ast}' class='latex' /></p>
<p>almost identically to the above, except that we flip the sign of the currents <img src='https://s0.wp.com/latex.php?latex=%5Ciota%27+%5Cin+%28%5Cmathbb%7BF%7D%5EA%29%5E%5Cast.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;iota&#039; &#92;in (&#92;mathbb{F}^A)^&#92;ast.' title='&#92;iota&#039; &#92;in (&#92;mathbb{F}^A)^&#92;ast.' class='latex' />  This again gives a Lagrangian relation. We use the twisted symplectification <img src='https://s0.wp.com/latex.php?latex=S%5Eti&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='S^ti' title='S^ti' class='latex' /> of the input function to relate the state on <img src='https://s0.wp.com/latex.php?latex=%5Cpartial+N&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;partial N' title='&#92;partial N' class='latex' /> to that on the inputs.</p>
<p>The Lagrangian relation corresponding to a circuit then comprises exactly a list of the potential-current pairs that are possible electrical states of the inputs and outputs of the circuit. In doing so, it identifies distinct circuits.  A simple example of this is the identification of a single 2-ohm resistor:</p>
<div align="center">
<img width="350" src="https://i0.wp.com/math.ucr.edu/home/baez/networks/circuits/one-resistor_circuit.jpg" />
</div>
<p>with two 1-ohm resistors in series:</p>
<div align="center">
<img width="450" src="https://i0.wp.com/math.ucr.edu/home/baez/networks/circuits/two-resistor_circuit.jpg" />
</div>
<p>Our inability to access the internal workings of a circuit in this representation inspires us to call this process <b>black boxing</b>: you should imagine encasing the circuit in an opaque black box, leaving only the terminals accessible. Fortunately, this information is enough to completely characterize the external behavior of a circuit, including how it interacts when connected with other circuits!</p>
<p>Put more precisely, the black boxing process is <i>functorial</i>: we can  compute the black-boxed version of a circuit made of parts by computing the black-boxed versions of the parts and then composing them.   In fact we shall  prove that <img src='https://s0.wp.com/latex.php?latex=%5Cmathrm%7BCirc%7D&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mathrm{Circ}' title='&#92;mathrm{Circ}' class='latex' /> and <img src='https://s0.wp.com/latex.php?latex=%5Cmathrm%7BLagrRel%7D&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mathrm{LagrRel}' title='&#92;mathrm{LagrRel}' class='latex' /> are dagger compact categories, and the black box functor preserves all this extra structure:</p>
<p><b>Theorem.</b> There exists a symmetric monoidal dagger functor, the <b>black box functor</b></p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cblacksquare%3A+%5Cmathrm%7BCirc%7D+%5Cto+%5Cmathrm%7BLagrRel%7D&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;blacksquare: &#92;mathrm{Circ} &#92;to &#92;mathrm{LagrRel}' title='&#92;blacksquare: &#92;mathrm{Circ} &#92;to &#92;mathrm{LagrRel}' class='latex' /></p>
<p>mapping a finite set <img src='https://s0.wp.com/latex.php?latex=X&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='X' title='X' class='latex' /> to the symplectic vector space <img src='https://s0.wp.com/latex.php?latex=%5Cmathbb%7BF%7D%5EX+%5Coplus+%28%5Cmathbb%7BF%7D%5EX%29%5E%5Cast&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mathbb{F}^X &#92;oplus (&#92;mathbb{F}^X)^&#92;ast' title='&#92;mathbb{F}^X &#92;oplus (&#92;mathbb{F}^X)^&#92;ast' class='latex' /> it generates, and a circuit <img src='https://s0.wp.com/latex.php?latex=%5Cbig%28%28N%2CE%2Cs%2Ct%2Cr%29%2Ci%2Co%5Cbig%29&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;big((N,E,s,t,r),i,o&#92;big)' title='&#92;big((N,E,s,t,r),i,o&#92;big)' class='latex' /> to the Lagrangian relation</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cbigcup_%7Bv+%5Cin+%5Cmathrm%7BGraph%7D%28dQ%29%7D+S%5Eti%28v%29+%5Ctimes+So%28v%29++++++%5Csubseteq+%5Coverline%7B%5Cmathbb%7BF%7D%5EX+%5Coplus+%28%5Cmathbb%7BF%7D%5EX%29%5E%5Cast%7D+%5Coplus+%5Cmathbb%7BF%7D%5EY+%5Coplus+%28%5Cmathbb%7BF%7D%5EY%29%5E%5Cast&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;bigcup_{v &#92;in &#92;mathrm{Graph}(dQ)} S^ti(v) &#92;times So(v)      &#92;subseteq &#92;overline{&#92;mathbb{F}^X &#92;oplus (&#92;mathbb{F}^X)^&#92;ast} &#92;oplus &#92;mathbb{F}^Y &#92;oplus (&#92;mathbb{F}^Y)^&#92;ast' title='&#92;bigcup_{v &#92;in &#92;mathrm{Graph}(dQ)} S^ti(v) &#92;times So(v)      &#92;subseteq &#92;overline{&#92;mathbb{F}^X &#92;oplus (&#92;mathbb{F}^X)^&#92;ast} &#92;oplus &#92;mathbb{F}^Y &#92;oplus (&#92;mathbb{F}^Y)^&#92;ast' class='latex' /></p>
<p>where <img src='https://s0.wp.com/latex.php?latex=Q&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='Q' title='Q' class='latex' /> is the circuit&#8217;s power functional.</p>
<p>The goal of this paper is to prove and explain this result.  The proof is more tricky than one might first expect, but our approach involves concepts that should be useful throughout the study of networks, such as &#8216;decorated cospans&#8217; and &#8216;corelations&#8217;.</p>
<p>Give it a read, and let us know if you have questions or find mistakes!</p>
]]></html><thumbnail_url><![CDATA[https://i2.wp.com/math.ucr.edu/home/baez/networks/circuits/circuit.jpg?fit=440%2C330]]></thumbnail_url><thumbnail_height><![CDATA[112]]></thumbnail_height><thumbnail_width><![CDATA[440]]></thumbnail_width></oembed>