\draftcut
\section{Algebraic Structures, Expansions, and Circuit Algebras}
\label{sec:generalities}

\begin{quote} \small {\bf Section Summary. }
  \summaryalg
\end{quote}

\subsection{Algebraic Structures} \label{subsec:AlgebraicStructures}

An ``algebraic structure'' $\glos{\calO}$ is some collection $(\calO_\alpha)$
of sets of objects of different kinds, where the subscript
$\alpha$ denotes the ``kind'' of the objects in $\calO_\alpha$,
along with some collection of ``operations'' $\glos{\psi_\beta}$, where
each $\psi_\beta$ is an arbitrary map with domain some product
$\calO_{\alpha_1}\times\dots\times\calO_{\alpha_k}$ of sets of objects,
and range a single set $\calO_{\alpha_0}$ (so operations may be unary or
binary or multinary, but they always return a value of some fixed kind).
We also allow some named ``constants'' within some $\calO_\alpha$'s
(or equivalently, allow some 0-nary operations).\footnote{% One may
Alternatively define ``algebraic structures'' using the theory of
``multicategories''~\cite{Leinster:Higher}. Using this language,
an algebraic structure is simply a functor from some ``structure''
multicategory $\calC$ into the multicategory {\bf Set} (or into {\bf
Vect}, if all $\calO_i$ are vector spaces and all operations are
multi-linear). A ``morphism'' between two algebraic structures over the
same multicategory $\calC$ is a natural transformation between the two
functors representing those structures.} The operations may or may not
be subject to axioms --- an ``axiom'' is an identity asserting that
some composition of operations is equal to some other composition of
operations.

\begin{figure}[h]
\parbox[m]{7cm}{\caption{An algebraic structure $\calO$ with 4 kinds of
objects and one binary, 3 unary and two 0-nary operations (the constants
$1$ and $\sigma$).}
\label{fig:AlgebraicStructure}}
\parbox[m]{9cm}{\centering
\def\ObjTypeThree{{\raisebox{3mm}{\parbox{0.7in}{\footnotesize
  $\left\{\parbox{0.5in}{\centering objects of kind 3}\right\}=$
}}}}
\input figs/AlgebraicStructure.pstex_t%
}
\end{figure}

Figure~\ref{fig:AlgebraicStructure} illustrates the general notion of an
algebraic structure. Here are a few specific examples:
\begin{itemize}
\item We will use $\langle b\rangle$, the free group on one generator $b$, as
  a running example throughout this chapter (of course $\langle b \rangle$ is isomorphic to $\bbZ$). 
  This is an algebraic structure
  with one kind of objects, a binary operation ``multiplication'',
  a unary operation ``inverse'', one constant ``the
  identity'', and the expected axioms.
\item Groups in general: one kind of objects, one binary ``multiplication'',
  one unary ``inverse'', one constant ``the identity'', and some axioms.
\item Group homomorphisms: Two kinds of objects, one for each
  group. 7 operations --- 3 for each of the two groups and the homomorphism
  itself, going between the two groups. Many axioms.
\item A group acting on a set, a group extension, a split group extension
  and many other examples from group theory.
\item A quandle is a set with an operation $\glos{\uparrow}$, satisfying
  $(x \uparrow y)\uparrow z=(x\uparrow y)\uparrow(y\uparrow z)$ and some further minor axioms. This is an algebraic 
  structure with one kind of objects and one operation. See \cite{WKO} for an analysis of quandles from the perspective of this paper.
\item Planar algebras as in~\cite{Jones:PlanarAlgebrasI} and circuit
  algebras as in Section~\ref{subsec:CircuitAlgebras}.
\item The algebra of knotted trivalent graphs as
  in~\cite{Bar-Natan:AKT-CFA, Dancso:KIforKTG}.
