This is a draft of a paper by John Baez.
There is a dagger-compact category whose morphisms are equivalence classes of electrical circuits made of linear resistors. To construct this category, we begin by recalling work going back to Weyl which expresses Kirchhoff’s laws and Ohm’s law in terms of chains and cochains on a graph. We show that a ‘lumped’ circuit made of linear resistors—that is, a circuit of this sort treated as a ‘black box’ whose inside workings we cannot see—amounts mathematically to a Dirichlet form: a finite-dimensional real vector space with a chosen basis and a quadratic form obeying some conditions. There are rules for composing and tensoring Dirichlet forms, which correspond to the operations of composing circuits in series and setting circuits side by side. However, these rules do not give a category, because the would-be identity morphisms are made of wires with zero resistance, which fall outside the Dirichlet form framework. The most elegant solution is to treat Dirichlet forms as a special case of Lagrangian correspondences. This leads to a dagger-compact category of electrical circuits that can include wires with zero resistance.
The concept of an electrical circuit made of linear resistors is well-known in electrical engineering, but we need to formalize it with more precision than usual. The basic idea is that an electrical circuit is a graph whose edges are labelled by positive real numbers called ‘resistances’, and whose set of vertices is equipped with two disjoint subsets: the ‘inputs’ and ‘outputs’.
All graphs in this paper will be directed. So, define a graph to be a pair of functions where and are finite sets. We call elements of edges and elements of vertices. We say that the edge has source and target , and we also say that is an edge from to .
Define an open graph to be a graph where the set of vertices is equipped with subsets and , called inputs and outputs. We do not require that and are disjoint. Often the difference between inputs and outputs will not matter, so we define , and call elements of this set terminals.
Define a circuit (made of linear resistors) to be an open graph together with a function called the resistance
assigning to each edge a positive real number. We will use to stand for a circuit:
Suppose we have another circuit
Then there is an obvious notion of a map of circuits . Such a map consists of a function sending vertices to vertices and a function sending edges to edges, both called :
which preserve sources and targets, inputs and outputs, and resistances:
This definition makes circuits into the objects of a category.
Given any circuit , there are three other circuits we can build from it. They are all rather trivial, since they have no edges, only vertices. Nonetheless they are very important in what follows.
First, we have a circuit whose set of vertices is and whose set of edges is empty. We call this the input of . There is an obvious map of circuits
coming from the inclusion and the inclusion .
Similarly, there is a circuit , called the output of , whose set of vertices is and whose set of edges is empty. There is an obvious map
Finally, there is a circuit whose set of vertices is and whose set of edges is empty. We call this the boundary of . Yet again there is an obvious map
In 1923, Hermann Weyl published a paper in Spanish which described electrical circuits in terms of the homology and cohomology of graphs (W). In this approach, Kirchhoff’s voltage and current laws simply say that voltage is a 1-coboundary and current is a 1-cocycle. Furthermore, the electrical resistances labelling edges of the graphs put an inner product on the space of 1-chains, allowing us to identify them with 1-cochains. Ohm’s law then says that voltage may then be identified with the current.
In the late 1960’s and early 1970’s, these ideas were further developed by authors including Paul Slepian (Sl), G. E. Ching (C), J. P. Roth (R) and Stephen Smale (Sm). By now they are well-known. The textbook by Bamberg and Sternberg (BS) uses electrical circuits to motivate homology, cohomology and the beginnings of Hodge theory. The text by Gross and Kotiuga (GK) uses chain and cochain complexes to tackle a wide variety of problems in electromagnetism. What follows is a terse review of the basics.
Any circuit determines a chain complex of real vector spaces, . As we shall see, a 1-chain in this complex can be used to describe the electrical current flowing through wires (that is, edges) of our circuit.
In fact, is just the usual chain complex associated to a graph. So, it has only two nonzero terms:
We can make a chain complex of finite-dimensional real Hilbert spaces, since the resistance defines an inner product on by
and there is also an inner product on for which the vertices form an orthonormal basis:
The dual of the chain complex is a cochain complex of finite-dimensional real Hilbert spaces, . As we shall see, a 1-cochain in this complex can be used to describe the voltage across wires of our circuit.
We call the differential in this cochain complex . It is is given by
But since any real Hilbert space is equipped with a canonical isomorphism to its dual, we get isomorphisms
Explicitly, these are given by:
where and .
Using these isomorphisms, we can transfer the differential on to a differential on , which we call
In other words, we define so that this diagram commutes:
or in other words:
We use the dagger notation because really is the Hilbert space adjoint of :
The inclusion of circuits
gives an inclusion of chain complexes
and then, by taking duals, a map of cochain complexes . Henceforth we call this map
This map is zero on 1-cochains, and on 0-cochains it simply amounts to restricting a function on the set of vertices to a function on the set of terminals.
Since we have cochain complexes of finite-dimensional real Hilbert spaces, we can also take the Hilbert space adjoint to get a map . We write this map as
This map is zero on 1-cochains, and on 0-cochains it simply amounts to extending a function on the set of terminals to a function on the set of vertices that is zero on the vertices that are not terminals.
The following standard facts will come in handy:
If the maps and are defined as above, then
FILL IN DETAILS.
Since , Equation (8) follows from a general fact about a linear map between finite-dimensional Hilbert spaces: .
Given a circuit, we shall focus on two quantities: a 1-chain called the current and a 1-cochain called the voltage. In 1847, Gustav Kirchhoff formulated two laws governing these quantities.
We say Kirchhoff’s voltage law holds if
for some called the potential. If Kirchhoff’s voltage law holds for some voltage , the potential is hardly ever unique. But we can say exactly how much it fails to be unique. Given , then if and only if their difference is constant on each connected component of the graph .
We say Kirchhoff’s current law holds if
for some , called the boundary current. This says that the total current flowing in or out of any vertex is zero unless that vertex is a terminal. If Kirchhoff’s current law holds for , the boundary current is unique, since is one-to-one.
In 1827 Georg Ohm published a book which included a relation between the voltage and current for circuits made of resistors (O). At the time, the critical reception was harsh: one contemporary called Ohm’s work “a web of naked fancies, which can never find the semblance of support from even the most superficial of observations”, and the German Minister of Education said that a professor who preached such heresies was unworthy to teach science (D,H). However, a simplified version of his relation is now widely used under the name of “Ohm’s law”.
As we have seen, the resistance lets us define an inner product on the vector space , which gives an isomorphism as defined in (1). We say Ohm’s law holds if the voltage and current are related as follows:
This allows us to express in terms of :
Kirchhoff’s voltage law then lets us write in terms of :
Given this, what does Kirchhoff’s current law say in terms of ? The answer is this:
Kirchhoff’s current law holds for if and only if
for some . Moreover, in this case we can take to be given by
where is the boundary current given by Kirchhoff’s current law.
Assume Kirchhoff’s current law: for some . Then we have
Conversely, suppose . Then taking , the same sort of reasoning shows that .
In this section we always assume Kirchhoff’s voltage law and Ohm’s law.
Given a circuit with voltage and current , the power dissipated by a circuit is defined to be
where we are pairing the 1-chain and the 1-cochain to get a real number. Ohm’s law allows us to rewrite as , so the power can be expressed in terms of the voltage:
Kirchhoff’s voltage law allows us to write as , so the power can also be expressed in terms of the potential:
This expression lets us formulate the ‘principle of minimum power’, which gives us information about the potential given its restriction to the boundary of . This restriction is an element of , and in general we call any element of this space a boundary potential.
We say a potential obeys the principle of minimum power for a boundary potential if minimizes the power subject to the constraint that .
A potential obeys the principle of minimum power for some boundary potential if and only if obeys Kirchhoff’s current law.
If obeys the principle of minimum power for some boundary potential , then for any with we must have
or in other words:
This means that , so by (8) we have
for some boundary voltage . By Proposition 2 this equation implies Kirchhoff’s current law for . Conversely, Kirchhoff’s current law for implies the above equation and thus, running the above calculation backwards,
It follows that is a critical point for the power as a function on potentials satisfying the constraint . But since the power is a nonnegative quadratic form, must minimize the power among such potentials.
We have seen that a potential gives a solution of all three basic equations governing electric circuits made from linear resistors—Kirchhoff’s voltage law, Kirchhoff’s current law and Ohm’s law—if and only if this equation holds:
Our next task is to solve this equation. But first, some remarks are in order.
acts as a discrete analogue of the Laplacian for the graph , so we call this operator the Laplacian of . Equation (14) is thus a version of Laplace’s equation with boundary conditions. It says the Laplacian of the potential equals zero except on the boundary of , where it equals .
We could try to solve for given . However, we prefer a slightly different approach, which emphasizes the role of the boundary potential . After all, we have seen that solves Equation (14) for some if and only if obeys the principle of minimum power for some boundary potential . We call the problem of finding a potential that minimizes the power for a fixed value of is a discrete version of the Dirichlet problem.
As we shall see, this version of the Dirichlet problem always has a solution. However, the solution is not necessarily unique. If we take a solution and add to it some with and , we clearly get another solution. It should be intuitively clear that such an is a function on the vertices of that is constant on each connected component and vanishes on the boundary of . To make this precise we need some standard concepts from graph theory:
Given two vertices of a graph , a path from to is a finite sequence of vertices and edges such that for each , either is an edge from to , or an edge from to .
A subset of the vertices of a graph is connected if for each pair of vertices in , there is a path from one to the other.
A connected component of a graph is a maximal connected subset of the vertices of .
In the theory of directed graphs, the qualifier ‘strongly’ is commonly used before the word ‘connected’ in the last two definitions. However, we never consider any other sort of connectedness, so we omit this qualifier.
A connected component of touches the boundary if it contains a vertex in .
It easy to see that obeys if and only if it is constant on each connected component of . If moreover , then must vanish on all connected components touching the boundary.
With these preliminaries in hand, we can solve the Dirichlet problem:
For any boundary potential there exists a potential obeying the principle of minimum power for . If we also demand that vanish on every connected component of not touching the boundary, then is unique, and depends linearly on .
For existence, note that a nonnegative quadratic form restricted to an affine subspace of a real vector space must reach a minimum somewhere on this subspace. So, because the power defines a nonnegative quadratic form on the space , for any the power must reach a minimum somewhere on the affine subspace
For uniqueness, suppose that both minimize the power. Let
Then , so lies in for all . Thus, the function
attains its minimum value both at and at . Since this function is smooth, we must have . Since
it follows that . Thus
Since this function takes on the same value at and , we must have . This implies that is constant on each connected component of . Furthermore, since , vanishes on each connected component of touching the boundary.
Thus, if we demand that both and vanish on every connected component of that does not touch the boundary, vanishes on every connected component of . It follows that , giving the desired uniqueness.
To prove that depends linearly on , suppose that for the potential obeys the principle of minimum power for and vanishes on every component of not touching the boundary. Then by Propositions 2 and 4, we have
for some . It follows that for any real numbers and , the potential obeys
we must have . So, depends linearly on .
Note from the proof of the above proposition that:
Suppose and is a potential obeying the principle of minimum power for . Then obeys the principle of minimum power for if and only if the difference is constant on every connected component of and it vanishes on every connected component touching the boundary of .
In this section we always assume that the principle of minimum power holds, as well as Kirchhoff’s voltage law and Ohm’s law.
Under these circumstances, we shall see that the boundary potential determines the boundary current. A ‘lumped circuit’ is an equivalence class of circuits, where two are considered equivalent when the boundary current is the same function of the boundary potential. The idea is that the boundary current and boundary potential are all that can be observed ‘from outside’, i.e. by making measurements at the terminals. Restricting our attention to what can be observed by making measurements at the terminals amounts to treating a circuit as a ‘black box’: that is, treating its interior as hidden from view. So, two circuits give the same lumped circuit when they behave the same as ‘black boxes’.
First let us check that the boundary current is a function of the boundary potential. For this we introduce an important quadratic form on the space of boundary potentials:
For any , let
Since defines a nonnegative quadratic form on the finite-dimensional vector space and the constraint picks out a linear subspace of this subspace, the infimum above is actually attained. One can check that is a nonnegative quadratic form on .
Up to a factor of , is just the power dissipated by the circuit when the boundary voltage is , thanks to the principle of minimum power. The factor of simplifies the next proposition, which uses to compute the boundary current as a function of the boundary voltage.
Since is a smooth real-valued function on , its differential at any given point defines an element of the dual space , which we denote by . In fact, this element is equal to the boundary current corresponding to the boundary voltage :
Suppose . Suppose is any potential minimizing the power subject to the constraint . Let be the corresponding voltage, the current, and where is the corresponding boundary current. Then
Note first that while there may be several choices of minimizing the power subject to the constraint that , Proposition 8 says that the difference between any two choices vanishes on all components touching the boundary of . Thus, these two choices give the same value for . So, with no loss of generality we may assume is the unique choice that vanishes on all components not touching the boundary. By Proposition 7, there is a linear operator
sending to this choice of , and then
Given any , we thus have
where in the last step we use Equation (13). Since , we obtain
where in the last step we use Equation (1). It follows that .
In this section we define a category of circuits, and also a category of lumped circuits. Both these are dagger-compact categories
There is a category where objects are finite sets of points, and a morphism is an equivalence class of circuits
equipped with bijections
The equivalence relation is as follows: is equivalent to if there is an isomorphism of circuits such that
The composition of circuits is given by pushout of cospans
This category is symmetric monoidal, and in fact a dagger-compact category. WHY???
We have seen that a lumped circuit is completely specified by the vector space along with its distinguished basis and the quadratic form . Now we describe which quadratic forms can arise this way. They are known as ‘Dirichlet forms’, and they admit a number of equivalent characterizations. We start with the simplest.
Given a finite set , let be the vector space of functions . A Dirichlet form on will be a certain sort of quadratic form on :
Given a finite set , a Dirichlet form on is a quadratic form given by the formula
for some nonnegative real numbers .
Note that we may assume without loss of generality that and ; we do this henceforth. Any Dirichlet form is nonnegative: for all . However, not all nonnegative quadratic forms are Dirichlet forms. For example, if :
is not a Dirichlet form.
In fact, the concept of Dirichlet form is vastly more general: such quadratic forms are studied not just on finite-dimensional vector spaces but on of any measure space. When this measure space is just a finite set, the concept of Dirichlet form reduces to the definition above. For a thorough introduction Dirichlet forms, see the text by Fukushima (F). For a fun tour of the underlying ideas, see the paper by Doyle and Snell (DS).
We will not really need any other characterizations of Dirichlet forms, but they do help illuminate the concept:
Given a finite set and a quadratic form , the following are equivalent:
is a Dirichlet form.
whenever for all .
whenever is independent of , and obeys the Markov property: when .
See Fukushima (F).
We begin with a naive attempt to construct a category where the morphisms are lumped circuits. This naive attempt doesn’t quite work, because it doesn’t include identity morphisms. However, it points in the right direction.
Given finite sets and , let denote their disjoint union. Let be the set of Dirichlet forms on . There is a way to compose these Diriclet forms:
defined as follows. Given and , let
where . Moreover, this composition is associative:
However, there is typically no Dirichlet form playing the role of the identity for this composition. A ‘category without identity morphisms’ is called a semicategory, so we see
There is a semicategory where:
the objects are finite sets,
a morphism from to is a Dirichlet form .
composition of morphisms is given by
We would like to make this into a category. The easy way is to formally adjoin identity morphisms; this trick works for any semicategory. This amounts to introducing some circuits that contains wires with zero resistance. However, we obtain a better category if we include more morphisms: more circuits having wires with zero resistance.
P. Katis, N. Sabadini, R. F. C. Walters, On the algebra of systems with feedback and boundary, Rendiconti del Circolo Matematico di Palermo Serie II, Suppl. 63 (2000), 123–156.
J. Kigami, Analysis on Fractals, Cambridge U. Press. First 60 pages available at http://www-an.acs.i.kyoto-u.ac.jp/~kigami/AOF.pdf.
Z.-M. Ma and M. R&oum;ckner, Introduction to the Theory of (Non-Symmetric) Dirichlet Forms, Springer, Berlin, 1991.
G. Ohm, Die Galvanische Kette, Mathematisch Bearbeitet, T. H. Riemann, Berlin, 1827. Also available at http://www.ohm-hochschule.de/bib/textarchiv/Ohm.Die_galvanische_Kette.pdf.
J. P. Roth, Existence and uniqueness of solutions to electrical network problems via homology sequences, Mathematical Aspects of Electrical Network Theory, SIAM-AMS Proceedings III, 1971, pp. 113-118.
P. Selinger, Dagger compact closed categories and completely positive maps, in Proceedings of the 3rd International Workshop on Quantum Programming Languages (QPL 2005), ENTCS 170 (2007), 139–163. Also available at http://www.mscs.dal.ca/~selinger/papers/dagger.pdf.
P. Slepian, Mathematical Foundations of Network Analysis, Springer, Berlin, 1968.