<?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 Markov&nbsp;Processes]]></title><type><![CDATA[link]]></type><html><![CDATA[<p>&nbsp;</p>
<div align="center"><a href="http://math.ucr.edu/home/baez/students/blake-brendan_big.jpg"><img width="450" src="https://i1.wp.com/math.ucr.edu/home/baez/students/blake-brendan.jpg" /><br />
</a></div>
<p>This summer my students <a href="http://www.cs.ox.ac.uk/people/brendan.fong/">Brendan Fong</a> and <a href="http://www.azimuthproject.org/azimuth/show/Blake+Pollard">Blake Pollard</a> visited me at the <a href="http://www.quantumlah.org/">Centre for Quantum Technologies</a>, and we figured out how to understand <i>open</i> continuous-time Markov chains!  I think this is a nice step towards understanding the math of living systems.</p>
<p>Admittedly, it&#8217;s just a small first step.  But I&#8217;m excited by this step, since Blake and I have been trying to get this stuff to work for a couple years, and it finally fell into place.  And we think we know what to do next.</p>
<p>Here&#8217;s our paper:</p>
<p>&bull; John C. Baez, Brendan Fong and Blake S. Pollard, <a href="http://arxiv.org/abs/1508.06448">A compositional framework for open Markov processes</a>.</p>
<p>And here&#8217;s the basic idea&#8230;</p>
<h3> Open detailed balanced Markov processes </h3>
<p>A <a href="https://en.wikipedia.org/wiki/Continuous-time_Markov_chain">continuous-time Markov chain</a> is a way to specify the dynamics of a population which is spread across some finite set of states. Population can flow between the states. The larger the population of a state, the more rapidly population flows out of the state.  Because of this property, under certain conditions the populations of the states tend toward an equilibrium where at any state the inflow of population is balanced by its outflow.</p>
<p>In applications to statistical mechanics, we are often interested in equilibria such that for any two states connected by an edge, say <img src='https://s0.wp.com/latex.php?latex=i&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='i' title='i' class='latex' /> and <img src='https://s0.wp.com/latex.php?latex=j%2C&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='j,' title='j,' class='latex' /> the flow from <img src='https://s0.wp.com/latex.php?latex=i&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='i' title='i' class='latex' /> to <img src='https://s0.wp.com/latex.php?latex=j&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='j' title='j' class='latex' /> equals the flow from <img src='https://s0.wp.com/latex.php?latex=j&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='j' title='j' class='latex' /> to <img src='https://s0.wp.com/latex.php?latex=i.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='i.' title='i.' class='latex' />  A continuous-time Markov chain with a chosen equilibrium having this property is called &#8216;<a href="https://en.wikipedia.org/wiki/Detailed_balance">detailed balanced</a>&#8216;.</p>
<p>I&#8217;m getting tired of saying &#8216;continuous-time Markov chain&#8217;, so from now on I&#8217;ll just say &#8216;Markov process&#8217;, just because it&#8217;s shorter.  Okay?  That will let me say the next sentence without running out of breath:</p>
<p>Our paper is about <i>open</i> detailed balanced Markov processes.</p>
<p>Here&#8217;s an example:</p>
<div align="center">
<img width="450" src="https://i2.wp.com/math.ucr.edu/home/baez/mathematical/compositional_markov/open_markov_process_1.png" /></div>
<p>The detailed balanced Markov process itself consists of a finite set of states together with a finite set of edges between them, with each state <img src='https://s0.wp.com/latex.php?latex=i&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='i' title='i' class='latex' /> labelled by an equilibrium population <img src='https://s0.wp.com/latex.php?latex=q_i+%3E0%2C&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='q_i &gt;0,' title='q_i &gt;0,' class='latex' /> and each edge <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' /> labelled by a rate constant <img src='https://s0.wp.com/latex.php?latex=r_e+%3E+0.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='r_e &gt; 0.' title='r_e &gt; 0.' class='latex' /></p>
<p>These populations and rate constants are required to obey an equation called the &#8216;detailed balance condition&#8217;.  This equation means that in equilibrium, the flow from <img src='https://s0.wp.com/latex.php?latex=i&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='i' title='i' class='latex' /> to <img src='https://s0.wp.com/latex.php?latex=j&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='j' title='j' class='latex' /> equal the flow from <img src='https://s0.wp.com/latex.php?latex=j&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='j' title='j' class='latex' /> to <img src='https://s0.wp.com/latex.php?latex=i.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='i.' title='i.' class='latex' />  Do you see how it works in this example?</p>
<p>To get an &#8216;open&#8217; detailed balanced Markov process, some states are designated as inputs or outputs.  In general each state may be specified as both an input and an output, or as inputs and outputs multiple times.  See how that&#8217;s happening in this example?  It may seem weird, but it makes things work better.</p>
<p>People usually say Markov processes are all about how <i>probabilities</i> flow from one state to another.  But we work with un-normalized probabilities, which we call &#8216;populations&#8217;, rather than probabilities that must sum to 1.  The reason is that in an <i>open</i> Markov process, probability is not conserved: it can flow in or out at the inputs and outputs.  We allow it to flow both in and out at both the input states and the output states.</p>
<p>Our most fundamental result is that there&#8217;s a category <img src='https://s0.wp.com/latex.php?latex=%5Cmathrm%7BDetBalMark%7D&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mathrm{DetBalMark}' title='&#92;mathrm{DetBalMark}' class='latex' /> where a morphism is an open detailed balanced Markov process.  We think of it as a morphism from its inputs to its outputs.</p>
<p>We compose morphisms in <img src='https://s0.wp.com/latex.php?latex=%5Cmathrm%7BDetBalMark%7D&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mathrm{DetBalMark}' title='&#92;mathrm{DetBalMark}' class='latex' /> by identifying the output states of one open detailed balanced Markov process with the input states of another. The populations of identified states must match. For example, we may compose this morphism <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' />:</p>
<div align="center">
<img width="450" src="https://i2.wp.com/math.ucr.edu/home/baez/mathematical/compositional_markov/open_markov_process_2.png" /></div>
<p>with the previously shown morphism <img src='https://s0.wp.com/latex.php?latex=M&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='M' title='M' class='latex' /> to get this morphism <img src='https://s0.wp.com/latex.php?latex=M+%5Ccirc+N&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='M &#92;circ N' title='M &#92;circ N' class='latex' />:</p>
<div align="center">
<img width="450" src="https://i2.wp.com/math.ucr.edu/home/baez/mathematical/compositional_markov/composite_open_markov_process.png" /></div>
<p>And here&#8217;s our second most fundamental result: the category <img src='https://s0.wp.com/latex.php?latex=%5Cmathrm%7BDetBalMark%7D&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mathrm{DetBalMark}' title='&#92;mathrm{DetBalMark}' class='latex' /> is actually a <a href="https://en.wikipedia.org/wiki/Dagger_compact_category">dagger compact category</a>. This lets us do other stuff with open Markov processes. An important one is &#8216;tensoring&#8217;, which lets us take two open Markov processes like <img src='https://s0.wp.com/latex.php?latex=M&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='M' title='M' class='latex' /> and <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' /> above and set them side by side, giving <img src='https://s0.wp.com/latex.php?latex=M+%5Cotimes+N&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='M &#92;otimes N' title='M &#92;otimes N' class='latex' />:</p>
<div align="center">
<img width="450" src="https://i1.wp.com/math.ucr.edu/home/baez/mathematical/compositional_markov/tensored_open_markov_process.png" /></div>
<p>The so-called <a href="https://en.wikipedia.org/wiki/Compact_closed_category">compactness</a> is also important. This means we can take some inputs of an open Markov process and turn them into outputs, or vice versa. For example, using the compactness of <img src='https://s0.wp.com/latex.php?latex=%5Cmathrm%7BDetBalMark%7D&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mathrm{DetBalMark}' title='&#92;mathrm{DetBalMark}' class='latex' /> we can get this open Markov process from <img src='https://s0.wp.com/latex.php?latex=M&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='M' title='M' class='latex' />:</p>
<div align="center">
<img width="450" src="https://i0.wp.com/math.ucr.edu/home/baez/mathematical/compositional_markov/dualized_open_markov_process.png" /></div>
<p>In fact all the categories in our paper are dagger compact categories, and all our functors preserve this structure.  Dagger compact categories are a well-known framework for describing systems with inputs and outputs, so this is good.</p>
<h3> The analogy to electrical circuits </h3>
<p>In a detailed balanced Markov process, population can flow along edges.  In the detailed balanced equilibrium, without any flow of population from outside, the flow along from state <img src='https://s0.wp.com/latex.php?latex=i&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='i' title='i' class='latex' /> to state <img src='https://s0.wp.com/latex.php?latex=j&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='j' title='j' class='latex' /> will be matched by the flow back from <img src='https://s0.wp.com/latex.php?latex=j&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='j' title='j' class='latex' /> to <img src='https://s0.wp.com/latex.php?latex=i.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='i.' title='i.' class='latex' />   The populations need to take specific values for this to occur.</p>
<p>In an electrical circuit made of linear resistors, charge can flow along wires.  In equilibrium, without any driving voltage from outside, the current along each wire will be zero.   The potentials will be equal at every node.</p>
<p>This sets up an analogy between detailed balanced continuous-time Markov chains and electrical circuits made of linear resistors!  I love analogy charts, so this makes me very happy:</p>
<div align="center">
<table border="1">
<tr>
<td align="center"><b>&nbsp; &nbsp; Circuits&nbsp; &nbsp; </b></td>
<td align="center"><b>Detailed balanced Markov processes</b></td>
</tr>
<tr>
<td align="center">potential</td>
<td align="center">population</td>
</tr>
<tr>
<td align="center">current</td>
<td align="center">flow</td>
</tr>
<tr>
<td align="center">conductance</td>
<td align="center">rate constant</td>
</tr>
<tr>
<td align="center">power</td>
<td align="center">dissipation</td>
</tr>
</table>
</div>
<p>This analogy is already well known.  Schnakenberg used it in his book <i>Thermodynamic Network Analysis of Biological Systems</i>.   So, our main goal is to formalize and exploit it.  This analogy extends from systems in equilibrium to the more interesting case of nonequilibrium steady states, which are the main topic of our paper.</p>
<p><a href="https://johncarlosbaez.wordpress.com/2015/04/28/a-compositional-framework-for-passive-linear-networks/">Earlier</a>, Brendan and I introduced a way to &#8216;black box&#8217; a circuit and define the relation it determines between potential-current pairs at the input and output terminals.  This relation describes the circuit&#8217;s external behavior as seen by an observer who can only perform measurements at the terminals.</p>
<p>An important fact is that black boxing is &#8216;compositional&#8217;: if one builds a circuit from smaller pieces, the external behavior of the whole circuit can be determined from the external behaviors of the pieces.  For category theorists, this means that black boxing is a functor!</p>
<p>Our new paper with Blake develops a similar &#8216;black box functor&#8217; for detailed balanced Markov processes, and relates it to the earlier one for circuits.</p>
<p>When you black box a detailed balanced Markov process, you get the relation between population&#8211;flow pairs at the terminals.  (By the &#8216;flow at a terminal&#8217;, we more precisely mean the net population outflow.)  This relation holds not only in equilibrium, but also in any nonequilibrium steady state.  Thus, <i>black boxing an open detailed balanced Markov process gives its steady state dynamics as seen by an observer who can only measure populations and flows at the terminals</i>.</p>
<h3> The principle of minimum dissipation </h3>
<p>At least since the work of Prigogine, it&#8217;s been widely accepted that a large class of systems minimize entropy production in a nonequilibrium steady state.  But people still fight about the the precise boundary of this class of systems, and even the meaning of this &#8216;principle of minimum entropy production&#8217;.</p>
<p>For detailed balanced open Markov processes, we show that a quantity we call the &#8216;dissipation&#8217; is minimized in any steady state.  This is a quadratic function of the populations and flows, analogous to the power dissipation of a circuit made of resistors.  We make no claim that this quadratic function actually deserves to be called &#8216;entropy production&#8217;.  Indeed, <a href="http://journals.aps.org/rmp/abstract/10.1103/RevModPhys.48.571">Schnakenberg</a> has convincingly argued that they are only approximately equal.</p>
<p>But still, the &#8216;dissipation&#8217; function is very natural and useful&mdash;and Prigogine&#8217;s so-called &#8216;entropy production&#8217; is also a quadratic function.</p>
<h3> Black boxing </h3>
<p>I&#8217;ve already mentioned the category <img src='https://s0.wp.com/latex.php?latex=%5Cmathrm%7BDetBalMark%7D%2C&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mathrm{DetBalMark},' title='&#92;mathrm{DetBalMark},' class='latex' /> where a morphism is an open detailed balanced Markov process.  But our paper needs two more categories to tell its story!  There&#8217;s the category of circuits, and the category of linear relations.</p>
<p>A morphism in the 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' /> is an open electrical circuit made of resistors: that is, a graph with each edge labelled by a &#8216;conductance&#8217; <img src='https://s0.wp.com/latex.php?latex=c_e+%3E+0%2C&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='c_e &gt; 0,' title='c_e &gt; 0,' class='latex' /> together with specified input and output nodes:</p>
<div align="center">
<img width="450" src="https://i2.wp.com/math.ucr.edu/home/baez/mathematical/compositional_markov/open_circuit.png" /></div>
<p>A morphism in the category <img src='https://s0.wp.com/latex.php?latex=%5Cmathrm%7BLinRel%7D&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mathrm{LinRel}' title='&#92;mathrm{LinRel}' class='latex' /> is a linear relation <img src='https://s0.wp.com/latex.php?latex=L+%3A+U+%5Cleadsto+V&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='L : U &#92;leadsto V' title='L : U &#92;leadsto V' class='latex' /> between finite-dimensional real vector spaces <img src='https://s0.wp.com/latex.php?latex=U&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='U' title='U' class='latex' /> and <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' />   This is nothing but a linear subspace <img src='https://s0.wp.com/latex.php?latex=L+%5Csubseteq+U+%5Coplus+V.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='L &#92;subseteq U &#92;oplus V.' title='L &#92;subseteq U &#92;oplus V.' class='latex' />  Just as relations generalize functions, linear relations generalize linear functions!</p>
<p>In our <a href="https://johncarlosbaez.wordpress.com/2015/04/28/a-compositional-framework-for-passive-linear-networks/">previous paper</a>, Brendan and I introduced these two categories and a functor between them, the &#8216;black box functor&#8217;:</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cblacksquare+%3A+%5Cmathrm%7BCirc%7D+%5Cto+%5Cmathrm%7BLinRel%7D+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;blacksquare : &#92;mathrm{Circ} &#92;to &#92;mathrm{LinRel} ' title='&#92;blacksquare : &#92;mathrm{Circ} &#92;to &#92;mathrm{LinRel} ' class='latex' /></p>
<p>The idea is that any circuit determines a linear relation between the potentials and net current flows at the inputs and outputs.   This relation describes the behavior of a circuit of resistors as seen from outside.</p>
<p>Our new paper introduces a black box functor for detailed balanced Markov processes:</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Csquare+%3A+%5Cmathrm%7BDetBalMark%7D+%5Cto+%5Cmathrm%7BLinRel%7D+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;square : &#92;mathrm{DetBalMark} &#92;to &#92;mathrm{LinRel} ' title='&#92;square : &#92;mathrm{DetBalMark} &#92;to &#92;mathrm{LinRel} ' class='latex' /></p>
<p>We draw this functor as a white box merely to distinguish it from the other black box functor.  The functor <img src='https://s0.wp.com/latex.php?latex=%5Csquare&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;square' title='&#92;square' class='latex' /> maps any detailed balanced Markov process to the linear relation obeyed by populations and flows at the inputs and outputs in a steady state.  In short, it describes the steady state behavior of the Markov process &#8216;as seen from outside&#8217;.</p>
<p>How do we manage to black box detailed balanced Markov processes?  We do it using the analogy with circuits!</p>
<h3> The analogy becomes a functor </h3>
<p>Every analogy wants to be a functor.  So, we make the analogy between detailed balanced Markov processes and circuits precise by turning it into a functor:</p>
<p><img src='https://s0.wp.com/latex.php?latex=K+%3A+%5Cmathrm%7BDetBalMark%7D+%5Cto+%5Cmathrm%7BCirc%7D&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='K : &#92;mathrm{DetBalMark} &#92;to &#92;mathrm{Circ}' title='K : &#92;mathrm{DetBalMark} &#92;to &#92;mathrm{Circ}' class='latex' /></p>
<p>This functor converts any open detailed balanced Markov process into an open electrical circuit made of resistors.  This circuit is carefully chosen to reflect the steady-state behavior of the Markov process.   Its underlying graph is the same as that of the Markov process.  So, the &#8216;states&#8217; of the Markov process are the same as the &#8216;nodes&#8217; of the circuit.</p>
<p>Both the equilibrium populations at states of the Markov process and the rate constants labelling edges of the Markov process are used to compute the conductances of edges of this circuit.  In the simple case where the Markov process has exactly one edge from any state <img src='https://s0.wp.com/latex.php?latex=i&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='i' title='i' class='latex' /> to any state <img src='https://s0.wp.com/latex.php?latex=j%2C&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='j,' title='j,' class='latex' /> the rule is this:</p>
<p><img src='https://s0.wp.com/latex.php?latex=C_%7Bi+j%7D+%3D+H_%7Bi+j%7D+q_j+++&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='C_{i j} = H_{i j} q_j   ' title='C_{i j} = H_{i j} q_j   ' class='latex' /></p>
<p>where:</p>
<p>&bull; <img src='https://s0.wp.com/latex.php?latex=q_j&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='q_j' title='q_j' class='latex' /> is the equilibrium population of the <img src='https://s0.wp.com/latex.php?latex=j&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='j' title='j' class='latex' />th state of the Markov process,</p>
<p>&bull; <img src='https://s0.wp.com/latex.php?latex=H_%7Bi+j%7D&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='H_{i j}' title='H_{i j}' class='latex' /> is the rate constant for the edge from the <img src='https://s0.wp.com/latex.php?latex=j&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='j' title='j' class='latex' />th state to the <img src='https://s0.wp.com/latex.php?latex=i&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='i' title='i' class='latex' />th state of the Markov process, and</p>
<p>&bull; <img src='https://s0.wp.com/latex.php?latex=C_%7Bi+j%7D&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='C_{i j}' title='C_{i j}' class='latex' /> is the conductance (that is, the reciprocal of the resistance) of the wire from the <img src='https://s0.wp.com/latex.php?latex=j&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='j' title='j' class='latex' />th node to the <img src='https://s0.wp.com/latex.php?latex=i&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='i' title='i' class='latex' />th node of the resulting circuit.</p>
<p>The detailed balance condition for Markov processes says precisely that the matrix <img src='https://s0.wp.com/latex.php?latex=C_%7Bi+j%7D&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='C_{i j}' title='C_{i j}' class='latex' /> is symmetric!  This is just right for an electrical circuit made of resistors, since it means that the resistance of the wire from node <img src='https://s0.wp.com/latex.php?latex=i&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='i' title='i' class='latex' /> to node <img src='https://s0.wp.com/latex.php?latex=j&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='j' title='j' class='latex' /> equals the resistance of the same wire in the reverse direction, from node <img src='https://s0.wp.com/latex.php?latex=j&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='j' title='j' class='latex' /> to node <img src='https://s0.wp.com/latex.php?latex=i.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='i.' title='i.' class='latex' /></p>
<h3> A triangle of functors </h3>
<p>If you paid careful attention, you&#8217;ll have noticed that I&#8217;ve described a triangle of functors:</p>
<div align="center">
<img width="350" src="https://i2.wp.com/math.ucr.edu/home/baez/mathematical/compositional_markov/triangle_of_functors.png" /></div>
<p>And if you know anything about how category theorists think, you&#8217;ll be wondering if this diagram commutes.</p>
<p>In fact, this triangle of functors does not commute!   However, a general lesson of category theory is that we should only expect diagrams of functors to commute <i>up to natural isomorphism</i>, and this is what happens here:</p>
<div align="center">
<img width="350" src="https://i0.wp.com/math.ucr.edu/home/baez/mathematical/compositional_markov/triangle_of_functors_with_natural_iso.png" /></div>
<p>The natural transformation <img src='https://s0.wp.com/latex.php?latex=%5Calpha&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;alpha' title='&#92;alpha' class='latex' /> &#8216;corrects&#8217; the black box functor for resistors to give the one for detailed balanced Markov processes.</p>
<p>The functors <img src='https://s0.wp.com/latex.php?latex=%5Csquare&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;square' title='&#92;square' class='latex' /> and <img src='https://s0.wp.com/latex.php?latex=%5Cblacksquare+%5Ccirc+K&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;blacksquare &#92;circ K' title='&#92;blacksquare &#92;circ K' class='latex' /> are actually equal on objects.  An object in <img src='https://s0.wp.com/latex.php?latex=%5Cmathrm%7BDetBalMark%7D&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mathrm{DetBalMark}' title='&#92;mathrm{DetBalMark}' class='latex' /> is 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' /> with each element <img src='https://s0.wp.com/latex.php?latex=i+%5Cin+X&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='i &#92;in X' title='i &#92;in X' class='latex' /> labelled a positive populations <img src='https://s0.wp.com/latex.php?latex=q_i.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='q_i.' title='q_i.' class='latex' /> Both functors map this object to the vector space <img src='https://s0.wp.com/latex.php?latex=%5Cmathbb%7BR%7D%5EX+%5Coplus+%5Cmathbb%7BR%7D%5EX.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mathbb{R}^X &#92;oplus &#92;mathbb{R}^X.' title='&#92;mathbb{R}^X &#92;oplus &#92;mathbb{R}^X.' class='latex' />    For the functor <img src='https://s0.wp.com/latex.php?latex=%5Csquare%2C&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;square,' title='&#92;square,' class='latex' /> we think of this as a space of population-flow pairs.  For the functor <img src='https://s0.wp.com/latex.php?latex=%5Cblacksquare+%5Ccirc+K%2C&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;blacksquare &#92;circ K,' title='&#92;blacksquare &#92;circ K,' class='latex' /> we think of it as a space of potential-current pairs.  The natural transformation <img src='https://s0.wp.com/latex.php?latex=%5Calpha&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;alpha' title='&#92;alpha' class='latex' /> then gives a linear relation</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Calpha_%7BX%2Cq%7D+%3A+%5Cmathbb%7BR%7D%5EX+%5Coplus+%5Cmathbb%7BR%7D%5EX+%5Cleadsto+%5Cmathbb%7BR%7D%5EX+%5Coplus+%5Cmathbb%7BR%7D%5EX&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;alpha_{X,q} : &#92;mathbb{R}^X &#92;oplus &#92;mathbb{R}^X &#92;leadsto &#92;mathbb{R}^X &#92;oplus &#92;mathbb{R}^X' title='&#92;alpha_{X,q} : &#92;mathbb{R}^X &#92;oplus &#92;mathbb{R}^X &#92;leadsto &#92;mathbb{R}^X &#92;oplus &#92;mathbb{R}^X' class='latex' /></p>
<p>in fact an isomorphism of vector spaces, which converts potential-current pairs into population-flow pairs in a manner that depends on the <img src='https://s0.wp.com/latex.php?latex=q_i.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='q_i.' title='q_i.' class='latex' />  I&#8217;ll skip the formula; it&#8217;s in the paper.</p>
<p>But here&#8217;s the key point.  The naturality of <img src='https://s0.wp.com/latex.php?latex=%5Calpha&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;alpha' title='&#92;alpha' class='latex' /> actually allows us to reduce the problem of computing the functor <img src='https://s0.wp.com/latex.php?latex=%5Csquare&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;square' title='&#92;square' class='latex' /> to the problem of computing <img src='https://s0.wp.com/latex.php?latex=%5Cblacksquare.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;blacksquare.' title='&#92;blacksquare.' class='latex' />   Suppose</p>
<p><img src='https://s0.wp.com/latex.php?latex=M%3A+%28X%2Cq%29+%5Cto+%28Y%2Cr%29&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='M: (X,q) &#92;to (Y,r)' title='M: (X,q) &#92;to (Y,r)' class='latex' /></p>
<p>is any morphism in <img src='https://s0.wp.com/latex.php?latex=%5Cmathrm%7BDetBalMark%7D.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;mathrm{DetBalMark}.' title='&#92;mathrm{DetBalMark}.' class='latex' />  The object <img src='https://s0.wp.com/latex.php?latex=%28X%2Cq%29&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='(X,q)' title='(X,q)' class='latex' /> is some 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' /> labelled by populations <img src='https://s0.wp.com/latex.php?latex=q%2C&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='q,' title='q,' class='latex' /> and <img src='https://s0.wp.com/latex.php?latex=%28Y%2Cr%29&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='(Y,r)' title='(Y,r)' class='latex' /> is some finite set <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' /> labelled by populations <img src='https://s0.wp.com/latex.php?latex=r.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='r.' title='r.' class='latex' />  Then the naturality of <img src='https://s0.wp.com/latex.php?latex=%5Calpha&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;alpha' title='&#92;alpha' class='latex' /> means that this square commutes:</p>
<div align="center">
<img width="300" src="https://i0.wp.com/math.ucr.edu/home/baez/mathematical/compositional_markov/naturality_square.png" /></div>
<p>Since <img src='https://s0.wp.com/latex.php?latex=%5Calpha_%7BX%2Cq%7D&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;alpha_{X,q}' title='&#92;alpha_{X,q}' class='latex' /> and <img src='https://s0.wp.com/latex.php?latex=%5Calpha_%7BY%2Cr%7D&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;alpha_{Y,r}' title='&#92;alpha_{Y,r}' class='latex' /> are isomorphisms, we can solve for the functor <img src='https://s0.wp.com/latex.php?latex=%5Csquare&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;square' title='&#92;square' class='latex' /> as follows:</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Csquare%28M%29+%3D+%5Calpha_Y+%5Ccirc+%5Cblacksquare+K%28M%29+%5Ccirc+%5Calpha_X%5E%7B-1%7D+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;square(M) = &#92;alpha_Y &#92;circ &#92;blacksquare K(M) &#92;circ &#92;alpha_X^{-1} ' title='&#92;square(M) = &#92;alpha_Y &#92;circ &#92;blacksquare K(M) &#92;circ &#92;alpha_X^{-1} ' class='latex' /></p>
<p>This equation has a clear intuitive meaning!   It says that to compute the behavior of a detailed balanced Markov process, namely <img src='https://s0.wp.com/latex.php?latex=%5Csquare%28f%29%2C&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;square(f),' title='&#92;square(f),' class='latex' /> we convert it into a circuit made of resistors and compute the behavior of that, namely <img src='https://s0.wp.com/latex.php?latex=%5Cblacksquare+K%28f%29.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;blacksquare K(f).' title='&#92;blacksquare K(f).' class='latex' />  This is not <i>equal</i> to the behavior of the Markov process, but we can compute that behavior by converting the input populations and flows into potentials and currents, feeding them into our circuit, and then converting the outputs back into populations and flows.</p>
<h3> What we really do </h3>
<p>So that&#8217;s a sketch of what we do, and I hope you ask questions if it&#8217;s not clear.  But I also hope you read our paper!  Here&#8217;s what we actually do in there.  After an introduction and summary of results:</p>
<p>&bull; Section 3 defines open Markov processes and the open master equation.</p>
<p>&bull; Section 4 introduces detailed balance for open Markov<br />
processes.</p>
<p>&bull; Section 5 recalls the principle of minimum power<br />
for open circuits made of linear resistors, and explains how to black box them.</p>
<p>&bull; Section 6 introduces the principle of minimum dissipation for open detailed balanced Markov processes, and describes how to black box these.</p>
<p>&bull; Section 7 states the analogy between circuits and detailed balanced Markov processes in a formal way.</p>
<p>&bull; Section 8 describes how to compose open Markov processes, making them into the morphisms of a category.</p>
<p>&bull; Section 9 does the same for detailed balanced Markov processes.</p>
<p>&bull; Section 10 describes the &#8216;black box functor&#8217; that sends any open detailed balanced Markov process to the linear relation describing its external behavior, and recalls the similar functor for circuits.</p>
<p>&bull; Section 11 makes the analogy between between open detailed balanced Markov processes and open circuits even more formal, by making it into a functor.  We prove that together with the two black box functors, this forms a triangle that commutes up to natural isomorphism.</p>
<p>&bull; Section 12 is about geometric aspects of this theory.  We show that the linear relations in the image of these black box functors are Lagrangian relations between symplectic vector spaces.  We also show that the master equation can be seen as a gradient flow equation.</p>
<p>&bull; Section 13 is a summary of what we have learned.</p>
<p>Finally, Appendix A is a quick tutorial on decorated cospans.  This is a key mathematical tool in our work, developed by Brendan in <a href="http://arxiv.org/abs/1502.00872">an earlier paper</a>.</p>
]]></html><thumbnail_url><![CDATA[https://i1.wp.com/math.ucr.edu/home/baez/students/blake-brendan.jpg?fit=440%2C330]]></thumbnail_url><thumbnail_height><![CDATA[314]]></thumbnail_height><thumbnail_width><![CDATA[440]]></thumbnail_width></oembed>