\item Let $\varsigma\colon B\to S$ be an arbitrary homomorphism of groups (though
  our notation suggests what we have in mind --- $B$ may well be braids,
  and $S$ may well be permutations). We can consider an algebraic structure
  $\calO$ whose kinds are the elements of $S$, for which the objects of
  kind $s\in S$ are the elements of $\calO_s:=\varsigma^{-1}(s)$, and with
  the product in $B$ defining operations
  $\calO_{s_1}\times\calO_{s_2}\to\calO_{s_1s_2}$.
\item W-tangles and w-foams, studied in the following two sections of this paper.
\item Clearly, many more examples appear throughout mathematics.
\end{itemize}

\draftcut
\subsection{Associated Graded Structures} \label{subsec:Grad}

Any algebraic structure $\calO$ has an ``especially natural'' 
associated graded structure: that is, we take the associated structure with
respect to a specific and natural filtration. This will be a repeating construction 
throughout the rest of this paper series. 

First extend
$\calO$ to allow formal linear combinations of objects of the same kind
(extending the operations in a linear or multi-linear manner), then let
$\glos{\calI}$, the ``augmentation ideal'', be the sub-structure made out of
all such combinations in which the sum of coefficients is $0$, then let
$\calI^m$ be the set of all outputs of algebraic expressions (that is,
arbitrary compositions of the operations in $\calO$) that have at least
$m$ inputs in $\calI$ (and possibly, further inputs in $\calO$), and
finally, set
\begin{equation} \label{eq:gradO}
  \glos{\grad}\calO:=\bigoplus_{m\geq 0} \calI^m/\calI^{m+1}.
\end{equation}
Clearly, with the operations inherited from $\calO$, the associated graded
$\grad\calO$ is again algebraic structure with the same multi-graph
of spaces and operations, but with new objects and with new operations
that may or may not satisfy the axioms satisfied by the operations of
$\calO$. The main new feature in $\grad\calO$ is that it is a ``graded''
structure; we denote the degree $m$ piece $\calI^m/\calI^{m+1}$ of
$\grad\calO$ by $\grads_m\calO$.

We believe that many of the most interesting graded structures that appear
in mathematics are the result of this construction (i.e., as associated graded 
structures with respect to powers of the augmentation ideal), and
that many of the interesting graded equations that appear in mathematics
arise when one tries to find ``expansions'', or ``universal finite type
invariants'', which are also morphisms\footnote{Indeed, if $\calO$ is
finitely presented then finding such a morphism $Z\colon \calO\to\grad\calO$
amounts to finding its values on the generators of $\calO$, subject to
the relations of $\calO$. Thus it is equivalent to solving a system
of equations written in some graded spaces.} $Z\colon \calO\to\grad\calO$
(see Section~\ref{subsec:Expansions}) or when one studies
``automorphisms'' of such expansions\footnote{The Drinfel'd graded
Grothendieck-Teichmuller group $\mathit{GRT}$ is an example of such an
automorphism group. See~\cite{Drinfeld:GalQQ, Bar-Natan:Associators}.}.
Indeed, the paper you are reading now is really the study of the
associated graded structures of various algebraic structures associated with
w-knotted objects. We would like to believe that much of the theory of
quantum groups (at ``generic'' $\hbar$) will eventually be shown to be a
study of the associatead graded structures of various algebraic structures associated
with v-knotted objects.


