\section{Introduction}

A specially important component of adaptation in nature is based on the capacity of some living beings to
respond to external signals by a proper combination of repeated exposure to
stimuli and the potential for storing memories.  One classical example is provided
by early experiments on conditioning, also known as {\em associative learning} (AL)
and is one particularly important example of a general class of processes involving
{\em associative memory} (Walters et al 1979; Hassoun 1993).
In these experiments, a given animal is known to respond automatically
to an unconditioned stimulus (US) such as air puff in the eye that leads to eyelid closure.
Instead, another stimulus such as a weak noise is unlikely to elicit a response. This would be an
example of a conditioned stimulus (CS). In a nutshell, associative learning occurs when
both stimuli are simultaneously presented, in such a way that a repeated exposure to
both stimuli creates a cognitive link.  At some point
the exposure to only CS leads to the response that was originally limited to US: the weak noise
triggers eyelid closure.

Conditional learning is part of the enormous potential exhibited by organisms
having neuronal systems and might have been a crucial innovation in the
evolutionary history of multicellularity (Ginsburg and Jablonka 2010). Many forms of adaptation are grounded in neuronal
circuits capable of creating correlations between different events, providing a plastic
and reliable way of predicting future changes (Grossberg 1988;
Gerstner and Kistler 2002). Most of these examples involve
the presence of a neural circuitry, but the phenomenon seems to be also at work
in non-neural agents. For example, microorganisms are capable of dealing with environmental correlates
and perform decision making tasks (Ben-Jacob 2004 ; Tagkopoulos et al 2008; Ben-Jacob 2009; Mitchell et al 2009; Reid et al 2015). This includes in particular molecular mechanisms
responsible for information processing (Bray 1995; Buchler et al. 2003). A relevant question here is how could we synthetically enhance the cognitive complexity of microorganims and how this can gives insight into the origins and evolution of
microbial inteligence (Sol\'e 2016). The potential for designing living systems has been rapidly improved in the last decade. Among the most promising areas where such engineering of microbial intelligence can be crucial is the engineering of the human microbiome (Huttenhower et al 2012;  Ackerman 2012; Ruder et al 2011). Treatments and recoveries from disturbance have been shown to be transitions among alternative states (Costello 2012, Pepper and Rosenfeld 2012). Mounting evidence
reveals that this complex ecosystem is relevant in many pathological states and that
engineered microbes could be designed to detect and cure microbiome-related disorder (Sonnenburg 2015).
Since we are often dealing with complex diseases, such as inflammatory processes, these need to be
smart bacteria, capable of delivering drugs under the required conditions but also shut off once the
inflammation is eliminated. This is more obvious if we take into account the enormous cross-talk that has been identified between microbial and human cells (Blaser et al 2013) particularly in relation with the gut microbiome and the nervous and
immune systems (Andrey Smith 2015). Engineering such microbial circuits
is a major challenge that requires moving beyond the sense-and-deploy framework.

Building complex decision making circuits within a single cell is a challenging task but
several candidates have been suggested (Amos 2004; Fernando et al 2009; Lu et al 2009; Sorek et al 2013;
Sardanyes et al 2015; Sol\'e et al 2015). These studies propose different ways
of approaching the problem of building synthetic systems capable of diverse
forms of bacterial intelligence. One example is the associative learning circuit presented
by Fernando and co-workers that could be implemented in {\em E. coli} as a model
organism  (Fernando et al 2009). It was inspired in previous theoretical studies that used model
neural networks to explain the process under a minimal set of assumptions.
In this case, the problem with the proposed design (as well as many others) is that it requires
engineering several interactions, tuning the connectivity matrix of the molecular network,
with all the problems derived from cross-talk (Kwok 2010). \\

In this paper we aim to provide a simple short cut to this problem, by using cellular consortia of
cells that are used as basic modules, each one containing
a small amount of engineering. This approximation has been successful in different contexts
(Regot et al 2011; Tamsir et al, 2011; Macia and Sol\'e 2013, 2014,
Goni-Moreno et al 2013; Macia et al 2016).
In the next section, we describe the logic
of our system design in order to illustrate its simplicity. Next, a potential implementation using
a computational model for {\em E. coli} will be described.

\section{The logic of multicellular learning}

A synthetic circuit capable of associative learning requires some type of modulation of internal states
through the learning process. Since the circuit responds to one signal (US) but not the other (CS) unless they have
been previously presented together, this indicates that the internal states of the underlying molecular circuit
must have changed. In figure 1a we show an example of a genetic implementation of AL introduced
in (Sorek et al 2013). This work proposed a design inspired in neural networks. Here $X$ can activate the
response $R$ whereas $Y$ will do it (when $X=0$) only if an intermediate module $M$ (that needs to be previously
activated by $X+Y$) has the right expression level. This kind of design and others of similar inspiration
(Fernando et al 2009) rely, if implemented inside one cell, a sophisticated wiring.

\begin{figure*}[htp]
\begin{center}
\includegraphics[width=0.85 \textwidth]{FIG-2CELL_r.pdf}
\caption{The logic of a two-cell associative learning circuit. In (a) an example of a "standard"
implementation, following neural network principles, is shown (redrawn from Sorek et al 2013).
In (b) we summarize the basis of the circuit presented here, that exploits the presence
of a toggle switch (indicated in gray). Two inputs are present, $X$ and $Y$ indicating unconditioned and
conditioned signals, respectively. The circuit can be split in two parts corresponding to two engineered
cells (c) here indicated as $C_1$ and $C_2$.  In (c-d) the proposed implementation of the synthetic
consortium is shown. Here the two cells (d, producer, e, learning cell) communicate in one direction by
means of a molecular signal ($A$).  Each engineered cell type performs
part of the processing required to implement the association
mechanism. We have used specific genes, cell-cell communication signals and reporters,
but the basic principle can be used in different contexts (see text). }
\label{fig_model}
\end{center}
\end{figure*}

One of the most fundamental requirements for associative learning is memory, and designing
synthetic circuits  (Gardner et al 2000;
Ajo-Franlin et al  2010; Fritz et al 2007; Siuti et al 2013, Padirac et al 2012,
Inniss and Silver 2013; Burrill and Silver 2010).
A well known, successful example of memory circuit
is provided by the toggle switch (Gardner et al 2000; Cherry and Adler 2000; Rodrigo and Jaramillo 2007)).
This module has been extensively studied and characterised and
is one of the best known components in cellular engineering. Since a molecular switch is capable
of storing two alternative states, we use it here as a key piece of our proposed multicellular circuit. This introduces
a restriction within the design of the system in relation to previous models. In order to illustrate
how we perform our implementation, in figure 1b we represent a basic wiring diagram where two inputs
are indicated as $X$ and $Y$, corresponding to the unconditioned and conditioned signals, respectively.

\begin{table}[ttbp]
\begin{center}
\begin{tabular}{|cc|cc|c|}
\hline
X (Uncond) & Y (Cond) &  $\; \;$   State A  $\; \;$  & State B $\; \;$ &  Output \\ \hline
0 &  0 & 1 &  0 & 0 \\   \hline
0 &  1 & 1 &  0 & 0 \\  \hline
1 &  0 & 1 &  0 & 1 \\  \hline
1 &  1 & 0 &  1 & 1 \\  \hline
0 &  0 & 0 &  1 & 0 \\  \hline
0 &  1 & 0 &  1 & 1 \\  \hline
1 &  0 & 0 &  1 & 1 \\ \hline
\end{tabular}
\end{center}
\caption{Transition table for the simplified Boolean circuit implementing the two-cell circuit shown in figure 1c. The
different input pair values given in the two left columns provides the sequence of states ($X$ and $Y$
for the conditional and unconditional inputs) introduced to test the
presence of associative learning, assuming that $A=1$ and $B=0$ at the beginning.}
\end{table}

The diagram in figure 1b presents some similarities with the one in figure 1a. We will assume here that
the switch has an internal, initial state, with $B=0$ and $A>0$. If $X>0$ and $Y=0$, a response will be observed
since the response unit receives direct and positive stimulation from X. Instead, since $A$ inhibits
the potential activation from $Y$, a signal coming inly from $Y$ will not trigger response. However, if
both $X$ and $Y$ activate $X$, it can toggle the switch, inactivating (or under-expressing) $A$. Once this
simultaneous activation occurs, the system is ready to react to $Y$ only. This defines the basic logic of our
implementation, but we have split the circuit in two parts (figure 1c) corresponding to a {\em learning cell},
$C_1$, carrying the toggle switch and a producer cell $C_2$, that is wired to $C_1$
through a molecular wire $A$. As can be seen, we maintain
the same scheme, but use cells as modules that allow to reduce the complexity of the engineering.
In the next section, we make an explicit case for a microbial consortium capable of AL.

Because of the large number of equations involved, little mathematical developments can be performed and the solutions
will be numerical. However, it is possible to see how the model works (and predict the key outcomes)
by using a simple Boolean circuit as the one indicated in figure 1c. Here we use a discrete dynamical
system based on a threshold network where all states are either $0$ or $1$. A reporter signal ($OUT$) with two possible states provides
the result of the computation. In the middle of the circuit we have located a module involving cross-repression
of two elements ($A$ and $B$) one of which can also modulate (through an inhibitory interaction) the effect of
$Y$ on the output. We can actually represent these interactions in terms of a Boolean dynamical system,
where the state of each element $S_i(t) \in \{ X, Y, A, B, O \}$ at a given step $t$ (assuming time is discretized)
follows a discrete threshold dynamics: $S_i(t+1) = \Phi \left [ W_{ji} S_j(t) - \theta_i \right ]$.
Here the connections among different pairs are indicated as $ W_{ji}$ and can be positive or negative,
indicating activation or inhibition respectively (Grossberg 1988). In figure 1a
we have included an example of possible weights for our system. The thresholds $\theta_i$ provide a condition
for the total input in order to trigger a response. This is defined by the threshold function $\Theta(x)$ which gives
$\Theta(x)=1$ if $x\ge 0$ and zero otherwise. This ideal function is a limit case of the standard cooperative functions
used in models of genetic networks (see section III).

For the circuit described in figure 1, our (discrete) equations are written as follows:
\begin{eqnarray}
A(t+1) = \Phi \left[ -B(t) + \theta \right] \\
B(t+1)= \Phi \left[ X(t) - Y(t) (1- A(t)) - \theta \right] \\
O(t+1) = \Phi \left[ X(t) + Y(t) \right]
\end{eqnarray}
It is possible to show, following the discrete steps of this Boolean model, that an associative
learning dynamics is being satisfied. The sequence of states associate to the consortium displayed
in fig 1c is shown in Table I, where the set of possible input pairs $(X,Y)$ and the $(A,B)$ the states
of the elements defining the memory switch (SM).

\section{Associative learning in a synthetic microbial consortium}

In order to avoid undesirable effects derived from complex constructs, cellular consortia, where
different parts of the computation are split into different engineered cells, can be used as an
alternative to single-cell designs. An example of such synthetic consortium  is displayed in figure 2(d-e).
It combines both constitutive and regulated gene expression and splits the circuit complexity
in two separated cells. As summarised in figurers 1b-e, the required behaviour is split into two basic modules, each one using a different engineering. Although we will assume that the two cell types belong to the same species, this is not a necessary condition. Each cell in this consortia acts as a separated  chassis for a subset of the required circuit. In our proposed implementation, we will use available information concerning
well established constructs and parameters gathered from the available literature
and take {\em E. coli} as our model organism. Several potential candidates could be used as
inputs, such anhydrotetracycline (aTc) as our non-conditional stimulus ($X$) and
Acyl homoserine lactone (AHL) (produced the gene luxI  from the {\em V. fischeri} quorum sensing system)
as a conditioned stimulus ($Y$). In presence of this stimulus there is not response unless the system
has established the association between $X$ and $Y$. In a nutshell,
whereas $X$ alone always induces a system's response, $Y$ does not. The computational model
requires an explicit definition of the mathematical equations for each cell, as well as
the consideration of the

We have chosen a fluorescent protein as the candidate for the cell's output, although this
could be some gene that triggers the delivery of a given therapeutic molecule.
LuxR is a transcriptional activator from the {\em V. fischeri} quorum sensing system
that binds to its cognate promoter Plux activating the expression of genes under its control. The wild type LuxR
is inactive when produced. Acyl homoserine lactone (AHL), produced by another gene, luxI, is an autoinducer
that binds LuxR and increases its activity.

\begin{figure*}[t]
\begin{center}
\includegraphics[width=0.85 \textwidth]{ALLSTEPS2_ALEARN.pdf}
\caption{Time series of the circuit behavior under the sequential introduction of the unconditional stimulus $X$ the two types of stimuli. In (a) we show the basic diagram of interactions detailed in figure 2. In figure b we show the time
series associated to an experiment of classical conditioning at the cell level. The first two time series give the
inputs of $X$ and $Y$, introduced as pulses for a given period and then removed. The sequence involves
$X>0, Y=0$, $X=0, Y>0$, $X,Y>0$ and then several pulses of $Y$-only activation. The upper diagrams (c-f)
represent the relevant subgraphs that are changed or activated once the pulse has been introduced and the system stabilised. Here we have used the parameters:
$\gamma_{TetR}=\gamma_{Las}=\gamma_{cI}=\gamma_{LuxR}=\gamma_{LacI}=\gamma_{A}=\gamma_{\lambda}=\gamma_{GFP}=0.1 \; \mu M/min$, $\beta_{cI}=0.008  \; \mu M$,
$\beta_{Tet}=0.04  \; \mu M$, $\theta_{Lux}=\theta_{Las}=0.01  \; \mu M^2$, $\delta_{TetR}=\delta_{Las}=0.02  \; min^{-1}$,
$\delta_{cI}=0.07  \; min^{-1}$, $\delta_{LuxR}=\delta_{GFP}=0.02  \; min^{-1}$, $\mu=0.025  \; \mu M$, $D_A=0.1 \; min^{-1}$.
}
\label{AssocLearningSeries}
\end{center}
\end{figure*}

The mathematical model associated to the cellular consortium displayed in figure 2 is decomposed in
two sets of equations. Both cells have $X$ and $Y$ as inputs, but the nature of their responses
is markedly different.

\subsection{Producer cell equations}

For the producer cell, we have five coupled differential equations, describing the
basic interactions indicated in figure 1d. These equations are standard
in the modelling of gene regulation networks (Ingalls 2103). Here we have
a feed-forward set of interactions described by:
\begin{equation}
{d [LasR] \over dt} = \gamma_{LasR}  - \delta_{Las} [LasR]
\end{equation}
which is a constitutive gene (here $P_c$ will indicate a constitutive promoter). The dynamical
equations for the rest of components in our cellular circuit read:
\begin{equation}
{d [LuxR] \over dt} = \gamma_{Lux}\Gamma_2([LasR],[A]) - \delta_{LuxR} [LuxR]
\end{equation}
\begin{equation}
{d [cI] \over dt} = \gamma_{cI} \Gamma_1([LuxR],[Y]) - \delta_{cI} [cI]
\end{equation}
\begin{equation}
{d [TetR] \over dt} = {\gamma_{TetR} \over 1 + \left (  {[cI] \over \beta_{cI}}  \right )^2 } - \delta_{TetR} [TetR]
\end{equation}
And the equation for the response dynamics, described by the concentration of our reporter,
is defined by:
\begin{equation}
{d [GFP] \over dt} = \gamma_{GFP} \Gamma_3([TetR],[X]) - \delta_{GFP} [GFP]
\end{equation}
The Hill functions used here are described by the functions
$\Gamma_1 ([LuxR],[Y])$ and $\Gamma_2([LasR],[A])$ involving
thresholded activation:
\begin{equation}
\Gamma_1([LuxR],[Y]) = { \left([LuxR][Y]\right)^2 \over \theta_{Lux} + \left([LuxR][Y]\right)^2}
\end{equation}
\begin{equation}
\Gamma_2([LasR],[A]) =  { ([LasR][A])^2 \over \theta_{Las} + \left([LasR][A]\right)^2}
\end{equation}
along with the Hill inhibition function:
\begin{equation}
\Gamma_3([TetR],[X]) =  {1 \over 1 +  \left ( {[TetR] \over \beta_{Tet}}� (1 +[ X]/\mu) \right )^2 }
\end{equation}
In particular, we can see that the reporter will be active if no repression from TetR is at work.
Either by inactivation of TetR or by the presence of $X$, the response will be observed.

\begin{figure}[!]
\begin{center}
\includegraphics[width=0.43 \textwidth]{FIGALLPHASES.pdf}
\caption{Phase space of the associative learning two-cell design and their output time series. Depending on the production rate of LacI ($\gamma_{LacI}$) and the production rate of LacI under CI regulation ($\gamma_\lambda$) there are four different response behaviours. (A.) Non learning situation; the system responds to the unconditioned stimuli ($X$) (blue region), the system is unable to respond to the conditioned signal ($Y$) even after the conditioning stimuli process.(B.) Damped learning; the learning cell has a temporal association (turquoise), the producer cells only respond to the conditioned signal for a limited time after the conditioning. (C.) Associative learning region (yellow), the learning cell change the state of the toggle switch after the simultaneous stimulation with $X$ and $Y$ signals, then the system have learned. (D.) Learned system (orange); the system responds to the unconditioned ($X$) and conditioned ($Y$) signals independently before the conditioning process pulses. The time series of the other variables can be seen at the supplementary figures $3$-$6$.   The parameters are the same than in previous figures; the phase space is performed with a $400x400$ latice.
 }
\label{fig_behaviours}%
\end{center}
\end{figure}

\subsection{Learning cell equations}

 For the learning cell (figure 1e) we consider a different set of equations. Here two
 genes are expressed constitutively thus involving linear equations:
\begin{equation}
{d [LuxR] \over dt} = \gamma_{LuxR}  - \delta_{LuxR} [LuxR]
\end{equation}
\begin{equation}
{d [TetR] \over dt} = \gamma_{TetR} - \delta_{TetR} [TetR]
\end{equation}
which provide the gene products that will interact with $X$ and $Y$ within this cell under
the nonlinear equtions
\begin{equation}
{d [LacI] \over dt} = \gamma_{LacI} \Gamma_3 \Gamma_1
+ {\gamma_{\lambda} \over 1 + \left (  {[cI] \over \beta_{cI}}  \right )^2 }
- \delta_{LacI} [LacI]
\end{equation}
We have also the well-known equations for the toggle switch defined by the pair:
\begin{equation}
{d [cI] \over dt} =  {\gamma_{cI} \over 1 + \left (  {[LacI] \over \beta_{Lac}}  \right )^2 }  - \delta_{cI} [cI]
\end{equation}
\begin{equation}
{d [LasI] \over dt} = {\gamma_{\lambda} \over 1 + \left (  {[cI] \over \beta_{cI}}  \right )^2 } - \delta_{LasI} [LasI]
\end{equation}
Which have two alternative states. Finally the linear equation
for the production of the molecule $A$, used in our first model
as the communication signal among the two cells:
\begin{equation}
{d [A] \over dt} = \gamma_{A} LasI  - \delta_A [A]
\end{equation}

\subsection{Cell-cell communication wire}

A final component needs also to be taken into account: the diffusion of the wiring molecule $A$
responsible for the intercellular connection. The last equation above only considers the production
within $C_2$, but it is shared with cell $C_1$ by diffusion and is also present in the
extracellular medium ($A_e$). Thus we need to write three equations that account for the dynamics of $A$ in each
compartment (see figure 2). The complete equations read:
\begin{eqnarray}
{d [A_2] \over dt} = \gamma_{A_2} LasI  - \delta_A [A_2] + D_A ([A_e]  - [A_2]) \\
{d [A_1] \over dt} =  D_A ([A_e]  - [A_1])- \delta_A [A_1]\\
 {d [A_e] \over dt} =  D_A ([A_1]+[A_2]-2[A_e])- \delta_A [A_e]
\end{eqnarray}
corresponding to the two cells and the extracellular medium, respectively.

\subsection{Associative learning dynamics}

The previous equations start from an initial condition where the toggle switch is displaced
towards $cI$. This defines the memory state of our system at time zero. Each input is introduced in the system in a pulse-like way. In figure 2 we show a typical example
of the numerical experiment consistent with an associative learning process. The left diagram
(figure 2a) provides a schematic representation of all the interactions and figure b
shows the time series obtained from the model. We first start by introducing $X$
but not $Y$. This leads to a response as shown by the pulse in GFP, which disappears as $X$ is also removed from the system. The positive response is easy to understand, since the only pathway being affected leading to GFP
is indicated in figure 2c, where$X$ blocks the inhibition of the reporter from $TetR$.

Afterwards, we do the same experiment with $Y$ but in this case no active reporter is seen. The repressor of GFP
acts with no inhibition (figure 2d) and the paths affected by $Y$ do not propagate. The crucial change occurs when the two inputs are simultaneously correlated. Here the reporter is again activated (top of diagram e) as it
happened in the first $X$-only pulse. However, the effect of the simultaneous input on the toggle switch
is that the state of the cI-LacI pair switches to the opposite state, where CI is now expressed and
LacI repressed. This is the internal state that has changed as a consequence of the correlated stimulus
and will remain in this state once we remove both inputs.

Once the previous pulse has been applied and both inputs removed again, we can see the effect of
these correlated input when the conditioned, $Y$ signal is introduced in the absence of the unconditioned one.
Here the stored memory state in the toggle switch has a very different impact. In this case, this state is
not changed, but allows the propagation of the effects of $Y$ to the producer cell, where cI is produced, repressing TetR and thus allowing GFP to be expressed. The consortium has created an association (thanks to the toggle) that essentially modifies the system's response to the conditioned state.

The model presented above has been analysed using a given parameter combination.
What is the effect of other parameter values on the dynamical response of
the consortium to other parameter combinations. Two parameters in particular
are relevant to our exploration of the response of the system. These are the production
rates $\gamma_{Lac}$ and $\gamma_{\lambda}$. By exploring the
$(\gamma_{Lac},\gamma_{\lambda})$ parameter space (fig 3a) using a wide range of parameter
values i. e. $10^{-4} \le \gamma_{Lac},\gamma_{\lambda} \le 10^0$. Four dynamical phases
are found, which are associated to four different types of responses to the incoming stimuli.

As in previous sections, the synthetic consortium receives a sequence of inputs where the
unconditioned stimulus $X$ is used first, followed by the conditional one $Y$ and then both
together. Afterwards, pulses of $Y$ are introduced and the type of output response is used
to classify the circuit's behaviour. The right panel in figure 3 shows examples of the output
response for each phase as the sequence of stimuli is introduced. The four classes are captured
by the time series associated to each one (A-D) in figure 3 right. No learning occurs within one phase
where there is only unconditional response. In a second phase (Damped learning, B, see figure 3 left)
a small responses is observed suggesting association, but it is rapidly lost after one weak response
to the conditional stimulus. A yellow domain points to the associative learning parameter space
whereas the domain of learned systems is associated to responses by both stimuli, no matter
how are they presented. The plot has been created on a log-log
scale, and thus we can see that a broad range of parameters are consistent with this behavior.

\subsection{Supresing associative learning}

\begin{figure*}[!]
\begin{center}
\includegraphics[width=0.9 \textwidth]{AL_Disassociation.pdf}
\caption{Time series of conditioning, memory erase and conditioning again. White regions are the non-conditioned regions; the cells are onlly able to express the GFP molecule under $X$ signalling. The green regions are regions where the system is being conditioned, there is the association process, simultaneous stimulation with $X$ and $Y$. Orange regions the system is conditioned; it is able to responds to the unconditioned stimuli and to the conditioned. When there is a pulse of IPTG (cyan area) there is a loss of memory, a disassociation between signals. The parameters are the same than in previous figure and $\beta_{IPTG}=0.04$ and the $IPTG$ pulse is $1  \; \mu M$ of amplitude.
 }
\label{fig_Association_Disassociation}
\end{center}
\end{figure*}

Once the association has been established in our circuit, as it occurs with conditioned
learning in animals, the switch is locked in a given state that allows the association
to be stable over time. However, if this is a circuit that has been designed to respond
to unconditional stimuli once the inputs of both kinds are presented simultaneously.
It can be interesting to return to the initial state where the consortium has not
yet

The LacI protein have one well known inhibitor, the IPTG molecule, which
\begin{equation}
\frac{d [CI]}{dt} = {
\gamma_{cI}
\over
1 +  \left (  {[LacI]  \over \beta_{Lac}  \left ( 1+ \xi \right)} \right )^2
}
- \delta_{cI} [cI]
\end{equation}
where $\xi=IPTG/\beta_{IPTG}$. A pulse of IPTG
makes inhibition of the LacI function. Then, the
CI promoter is active again leading to an inversion of the toggle
switch LacI-CI. After this process the conditioning have been lost.

\section{Discussion}

\begin{figure*}[!]
\begin{center}
\includegraphics[width=0.9 \textwidth]{TWOCELLS-Altenative_Diagrams_PS_015.pdf}
\caption{Alternative circuits for synthetic memory. a. Associative learning circuit based on positive feedback loop (FIG.1a). b. Damped learning synthetic circuit. Bellow each diagram, there is the phase space relating the parameters with the behaviour exhibited: (A.) There is response to the unconditioned signal. (B.) Damped learning, there is a characteristic time where the two cells system responds to $X$ and $Y$, afterwards  the system does not respond to the unconditioned signal. (C.) Associative learning, once the cells are stimulated simultaneously by both molecules ($X$ and $Y$), the system responds either the conditioned or unconditioned stimulus. The mathematical models are exposed in the Supplementary Material. The parameters are set to the same values than in FIG.2. The phase space are lattices of $400$ units per parameter, excepting the number of copies of LasI given that this parameter is discrete.
 }
\label{fig_AL_alt}
\end{center}
\end{figure*}

One of the challenges synthetic biology is to make possible the
reprogramming of cellular behaviour by means of a predictable, engineered manipulation of
the available molecular toolkit. The potential of such engineered molecular networks is great,
and cover a wide range of areas, from standard biosensors to complex decision making circuits
able to gather a range of external stimuli from the environment and respond according to a
predefined set of rules.  An important goal is to provide these engineered systems with
the appropriate adaptation potential, which necessarily requires the use of learning and memory.
In this context, the potential for recapitulating the evolutionary innovations by building synthetic circuits
provides a unique opportunity for the study of major transitions (Sol\'e 2016).

The proposed synthetic systems presented here show that the use of a cell consortia
can help designing complex decision-making biological circuits capable to cope with external
signals and their changes. The human microbiome provides an ideal testbed for these kind of
synthetic designs. If the metaphor of this as a "second brain" becomes valid, then what we are
suggesting is to introduce pieces of computational complexity to play an active role within
the network of microbial interactions. Our example also combines the internal machinery that
responds to external signals  (which could be drugs) with a flexible design capable
of exploiting the history of previous events. This basic scheme can be generalised to more complex
designs. Future work should test the experimental feasibility of our approach as well its scalability.

The circuits proposed above assume that the two-cell consortium is obtained by engineering
the same class of model organism, but this is not required for our purposes. Mixed consortia
involving both microbial and human cells could be constructed, and other possibilities are also
available, including the design of symbiotic consortia between soil microorganisms and plant cells
(or nitrogen-fixing microorganisms living within plant nodules) as potential strategies of ecosystem
repair (Sol\'e 2015, Sol\'e et al 2015). Concerning diseases associated with a malfunctioning microbiome,
our results suggest that both permanent and transient modifications of some engineered
strains could help to dynamically control some key processes requiring memory and learning. This is
an interesting possibility given the feedback existing between both the immune system and the brain
as connected with the microbiome (Mayer et al 2014; Sampson and Mazmanian 2015).
Since both immune and brain networks are capable of displaying
learning and memory, microbial consortia as the ones presented here
could act as extensions of neural-like decision circuits.

Finally, another interesting possibility concerns the
design of synthetic learning circuits that could be incorporated within organoids (Lancaster and Knoblich 2014).
Such enhanced cognitive complexity seems a desirable trait of future designed organoids and allow
to move away from natural designs, thus reaching some unexplored regions of organ space (Oll\'e-Vila et al 2016).

\section{Acknowledgements}
We thank the members of the Complex Systems Lab for useful discussions.
This work has been supported by an ERC Advanced Grant Number 294294
from the EU seventh framework program (SYNCOM) the Botin Foundation by
Banco Santander through its Santander Universities Global Division, the Secretaria
d'Universitats i Recerca del Departament d'Economia i Coneixement de la Generalitat de
Catalunya, a grant of MINECO, FIS2015-67616-P and by the Santa Fe Institute.


\chapter{Properties of Hankel functions}\label{app:hankel}
This appendix is intended to provide a reference for the properties of the
Hankel functions required for the development of this paper.
\begin{section}{Differential equation}
In this section we present the construction of the Hankel functions as well
as some important relations between them. The Hankel functions are solutions
to the Bessel equation \cite{bookpart:smirnov_bess}:
\begin{equation}
  \left(z^2 \frac{d^2}{dz^2} + z \frac{d}{dz} + (z^2 - \nu^2)\right)
  Z_p(z) = 0. \label{eq:bessel_equation}
\end{equation}
The series solutions to the above equation are the Bessel functions of order
$\pm \nu$:
\begin{equation}
  J_{\pm \nu}(z) = \left(\frac{z}{2}\right)^{\pm\nu}
  \sum_{k = 0}^{\infty} \frac{(-1)^k}{k! \Gamma{k \pm \nu + 1}}
  \left(\frac{z}{2}\right)^{2k}. \label{eq:bessel_function}
\end{equation}
The complex conjugate passes onto the order and the argument:
\begin{equation}
	J_{\nu}(z)^* = J_{\nu^*}(z^*). \label{eq:bessel_hc}
\end{equation}
The wronskian \cite{bookpart:watson_wronsk} of the Bessel functions of opposite
order is:
\begin{equation}
  W(J_{-\nu}, J_{\nu}) = \frac{\mathcal{C}}{z} = \frac{2 \sin{\nu\pi}}{\pi z}.
  \label{eq:bessel_wronskian}
\end{equation}
The two solutions of order $\nu$ and $-\nu$ are linearly independent when
$\nu$ is not an integer (because the wronskian is non-zero). When
$\nu = n$ is an integer, the two functions are linearly dependent, since
they are related by
\begin{equation}
	J_{-n}(z) = (-1)^n J_{n}(z). \label{eq:bessel_minusn}
\end{equation}
Bessel functions of the second kind, or Neumann functions, can be
constructed using $J_{\pm \nu}$:
\begin{equation}
	N_{\nu}(z) = \frac{J_\nu(z) \cos{\nu\pi} - J_{-\nu}(z)}{\sin{\nu\pi}}.
	\label{eq:neumann_function}
\end{equation}
Using \eqref{eq:bessel_hc}, we see that the complex conjugate passes onto the
order and the argument:
\begin{equation}
	N_{\nu}(z)^* = N_{\nu^*}(z^*). \label{eq:neumann_hc}
\end{equation}
The wronskian of Neumann functions of opposite order follows:
\begin{equation}
  W(N_{-\nu}, N_{\nu}) = \frac{-2 \cos^2{\pi\nu} + 2}{\pi z \sin{\pi\nu}}
  = \frac{2 \sin{\nu\pi}}{\pi z}. \label{eq:neumann_wronskian}
\end{equation}
The wronskian with the bessel function of the same order is
\begin{equation}
	W(J_{\nu}, N_{\nu}) = W(J_{-\nu}, J_{\nu})/\sin{\nu\pi} = \frac{2}{\pi z}.
  \label{eq:neumann_bessel_wronskian}
\end{equation}
Therefore, the two functions are always linearly independent.

The wronskian with the bessel function of opposite order is
\begin{equation}
	W(J_{-\nu}, N_{\nu}) = W(J_{-\nu}, J_{\nu}) \cos{\nu\pi}/\sin{\nu\pi} =
	\frac{2 \cos{\nu\pi}}{\pi z}. \label{eq:neumann_besseln_wronskian}
\end{equation}
Bessel functions of the third kind \cite{book:jackson}, or Hankel functions
are constructed with these two linear independent solutions:
\begin{subequations} \label{eq:hankel_functions}
\begin{align}
  \Hank{1}{\nu}(z) &= J_\nu(z) + i N_\nu(z) &
  &\textrm{Hankel function of the first kind}\label{eq:hankel1_def}\\
  \Hank{2}{\nu}(z) &= J_\nu(z) - i N_\nu(z) &
  &\textrm{Hankel function of the second kind}\label{eq:hankel2_def}
\end{align}
\end{subequations}
	The wronskian of the two kinds of Hankel functions is
\begin{equation}
	W(\Hank{1}{\nu}, \Hank{2}{\nu}) = -2i W(J_{\nu}, N_{\nu})
	= -\frac{4i}{\pi z}.	\label{eq:hankel12_wronskian}
\end{equation}
Complex conjugation passes to the order and argument and switches between
the two kinds of Hankel functions:
\begin{equation}
  \Hank{1}{\nu}(z)^{*} = \Hank{2}{\nu^*}(z^*),\qquad
  \Hank{2}{\nu}(z)^{*} = \Hank{1}{\nu^*}(z^*).
  \label{eq:hankel_hc}
\end{equation}
Replacing the Neumann function \eqref{eq:neumann_function} in
\eqref{eq:hankel_functions} we obtain an alternative form for
the Hankel functions:
\begin{equation*}
  \Hank{1}{\nu}(z) = \frac{i}{\sin{\nu\pi}}\left(J_\nu(z) e^{-i \nu\pi} -
  J_{-\nu}(z)\right) ,\qquad
  \Hank{2}{\nu}(z) = \frac{-i}{\sin{\nu\pi}}\left(J_\nu(z) e^{i \nu\pi} -
  J_{-\nu}(z)\right).
\end{equation*}
From this form we can read the connection between $\Hank{1,2}{-\nu}$
and $\Hank{1,2}{\nu}$:
\begin{equation}
  \Hank{1}{-\nu}(z) = e^{i\nu\pi} \Hank{1}{\nu}(z),\qquad
  \Hank{2}{-\nu}(z) = e^{-i\nu\pi} \Hank{2}{\nu}(z).
  \label{eq:hank_minusnu}
\end{equation}
Denoting by $\Omega_{\nu}$ any of the Bessel functions introduced so far,
the following relations stand:
\begin{subequations}
\begin{gather}
	\Omega_{\nu - 1}(z) + \Omega_{\nu + 1}(z) = \frac{2\nu}{z} \Omega_{\nu}(z)
	\label{eq:bessel_rec_nu},\\
	\Omega_{\nu - 1}(z) - \Omega_{\nu + 1}(z) = 2 \Omega^\prime_{\nu}(z)
	\label{eq:bessel_rec_nuprime},\\
	\Omega^\prime_{\nu}(z) = \Omega_{\nu - 1}(z) - \frac{\nu}{z} \Omega_{\nu}(z)
	\label{eq:bessel_rec_nuprime_minus},\\
	\Omega^\prime_{\nu}(z) = -\Omega_{\nu + 1}(z) + \frac{\nu}{z} \Omega_{\nu}(z)
	\label{eq:bessel_rec_nuprime_plus}.
\end{gather}
\end{subequations}
A common example of Hankel functions is that of order $\nu = 1/2$:
\begin{subequations}\label{eq:hankel_1_2}
\begin{align}
	\Hank{1}{1/2} &= -i \sqrt{\frac{2}{\pi z}} e^{i z}\label{eq:hankel1_1_2},\\
	\Hank{2}{1/2} &= \phantom{-}i \sqrt{\frac{2}{\pi z}} e^{-i z}.
	\label{eq:hankel2_1_2}
\end{align}
\end{subequations}
\end{section}
\begin{section}{Asymptotic forms}
In this section we give the asymptotic forms for small and large values of the
argument, corresponding to the Hankel functions and their derivatives.

For small values of the argument we have \cite{bookpart:zwillinger_bessel}:
\begin{subequations}\label{eq:bessel_all_as_smallz}
\begin{align}

	\Hank{1}{\nu}(z) &=
	\phantom{-}\left(\frac{2}{z}\right)^{\nu} \frac{\Gamma(\nu)}{i\pi} +
	\left(\frac{z}{2}\right)^{\nu} \frac{1+i\cot(\pi\nu)}{\Gamma(1+\nu)}+
	\mathcal{O}(z^{2 \pm \nu}),
	\label{eq:hankel1_as_smallz}\\
	\Hank{2}{\nu}(z) &=
	-\left(\frac{2}{z}\right)^{\nu} \frac{\Gamma(\nu)}{i\pi} +
	\left(\frac{z}{2}\right)^{\nu} \frac{1-i\cot(\pi\nu)}{\Gamma(1+\nu)} +
	\mathcal{O}(z^{2\pm \nu}).
	\label{eq:hankel2_as_smallz}
\end{align}
\end{subequations}
The derivatives of the Hankel functions can be approximated by:
\begin{subequations}\label{eq:hankelp_as_smallz}
\begin{align}
	\Hank{1}{\nu}(z)^{\prime} &=
	- \frac{\nu}{z} \left(\phantom{-}
	\left(\frac{2}{z}\right)^{\nu} \frac{\Gamma(\nu)}{i\pi} -
	\left(\frac{z}{2}\right)^{\nu} \frac{1+i\cot(\pi\nu)}{\Gamma(1+\nu)}
	\right) + \mathcal{O}(z^{2\pm \nu}), \label{eq:hankel1prime_as_smallz}\\
	\Hank{2}{\nu}(z)^{\prime} &=
	- \frac{\nu}{z} \left(
	-\left(\frac{2}{z}\right)^{\nu} \frac{\Gamma(\nu)}{i\pi} -
	\left(\frac{z}{2}\right)^{\nu} \frac{1-i\cot(\pi\nu)}{\Gamma(1+\nu)}
	\right) + \mathcal{O}(z^{2\pm \nu}). \label{eq:hankel2prime_as_smallz}
\end{align}
\end{subequations}
For large values of the argument we can use \cite{book:abramowitzstegun}:
\begin{subequations}\label{eq:bessel_all_as_largez}
\begin{align}
	\Hank{1}{\nu}(z) &=
	\sqrt{\frac{2}{\pi z}} e^{i(z - \nu\pi/2 - \pi/4)}
	\left(1 + \mathcal{O}(z^{-1})\right),
	\label{eq:hankel1_as_largez}\\
	\Hank{2}{\nu}(z) &=
	\sqrt{\frac{2}{\pi z}} e^{-i(z - \nu\pi/2 - \pi/4)}
	\left(1 + \mathcal{O}(z^{-1})\right).
	\label{eq:hankel2_as_largez}
\end{align}
\end{subequations}
The derivatives of the Hankel functions are simply
\begin{subequations}\label{eq:hankelprime_as_largez}
\begin{align}
	\Hank{1}{\nu}(z)^{\prime} &=
	i \sqrt{\frac{2}{\pi z}} e^{i(z - \nu\pi/2 - \pi/4)}
	\left(1 + \mathcal{O}(z^{-1})\right),
	\label{eq:hankel1prime_as_largez}\\
	\Hank{2}{\nu}(z)^{\prime} &=
	-i \sqrt{\frac{2}{\pi z}} e^{i(z - \nu\pi/2 - \pi/4)}
	\left(1 + \mathcal{O}(z^{-1})\right).
	\label{eq:hankel2prime_as_largez}
\end{align}
\end{subequations}
Hankel's expansion is given by:
\begin{subequations}\label{eq:bessel_all_as_hankel_largez}
\begin{align}
	\Hank{1}{\nu}(z) &=
	\sqrt{\frac{2}{\pi z}}(P(\nu, z) + i Q(\nu, z)) e^{i\chi},
	\label{eq:hankel1_as_hankel}\\
	\Hank{2}{\nu}(z) &=
	\sqrt{\frac{2}{\pi z}}(P(\nu, z) - i Q(\nu, z)) e^{-i \chi},
	\label{eq:hankel2_as_hankel}
\end{align}
with
\begin{align}
	P(\nu, z) &\xrightarrow[z\rightarrow \infty]{}
	\sum_{k = 0}^{\infty} (-1)^k \frac{(\nu, 2k)}{(2z)^{2k}}\nonumber\\
	&= 1 - \frac{(\mu - 1)(\mu - 9)}{2!(8z)^2} +
	\frac{(\mu - 1)(\mu - 9)(\mu - 25)(\mu - 49)}{4!(8z)^4}
	+ \mathcal{O}(z^{-6}),\label{eq:P_hankel}\\
	Q(\nu, z) &\xrightarrow[z\rightarrow \infty]{}
	\sum_{k = 0}^{\infty} (-1)^k \frac{(\nu, 2k + 1)}{(2z)^{2k + 1}}\nonumber\\
	&= \frac{\mu - 1}{8z} -
	\frac{(\mu - 1)(\mu - 9)(\mu - 25)}{3!(8z)^3} +
	+ \mathcal{O}(z^{-5}),\label{eq:Q_hankel}\\
	(\alpha, n) &=
	- \frac{(n - 1/2)^2 - \alpha^2}{n} (\alpha, n - 1) ,\qquad
	(\alpha, 0) = 1,\nonumber\\
	\chi &= z - \frac{\pi\nu}{2} - \frac{\pi}{4},\nonumber\\
	\mu &= 4\nu^2. \nonumber
\end{align}
\end{subequations}
Hankel's expansion for the derivatives is:
\begin{subequations}\label{eq:besselp_all_as_hankel_largez}
\begin{align}
	\Hank{1}{\nu}^\prime(z) &=
	i \sqrt{\frac{2}{\pi z}}(R(\nu, z) + i S(\nu, z)) e^{i\chi},
	\label{eq:hankel1p_as_hankel}\\
	\Hank{2}{\nu}^\prime(z) &=
	-i \sqrt{\frac{2}{\pi z}}(R(\nu, z) - i S(\nu, z)) e^{-i \chi},
	\label{eq:hankel2p_as_hankel}
\end{align}
with
\begin{align}
	R(\nu, z) &\xrightarrow[z\rightarrow \infty]{}
	\sum_{k = 0}^{\infty} (-1)^k
	\frac{4\nu^2+16k^2-1}{4\nu^2-(4k-1)^2} \frac{(\nu, 2k)}{(2z)^{2k}}\nonumber\\
	&= 1 - \frac{(\mu - 1)(\mu + 15)}{2!(8z)^2} + \mathcal{O}(z^{-4}),
	\label{eq:R_hankel}\\
	S(\nu, z) &\xrightarrow[z\rightarrow \infty]{}
	\sum_{k = 0}^{\infty} (-1)^k
	\frac{4\nu^2+4(2k+1)^2-1}{4\nu^2-(4k+1)^2} \frac{(\nu, 2k + 1)}{(2z)^{2k + 1}}\nonumber\\
	&= \frac{\mu + 3}{8z} -
	\frac{(\mu - 1)(\mu - 9)(\mu + 35)}{3!(8z)^3} + \mathcal{O}(z^{-5}).
	\label{eq:S_hankel}
\end{align}
\end{subequations}
\end{section}
\begin{section}{Hankel functions for the de Sitter scalar field}\label{sec:hank_kg}
Here we give some useful insight on the Hankel functions employed in the
development of the scalar theory on de Sitter space.

The solution to the scalar field equation \eqref{eq:kg_Z_def} is chosen
such that in the conformally coupled massless case ($\mu = 1/4$) it
approaches the Minkowski plane-wave solution. Indeed, the Hankel function
of order $\nu = 1/2$, given by \eqref{eq:hankel1_1_2}, has the exponential
form we are looking for:
\begin{equation*}
	\varphi_p(\eta) \sim_{\substack{m = 0\\\xi = 1/6}} e^{-i p \eta}.
\end{equation*}
The complex conjugate of $Z_\nu(z)$ is
\begin{equation*}
	Z^{*}_\nu(z) = \begin{cases}
	\Hank{2}{\nu}(z) & \mu > 0,\\
	e^{-\frac{\pi\nu}{2}} \Hank{2}{-i \nu}(z) & \mu < 0.
\end{cases}
\end{equation*}
The imaginary argument flipped sign. We can use \eqref{eq:hank_minusnu} to
get the sign back:
\begin{equation*}
	Z^{*}_\nu(z) = \begin{cases}
		\Hank{2}{\nu}(z) & \mu > 0,\\
		e^{\frac{\pi\nu}{2}} \Hank{2}{i \nu}(z) & \mu < 0.
	\end{cases}
\end{equation*}
which is just what \eqref{eq:kg_Z_def} states. It is important to note
that the Wronskian of $Z_{\nu}$ and $Z^*_\nu$ is the same in both branches,
irrespective of the value of $M^2$, and is given by
\eqref{eq:hankel12_wronskian}:
\begin{equation}
	W(Z_\nu(z), Z^*_\nu(z)) = - \frac{4 i}{\pi z}.
	\label{eq:kg_wronski}
\end{equation}
Although the normalization factor is dependent on the value of $\mu$,
it cancels in products of the form $Z_\nu Z^*_\nu$.
\end{section}
\begin{section}{Hankel functions for the de Sitter spinorial field}\label{sec:hank_dirac}
In this section we briefly discuss the Hankel functions used for the
construction of the solutions to the Dirac equation on de Sitter space
\eqref{eq:dirac_fieldeq}, which are written in terms of Hankel functions
$\Hank{1/2}{\nu_\pm}(z)$, with $\nu_{\pm} = \nicefrac{1}{2} \pm k$ and
$z = -p\eta$. In the massless limit, the Dirac equation field is conformal
to the Minkowski case and the solutions \eqref{eq:dirac_Usol_frw} reduce to
\begin{equation}
	U_{{\Vec{p}}, \lambda}(\eta,\Vec{x}) \xrightarrow[m\rightarrow 0]{} \frac{1}{(2\pi)^{3/2} \sqrt{2}}
	(-\omega\eta)^{3/2}
	\begin{pmatrix}
		\xi_{\lambda}({\Vec{p}})\\2\lambda \xi_{\lambda}({\Vec{p}})
	\end{pmatrix}
	e^{-i p \eta + i {\Vec{p}} \Vec{x}}.
	\label{eq:dirac_Usol_m0}
\end{equation}
Up to a factor $(-\omega \eta)^{3/2}$, this is the polarized plane wave
solution on the Minkowski space.

Under complex conjugation, the Hankel functions change order and kind:
\begin{equation}
	\Hank{1}{\nu_\pm}^*(z) = \Hank{2}{\nu_\mp}(z).
	\label{eq:hank_nupms}
\end{equation}
Using \eqref{eq:bessel_rec_nuprime_minus}, \eqref{eq:hank_minusnu} and
$-\nu_\pm = 1 - \nu_\mp$ we find:
\begin{subequations}\label{hank_nupm_prime}
\begin{align}
	\Hank{1}{\nu_\pm}^\prime(z) &= \phantom{-}
	i e^{\pm\pi k} \Hank{1}{\nu_\mp}(z)-\frac{\nu_{\pm}}{z}\Hank{1}{\nu_\pm}(z),
	\label{eq:hank1_nupm_prime}\\
	\Hank{2}{\nu_\pm}^\prime(z) &=
	-i e^{\mp\pi k}\Hank{2}{\nu_\mp}(z)-\frac{\nu_{\pm}}{z}\Hank{2}{\nu_\pm}(z).
	\label{eq:hank2_nupm_prime}
\end{align}
\end{subequations}
Replacing this in the wronskian \eqref{eq:hankel12_wronskian} we find
\begin{equation*}
	iW(\Hank{1}{\nu_-}, \Hank{2}{\nu_-}) =
	e^{\pi k} \Hank{2}{\nu_+}(z) \Hank{1}{\nu_-}(z) +
	e^{- \pi k} \Hank{2}{\nu_-}(z) \Hank{1}{\nu_+}(z),
\end{equation*}
and we arrive at the identity \cite{art:cota_polarized_fermions}:
\begin{equation}
	e^{\pi k} \Hank{2}{\nu_+}(z) \Hank{1}{\nu_-}(z) +
	e^{- \pi k} \Hank{2}{\nu_-}(z) \Hank{1}{\nu_+}(z) = \frac{4}{\pi z}.
	\label{eq:hank_idcota}
\end{equation}
Because the order is $\nu_{\pm} = 1/2 \pm ik$, the small argument
approximation \eqref{eq:bessel_all_as_smallz} is
\begin{subequations}\label{eq:hankelnu_as_smallz}
\begin{align}
	\Hank{1}{\nu_\pm}\left(\frac{p}{\omega}\right) &\xrightarrow[z\rightarrow 0]{} \phantom{-}
	\sqrt{\frac{2\omega}{p}} \frac{1}{i\pi} \Gamma_\pm(p,p) +
	\sqrt{\frac{p}{2\omega}}\frac{e^{\pm \pi k}}{\pi\nu_\pm}
	\Gamma_\mp(p,p),
	\label{eq:hankelnu1_as_smallz}\\
	\Hank{2}{\nu_\pm}\left(\frac{p}{\omega}\right) &\xrightarrow[z\rightarrow 0]{}
	-\sqrt{\frac{2\omega}{p}} \frac{1}{i\pi} \Gamma_\pm(p,p) +
	\sqrt{\frac{p}{2\omega}}\frac{e^{\mp \pi k}}{\pi\nu_\pm}
	\Gamma_\mp(p,p).
	\label{eq:hankelnu2_as_smallz}
\end{align}
\end{subequations}
The shorthand notation $\Gamma_{\pm}(p, q)$ stands for
\begin{equation}
	\Gamma_{\pm}(p, q) = \left(\frac{2\omega}{\sqrt{pq}}\right)^{\pm ik}
	\Gamma(\nu_{\pm}),\qquad
	\Gamma_{+}^*(p, q) = \Gamma_{-}(p, q) \quad,\quad
	\abs{\Gamma_{\pm}(p, q)}^2 = \frac{\pi}{\cosh{\pi k}}.
	\label{eq:def_gammapm}
\end{equation}
We have used the identity
\begin{equation}
	\Gamma(x) \Gamma(1-x) = \frac{\pi}{\sin{\pi x}}.
	\label{eq:gamma_id}
\end{equation}
\end{section}

\chapter{Pauli spinors} \label{chap:pauli_spinors}
\begin{section}{Spinor construction}
	The Pauli spinors are two-component eigenvectors of the Pauli matrices:
	\begin{align}
		\sigma_1 = \begin{pmatrix}
		0 & 1\\
		1 & 0 \end{pmatrix}
		,\qquad
		\sigma_2 = \begin{pmatrix}
		0 & -i\\
		i & 0 \end{pmatrix}
		,\qquad
		\sigma_3 = \begin{pmatrix}
		1 & 0\\
		0 & -1 \end{pmatrix}.
		\label{eq:pauli_matrices}
	\end{align}
	These matrices have the following (anti)-commutation rules:
	\begin{equation}
		\acomm{\sigma_i}{\sigma_j} = 2 \delta_{ij},\qquad
		\comm{\sigma_i}{\sigma_j} = 2i \varepsilon_{ijk} \sigma_k.
		\label{eq:sigma_comm_anticomm}
	\end{equation}
	The goal of this section is to construct the Pauli spinors
	$\xi_\lambda({\Vec{p}})$ and $\eta_\lambda({\Vec{p}})$ defined by \eqref{eq:dirac_xietadef}.
	Let $\Vec{n} = {\Vec{p}}/p$ be the
	unit vector along ${\Vec{p}}$. The eigenvalue equations for $\xi$ and $\eta$ are
	\begin{equation}
		\Vec{n} \cdot \boldsymbol\sigma \xi_{\lambda}(\Vec{n}) = 2 \lambda \xi_{\lambda}(\Vec{n}),\qquad
		\Vec{n} \cdot \boldsymbol\sigma \eta_{\lambda}(\Vec{n}) = -2 \lambda \eta_{\lambda}(\Vec{n}).
		\label{eq:xieta_eigeneq}
	\end{equation}
	First, we solve the equation for $\Vec{n}=(0,0,1)$. If we denote
	$\xi_\lambda(\Vec{e}_3) = (\xi^1_\lambda, \xi^2_\lambda)^{\rm T}$,
	we arrive at the equation
	\begin{equation*}
		(1 - 2\lambda) \xi^1_\lambda = 0,\qquad
		(1 + 2\lambda) \xi^2_\lambda = 0.
	\end{equation*}
	From this we conclude that $\lambda = \pm 1/2$, so
	$1 - 4\lambda^2 = (1 - 2\lambda)(1 + 2\lambda) = 0$. This gives the
	natural solution for $\xi$ (and $\eta$ through (\ref{eq:dirac_etaxicc})):
	\begin{equation}
		\xi_{\lambda}(\Vec{e}_3) = \begin{pmatrix}
			\frac{1}{2} + \lambda \\
			\frac{1}{2} - \lambda
		\end{pmatrix},\qquad
		\eta_{\lambda}(\Vec{e}_3) = \begin{pmatrix}
			\frac{1}{2} - \lambda \\
			-\frac{1}{2} - \lambda
		\end{pmatrix}.
		\label{eq:xieta_e3}
	\end{equation}
	Explicitly, the spinors have the following form:
	\begin{equation}
	\begin{array}{c|cc}
		& \xi_{\lambda}(\Vec{e}_3) & \eta_{\lambda}(\Vec{e}_3)\\\hline
		\lambda=\frac{1}{2} & \begin{pmatrix}	1\\ 0	\end{pmatrix} &
		\begin{pmatrix}	0\\ -1	\end{pmatrix}\smallskip\\
		\lambda=-\frac{1}{2} & \begin{pmatrix}	0\\ 1	\end{pmatrix} &
		\begin{pmatrix}	1\\ 0	\end{pmatrix}
	\end{array}
	\end{equation}
	These spinors are already orthonormal in the sense that
	\begin{equation}
		\xi_{\lambda}^{\dagger}(\Vec{e}_3)\xi_{\lambda^{\prime}}(\Vec{e}_3) = \delta_{\lambda\lambda^{\prime}},\qquad
		\eta_{\lambda}^{\dagger}(\Vec{e}_3)\eta_{\lambda^{\prime}}(\Vec{e}_3) = \delta_{\lambda\lambda^{\prime}}.
		\label{eq:xieta_ortho_e3}
	\end{equation}
	The spinors corresponding to arbitrary orientations $\Vec{n}$ can be
	constructed from the above by using the spinorial representation
	of the $SU(2)$ group, $D_{\Vec{n}}(\theta) = \exp(-i \Vec{n} \boldsymbol\sigma/2)$.
	We shall use the {\em Euler angles} parametrization of the rotation
	group:
	\begin{equation*}
		R(\alpha, \beta, \gamma) = R_3(\alpha)R_2(\beta)R_3(\gamma).
	\end{equation*}
	$R$ stands for the standard $3$-dimensional representation of the rotation
	group, and $D(R)$ is the spinorial representation of the rotation $R$.
	The subscripts of the form $i$ denote rotations about the $i$ coordinate
	axis.	The rotation which brings a vector on the third axis given by
	spherical coordinates $\theta=0, \varphi=0$ to an arbitrary position
	$\Vec{n}(\theta, \varphi)$ is $R(\varphi, \theta, 0)$, and thus we expect
	that the eigenvector of the operator $\Vec{n} \cdot \boldsymbol\sigma$ is given by
	\begin{equation*}
		\Vec{n} \boldsymbol\sigma \xi_{\lambda}(\Vec{n}) = 2\lambda \xi_{\lambda}(\Vec{n}),\qquad
		\xi_{\lambda}(\Vec{n}) = D_3(\varphi) D_2(\theta) \xi_{\lambda}(\Vec{e}_3).
	\end{equation*}
	We can prove the validity of this construction by considering the action of
	the rotation $D(\varphi,\theta,0)$ over the eigenvalue equation
	\eqref{eq:xieta_eigeneq} for $\Vec{n} = \Vec{e}_3$. The following identity
	($A$ and $B$ are matri\-ces)
	is useful:
	\begin{equation}
	e^{A} B e^{-A} = B + \comm{A}{B} + \frac{1}{2!} \comm{A}{\comm{A}{B}} + \dots
	= B + \sum_{n} \frac{1}{n!} \ad{A}^n(B).\label{eq:id_eA_B_eA}
	\end{equation}
	With \ad{X} given by
	\begin{equation}
		\ad{X}(Y) = \comm{X}{Y},\qquad \ad{X}^{n+1}(Y)
		= \comm{X}{\ad{X}^n(Y)}. \label{eq:ad_def}
	\end{equation}
	By using the commutation relations \eqref{eq:sigma_comm_anticomm} between
	the $\sigma$ matrices, we can evaluate
	\begin{equation}
		D_j(\theta) \sigma_i D_j^{\dagger}(\theta)
		= \sigma_j \cos{\theta} + \varepsilon_{ijk} \sigma_k \sin{\theta},
		\qquad i\neq j.
		\label{eq:sigmai_rotj}
	\end{equation}
	Succesively applying relation \eqref{eq:sigmai_rotj} for the two rotations
	$D(\Vec{n}) = D_3(\varphi) D_2(\theta)$ yields
	\begin{equation*}
		D(\varphi,\theta,0) \sigma_3 \xi_{\lambda}(\Vec{e}_3) =
		(\sigma_1 \sin{\theta} \cos{\varphi} + \sigma_2 \sin{\theta} \sin{\varphi}
		+ \sigma_3 \cos{\theta}) D_3(\varphi) D_2(\theta) \xi_{\lambda}(\Vec{e}_3),
	\end{equation*}
	which is equivalent to the eigenvalue equation \eqref{eq:xieta_eigeneq}.
	This enables us to define the spinors of arbitrary orientation $\Vec{n}$ as
	\begin{subequations}\label{eq:xieta_vn_def}
	\begin{gather}
		\Vec{n} \cdot \boldsymbol\sigma \xi_{\lambda}(\Vec{n}) = 2\lambda \xi_{\lambda}(\Vec{n}),\qquad
		\xi_{\lambda}(\Vec{n}) = D(\Vec{n}) \xi_{\lambda}(\Vec{e}_3), \label{eq:xi_vn_def}\\
		\Vec{n} \cdot \boldsymbol\sigma \eta_{\lambda}(\Vec{n}) = -2\lambda \eta_{\lambda}(\Vec{n}),\qquad
		\eta_{\lambda}(\Vec{n}) = D(\Vec{n}) \xi_{\lambda}(\Vec{e}_3). \label{eq:eta_vn_def}
	\end{gather}
	\end{subequations}
	The explicit form of these spinors can be obtained by evaluating the rotation
	matrices $D_3(\varphi)$ and $D_2(\theta)$ and applying them following the
	prescription \eqref{eq:xieta_vn_def}:
	\begin{subequations} \label{eq:xi_eta_vn}
	\begin{align}
		\xi_{\lambda}(\theta,\varphi) &= \begin{pmatrix}
			e^{-i\varphi/2} \left(
			\cos{\frac{\theta}{2}} \left(\frac{1}{2} + \lambda\right) -
			\sin{\frac{\theta}{2}} \left(\frac{1}{2} - \lambda\right) \right)\\
			e^{i\varphi/2} \left(
			\cos{\frac{\theta}{2}} \left(\frac{1}{2} - \lambda\right) +
			\sin{\frac{\theta}{2}} \left(\frac{1}{2} + \lambda\right) \right)
		\end{pmatrix}, \label{eq:xi_vn}\\
		\eta_{\lambda}(\theta,\varphi) &= \begin{pmatrix}
			e^{-i\varphi/2} \left(
			\cos{\frac{\theta}{2}} \left(\frac{1}{2} - \lambda\right) +
			\sin{\frac{\theta}{2}} \left(\frac{1}{2} + \lambda\right) \right)\\
			e^{i\varphi/2} \left(
			-\cos{\frac{\theta}{2}} \left(\frac{1}{2} + \lambda\right) +
			\sin{\frac{\theta}{2}} \left(\frac{1}{2} - \lambda\right) \right)
		\end{pmatrix}.\label{eq:eta_vn}
	\end{align}
	\end{subequations}
	Explicitly, these spinors are
	\begin{equation}
	\begin{array}{c|cc}
		& \xi_{\lambda}(\Vec{n}) & \eta_{\lambda}(\Vec{n})\\\hline
		%
		\lambda=\frac{1}{2} &
		\begin{pmatrix}
			e^{-i\varphi/2} \cos{\frac{\theta}{2}}\\
			e^{\phantom{-}i\varphi/2} \sin{\frac{\theta}{2}}
		\end{pmatrix}
		&
		\begin{pmatrix}
			\phantom{-}e^{-i \varphi/2} \sin{\frac{\theta}{2}}\\
			-e^{\phantom{-}i \varphi/2} \cos{\frac{\theta}{2}}
		\end{pmatrix}
		\smallskip\\
		%
		\lambda=-\frac{1}{2} &
		\begin{pmatrix}
			-e^{-i \varphi/2} \sin{\frac{\theta}{2}}\\
			\phantom{-}e^{\phantom{-}i \varphi/2} \cos{\frac{\theta}{2}}
		\end{pmatrix}
		&
		\begin{pmatrix}
			e^{-i\varphi/2} \cos{\frac{\theta}{2}}\\
			e^{\phantom{-}i\varphi/2} \sin{\frac{\theta}{2}}
		\end{pmatrix}
	\end{array}
	\end{equation}
	The appearance of half angles should not be a surprise, since we are working
	in a spinorial representation of $\mathcal{S}\mathcal{U}(2)$ (spin $\frac{1}{2}$). The
	interesting feature of this representation is that
	$\xi_\lambda(\theta, \phi+2\pi) = -\xi_{\lambda(\theta,\phi)}$. This property
	will be very important in understanding the Bogoliubov coefficients defined
	in \autoref{chap:dirac_bogo}.

	In order to be convinced that the above definition for $\eta$ still obeys
	the conjugation relation \eqref{eq:dirac_etaxicc}, we use the anticommutation
	relations \eqref{eq:sigma_comm_anticomm} and the explicit forms of the
	$\sigma$ matrices \eqref{eq:pauli_matrices} to obtain
	\begin{equation}
		\sigma_2 \sigma_i = - \sigma_i^* \sigma_2. \label{eq:sigma_cc}
	\end{equation}
	We apply the conjugation relation \eqref{eq:dirac_etaxicc}
	to the equation defining $\xi_\lambda(\Vec{n})$ \eqref{eq:xieta_vn_def}
	and we obtain
	\begin{equation}
		i \sigma_2 D^{*}(\Vec{n})\xi^*_{\lambda}(\Vec{e}_3) =
		D(\Vec{n}) (i \sigma_2 \xi^*_{\lambda}(\Vec{e}_3)),
	\end{equation}
	since $D^{*}_k(\varphi) = \exp(i \varphi \sigma_k^* /2)$.

	Finaly, these spinors obey the same orthonormalization relations as their
	$\Vec{e}_3$ counterparts (\eqref{eq:xieta_ortho_e3}):
	\begin{equation}
		\xi^\dagger_{\lambda^{\prime}}(\Vec{n}) \xi_{\lambda}(\Vec{n}) = \delta_{\lambda\lambda^{\prime}}
		,\qquad
		\eta^\dagger_{\lambda^{\prime}}(\Vec{n}) \eta_{\lambda}(\Vec{n}) = \delta_{\lambda\lambda^{\prime}}
		\label{eq:xieta_ortho_vn}
	\end{equation}
\end{section}
\begin{section}{Behaviour under parity transformations}
	It is instructive to consider the parity-transformed spinor corresponding
	to $-\Vec{n}$. In spherical coordinates, the easiest way to define this
	reflection about the origin of the coordinate axes is
	\begin{equation}
		\Vec{n}(\theta, \varphi) \mapsto -\Vec{n}(\pi - \theta, \varphi + \pi)
		\mapsto -(-\Vec{n})(\theta, \varphi + 2\pi).
		\label{eq:sph_rev}
	\end{equation}
	We can see that two consecutive reversals (as defined above)
	are equivalent to a shift of $2\pi$ in the angle $\varphi$, which has the
	effect of introducing a $-$ sign in the corresponding spinor. To prove this,
	we must investigate the transformed spinor. Let's analyze first the spinor
	$\xi_{\lambda}(-\Vec{e}_3)$ (which we read from \eqref{eq:xi_vn}):
	\begin{equation}
		\xi_{\lambda}(-\Vec{e}_3) = i \xi_{-\lambda}(\Vec{e}_3).
		\label{eq:xi_me3}
	\end{equation}
	The $i$ factor is the hallmark of the spinorial representations
	of the rotation group. Next, in order to evaluate de general case, we
	must use
	\begin{equation}
		D_3(\pi) D_2(\theta) D_3^{\dagger}(\pi) = D_2(-\theta).
	\end{equation}
	The above follows from the unitarity of the representation
	matrices and relation \eqref{eq:sigmai_rotj}. We can now evaluate the $-\Vec{n}$
	spinor:
	\begin{subequations}\label{xi_eta_mvn}
	\begin{multline}
		\xi_{\lambda}(-\Vec{n}) = D_3(\pi + \varphi) D_2(\pi - \theta) \xi_{\lambda}(\Vec{e}_3) =
		D_3(\varphi) D_2(\theta) D_3(\pi) D_2(\pi) \xi_{\lambda}(\Vec{e}_3)\\
		= i \xi_{-\lambda}(\Vec{n}).
		\label{eq:xi_mvn}
	\end{multline}
	The $\eta$ spinor has a similar behaviour, which we investigate by applying
	the charge conjugation \eqref{eq:dirac_etaxicc} to the above expression:
	\begin{equation}
		\eta_{\lambda}(-\Vec{n}) = -i \eta_{-\lambda}(\Vec{n}).
		\label{eq:eta_mvn}
	\end{equation}
	\end{subequations}
\end{section}

\begin{section}{Relation between \texorpdfstring{$\xi$ and $\eta$}{xi and eta}}
	If we take a closer look at the forms of the spinors $\xi$ and $\eta$
	\eqref{eq:xieta_e3}, we see that there is an easy relation between them:
	\begin{equation}
		\eta_{\lambda}(\Vec{e}_3) = -2 \lambda \xi_{-\lambda}(\Vec{e}_3).
	\end{equation}
	Rotating the above relation to an arbitrary vector $\Vec{n}$, we obtain
	\begin{equation}
		\eta_\lambda(\Vec{n}) = - 2\lambda \xi_{-\lambda}(\Vec{n}).
	\end{equation}
	If we let $\Vec{n} \mapsto -\Vec{n}$ as defined in \eqref{eq:sph_rev}, we find the
	relevant relation
	\begin{equation}
		\eta_{\lambda}(-\Vec{n}) = -2 i \lambda \xi_{\lambda}(\Vec{n}).
		\label{eq:eta_mvn_xi}
	\end{equation}
	With this we can evaluate the inner products
	\begin{equation}
		\eta^\dagger_{\lambda}(-\Vec{n}) \xi_{\lambda^{\prime}}(\Vec{n}) =
		-2 i \lambda \delta_{\lambda\lambda^{\prime}},\qquad
		\xi^\dagger_{\lambda}(-\Vec{n}) \eta_{\lambda^{\prime}}(\Vec{n}) =
		2 i \lambda \delta_{\lambda\lambda^{\prime}}\label{eq:eta_mvn_xi_vn_prod}
	\end{equation}
	These relations will be used in the derivation of the matching coefficients
	between de Sitter and Minkowski modes in \autoref{chap:dirac_bogo}.
\end{section}

\section{abc}\label{sec:aaa}... \nameref{sec:aaa} -> section abc
\def