\begin{example}\label{ex:bbZ}
 We compute the associated graded structuture of the running example $\langle b \rangle$.
 Allowing formal $\bbQ$-linear combinations of elements we get $\bbQ\langle b\rangle=\bbQ[b,b^{-1}]$. 
 The augmentation ideal $\calI$ is generated by differences 
 $(b^n-1)$ as a vector space (where $1=b^0$), and generated by $(b-1)$ as an ideal. 
 
 We claim that $\grad \langle b \rangle \cong \bbQ[[c]]$, the algebra of power series
 in one variable. To show this, consider the map $\pi: \bbQ[[c]] \to \grad \langle b \rangle$ by setting $\pi(c)=[b-1]$ (mod $\calI^2$). 
 It is easy to show explicitly
 that $\pi$ is surjective. For example, in degree 1, we need to show that $b-1$ generates $\calI/\calI^2$. 
 indeed, $(b^n-1)-n(b-1)$ has a double zero at $b=1$, and hence $f=\frac{(b^n-1)-n(b-1)}{(b-1)^2}$ is a polynomial, 
 and $b^n-1=n(b-1)+f(b-1)^2$. So modulo $(b-1)^2 \in \calI^2$, $b^n-1=n(b-1)$. 
 A similar argument works to show that $(b-1)^k$ generates
 $\calI^k/\calI^{k+1}$. 
 
 Note that $\langle b \rangle$ can also be thought of as the pure braid group on two strands: $b$ would be a ``full twist'' and $c$ can be
 represented as a single ``horizontal chord''. In other knot theoretic settings,
 it is generally relatively easy to find a ``candidate associated graded'' and a map $\pi$, which can be shown to be surjective
 by explicit means. 
 
 To show that $\pi$ is injective we are going to use the machinery of ``expansions'' which is the tool we use to accomplish
 similar tasks in the later sections of this paper.
\end{example}

We end this section with two more examples of computing associated graded structures: the 
proof of Proposition \ref{prop:GradGrp} is an exercise; for the
proof of Proposition \ref{prop:GradQ} see \cite{WKO}.

\begin{proposition}\label{prop:GradGrp} If $G$ is a group, $\grad G$ is a graded associative
algebra with unit. Similarly, the associated graded structure of a group homomorphism is a homomorphism of
graded associative algebras. \qed
\end{proposition}

\begin{proposition} \label{prop:GradQ} If $Q$ is a unital quandle,
$\grads_0 Q$ is one-dimensional and $\grads_{>0} Q$ is a graded 
right Leibniz 
algebra\footnote{A Leibniz algebra is a Lie algebra without anti-commutativity, as
defined by Loday in \cite{Loday:LeibnizAlg}.}
generated by $\grads_1 Q$.
\end{proposition}

\draftcut
\subsection{Expansions and Homomorphic Expansions}
\label{subsec:Expansions}
We
start with the definition. Given an algebraic structure $\calO$ let
$\glos{\fil}\calO$ denote the filtered structure of linear combinations of
objects in $\calO$ (respecting kinds), filtered by the powers $(\calI^m)$
of the augmentation ideal $\calI$. Recall also that any graded space
$G=\bigoplus_mG_m$ is automatically filtered, by $\left(\bigoplus_{n\geq
m}G_n\right)_{m=0}^\infty$.

\begin{definition} An ``expansion'' $Z$ for $\calO$
is a map $Z\colon \calO\to\grad\calO$ that preserves the kinds of objects
and whose linear extension (also called $Z$) to $\fil\calO$ respects the
filtration of both sides, and for which $\left(\gr Z\right):
\left(\gr\fil\calO=\grad\calO\right) \to
\left(\gr\grad\calO=\grad\calO\right)$ is the identity map of
$\grad\calO$; we refer to this as the ``universality property''.
\end{definition}

In practical terms, this is equivalent to saying that $Z$ is a map
$\calO\to\grad\calO$ whose restriction to $\calI^m$ vanishes in degrees
less than $m$ (in $\grad\calO$) and whose degree $m$ piece is the
projection $\calI^m\to\calI^m/\calI^{m+1}$.

We come now to what is perhaps the most crucial definition in this paper.

\begin{definition} A ``homomorphic expansion'' is an expansion which
also commutes with all the algebraic operations defined on the algebraic
structure $\calO$.
\end{definition}

\noindent{\bf Why Bother with Homomorphic Expansions?} Primarily, for two
reasons:
\begin{itemize}
\item Often $\grad\calO$ is simpler to work with than $\calO$;
for one, it is graded and so it allows for finite ``degree by degree''
computations, whereas often times, such as in many topological examples,
anything in $\calO$ is inherently infinite. Thus it can be beneficial to
translate questions about $\calO$ to questions about $\grad\calO$. A
simplistic example would be, ``is some element $a\in\calO$ the square
(relative to some fixed operation) of an element $b\in\calO$?''. Well, if
$Z$ is a homomorphic expansion and by a finite computation it can be shown
that $Z(a)$ is not a square already in degree $7$ in $\grad\calO$, then
we've given a conclusive negative answer to the example question. Some less
simplistic and more relevant examples appear in~\cite{Bar-Natan:AKT-CFA}.
\item Often $\grad\calO$ is ``finitely presented'', meaning that it
is generated by some finitely many elements $g_1,\dots,g_k\in\calO$,
subject to some relations $R_1\dots R_{n}$ that can be written in terms
of $g_1,\dots,g_k$ and the operations of $\calO$. In this case, finding a
homomorphic expansion $Z$ is essentially equivalent to guessing the values
of $Z$ on $g_1,\dots,g_k$, in such a manner that these values
$Z(g_1),\dots,Z(g_k)$ would satisfy the $\grad\calO$ versions of the
relations $R_1\dots R_{n}$. So finding $Z$ amounts to solving equations in
graded spaces. It is often the case (as will be demonstrated in this paper;
see also~\cite{Bar-Natan:NAT, Bar-Natan:Associators})
that these equations are very interesting for their own algebraic sake, and
that viewing such equations as arising from an attempt to solve a problem
about $\calO$ sheds further light on their meaning. 
\end{itemize}


In practice, often the first difficulty in searching for an
expansion (or a homomorphic expansion) $Z\colon \calO\to\grad\calO$ is that its
would-be target space $\grad\calO$ is hard to identify. It is typically
easy to make a suggestion $\calA$ for what $\grad\calO$ could be. It
is typically easy to come up with a reasonable generating set $\calD_m$
for $\calI^m$ (keep some knot theoretic examples in mind, or $\bbZ$ in Example~\ref{ex:bbZ}). 
It is a bit harder but not
exceedingly difficult to discover some relations $\calR$ satisfied by the
elements of the image of $\calD$ in $\calI^m/\calI^{m+1}$ (4T, $\aft$, and
more in knot theory, there are no relations for $\bbZ$).
Thus we set $\calA:=\calD/\calR$; but it is often very hard to be
sure that we found everything that ought to go in $\calR$; so perhaps
our suggestion $\calA$ is still too big? Finding 4T for example 
was actually not {\em that} easy. Could we have
missed some further relations that are hiding in $\calA$?

The notion of an $\calA$-expansion, defined below, solves two problems at
once. Once we find an $\calA$-expansion we know that we've identified
$\grad\calO$ correctly, and we automatically get what we really wanted, a
($\grad\calO$)-valued expansion.

\parpic[r]{\raisebox{-9mm}{$\xymatrix{
  & \calA \ar@<-2pt>[d]_\pi \\
  \calO \ar[ur]^{Z_{\calA}} \ar[r]_<>(0.4)Z
  & \grad\calO \ar@<-2pt>[u]_{\gr Z_\calA}
}$}}
\begin{definition} \label{def:CanGrad}
A ``candidate assoctaed graded structure'' for an algebraic structure
$\calO$ is a graded structure $\glos{\calA}$ with the same operations as
$\calO$ along with a homomorphic surjective graded map $\pi\colon
\calA\to\grad\calO$. An ``$\calA$-expansion'' is a kind and filtration
respecting map $\glos{Z_\calA}\colon \calO\to\calA$ for which $(\gr
Z_\calA)\circ\pi\colon \calA\to\calA$ is the identity. One can similarly
define ``homomorphic $\calA$-expansions''.
\end{definition}

\begin{proposition} \label{prop:CanGrad}
If $\calA$ is a candidate associated graded of $\calO$
and $Z_\calA\colon \calO\to\calA$ is a homomorphic $\calA$-expansion, then
$\pi:\calA\to\grad\calO$ is an isomorphism and $Z:=\pi\circ Z_\calA$ is a
homomorphic expansion. (Often in this case, $\calA$ is identified with
$\grad\calO$ and $Z_\calA$ is identified with $Z$).
\end{proposition}

\begin{proof} Note that $\pi$ is surjective by birth. Since $(\gr Z_\calA)\circ\pi$
is the identity, $\pi$ it is also injective and hence it is an
isomorphism. The rest is immediate. \qed
\end{proof}

\begin{example}
 Back to $\langle b \rangle$, in Example~\ref{ex:bbZ} we found a candidate associated graded structure $\calA=\bbQ[[c]]$ and a map $\pi: c \mapsto [b-1]$.
 According to Proposition~\ref{prop:CanGrad}, it is enough to find a homomorphic $\calA$-expansion, that is, an algebra homomorphism
 $Z_{\calA}: \bbQ\langle b \rangle \to \bbQ[[c]]$ such that $\gr Z_\calA \circ \pi$ is the identity of $\bbQ[[c]]$. It is a straightforward calculation to
 check that any algebra map defined by $Z_{\calA}(b)=1+c+\{\text{higher order terms}\}$ satisfies this property. If one seeks a ``group-like''
 homomorphic expansion then $Z_{\calA}(b)=e^c$ is the only solution. In either case, exhibiting $Z_{\calA}$ proves that $\pi$ is injective and
 hence $\calA$ is the associated graded structure of $\langle b \rangle$.
\end{example}


\draftcut
\subsection{Circuit Algebras} \label{subsec:CircuitAlgebras}

``Circuit algebras'' are so common and everyday, and they make
such a useful language (definitely for the purposes of this paper,
but also elsewhere), we find it hard to believe they haven't made
it into the standard mathematical vocabulary\footnote{Or have they,
and we have been looking the wrong way?}. People familiar with planar
algebras~\cite{Jones:PlanarAlgebrasI} may note that circuit algebras are
just the same as planar algebras, except with the planarity requirement
dropped from the ``connection diagrams'' (and all colourings are dropped
as well). 

In our context, the main utility of circuit algebras is that they allow
for a much simpler presentation of $v$(irtual)- and $w$-tangles. 
There are planar algebra presentations of $v$- and $w$-tangles, generated by the usual crossings and the ``virtual crossing'', 
modulo the usual as well as the ``virtual'' and ``mixed'' Reidemeister moves.
Switching from planar algebras to circuit algebras however renders the extra generators
and relations unnecessary: the ``virtual crossing'' becomes merely a circuit algebra
artifact, and the new Reidemeister moves are implied by the circuit algebra structure 
(see Warning~\ref{warn:virtualxings}, Definition~\ref{def:vw-tangles}, and Remark \ref{rmk:VirtualXings}). 

The everyday intuition for circuit algebras comes from electronic circuits,
whose components can be wired together in many, not necessarily planar, 
ways, and it is not important to know how these wires are embedded in space.
For details and more motivation see Section~\ref{subsec:CAMotivation}.
We start formalizing this image by defining
``wiring diagrams'', the abstract analogs of printed circuit boards.
Let $\bbN$ denote the set of natural numbers including $0$, and for
$n\in\bbN$ let $\underline{n}$ denote some fixed set with $n$ elements,
say $\{1,2,\dots,n\}$.

{
\makeatletter\def\thm@space@setup{%
  \thm@preskip=0cm plus 0cm minus 0cm %\thm@postskip=\thm@preskip
}\makeatother
\parpic[r]{\input{figs/WiringDiagram.pstex_t}}
\begin{definition} Let $k, n, n_1,\dots,n_k\in\bbN$ be natural
numbers. A ``wiring diagram'' $D$ with inputs $\underline{n_1},\dots
\underline{n_k}$ and outputs $\underline{n}$ is an unoriented
compact 1-manifold whose boundary is $\underline{n}\amalg
\underline{n_1}\amalg\cdots\amalg\underline{n_k}$, regarded
up to homeomorphism (on the right is an example with $k=3$, $n=6$,
and $n_1=n_2=n_3=4$). In strictly combinatorial terms, it is a
pairing\footnote{We mean ``pairing'' in the sense of combinatorics,
not in the sense of linear algebra. That is, an involution without fixed
point.} of the elements of the set $\underline{n}\amalg
\underline{n_1}\amalg\cdots\amalg\underline{n_k}$ along
with a single further natural number that counts closed
circles. If $D_1;\dots;D_m$ are wiring diagrams with inputs
$\underline{n_{11}},\dots,\underline{n_{1k_1}}; \dots;
\underline{n_{m1}},\dots,\underline{n_{mk_m}}$ and outputs
$\underline{n_1};\dots;\underline{n_m}$ and $D$ is a wiring diagram
with inputs $\underline{n_1};\dots;\underline{n_m}$ and outputs
$\underline{n}$, there is an obvious ``composition'' $D(D_1,\dots,D_m)$
(obtained by gluing the corresponding 1-manifolds, and also describable
in completely combinatorial terms) which is a wiring diagram with
inputs $(\underline{n_{ij}})_{1\leq i\leq k_j,1\leq j\leq m}$ and
outputs $\underline{n}$ (note that closed circles may be created in
$D(D_1,\dots,D_m)$ even if none existed in $D$ and in $D_1;\dots;D_m$).
\end{definition}
}

A circuit algebra is an algebraic structure (in the sense of
Section~\ref{subsec:Grad}) whose operations are parametrized by
wiring diagrams. Here's a formal definition:

\begin{definition} A circuit algebra consists of the following data:
\begin{itemize}
\item For every natural number $n\geq 0$ a set (or a $\bbZ$-module) $C_n$ ``of
circuits with $n$ legs''.
\item For any wiring diagram $D$ with inputs $\underline{n_1},\dots
\underline{n_k}$ and outputs $\underline{n}$, an operation (denoted by the
same letter) $D\colon C_{n_1}\times\dots\times C_{n_k}\to C_n$ (or linear
$D\colon C_{n_1}\otimes\dots\otimes C_{n_k}\to C_n$ if we work with
$\bbZ$-modules).
\end{itemize}
We insist that the obvious ``identity'' wiring diagrams with
$\underline{n}$ inputs and $\underline{n}$ outputs act as the identity of
$C_n$, and that the actions of wiring diagrams be compatible in the obvious
sense with the composition operation on wiring diagrams.
\end{definition}

A silly but useful example of a circuit algebra is the circuit algebra
$\glos{\calS}$ of empty circuits, or in our context, of ``skeletons''. The
circuits with $n$ legs for $\calS$ are wiring diagrams with $n$ outputs
and no inputs; namely, they are 1-manifolds with boundary $\underline{n}$
(so $n$ must be even).

More generally one may pick some collection of ``basic components''
(analogous to logic gates and junctions for electronic circuits as in
Figure~\ref{fig:FlipFlop}) and speak of the ``free circuit algebra''
generated by these components; even more generally we can speak of
circuit algebras given in terms of ``generators and relations''. (In the
case of electronics, our relations may include the likes of De Morgan's
law $\neg(p\vee q)=(\neg p)\wedge(\neg q)$ and the laws governing the
placement of resistors in parallel or in series.) We feel there is no need
to present the details here, yet many examples of circuit algebras given
in terms of generators and relations appear in this paper, starting with
the next section. We will use the notation $C=\CA\langle \, G \mid R \, \rangle$
to denote the circuit algebra generated by a collection of elements
$G$ subject to some collection $R$ of relations. 

People familiar with electric circuits know that connectors
sometimes come in ``male'' and ``female'' versions, and that you
can't plug a USB cable into a headphone jack. 
Thus one may define ``directed circuit algebras'' in which
the wiring diagrams are oriented, the circuit sets $C_n$ get replaced
by $C_{p,q}$ for ``circuits with $p$ incoming wires and $q$
outgoing wires'' and only orientation preserving connections are ever
allowed\footnote{By convention we label the boundary points of such circuits $1,\ldots,p+q$, with the first $p$
labels reserved for the incoming wires and the last $q$ for the outgoing. The inputs of wiring
diagrams must be labeled in the opposite way for the numberings to match.}. Likewise
there is a ``coloured'' version of everything, in which the wires may be
coloured by the elements of some given set $X$ (which may include among
its members the elements ``USB'' and ``audio'') and in which connections
are allowed only if the colour coding is respected. We will leave the
formal definitions of directed and coloured circuit algebras, as well
as the definitions of directed and coloured analogues of the skeletons
algebra $\calS$ and generators and relations for directed and coloured
algebras, as an exercise.

Note that there is an obvious notion of ``a morphism between
two circuit algebras'' and that circuit algebras (directed or not,
coloured or not) form a category. We feel that a precise definition
is not needed. A lovely example is the ``implementation morphism''
of logic circuits in the style of Figure~\ref{fig:FlipFlop} in Section \ref{sec:odds} into more
basic circuits made of transistors and resistors.

Perhaps the prime mathematical example of a circuit algebra is tensor
algebra. If $t_1$ is an element (a ``circuit'') in some tensor product of
vector spaces and their duals, and $t_2$ is the same except in a possibly
different tensor product of vector spaces and their duals, then once an
appropriate pairing $D$ (a ``wiring diagram'') of the relevant vector
spaces is chosen, $t_1$ and $t_2$ can be contracted (``wired together'')
to make a new tensor $D(t_1,t_2)$. The pairing $D$ must pair a vector
space with its own dual, and so this circuit algebra is coloured by the
set of vector spaces involved, and directed, by declaring (say) that
some vector spaces are of one gender and their duals are of the other. We
have in fact encountered this circuit algebra in
\cite[Section~\ref{1-subsec:LieAlgebras}]{Bar-NatanDancso:WKO1}.

Let $G$ be a group. A $G$-graded algebra $A$ is a collection $\{A_g\colon g\in
G\}$ of vector spaces, along with products $A_g\otimes A_h\to A_{gh}$ that
induce an overall structure of an algebra on $A:=\bigoplus_{g\in G}A_g$. In
a similar vein, we define the notion of an $\calS$-graded circuit algebra:

\begin{definition}\label{def:Skeleta} An $\calS$-graded circuit algebra, 
or a ``circuit algebra with skeletons'', is an algebraic structure $C$ with
spaces $C_\beta$, one for each element $\beta$ of the circuit algebra of
skeletons $\calS$, along with composition operations
$D_{\beta_1,\dots,\beta_k}\colon C_{\beta_1}\times\dots\times C_{\beta_k}\to
C_\beta$, defined whenever $D$ is a wiring diagram and
$\beta=D(\beta_1,\dots,\beta_k)$, so that with the obvious induced
structure, $\coprod_\beta C_\beta$ is a circuit algebra. A similar
definition can be made if/when the skeletons are
taken to be directed or coloured.
\end{definition}

Loosely speaking, a circuit algebra with skeletons is a circuit
algebra in which every element $T$ has a well-defined skeleton
$\varsigma(T)\in\calS$. Yet note that as an algebraic structure a circuit
algebra with skeletons has more ``spaces'' than an ordinary circuit
algebra, for its spaces are enumerated by skeleta and not merely by
integers. The prime examples for circuit algebras with skeletons appear in
the next section.
