# Building a quantum superposition of conscious states with integrated
information theory

Kelvin J. McQueen  Ian T. Durham  Markus P. Müller

###### Abstract

Could there be a quantum superposition of consciousness, as in the Wigner’s
friend thought experiment? The integrated information theory (IIT) of
consciousness has turned this into a well-defined question. According to IIT,
consciousness is a measurable physical quantity given by integrated
information ($\Phi$), such that the amount of consciousness in a system
corresponds to its amount of $\Phi$. We use the most recent IIT formalism
(IIT4.0) to analyze the simplest non-zero $\Phi$ system known as a feedback
dyad. We then propose a circuit that puts the dyad into a superposition of
states which, according to IIT, would correspond to a superposition of
conscious states. We refer to this as “Schrödinger’s dyad”. We therefore show
that either IIT is false or the simple dyad is conscious and can easily be put
into a superposition of conscious states. We then identify the simplest
possible consciousness-collapse model, which predicts that this superposition
is unstable and collapses at a rate determined by a measure of difference
between the superposed conscious states. Our analysis will enable us to make a
number of key observations about the general structure of integrated
information theory (IIT2.0, IIT3.0, IIT4.0, and QIIT) and the general
structure of consciousness-collapse models.

###### Contents

  1. 1 Introduction
  2. 2 The feedback dyad
  3. 3 Calculating the amount of consciousness ($\Phi$) in the feedback dyad
  4. 4 Calculating the state of consciousness (Q-shape) of the feedback dyad
  5. 5 The simplest consciousness-collapse model
  6. 6 Physically implementing the dyad
  7. 7 Conclusion
  8. A The general IIT4.0 formalism
  9. B The quantum feedback dyad in QIIT
  10. C Solution of the optimization problem of section 5

##  1 Introduction

Could there be a quantum superposition of consciousness? This question was
raised by Eugene Wigner in the thought experiment that is now known as
“Wigner’s Friend”. Wigner imagined his friend, in a nearby sealed lab, making
a quantum measurement. Wigner, who is uncertain of his friend’s result,
wonders whether he should consider his friend to have entered a quantum
superposition of experiencing different results. Wigner argued that this is
“absurd because it implies that my friend was in a state of suspended
animation”. He then concluded that “consciousness must have a different role
in quantum mechanics than the inanimate measuring device” ([51, p.180]).

There has since been much speculation by physicists and philosophers over
whether states of consciousness could be superposed and what that would even
mean. For example, there have been many attempts to extend the Wigner’s friend
scenario and the associated epistemological and metaphysical implications
([21], [14], [19], [13], [52]). There have also been many attempts to make
sense of superpositions of conscious states in many worlds and many minds
interpretations of quantum mechanics ([20], [44], [50], [33], [16], [5], [8],
[31], [32]). However, without any well-defined criteria for determining which
physical states are conscious (and to what degree), the question of whether
there could be such a superposition, and what it would be like to be in one,
is difficult to evaluate.

Recent neuroscience, on the other hand, has seen the rise of mathematical
theories of consciousness, notably, the integrated information theory, or IIT
for short ([46], [47], [40], [48], [4])). IIT associates systems with both
quantitative amounts of consciousness (roughly, the amount of integrated
information in the system, denoted by the symbol $\Phi$) and qualitative
states of consciousness (roughly, the “shape” of the system’s integrated
information, or its “Q-shape”). More recently, IIT has been extended into the
quantum domain in a framework known as QIIT ([53], [27], [3]). Inspired by
these results, Wigner’s suggestion that consciousness may be responsible for
the collapse of the wave function has been resurrected in models that use
integrated information as a criterion for collapse ([28], [17]). In comparison
to standard collapse models [11], it has been claimed that IIT-based
consciousness-collapse models may be much easier to experimentally test, since
they can be tested by the right sorts of quantum computers, if only we could
design the right sort of circuit [17].

In this paper, we propose such a circuit which, if implemented, would put a
simple quantum computer into a superposition of states of conscious experience
according to the IIT definition of consciousness. Following [17], we consider
the simplest non-zero $\Phi$ system, a feedback dyad. Classically, the dyad
has four possible states: (0,0), (1,1), (0,1), and (1,0). Each state is
predicted to have a tiny amount of consciousness. This prediction is robust
across successive IIT formalisms. Each dyad state has $\Phi=2$ in IIT2.0 and
$\Phi=1$ in IIT3.0, as shown in [37]. Here, we show that each dyad state has
$\Phi=2$ in IIT4.0 (section 3) and in QIIT (appendix B). Although these states
have the same amount of consciousness, they yield different states of
consciousness, because they are associated with different Q-shapes, as we show
in section 4. The dyad in a superposition of two of its four possible states
is therefore the simplest consciousness superposition predicted by IIT. We
refer to this as “Schrödinger’s dyad” and we propose a simple quantum circuit
that allows Schrödinger’s dyad to be built.

We would like to stress that we are not endorsing IIT, and so we remain
agnostic on whether the dyad is conscious in any meaningful sense. IIT has
been shown to be consistent with a number of important experimental results in
neuroscience ([34], [15], [22], [2], [30], [29], [38]). However, many
criticisms of IIT have also been proposed, and we are sympathetic with some of
them ([23], [1], [12], [7], [18], [41]). Either way, what we show is that
unless one drastically revises IIT (e.g. [36], [35]), then either IIT is false
or the dyad is conscious and can easily be put into a superposition of
conscious states. We leave it to the reader to decide between these options.

In section 5 we identify the simplest possible consciousness-collapse model,
which predicts that Schrödinger’s dyad is unstable and collapses at a rate
determined by a measure of difference between the superposed conscious states.
We take the Q-shapes defined in section 4, and use them to define the simplest
possible collapse operators. This toy model makes a number of important
properties of such models transparent. We then compare our toy-model to the
more general consciousness-collapse model proposed in [17].

Finally, in section 6 we propose a physical implementation of Schrödinger’s
dyad, in which two photons enter into a feedback loop inside an optical cable.
On the one hand, the implementation may potentially falsify the simplest
versions of the IIT-based consciousness collapse models. On the other hand,
the example raises a difficulty with IIT when it comes to physical
implementation: IIT assumes that there is always an objective fact of the
matter about what the basic causal units in a physical system are.

In addition to identifying this prediction of IIT, our analysis helps to
reveal much about the structure of IIT. For example, we resolve a crucial
ambiguity in IIT in which logic gates are treated as having binary states
(section 2). We also identify a subtle inconsistency between the IIT4.0
description of the dyad and the axioms of IIT4.0 (appendix A).

The paper is organized as follows. Section 2 describes the classical feedback
dyad. Section 3 shows how to calculate the classical dyad’s $\Phi$ using
IIT4.0. Section 4 provides a simple way of describing the classical dyad’s
Q-shape. Section 5 explains the simple consciousness-collapse model. Section 6
proposes a physical implementation of the dyad, which may test the model, but
which also raises questions about how to understand causality in IIT.

Finally, appendix A explains IIT4.0 more generally and identifies the steps in
the IIT calculus that our simple dyad allowed us to skip; appendix B shows how
our analysis is consistent with QIIT as presented in [3]; and appendix C
proves a general result concerning our Q-shape collapse operators.

##  2 The feedback dyad

The classical dyad is a simple system consisting of two elements or channels,
A and B, that simply swap their states from one time step to the next. That
is, if at some time, $t_{0}$, A is in state 1 and B is in state 0, then at the
next time step, $t_{+1}$, A is in state 0 and B is in state 1. The action on
these channels is equivalent to a logical SWAP gate which is given a simple
diagrammatic representation in Figure 1.

SWAPB$\;:\;b$A$\;:\;a$B$\;:\;a$A$\;:\;b$ Figure 1:  The logical SWAP gate
simply exchanges the values $a$ and $b$ of channels A and B respectively such
that if the input is (A=a,B=b), then the output is (A=b,B=a).

The figure makes it clear that there are three distinct levels of description
to the dyad: channels, channel values, and channel relationships. A and B are
the channels that are related via the logical SWAP gate in such a way as to
exchange their values. In the language of quantum information, the channels
are systems, the channel values are states, and the channel relationships are
transformations. This is a crucial point. The SWAP gate is a transformation of
the states of systems A and B. The gate itself is never “in a state” on its
own.

This is an important distinction because gates are frequently described as
being in a state that possesses a value, especially in IIT3.0 [40]. In
particular, the elements or nodes in the IIT3.0 diagrams have binary states
but are also treated as being logic gates. If the nodes are understood as
neurons, then they are considered as being in an “active” or an “inactive”
state [9], much like a channel. Yet the neurons are also said to act like
gates by only activating in response to the right combination of connections
to other neurons that are themselves either active or inactive. But this is
really a notational relic from the early days of Boolean networks [24, 25]
that ignores what is happening at a more granular level. In the neuronal case,
an “active” or “inactive” neuron really refers to whether it sends a signal
via some channel, i.e. it represents an action. The difference is typically
unimportant at the granularity in which it is usually considered. But when
considering quantum models of these networks, this treatment breaks down. As
such, it is the states of the channels that can be in superposition, not the
gates themselves. In a neuronal sense, it is thus conscious states that are in
superposition, not the physical neurons themselves.

Figure 1 also highlights a fundamental causal dependence in the dyad. The
output of channel A causally depends on the input to channel B and vice-versa.
In order to emphasize this point, we use capital letters to identify the
channels or systems themselves and lowercase letters to identify the values
the channels can attain, i.e. their states. One could think of the SWAP gate
as a black box with the channels simply identifying the locations of the
inputs and outputs of the box. Values are fed into the inputs and then
produced by the outputs.

To develop a feedback system with this SWAP gate we simply feed the outputs
directly back into the inputs. For simplicity we can represent this system
over a series of time steps in the manner shown in Figure 3.

BA$t_{-1}$SWAP$t_{0}$SWAP$t_{+1}$BA Figure 2:  The SWAP gate considered as a
feedback system over a series of time steps $t_{-1}$, $t_{0}$, and $t_{+1}$.
The output at any given time step is determined by the input at the previous
time step according to the mapping shown in Figure 1.

The output at a given time step is given as in Figure 1. For example, if the
system at a given time step is given by $(a,b)\in\\{0,1\\}$ where the first
element of the set is the state of channel A and the second is the state of
channel B, if the inputs were $(a=0,b=1)\equiv(0,1)$ the evolution of the
system state over time is just $(0,1)\to(1,0)\to(0,1)$.

Creating Schrödinger’s dyad then requires that we treat the channels as
quantum and represent their states as such. That is, a classical state $(a,b)$
is equivalent to a pure quantum state in the so-called computational basis
$\ket{a,b}$. A superposition of the $\ket{1,0}$ and $\ket{0,0}$ states can be
achieved by feeding the superposition state

$\ket{+}=\frac{1}{\sqrt{2}}\left(\ket{0}+\ket{1}\right)$ (1)

into channel $B$ at $t_{-1}$. The input state to the dyad as a whole at
$t_{-1}$ is

$\ket{0,+}=\ket{0}\otimes\ket{+}=\frac{1}{\sqrt{2}}\left(\ket{0,0}+\ket{0,1}\right),$
(2)

which then evolves into the following state at $t_{0}$:

$\ket{+,0}=\ket{+}\otimes\ket{0}=\frac{1}{\sqrt{2}}\left(\ket{0,0}+\ket{1,0}\right).$
(3)

This is not a superposition of $\Phi$ values, since all four possible
classical states of the dyad have the same $\Phi$ value. It is, however, a
superposition of distinct Q-shapes according to IIT3.0 and IIT4.0, as we show
in section 4. And so according to IIT, the $t_{0}$ state of equation 3
represents a superposition of qualitatively distinct states of consciousness.
We begin by calculating the dyad’s $\Phi$.

##  3 Calculating the amount of consciousness ($\Phi$) in the feedback dyad

The general procedure for calculating $\Phi$ and Q-shape takes many steps.
Fortunately, the simplicity of our dyad allows us to skip several steps and to
emphasize the most important ones. We explain the more general case in
appendix A.

The dyad consists of two parts, A and B. We begin by calculating the
integrated cause information and the integrated effect information of each
part. Integrated information concerns how much information is lost by
partitioning the system, which means replacing a causal relationship with
noise where the noise is represented as an equiprobable distribution over all
possible states.

To illustrate, let us calculate how much integrated effect information A has,
given its present state, about the next state of each of the system’s parts, A
and B. The maximum of these defines A’s integrated effect information.

Given that our dyad is a SWAP gate, it is trivially true that A’s present
state has zero integrated effect information about A’s next state since A’s
next state is entirely determined by B’s present state. Put another way, A’s
possible next states are all equally probable given its current state. So
introducing a partition that induces noise between A at $t_{0}$ and A at
$t_{+1}$ makes no difference. This makes sense given that there is no causal
connection between them in the first place: A affects B but not itself in the
next time step. A’s present state is not causally connected to A’s future
state and so there is no integrated effect information.

However, A’s present state does fully determine B’s future state and so if,
for example, our system’s present state is (1,0), equation 39 in [4] tells us
that the integrated effect information of A’s state at time $t_{0}$ given that
it is in state 1 at that instant, is

$\phi_{e}(a_{t_{0}}=1)=p(b_{t_{+1}}=1|a_{t_{0}}=1)\log_{2}\left[\frac{p(b_{t_{+1}}=1|a_{t_{0}}=1)}{p^{\theta}(b_{t_{+1}}=1|a_{t_{0}}=\textrm{noise})}\right].$
(4)

Here, $p(b_{t_{+1}}=1|a_{t_{0}}=1)$ is the probability that B will be in state
$b=1$ at time $t_{+1}$ given that A is currently in state 1. It is trivially
true that this equals 1. Likewise
$p^{\theta}(b_{t_{+1}}=1|a_{t_{0}}=\textrm{noise})$ represents the probability
that B will be in state 1 at time $t_{+1}$ given the partition $\theta$ which
sets the value of channel A to an equiprobable distribution of the two
possible states. In other words, the partition replaces the effect that A had
on B with noise, which means that B’s future state is randomly determined.
Since there are only two possible states, that means that
$p^{\theta}(b_{t_{+1}}=1|a_{t_{0}}=\textrm{noise})=0.5$. As such, we have

$\phi_{e}(a_{t_{0}}=1)=1\cdot\log_{2}\left[\frac{1}{0.5}\right]=1.$ (5)

The same basic equation tells us that the integrated effect information of B’s
state at time $t_{0}$, $\phi_{e}(b_{t_{0}}=0)$, also equals 1.

The integrated cause information for A is calculated in a slightly different
manner and illustrates a time asymmetry in the equations of IIT. As in the
effect case, the past state of A contains no information about the present
state of A, and likewise for B. We only consider the information B’s past
state has on A’s current state and the information A’s past state has on B’s
current state. Specifically, given a current state of (1,0), equation 42 in
[4] gives

$\phi_{c}(a_{t_{0}}=1)=p(b_{t_{-1}}=1|a_{t_{0}}=1)\log_{2}\left[\frac{p(a_{t_{0}}=1|b_{t_{-1}}=1)}{p^{\theta}(a_{t_{0}}=1|b_{t_{-1}}=\textrm{noise})}\right]$
(6)

where $p(b_{t_{-1}}=1|a_{t_{0}}=1)$ is calculated according to Bayes’ rule as
follows:

$p(b_{t_{-1}}=1|a_{t_{0}}=1)=\frac{p(a_{t_{0}}=1|b_{t_{-1}}=1)\cdot
p(b_{t_{-1}}=1)}{p(a_{t_{0}}=1)}$ (7)

where $p(a_{t_{0}}=1)$ and $p(b_{t_{-1}}=1)$ are unconstrained probabilities
(see equations 6-8 in [4]) and are both equal to 0.5 since, at any given time
step and with no knowledge of past or future states, the probability that we
will find either channel in a given state is 0.5 because there are only two
states. Here we also have that $p(a_{t_{0}}=1|b_{t_{-1}}=1)$ is the
probability that A’s current state is 1 if B’s past state is 1 and
$p(b_{t_{-1}}=1|a_{t_{0}}=1)$ is the probability that B’s past state was 1
given that A’s state is currently 1. As before,
$p^{\theta}(a_{t_{0}}=1|b_{t_{-1}}=\textrm{noise})$ noises the system and is
equal to 0.5. Since $p(a_{t_{0}}=1|b_{t_{-1}}=1)=1$, Bayes’ rule given by
equation (7) tells us that $p(b_{t_{-1}}=1|a_{t_{0}}=1)=1$. As before, then,
we find that $\phi_{c}(a_{t_{0}}=1)=1$. Likewise, the same process tells us
that $\phi_{c}(b_{t_{0}}=0)$ also equals 1.

Equation 45 in [4] then tells us that the integrated information of a part is
the minimum of its integrated effect and integrated cause information, i.e.

$\displaystyle\phi(a_{t_{0}}=1)$
$\displaystyle=\min\left[\phi_{c}(a_{t_{0}}=1),\phi_{e}(a_{t_{0}}=1)\right]$
(8) $\displaystyle\phi(b_{t_{0}}=0)$
$\displaystyle=\min\left[\phi_{c}(b_{t_{0}}=0),\phi_{e}(b_{t_{0}}=0)\right]$
(9)

respectively, which are both trivially 1.

The amount of consciousness ($\Phi$) in the state of the whole system is then
simply a sum of the integrated information of the smaller subsystems as
calculated above. The state of the dyad at the time $t_{0}$ therefore has

$\displaystyle\Phi(t_{0})$ $\displaystyle=\phi(a_{t_{0}}=1)+\phi(b_{t_{0}}=0)$
(10) $\displaystyle=1+1=2$

units of consciousness.

No matter which of its four possible states the dyad is in, all of the above
reasoning applies, and we find that it always has two units of consciousness.
It is therefore not possible to put the dyad into a superposition of
$\Phi$-values. What we can do, however, is put the system into a superposition
of different states of consciousness.

To understand this distinction intuitively, compare experiencing a green
screen with experiencing a blue screen. It might be that these two experiences
do not correspond to any difference in $\Phi$ (why would changing only the
color change the amount of consciousness?). Now imagine that we put a subject
into a superposition of experiencing a blue screen and experiencing a green
screen. By assumption this is not a $\Phi$ superposition, but it is clearly a
superposition of distinct conscious experiences. One might doubt that distinct
human states of consciousness could ever have identical $\Phi$ [26], but IIT
allows for this in AI, and IIT3.0 and IIT4.0 predict that this is indeed the
case for our simple dyad, as we now explain.

##  4 Calculating the state of consciousness (Q-shape) of the feedback dyad

If two qualitatively distinct states of consciousness are quantitatively
identical (i.e. they have identical $\Phi$), then their distinctness must come
down to the different ways in which each state generates that $\Phi$-value.
This difference is what is captured in a Q-shape.111This has come under
various labels in the literature. In [40] it is primarily referred to as a
“maximally irreducible conceptual structure (MICS)”. But it is also referred
to as a “shape in qualia space”, and so we adopt the simpler terminology,
“Q-shape”. In [4] it is referred to as a “$\Phi$-structure”. In this section
we define Q-shapes for all four states of the dyad. We show that these
Q-shapes are distinct. It follows that IIT (as presently formulated) must
treat these states as corresponding to qualitatively distinct states of
consciousness. Finally, we discuss some differences in how Q-shapes are
understood in IIT3.0 versus IIT4.0, which will be relevant to the collapse
model proposed in the next section.

The dyad states $(1,0)$ and $(0,0)$ each have $\Phi=2$, but for different
reasons. This can be seen by partitioning the dyad, replacing some of the
parts by noise, as defined above, and then noting that $(1,0)$ and $(0,0)$
induce different forward and backward probability distributions. These
different distributions lead to different Q-shapes. In the general case of
more complex systems, we also have to weigh the parts according to their
individual values of $\phi$. The simple structure of the dyad allows us to
bypass this (since $\phi(A)=\phi(B)=1$), but we will return to the more
general case in the next section.

We begin with part A, when the dyad is in state $(1,0)$. The prescription of
partitioning means that we replace the complement of A (that is, B) by noise,
i.e. an equiprobable distribution of $0$ and $1$, while keeping $A$ in state
$1$. Evolving this forward in time, we obtain a probability distribution
$(0,\frac{1}{2},0,\frac{1}{2})$, where we have labelled the four states in
lexicographical order: $(0,0),(0,1),(1,0),(1,1)$. Evolving it backwards in
time, i.e. retrodicting the dyad’s state at one time step earlier, we obtain
exactly the same probability distribution. This gives us the first two rows in
the Q-shape matrix

$Q(1,0)=\left(\begin{array}[]{cccc}0&\frac{1}{2}&0&\frac{1}{2}\\\
0&\frac{1}{2}&0&\frac{1}{2}\\\ \frac{1}{2}&\frac{1}{2}&0&0\\\
\frac{1}{2}&\frac{1}{2}&0&0\end{array}\right).$ (11)

The third and fourth row are the forward (effect) and backward (cause)
probability distributions that we obtain if we consider the subsystem B
instead, keeping it in state $0$ and replacing A by noise as above. Thus, the
Q-shape of a given state (such as $(1,0)$) is a collection of four probability
distributions over the four dyad states, represented by the four rows in our
representation matrix.

Performing the calculation for the other dyad states (which each have $\Phi=2$
due to the two parts always having $\phi$=1), we obtain

$Q(0,0)=\left(\begin{array}[]{cccc}\frac{1}{2}&0&\frac{1}{2}&0\\\
\frac{1}{2}&0&\frac{1}{2}&0\\\ \frac{1}{2}&\frac{1}{2}&0&0\\\
\frac{1}{2}&\frac{1}{2}&0&0\end{array}\right),\enspace
Q(0,1)=\left(\begin{array}[]{cccc}\frac{1}{2}&0&\frac{1}{2}&0\\\
\frac{1}{2}&0&\frac{1}{2}&0\\\ 0&0&\frac{1}{2}&\frac{1}{2}\\\
0&0&\frac{1}{2}&\frac{1}{2}\end{array}\right),\enspace
Q(1,1)=\left(\begin{array}[]{cccc}0&\frac{1}{2}&0&\frac{1}{2}\\\
0&\frac{1}{2}&0&\frac{1}{2}\\\ 0&0&\frac{1}{2}&\frac{1}{2}\\\
0&0&\frac{1}{2}&\frac{1}{2}\end{array}\right).$ (12)

Our Q-shapes are not really “shapes”; they are just matrices of probability
distributions. But we can turn them into shapes by following the IIT3.0
prescription described in [40] (see especially Figures 10-12). To obtain such
visualizations for our dyad states, we simply interpret two probability
distributions over the dyad’s state space (which have four real entries each)
as an element of the eight-dimensional vector space $\mathbb{R}^{8}$. This is
the phase space of the dyad. Let us use this to build the “shape”
corresponding to $Q(1,0)$ from equation 11 above. Consider the first two rows
of that matrix. They determine the location of part A. The last two rows
determine the location of part B. This gives us two points in the eight-
dimensional space. Since $\phi=1$ in all our cases, it does not help us to
distinguish Q-shapes, so we have ignored it.

IIT3.0 therefore predicts that the dyad is (minimally) conscious, and can be
in one of four qualitatively distinct conscious states. It is natural
therefore to wonder what it is like to be the dyad, and what these qualitative
differences actually consist of. This is a question that IIT actually aims to
answer. That is, IIT wants to be able to say something about what the
experience of any given conscious system is like, especially when the system
is incapable of verbal reports. The general idea is to extrapolate from
features of our own Q-shapes.

For example, consider what it is like to be an echolocating bat. In [39] it
was famously argued that this question is intractable. However, more recently
in [49] it was argued that IIT makes it tractable. The idea is to consider the
general properties of human visual experience Q-shapes and human auditory
experience Q-shapes. Then, we compare them with bat experience Q-shapes. If
bat experience Q-shapes are “more similar” to, say, human auditory experience
Q-shapes, then we can say something about what it is like to be a bat (it is
more like human auditory experience than human visual experience). Of course
for both human and bat experience, deriving exact Q-shapes is far too
complicated. Consequently, there is also no straightforward way to compare the
dyad Q-shapes with (aspects of) our Q-shapes.

Nonetheless, there is a curious discussion about this in [40] (see Figure 19),
that considers a system that is only slightly more complex than our dyad,
which they call a “photodiode”. It also involves two parts, labelled ‘D’ and
‘P’, that specify each other’s states at each time step. (The main difference
is that D receives two external inputs and has a threshold $\geq$ 2\. All
connections have weight 1. Meanwhile P serves as a memory for the previous
state of D and its feedback to D serves as a predictor of the next external
input by effectively decreasing the threshold of D.) Despite these
differences, its Q-shapes are very similar to our dyad’s Q-shapes. They also
involve two points in an 8D space. About its experience, they say the
following:

> “It is instructive to consider the quality of experience specified by such a
> minimally conscious photodiode. […] D says something about P’s past and
> future, and P about D’s, and that is all. Accordingly, the shape in qualia
> space is a constellation having just two [points], and is thus minimally
> specific. […] Moreover, the symmetry of the [Q-shape] implies that the
> quality of the experience would be the same regardless of the system’s
> state: the photodiode in state DP=00, 01, or 10, receiving one external
> input, generates exactly the same [Q-shape] as DP=11. In all the above
> cases, the experience might be described roughly as “it is like this rather
> than not like this”, with no further qualifications. The photodiode’s
> experience is thus both quantitatively and qualitatively minimal.”

If all four states of the photodiode have the same Q-shape, then they must all
correspond to the same probability distributions. For as they say (in the
IIT3.0 jargon), the probability distributions (or “cause effect repertoires”)
for each part (or each “concept”) specifies what each part “contributes to the
quality of the experience”. (Meanwhile, the $\phi$ of each part is said to be
“how much” the part is present in experience.) But as we have seen, our
feedback dyad does not yield this result: the four possible states correspond
to distinct Q-shapes. It is therefore not possible to simply describe each of
the four possible conscious states of the dyad as “it is like this rather than
not like this”. What could the differences in our four dyad Q-shapes possibly
translate to in experience? These are difficult questions for IIT.

We have mostly followed the IIT3.0 rather than the IIT4.0 prescription for
building Q-shapes. In IIT4.0, they are somewhat simpler, in that they replace
probability distributions with states (see equation (56) in [4]). In
particular, the IIT4.0 Q-shape of any dyad state is given by the $\phi$-values
of A and B as well as the states that these $\phi$-values were maximized over.
So in the case of $Q(1,0)$, A and B both have $\phi=1$; for A this was
maximized over B being in state 1 (i.e. $b=1$), while for B this was maximized
over A being in state 0 (i.e. $a=0$). For $Q(0,0)$, A and B both have
$\phi=1$; for A this was maximized over B being in state 0 (i.e. $b=0$), while
for B this was maximized over A being in state 1 (i.e. $a=1$). The four states
of the dyad therefore correspond to distinct Q-shapes in IIT4.0, consistently
with IIT3.0.

The choice of how to represent Q-shapes here seems somewhat arbitrary, as both
options satisfy the constraint of identifying differences in how the parts
contributed to an overall $\Phi$-value for the system. However, as we explain
in the next section, the IIT3.0 choice is much better suited for a certain
application of IIT: defining a fully general consciousness-collapse model.

##  5 The simplest consciousness-collapse model

In [17] a dynamical collapse model is proposed in which Q-shape superpositions
are unstable and tend to collapse. The following general form for continuous
collapse models ([10, p.27]) is used:

$d\psi_{t}=[-i\hat{H}_{0}dt+\sqrt{\lambda}(\hat{A}-\langle\hat{A}\rangle_{t})dW_{t}-\frac{\lambda}{2}(\hat{A}-\langle\hat{A}\rangle_{t})^{2}dt]\psi_{t}.$
(13)

The first term on the right-hand side of the equation represents Schrödinger
evolution, while the remaining two terms represent the collapse evolution.
Here, $\hat{H}_{0}$ is the Hamiltonian of the system, $\lambda$ is a real-
valued parameter governing the collapse rate, $\hat{A}$ is a collapse operator
whose eigenstates the system collapses towards, $\langle\hat{A}\rangle_{t}$ is
its expected value at time $t$, and $W_{t}$ is a noise process which ensures
that collapse happens stochastically at a rate determined by a measure of
difference between the superposed $\hat{A}$ eigenstates.

The pure state $\rho_{t}^{W}:=|\psi_{t}\rangle\langle\psi_{t}|$ therefore
evolves stochastically. All statistical predictions that we can extract from
this state are linear in $\rho_{t}^{W}$ due to the Born rule. Hence, given a
single realization of the process (13), all statistical predictions (say,
about outcomes of any measurement that we might decide to perform at some
point while the process unfolds) can be computed from
$\rho_{t}:=\mathbb{E}[\rho_{t}^{W}]$ [10]. As a consequence of (13), this
resulting state evolves according to the Lindblad equation

$\frac{d}{dt}\rho_{t}=-i[\hat{H}_{0},\rho_{t}]-\frac{\lambda}{2}[\hat{A},[\hat{A},\rho_{t}]]$
(14)

(for the derivation see e.g. [10]). Hence, the system can evolve via
Schrödinger dynamics, via collapse, or via some combination of the two. To
understand the collapse term we can ignore the Schrödinger dynamics term by
setting its Hamiltonian to zero, $\hat{H}_{0}=0$. The collapse term only has
an effect when the system is in a superposition of eigenstates of $\hat{A}$.
In this situation, the double commutator will be non-zero and the state will
evolve. The “speed” at which it evolves is a function of the eigenvalues
$a_{i}$ of $\hat{A}$. This is because the $(i,k)$th matrix entry of the double
commutator in $\hat{A}$’s eigenbasis is

$[\hat{A},[\hat{A},\rho]]_{ik}=\rho_{ik}(a_{i}-a_{k})^{2}.$ (15)

The dampening of the off-diagonal elements of $\rho$ occurs at a rate that
grows with $(a_{i}-a_{k})^{2}$ where if $a_{i}\neq a_{k}$ the system is in a
superposition. We see that the eigenbasis of $\hat{A}$ determines the collapse
basis, i.e. the basis in which the state becomes “classical”, while its
eigenvalues tell us which superpositions of pairs of such states are removed
more quickly (namely, those with large $(a_{i}-a_{k})^{2}$).

Let us now use this prescription to construct the simplest possible
consciousness collapse model for the dyad. Subsequently, we will compare this
with the more general, but more involved approach in [17]. For the moment, let
us only mention that our simple model contains only a single collapse
operator, whereas the one in [17] involves several such operators,
generalizing Eq. (13). We will say more about the similarities and differences
below.

The four states of the dyad are mutually distinct states of consciousness,
spanning the total Hilbert space. Therefore, we expect a consciousness-
collapse model to lead to a state for large times $t$ that is diagonal in that
basis. Therefore, our collapse operator $\hat{Q}$ will have the form

$\hat{Q}=\lambda_{00}|00\rangle\langle 00|+\lambda_{01}|01\rangle\langle
01|+\lambda_{10}|10\rangle\langle 10|+\lambda_{11}|11\rangle\langle 11|,$ (16)

with four eigenvalues $\lambda_{ij}$. Any consciousness-collapse model should
arguably imply the following principle for the choice of those eigenvalues:

If two states of the dyad (say, $ij$ and $kl$) are qualitatively very
different states of consciousness, then superpositions of these states should
vanish very quickly, i.e. $|\lambda_{ij}-\lambda_{kl}|$ should be very large.

That is, it is natural to allow superpositions of “qualitatively similar”
states to persist for longer, while qualitatively different states must
decohere quickly.

For a quantitative application of this prescription, we need a way to compare
states of consciousness, i.e. a distance measure on Q-shapes. Since Q-shapes
are collections of probability distributions, it is natural to define their
distance in terms of distance measures on probability distributions, which is
a classical and well-studied topic in information theory. The preferred
distance measures on probability distributions in IIT have changed in almost
every successive version. IIT2.0 used the well-known Kullback-Leibler
divergence. IIT3.0 used Earth Mover’s distance [42]. IIT4.0 uses the intrinsic
difference measure from section 3. IIT3.0’s measure was explicitly turned into
a generalized distance measure for Q-shapes. IIT4.0’s measure is not so well
suited for this task, a point we will return to at the end of the section.

A natural choice is to define the distance of two Q-shapes
$Q=(q_{1},q_{2},q_{3},q_{4})^{\top}$ (i.e. with rows $q_{1},\ldots,q_{4}$) and
$\tilde{Q}=(\tilde{q}_{1},\tilde{q}_{2},\tilde{q}_{3},\tilde{q}_{4})^{\top}$
as

$\mathcal{D}(Q,\tilde{Q}):=\sum_{i=1}^{4}\mathcal{D}(q_{i},\tilde{q}_{i}),$
(17)

where $\mathcal{D}$ is some choice of distance measure on the set of
probability distributions. That is, the distance of two Q-shapes is the sum of
the distances of their probability distributions. (This is precisely the form
of IIT3.0’s extended Earth mover’s distance measure.)

Now we have a large choice of possible distance measures $\mathcal{D}$ at our
disposal. However, note that the four Q-shapes of the dyad (Eqs. (11) and
(12)) consist of a small variety of very simple probability distributions
only: all entries are $0$ or $\frac{1}{2}$, and any two rows are either equal,
or they differ in all $4$ entries. Two identical rows must have distance zero.
Furthermore, it is natural to demand that every two probability distributions
arising as rows in these Q-shapes that differ in all four places all have the
same distance, which we can set to unity by a choice of scaling factor. For
example,

$\textstyle\mathcal{D}\left((0,\frac{1}{2},0,\frac{1}{2}),(\frac{1}{2},0,\frac{1}{2},0)\right)=1.$

We can then determine the distances between all pairs of Q-shapes of the dyad
and obtain the following values, writing $\mathcal{D}(Q,\tilde{Q})$ as the
$Q\tilde{Q}$-entry of a table:

| Q(0,0) | Q(0,1) | Q(1,0) | Q(1,1)
---|---|---|---|---
Q(0,0) | $0$ | $2$ | $2$ | $2$
Q(0,1) | $2$ | $0$ | $4$ | $2$
Q(1,0) | $2$ | $4$ | $0$ | $2$
Q(1,1) | $2$ | $2$ | $2$ | $0$

Let us now return to our consciousness-collapse principle. Formulating it in
terms of this distance measure, it reads: If the distance $\mathcal{D}$
between two Q-shapes $Q(i,j)$ and $Q(k,l)$ is large, then the distance between
the eigenvalues $\lambda_{ij}$ and $\lambda_{kl}$ of the collapse operator
must also be large.

This desideratum could always be satisfied by the arbitrary prescription to
make all eigenvalues extremely large and distant from each other. However,
this would typically induce almost-instantaneous collapse, a behavior that we
do not expect for simple systems such as the dyad. Thus, we are searching for
a choice of eigenvalues that is as tame as possible while still satisfying the
above postulate.

This leads us to define the eigenvalues in terms of an optimization problem:

Minimize $\lambda_{00}+\lambda_{01}+\lambda_{10}+\lambda_{11}$ subject to
$\lambda_{ij}\geq 0$,
$|\lambda_{ij}-\lambda_{kl}|\geq\mathcal{D}(Q(ij),Q(kl))$.

This prescription keeps the collapse behavior “tame” by demanding that the
eigenvalues are not arbitrarily large, but only as large as they need to be
(in their total sum) to satisfy our principle for all pairs of Q-shapes. Note
that the total time scale of the collapse is not determined by $\hat{Q}$ and
its eigenvalues, which do not have any physical units. Instead, it is
determined by the noise term of (13), i.e. the parameter $\lambda$ in (14).
This will remain a parameter of the collapse model that needs to be determined
experimentally. The above considerations tell us only the relative speed at
which superpositions between distinct Q-shapes are suppressed, whereas the
total speed would depend on $\lambda$ and hence on further considerations as
to which states of consciousness are implausible to remain in superposition
for significant amounts of time because of, say, human experience.

As we show in appendix C, this optimization problem has twelve solutions: one
of them is

$\lambda_{00}=2,\enspace\lambda_{01}=0,\enspace\lambda_{10}=4,\enspace\lambda_{11}=6,$

and the other solutions are permutations of this one ($(2,0,4,6)$), such as
$(6,4,0,2)$ — indeed, all permutations of these four numbers such that
$|\lambda_{01}-\lambda_{10}|\geq 4$. This degeneracy can be understood as a
consequence of the symmetry of the problem: for example, the table of pairwise
distances does not change if we exchange $Q(0,0)$ and $Q(1,1)$. Indeed, these
solutions do not only minimize the sum of the $\lambda_{ij}$, but they also
minimize the expression

$\frac{1}{2}\sum_{i,j,k,l}|\lambda_{ij}-\lambda_{kl}|=|\lambda_{00}-\lambda_{01}|+|\lambda_{00}-\lambda_{10}|+|\lambda_{00}-\lambda_{11}|+|\lambda_{01}-\lambda_{10}|+|\lambda_{01}-\lambda_{10}|+|\lambda_{10}-\lambda_{11}|,$

i.e. the total sum of the pairwise collapse rates, under the assumption (that
we can always make) that one of the $\lambda_{ij}$ is zero.

We can simply pick one of the six solutions and use it to define our collapse
operator. For the sake of the argument, let us pick the above, but the choice
does not matter for the following discussion.

Let us interpret the result by looking at some example collapse rates. We have
$\mathcal{D}(Q(00),Q(01))=2$ which is small, and
$|\lambda_{00}-\lambda_{01}|=2$ is also small (and, indeed, identical).
Superpositions of the two dyad states $00$ and $01$ can thus remain stable for
a relatively long time. On the other hand, $\mathcal{D}(Q(01),Q(10))=4$ is
large, and so is $|\lambda_{01}-\lambda_{10}|=4$. Hence, superpositions
between the dyad states $01$ and $10$ will be killed off more quickly.

However, consider the two dyad states $01$ and $11$. Their distance is small,
$\mathcal{D}(Q(01),Q(11))=2$, and our principle demands that the corresponding
difference of eigenvalues (i.e. the associated collapse rate) is at least as
large as that. However, it is actually $|\lambda_{01}-\lambda_{11}|=6$, which
is much larger than required. Thus, any superposition of these two dyad states
would fall off much faster than what would be expected by considering the
difference between their Q-shapes alone.

We can understand this behavior by noting that the $n=4$ dyad states lead to
$n(n-1)/2=6$ distance values (the table above), from which $n=4$ eigenvalues
of the collapse operator have to be determined. Thus, every value of
$|\lambda_{ij}-\lambda_{kl}|$ must depend on more than just the number
$\mathcal{D}(Q(ij),Q(kl))$. If our principle is satisfied, then a large value
of the latter implies a large value of the former, but the converse is not in
general true. The quantum limitation of only having $n$ eigenvalues introduces
additional constraints.

It seems that this must be a general phenomenon: if we have $n$ distinct
Q-shapes, but $m\ll n/2$ collapse operators, then the $m\cdot n$ eigenvalues
are smaller in number than the $n(n+1)/2$ distance values. We must hence have
pairs of Q-shapes whose superposition must collapse more quickly than what
their mere qualitative distance as states of consciousness would suggest.
Superposition resistance hence cannot only resemble the structure of conscious
experience, but is also additionally constrained by the general structure of
quantum mechanics.

We can now see how the elements of the construction above are realized in
greater generality in [17]. Here, there is not a single Q-shape operator whose
eigenstates are all the classical Q-shapes. Rather, a Q-shape is associated
with an ensemble of orthogonal self-adjoint collapse operators. The eigenvalue
of each operator does not pick out a Q-shape, but an element of a Q-shape,
which is either an entry in a probability matrix or a $\phi$-value. This
solves the above problem and allows for superposition resistance to resemble
the structure of conscious experience more closely. However it does so at the
cost of having a very complex model.

To illustrate this complexity, consider how many collapse operators we need to
capture all the details of a Q-shape of a classical system. A system of n
elements will have $2^{n}-1$ subsystems. So if we have two elements, as with
our dyad, we have three subsystems (A, B, and AB). We were able to ignore AB
in our simple case but we cannot do that in general. Every element has d
possible states giving a total of $d^{n}$ possible states for the system. Each
subsystem is associated with two probability distributions, as we saw in the
previous section, and one $\phi$-value. To capture all of this, the number of
collapse operators we need is $(2^{n}-1)\times(2\times d^{n}+1)$. So for our
classical dyad, where $n=d=2$, we need 27 collapse operators. It would be
extraordinary if Nature were to operate at such a high level of complexity for
such a simple system.

But this still is not sufficient when dealing with quantum systems, since
qubit elements do not have $d=2$ possible states, but have infinitely many
possible pure states. It is for this reason that the model in [17] formulates
everything in terms of the QIIT found in ([53],[27]). Here each subsystem is
associated with two appropriate density matrices instead of two appropriate
classical probability distributions. The density matrices for the quantum dyad
have more entries than the classical probability distributions associated with
the classical dyad, so we need more collapse operators. In particular, we now
need $(2^{n}-1)\times(2\times d^{2n}+1)$ collapse operators in general, and so
99 collapse operators for our dyad.

The use of QIIT raises a further complication. In QIIT, every quantum system
is assigned a well-defined Q-shape (which in many cases may be the null
Q-shape) whether or not the system is in a superposition of classical
Q-shapes. That is, for QIIT, _distinct states of consciousness do not always
correspond to mutually orthogonal quantum states_ , and this makes it in
general impossible to have physical processes whose observable behavior
depends on all the properties of those states of consciousness (because non-
orthogonal states cannot be perfectly distinguished). In particular, this
excludes collapse models where the rate of collapse is proportional to the
“size” of the superposition, e.g. to the qualitative difference of the
superposed conscious states. The ensemble of collapse operators defined in
equation (2) of [17] therefore adds an additional constraint that restricts
these operators to just those states that are associated with classical
Q-shapes.

Thus, in an attempt to be completely general, the collapse model in [17]
became very complex. But as has been demonstrated here, if one just wants a
collapse model for some simple system whose physical properties are known,
then much of those complexities can be bypassed, as we can instead define a
single collapse operator as we have done here.

Finally, we note that specific predictions of one’s collapse model may vary
with the use of IIT formalism, which is constantly being updated. The choice
of distance measure in particular has undergone significant revision.

IIT2.0 used the Kullback-Leibler divergence to measure the distance between
probability distributions. But that was rejected in part because it is not
symmetric.

IIT3.0 adopted Earth Mover’s distance (EMD). This is symmetric and, as shown
in [40], yields different results than the IIT2.0 measure, even for the dyad.
The EMD can easily be generalized to become a measure of distance between
Q-shapes, as in equation 17. This Q-shape distance measure was essential to
IIT3.0 because it was used to calculate $\Phi$ (by measuring the distance
between the Q-shape of a system’s state and the Q-shape of that state
partitioned). But the EMD has recently been abandoned, in part because of
problems raised in [7]. Alternative measures can be found in [45].

IIT4.0 adopts the intrinsic difference measure, described in IIT4.0 and in
section 3 above, as its preferred distance measure. The intrinsic difference
is infinite if the denominator is zero. This is avoided when the denominator
involves some partition and therefore white noise. But measuring the distance
between two Q-shapes doesn’t involve any partitioning. So, the intrinsic
difference is not suitable for measuring Q-shape distance. Consequently,
IIT4.0 does not supply such a distance measure. This led to a simpler
calculation of $\Phi$ in IIT4.0: the system $\Phi$ is a sum of subsystem
$\phi$-values. QIIT in its most recent version is consistent with IIT4.0 B.

##  6 Physically implementing the dyad

Consider the following simple implementation of the dyad as depicted in Figure
3: channels A and B are optical cables and the dyad does nothing more than
cross those cables, without contact. The outputs are then fed back into the
inputs, creating a kind of feedback cycle. We have two photons in the cables,
and each of them can carry one of two perfectly distinguishable “classical”
states, corresponding to horizontal $|0\rangle$ or vertical polarization
$|1\rangle$. What horizontal or vertical means is determined by an external
reference frame; for what follows, the exact choice of reference is
unimportant, except that the physical situation must tell us what we mean by
both photons carrying _identical_ or _orthogonal_ polarization directions
(e.g. $|00\rangle$ in the first case, and $|01\rangle$ in the second). It is
clear that we are not restricted to preparing the photons in the classical
basis states, but we can prepare them in arbitrary superpositions, such as
that of Equation 3. This is a necessary condition to implement “Schrödinger’s
dyad” as introduced in the previous sections.

ABAB Figure 3:  A possible implementation of the dyad. The dashed line and
labels indicate that the systems A and B are associated with regions of space.

However, if we identify our basic units as the photons that traverse the
cables, then it may not seem like IIT applies here, since IIT requires causal
relationships. In particular, to be a basic unit of IIT, something should have
the power to “take a difference” (be affected by something) and “make a
difference” (produce effects on something) [4]. The concern with this
implementation is that the photons do not take or make a difference, because
they never change their polarization states. Indeed, under this interpretation
of the physical setup, we would not even have implemented the dyad, but
another system (two bits and an identity gate).

On the other hand, this depends on counting the photons as our basic causal
units. If we instead identify our basic units as the polarization qubits at
the physical locations $A$ and $B$ in space, we get a different result. In
particular, we may say that the photon polarization state at At0 causes the
state at Bt+1 and was caused by the state at Bt-1. Under this way of
identifying our basic units, the system has non-zero $\Phi$ and is the
simplest conscious system according to IIT. This may even fit well with
interpretations of modern physics in which the basic causal objects are
spacetime points [43].

IIT does not want the $\Phi$ or Q-shape of a system to depend on some
arbitrary choice: these are meant to be objective properties. So at least one
of the above two causal interpretations of the system must be ruled out. IIT
does not give clear criteria for what to do in such a situation. However, one
option is suggested by the IIT4.0 principle of maximal existence, which states
that “what exists is what exists the most”. This ontological principle is used
to motivate the exclusion principle, which effectively states that if two
overlapping sets of units have non-zero $\Phi$, then only the system with
maximal $\Phi$ is conscious. Thus, if there are multiple interpretations of
what the causal units are in the first place, we might similarly only consider
the interpretation that yields the greater $\Phi$. In that case, we have found
a very simple implementation of the dyad by identifying the qubits with
locations in space.

##  7 Conclusion

In this paper we have described some simple predictions of IIT that have
enabled us to make a number of observations.

First, we showed that either IIT is false, or a simple system like the
feedback dyad is conscious and can easily be put into a quantum superposition
of conscious states (i.e. a superposition of Q-shapes). This result was shown
to be robust across successive IIT formalisms.

Second, we identified the simplest consciousness-collapse (or Q-shape-
collapse) model. It involves a single Q-shape collapse operator, whose
eigenstates are the four possible states of the dyad. For the model to do what
is needed (make the collapse rate proportional to a measure of difference
between the superposed Q-shapes), we found that the four eigenvalues must
depend on six distance values.

In such models, the rate of collapse of a superposition of two states of
consciousness must therefore depend on more than the relation between the two
states. More complex models may avoid this by defining an ensemble of
orthogonal Q-shape collapse operators. However, this can get very complicated,
so for practical purposes (like testing Q-shape-collapse models), the
prescription that we have provided here may be more useful.

Finally, we have made several observations about the general structure of IIT.
For example, we argued that while treating gates as having states is
permissible if gates are neurons, this does not work in general, and
especially not for computers, where gates operate on systems that possess
states. This is especially clear for quantum computers, where qubits, and not
gates, are superposed. We have also noted that to apply IIT to a physical
system, we need a specification of the basic causal units in the system.
Insofar as physics does not specify such things, IIT is not fully applicable
to physical systems.

In further research, it would be interesting to investigate whether any
existing quantum computers (or other quantum systems) can maintain states like
the $t_{0}$ state of our quantum dyad, and for how long. Such systems may
place bounds on the fundamental parameters of IIT-based consciousness-collapse
models.

## Acknowledgments

We are grateful to Thomas D. Galley for discussions, and to Larissa Albantakis
for helpful feedback on an earlier draft. This research was supported by grant
number FQXi-RFP-CPW-2015 from the Foundational Questions Institute and Fetzer
Franklin Fund, a donor advised fund of Silicon Valley Community Foundation.
Moreover, this research was supported in part by Perimeter Institute for
Theoretical Physics. Research at Perimeter Institute is supported by the
Government of Canada through the Department of Innovation, Science, and
Economic Development, and by the Province of Ontario through the Ministry of
Colleges and Universities.

## References

  * [1] S. Aaronson  “Why I Am Not An Integrated Information Theorist (or, the Unconscious Expander)”, 2014  URL: http://www.scottaaronson.com/blog/?p=1799
  * [2] Mohsen Afrasiabi et al.  “More than just front or back: Parietal-striatal-thalamic circuits predict consciousness level”  In _bioRxiv_ , 2020  DOI: 10.1101/2020.04.07.030429
  * [3] Larissa Albantakis, Robert Prentner and Ian Durham  “Computing the Integrated Information of a Quantum Mechanism”  In _Entropy_ 25.3 MDPI, 2023, pp. 449
  * [4] Larissa Albantakis et al.  “Integrated information theory (IIT) 4.0: Formulating the properties of phenomenal existence in physical terms”  In _arXiv preprint arXiv:2212.14787_ , 2022
  * [5] D.. Albert  “Quantum Mechanics and Experience”  Cambridge University Press, 1992
  * [6] Leonardo S. Barbosa et al.  “A measure for intrinsic information”  In _Scientific Reports_ 10, 2020  DOI: 10.1038/s41598-020-75943-4
  * [7] A Barrett and Pedro AM Mediano  “The Phi measure of integrated information is not well-defined for general physical systems”  In _Journal of Consciousness_ 26, 2019, pp. 11–20
  * [8] Jeffrey A Barrett  “The quantum mechanics of minds and worlds”  OUP Oxford, 1999
  * [9] Gary Bartlett  “Does integrated information theory make testable predictions about the role of silent neurons in consciousness?”  In _Neuroscience of Consciousness_ 2022.1 Oxford University Press UK, 2022, pp. niac015
  * [10] A. Bassi  “Gravitational decoherence”  In _Class. Quantum Grav._ 34, 2017
  * [11] A. Bassi et al.  “Models of wave-function collapse, underlying theories, and experimental tests”  In _Rev. Mod. Phys._ 85, 2013, pp. 471–527
  * [12] T. Bayne  “On the axiomatic foundations of the integrated information theory of consciousness”  In _Neuroscience of Consciousness_ 2018.1, 2018
  * [13] Kok-Wei Bong et al.  “A strong no-go theorem on the Wigner’s friend paradox”  In _Nature Physics_ 16.12 Nature Publishing Group UK London, 2020, pp. 1199–1205
  * [14] Časlav Brukner  “A no-go theorem for observer-independent facts”  In _Entropy_ 20.5 MDPI, 2018, pp. 350
  * [15] S. Casarotto et al.  “Stratification of unresponsive patients by an independently validated index of brain complexity”  In _Annals of Neurology_ 80.5, 2016, pp. 718–729
  * [16] D.J. Chalmers  “The Conscious Mind”  Oxford University Press., 1996
  * [17] D.J. Chalmers and K.J. McQueen  “Consciousness and the collapse of the wave function”  In _Consciousness and Quantum Mechanics_ Oxford University Press, 2022  URL: http://arxiv.org/abs/2105.02314
  * [18] A. Doerig, A. Schurger, K. Hess and M.H. Herzog  “The unfolding argument: Why IIT and other causal structure theories cannot explain consciousness”  In _Consciousness and Cognition_ 72, 2019, pp. 49–59
  * [19] Ian T Durham  “Observer-independence in the presence of a horizon”  arXiv, 2019  DOI: 10.48550/arXiv.1902.09028
  * [20] H. Everett  ““Relative State” Formulation of Quantum Mechanics”  In _Rev. Mod. Phys._ 29, 1957, pp. 454–462
  * [21] Daniela Frauchiger and Renato Renner  “Quantum theory cannot consistently describe the use of itself”  In _Nature communications_ 9.1 Nature Publishing Group UK London, 2018, pp. 3711
  * [22] Andrew M. Haun et al.  “Conscious Perception as Integrated Information Patterns in Human Electrocorticography”  In _eNeuro_ 4.5, 2017  DOI: 10.1523/ENEURO.0085-17.2017
  * [23] Amber R Hopkins and Kelvin J McQueen  “Filled/non-filled pairs: an empirical challenge to the integrated information theory of consciousness”  In _Consciousness and Cognition_ 97 Elsevier, 2022, pp. 103245
  * [24] Stuart Kauffman  “Metabolic stability and epigenesis in randomly constructed genetic nets”  In _Journal of Theoretical Biology_ 22, 1969, pp. 437–467
  * [25] Stuart Kauffman  “Origins of Order: Self Organization in Evolution”  Oxford: Oxford University Press, 1990
  * [26] Adrian Kent  “Collapse and Measures of Consciousness”  In _Foundations of Physics_ 51.3 Springer, 2021, pp. 62
  * [27] J. Kleiner and S. Tull  “The Mathematical Structure of Integrated Information Theory”, 2020  arXiv:2002.07655 [q-bio.NC]
  * [28] K. Kremnizer and A. Ranchin  “Integrated Information-Induced Quantum Collapse”  In _Found Phys_ 45, 2015, pp. 889–899
  * [29] Angus Leung and Naotsugu Tsuchiya  “Separating weak integrated information theory (IIT) into IIT-inspired and aspirational-IIT approaches”  PsyArXiv, 2023  DOI: 10.31234/osf.io/kxywt
  * [30] Angus Leung, Dror Cohen, Bruno van Swinderen and Naotsugu Tsuchiya  “Integrated information structure collapses with anesthetic loss of conscious arousal in Drosophila melanogaster”  In _bioRxiv_ , 2020  DOI: 10.1101/2020.05.17.090001
  * [31] David Lewis  “How many lives has Schrödinger’s cat?”  In _Australasian Journal of Philosophy_ 82.1 Taylor & Francis, 2004, pp. 3–22
  * [32] Peter J Lewis  “What is it like to be Schrödinger’s cat?”  In _Analysis_ JSTOR, 2000, pp. 22–29
  * [33] Michael Lockwood  “’Many Minds’. Interpretations of Quantum Mechanics”  In _The British journal for the philosophy of science_ 47.2 JSTOR, 1996, pp. 159–188
  * [34] M Massimini et al.  “Breakdown of cortical effective connectivity during sleep”  In _Science (New York)_ 309.5744, 2005, pp. 2228–2232
  * [35] K.J. McQueen  “Illusionist Integrated Information Theory”  In _Journal of Consciousness Studies_ 26, 2019, pp. 141–169
  * [36] K.J. McQueen  “Interpretation-Neutral Integrated Information Theory”  In _Journal of Consciousness Studies_ 26, 2019, pp. 76–106
  * [37] K.J. McQueen and Naotsugu Tsuchiya  “When do parts form wholes? Integrated information as the restriction on mereological composition”  In _Neuroscience of Consciousness_ 2023.1 Oxford University Press UK, 2023, pp. niad013
  * [38] Lucia Melloni et al.  “Adversarial Collaboration to test GNW and IIT.”  OSF, 2023  URL: osf.io/mbcfy
  * [39] Thomas Nagel  “What is it like to be a bat?”  In _The Language and Thought Series_ Harvard University Press, 1980, pp. 159–168
  * [40] Masafumi Oizumi, L. Albantakis and Giulio Tononi  “From the Phenomenology to the Mechanisms of Consciousness: Integrated Information Theory 3.0”  In _PLOS Computational Biology_ 10, 2014, pp. 1–25
  * [41] Adam Pautz  “What Is the Integrated Information Theory of Consciousness?”  In _Journal of Consciousness Studies_ 26.1-2, 2019, pp. 1–2
  * [42] Ofir Pele and Michael Werman  “Fast and robust earth mover’s distances”  In _2009 IEEE 12th international conference on computer vision_ , 2009, pp. 460–467  IEEE
  * [43] Oliver Pooley  “Substantivalist and Relationalist Approaches to Spacetime”  In _The Oxford Handbook of Philosophy of Physics_ Oxford University Press, 2013
  * [44] Euan J Squires  “One mind or many—A note on the everett interpretation of quantum theory”  In _Synthese_ 89 Springer, 1991, pp. 283–286
  * [45] M. Tegmark  “Improved measures of integrated information”  In _PLoS Computational Biology_ 12.11, 2016, pp. 195–199
  * [46] Giulio Tononi  “An information integration theory of consciousness”  In _BMC Neurosci_ 5.42, 2004
  * [47] Giulio Tononi  “Consciousness as integrated information: a provisional manifesto.”  In _Biol Bull_ 215.3, 2008, pp. 216–242
  * [48] Giulio Tononi, M. Boly, M. Massimini and C. Koch  “Integrated information theory: from consciousness to its physical substrate.”  In _Nat Rev Neurosci_ 17, 2016, pp. 450–461
  * [49] Naotsugu Tsuchiya  ““What is it like to be a bat?”—a pathway to the answer from the integrated information theory”  In _Philosophy Compass_ 12.3, 2017, pp. e12407
  * [50] Lev Vaidman  “On schizophrenic experiences of the neutron or why we should believe in the many-worlds interpretation of quantum theory”  In _International studies in the Philosophy of science_ 12.3 Taylor & Francis, 1998, pp. 245–261
  * [51] E.. Wigner  “Remarks on the mind-body question”  In _The Scientist Speculates_ Heineman, 1961
  * [52] Howard M Wiseman, Eric G Cavalcanti and Eleanor G Rieffel  “A” thoughtful” Local Friendliness no-go theorem: a prospective experiment with new assumptions to suit”  In _arXiv preprint arXiv:2209.08491_ , 2022
  * [53] P. Zanardi, M. Tomka and L.C. Venuti  “Towards Quantum Integrated Information Theory”, 2018  arXiv:1806.01421 [quant-ph]

##  Appendix A The general IIT4.0 formalism

Our simple dyad allowed us to steer clear of many complications that arise
when calculating $\Phi$ and Q-shape for more complex systems. Here we explain
IIT4.0 more generally, and identify which steps we avoided in section 3. We
also identify a subtle inconsistency with respect to an axiom of IIT4.0.

Standard presentations of IIT do not begin with its formalism. Instead, they
begin with a small set of axioms, from which a small set of postulates are
derived. The formalism is then built from these postulates.

In IIT4.0, there are six axioms, which state that conscious experience exists
and is intrinsic, specific, unitary, definite, and structured. Drawing upon
“introspection and reason” these axioms are deemed to be “axiomatic or
essential properties, properties that are immediate and irrefutably true of
every conceivable experience.” [4] However, there is a problem with this last
axiom, known as the axiom of composition.

The axiom of composition states that “experience is structured: it is composed
of distinctions and the relations that bind them together, yielding a
phenomenal structure [i.e. yielding a Q-shape]”. However, the dyad is actually
a counterexample to this axiom since the dyad has no “relations” between its
distinctions. That is, it yields a phenomenal structure without relations.

IIT4.0 calculates the integrated information of the relations between the
distinctions, $\phi_{r}(d)$. That is, relations exist when distinct parts
maximize their $\phi$ over the same or overlapping parts. However, our dyad
avoids this complication because A has $\phi$ about B only and B has $\phi$
about A only, so there is no overlap in what these parts contain integrated
information about. As such, $\phi_{r}(d)=0$ for the dyad. This is why we
ignored the relation/distinction contrast in the main text. The dyad states
are conscious, because they have nonzero $\Phi$ but are without structure, as
they have no relations.

Note that if our dyad did have relations, then $\phi_{r}(d)$ terms would have
to enter the sum in equation 10 for the $\Phi$ of the system. They would also
need to be included in the dyad’s Q-shape. At any rate, IIT4.0 either needs to
weaken their composition axiom so that relations are not necessary or
strengthen their postulates to render the relationless dyad unconscious.

This points to a further complication that our dyad avoided, which arises when
a part has multiple connections to other parts so that multiple partitions
become available e.g. if A is connected to B and C and we are considering the
integrated information A has about BC. In such cases we take the minimum
information partition into account i.e. the partition that makes the least
difference to the information that A has about BC. But this is trivial in the
dyad since there is only a single partition.

The remaining complications that our dyad avoided concern the beginning stages
of the calculation. The first step in the IIT4.0 analysis of any system that
is presently in some state, is to identify which future state is most probable
given the present state, and which past state is most probable given the
present state. In general, this is determined by calculating something called
the intrinsic information of a system (see equation 12 in [4]). But for our
system in Figure 3, this is trivial: if the present state is (1,0), for
example, then both the most probable future state and the most probable past
state are (0,1) since our dyad is a completely deterministic SWAP gate.

Next we divide the system up into subsystems or parts such that there are two
or more parts and each part (1) contains at least one unit or element; (2)
does not overlap any other part; (3) causally interacts with other parts of
the system (see equation 13 in [4]). For the dyad, this is once again trivial,
as there are clearly only two causally interacting parts: A and B.

We then calculate a quantity called the “small phi” of the system as a whole
($\phi_{s}$), to ensure it is nonzero. The purpose of this is to ensure that
our system really is an integrated whole, and not just two (or more) separate
systems that are simply causally interacting with themselves, (see equations
20-22 in [4]). Again, it is clear that A and B are causally interacting, so we
skip this step.

Finally, we might have a case where we have many overlapping systems that have
nonzero $\phi_{s}$. IIT’s exclusion postulate tells us that the overlapping
system that maximizes $\phi_{s}$ wins, and is the truly conscious system. Once
again, this can be skipped, since our system is closed and does not overlap
with any other systems. Now our calculation proceeds as in section 3.

##  Appendix B The quantum feedback dyad in QIIT

There have been several attempts to extend IIT to the quantum realm. Kleiner
and Tull [27], in their efforts to broadly classify theories of consciousness
in a mathematically rigorous way, provided an abstract framework within which
any quantum extension of IIT should fit.

Zanardi, Tomka, and Venuti developed a quantum theory that was analogous to
classical IIT but that was not unique, did not converge to the classical
formalism in the case of essentially purely classical inputs, and did not
strictly adhere to the axioms of classical IIT [53]. Most recently Albantakis,
Prentner, and Durham [3] developed a direct quantum translation of IIT4.0 that
is faithful to its axioms and that reduces to the classical formalism, as
described here in Section 3, in the case of purely classical inputs.

Once again consider a feedback SWAP function as described in Figure 3. Whereas
channels A and B in the classical case could only be represented as classical
bits (thus limiting their values to be exclusively on the Boolean domain (i.e.
$\\{0,1\\}$), we will now allow these channels to be represented as qubits
which extends the range of possible values that they may take.

Specifically, consider a discrete quantum system described by some density
operator $\rho=\sum_{j}p_{j}\ket{\psi_{j}}\bra{\psi_{j}}$ where the
$\ket{\psi_{j}}$ are pure states, each prepared with a probability $p_{j}$. As
such, $\rho$ can be either a single pure state or an ensemble of pure states,
i.e. a mixed state. We consider unitary time evolution in which the state
evolves according to

$\rho_{t_{+1}}=U\rho_{t_{0}}U^{\dagger}$ (18)

where $U$ is a unitary operator defined by $UU^{\dagger}=1$ which ensures that
$U$ is reversible.

In quantum IIT, rather than comparing probability distributions we are
comparing density operators. Given two density operators
$\rho=\sum_{i}p_{i}\ket{\psi_{i}}\bra{\psi_{i}}$ and
$\sigma=\sum_{j}q_{j}\ket{\psi_{j}}\bra{\psi_{j}}$, the quantum relative
entropy between them is defined as

$\displaystyle S(\rho\|\sigma)$
$\displaystyle=\textrm{Tr}\rho\log\rho-\textrm{Tr}\rho\log\sigma$ (19)
$\displaystyle=\sum_{i}p_{i}\left(\log(p_{i})-\sum_{ij}P_{ij}\log(q_{j})\right)$

where $P_{ij}=\braket{\psi_{i}}{\psi_{j}}\braket{\psi_{j}}{\psi_{i}}$. The
quantum intrinsic difference (QID) is thus defined as

$\textrm{QID}(\rho\|\sigma)=\max_{\i}p_{i}\left(\log(p_{i})-\sum_{ij}P_{ij}\log(q_{j})\right).$
(20)

In the case in which $\rho=\sigma$, equation 20 reduces to equation 4.
Similarly, if $\rho$ is pure, $\textrm{QID}(\rho||\sigma)=S(\rho||\sigma)$ as
in the classical case for fully selective distributions. Otherwise
$\textrm{QID}(\rho||\sigma)$ is subadditive as required [6].

The procedure for calculating the integrated cause and effect information in
the quantum case proceeds in much the same manner as in the classical case. In
fact, the case in which the input state is $\rho=\ket{0,1}\bra{0,1}$
corresponds exactly to the classical case with input $(0,1)$ which was
analyzed in section 3. Hence, restricting ourselves to the so-called
computational basis, $\\{\ket{0},\ket{1}\\}$, the formalism developed in [3]
exactly reproduces the the classical results for the same circuit and is
essentially analyzed in precisely the same manner.

To initiate a quantum system we can represent the state of the dyad at $t_{0}$
as the superposition state
$\rho_{t_{0}}=\ket{+,0}\bra{+,0}=\ket{+}\bra{+}\otimes\ket{0}\bra{0}$ where
$\ket{+}=(1/\sqrt{2})\ket{0}+(1/\sqrt{2})\ket{1}$. We then partition the
system as usual and calculate the integrated effect information by evaluating
the QID over the eigenstate for a particular partition such that

$\phi_{e}=\textrm{QID}(\rho\|\sigma)=p_{i}\left(\log(p_{i})-\sum_{j}P_{ij}\log(q_{j}^{\theta})\right)$
(21)

where $\sigma=\sum_{j}q_{j}^{\theta}\ket{j}\bra{j}$ is now the partitioned
effect repertoire.

We can then begin by identifying three subsystems as before, A, B, and AB (we
will initially consider AB but will show that, as in the classical case, it is
irrelevant). At $t_{0}$ the density matrices for these subsystems are
$\rho_{\textrm{A}_{t_{0}}}=\ket{+}\bra{+}$,
$\rho_{\textrm{B}_{t_{0}}}=\ket{0}\bra{0}$, and
$\rho_{\textrm{AB}_{t_{0}}}=\ket{+,0}\bra{+,0}$ respectively. As described
above, in the case of purely classical inputs, the QID given by equation 20
simply reduces to the ID given by equation 4.

As with classical IIT, the first step is to identify which future and past
states are the most probable given the present state. As in the classical
case, this is trivial since all the dyad does is swap the states. That is, if
the present state is $\rho_{\textrm{AB}_{t_{0}}}=\ket{+,0}\bra{+,0}$, then
both the past and future states are
$\rho_{\textrm{AB}_{t_{0}}}=\ket{0,+}\bra{0,+}$.

We now consider each of the subsystems separately as before. As in the
classical case, A’s present state contains no integrated effect information
about A’s future state (and likewise for B). The same is also true for the
future state of the whole system AB since, as before, there is a possible
partition (A to A) that does nothing. That leaves just a single partition to
consider and, since the current state of A is purely classical, the
calculation is identical to equation 4. In other words, as before,
$\phi_{e}(a_{t_{0}}=\rho_{0}=\ket{0}\bra{0})=1$.

Calculating the effect information of B might seem as if it would be different
since the input is not classical, but due to the simplicity of the SWAP
operation, the calculation is nearly identical to the classical case. The
partition, as before, simply replaces the effect that B’s current state has on
A’s future state with noise, but the noise is now treated differently. In the
quantum case, noise is given by the maximally mixed state

$\rho_{mm}=\frac{1}{2}\ket{0}\bra{0}+\frac{1}{2}\ket{1}\bra{1}.$ (22)

In order to fully work through a calculation of equation 21 it will help to
calculate the individual pieces separately. Since we’re calculating the
effect, the $p_{i}$ in equation 21 represents the future state of A while the
$q_{j}$ represents the present state of B. Recall that the definition of a
density operator $\rho=\sum_{i}p_{i}\ket{\psi_{i}}\bra{\psi_{i}}$ defines the
$p_{i}$ in terms of a spectral decomposition. By this definition, then,
$p_{i}=1$ for the $\rho=\ket{+}\bra{+}$ state. This means that the
$\log_{2}(p_{i})$ term in equation 21 is zero. Since
$P_{ij}=\braket{i}{j}\braket{j}{i}$ and $q_{0}^{\theta}=q_{1}^{\theta}=1/2$
from equation 22, the second term in equation 21 becomes

$\displaystyle-\sum_{j}\braket{i}{j}\braket{j}{i}\log(q_{j}^{\theta})$
$\displaystyle=-\left(\braket{+}{0}\braket{0}{+}\log\left(\frac{1}{2}\right)+\braket{+}{1}\braket{1}{+}\log\left(\frac{1}{2}\right)\right)$
(23)
$\displaystyle=-\left(\frac{1}{\sqrt{2}}\cdot\frac{1}{\sqrt{2}}\cdot(-1)+\frac{1}{\sqrt{2}}\cdot\frac{1}{\sqrt{2}}\cdot(-1)\right)$
$\displaystyle=1$

where we note that
$\braket{+}{0}=\braket{0}{+}=\braket{-}{0}=\braket{0}{-}=1/\sqrt{2}$. Equation
21 then reads in full

$\displaystyle\phi_{e}(b_{t_{0}}=\rho_{+})$
$\displaystyle=p_{i}\left(\log(p_{i})-\sum_{j}P_{ij}\log(q_{j}^{\theta})\right)$
(24) $\displaystyle=1\cdot(0+1)=1.$

The calculation for $\phi_{c}$ is identical except the $p_{i}$ are for the
present state and the $q_{j}$ are for the past state. For the case in which
A’s present state is $\rho_{0}$ we thus find that
$\phi_{c}(a_{t_{0}}=\rho_{0})=1$ and, likewise for the case in which B’s
present state is $\rho_{+}$, we find that $\phi_{c}(b_{t_{0}}=\rho_{+})=1$.

Once again, the integrated information of each subsystem is then just the
minimum of each of these values for each subsystem which gives

$\phi(a_{t_{0}}=\rho_{0})=1;\quad\phi(b_{t_{0}}=\rho_{+})=1;\quad\phi(ab_{t_{0}}=\rho_{0,+})=0.$
(25)

As before the amount of consciousness $(\Phi)$ in the entire system is simply
the sum of these values:

$\Phi(ab_{t_{0}}=\rho_{0,+}=\phi(a_{t_{0}}=\rho_{0})+\phi(b_{t_{0}}=\rho_{+})+\phi(ab_{t_{0}}=\rho_{0,+})=1+1+0=2.$
(26)

##  Appendix C Solution of the optimization problem of section 5

First note that replacing $\lambda_{ij}$ by
$\lambda^{\prime}_{ij}:=\lambda_{ij}-m$, where $m:=\min_{k,l}\lambda_{k,l}$,
will also satisfy the constraints, but lead to
$\lambda^{\prime}_{00}+\lambda^{\prime}_{01}+\lambda^{\prime}_{10}+\lambda^{\prime}_{11}<\lambda_{00}+\lambda_{01}+\lambda_{10}+\lambda_{11}$
unless $m=0$. Thus, to be a minimizer, at least one of the $\lambda_{ij}$ must
be zero.

Consider, for example, the case that $\lambda_{01}=0$. Then
$|\lambda_{00}-\lambda_{01}|\geq\mathcal{D}(Q(00),Q(01))=2$, and so
$\lambda_{00}\geq 2$. Similarly,
$|\lambda_{00}-\lambda_{10}|\geq\mathcal{D}(Q(00),Q(10))=2$, and so either
$\lambda_{10}\leq 0$ (which is impossible) or $\lambda_{10}\geq 4$. Finally,
$|\lambda_{10}-\lambda_{11}|\geq\mathcal{D}(Q(10),Q(11))=2$, and so either
$\lambda_{11}\geq 6$ or $\lambda_{11}\leq\lambda_{10}-2$. The “either” case
gives us a possible minimizer $(2,0,4,6)$, where
$s:=\sum_{ij}\lambda_{ij}=12$. Consider this sum for the “or” case. It is

$s:=\lambda_{00}+\lambda_{01}+\lambda_{10}+\lambda_{11}\geq
2+0+(\lambda_{11}+2)+\lambda_{11}=4+2\lambda_{11}.$

For this to define a minimizer, we need $s\leq 12$, which means that
$\lambda_{11}\leq 4$. But
$|\lambda_{11}-\lambda_{00}|\geq\mathcal{D}(Q(11),Q(00))=2$, and so
$\lambda_{11}\geq 4$. In summary, we must have equality, $\lambda_{11}=4$, and
then $\lambda_{00}=2$, and so $\lambda_{10}\geq 6$. This yields the other
minimizer, $(2,0,6,4)$.

All other minimizers can be determined similarly, but considering all the
other three cases of zero $\lambda_{ij}$.


# CATTO: Just-in-time Test Case Selection and Execution

Dario Amoroso d’Aragona1, Fabiano Pecorelli1, Simone Romano2, Giuseppe
Scanniello2, Maria Teresa Baldassarre3, Andrea Janes4, Valentina Lenarduzzi5
<EMAIL_ADDRESS><EMAIL_ADDRESS><EMAIL_ADDRESS><EMAIL_ADDRESS><EMAIL_ADDRESS><EMAIL_ADDRESS><EMAIL_ADDRESS>1Tampere University, Finland, 2University of
Salerno, Italy, 3University of Bari, Italy  4Free University of Bozen-Bolzano,
Italy, 5University of Oulu, Finland

###### Abstract

Regression testing wants to prevent that errors, which have already been
corrected once, creep back into a system that has been updated. A naïve
approach consists of re-running the entire test suite (TS) against the changed
version of the software under test (SUT). However, this might result in a
time- and resource-consuming process; e.g., when dealing with large and/or
complex SUTs and TSs. To avoid this problem, Test Case Selection (TCS)
approaches can be used. This kind of approaches build a temporary TS
comprising only those test cases (TCs) that are relevant to the changes made
to the SUT, so avoiding executing unnecessary TCs. In this paper, we introduce
Catto (Commit Adaptive Tool for Test suite Optimization), a tool implementing
a TCS strategy for SUTs written in Java as well as a wrapper to allow
developers to use Catto within IntelliJ IDEA and to execute Catto just-in-time
before committing changes to the repository. We conducted a preliminary
evaluation of Catto on seven open-source Java projects to evaluate the
reduction of the test-suite size, the loss of fault-revealing TCs, and the
loss of fault-detection capability. The results suggest that Catto can be of
help to developers when performing TCS. The video demo and the documentation
of the tool is available at: https://catto-tool.github.io/

###### Index Terms:

Software testing, test case selection, regression testing

##  I Introduction

Regression testing wants to prevent that errors, which have already been
corrected once, creep back into a system that has been updated [1]. A naïve
approach, namely Retest-all, consists of re-running the entire test suite (TS)
against the changed version of the software under test (SUT) [2]. The problem
with Retest-all is that the re-execution of the entire TS might result in a
time- and resource-consuming process, especially when the SUT and its TS grow
in size and/or complexity. Moreover, there are Agile development practices,
like test-driven development [3], which leverage continuous regression
testing, requiring the developer to execute the TS several times during a
development session. If the execution of the TS demands too much time or too
many resources, the developer is likely not to execute regression tests as
many times as the Agile development practice would require. To tackle this
problem, researchers have devised several strategies, which can be grouped
into three main groups: test suite minimization (or reduction), Test Case
Selection (TCS), and test case prioritization [1]. Both test suite
minimization and TCS strategies seek to reduce the size of the TS that will be
re-executed against the SUT. To that end, test suite minimization strategies
remove redundant/obsolete test cases (TCs), either temporarily or permanently,
from the TS. On the other hand, TCS strategies temporarily remove TCs that are
not modification-aware. In other words, TCS strategies build a temporarily TS
by selecting a subset of TCs (from the original TS) that are relevant to the
changes made to the SUT, so avoiding executing those TC that do not exercise
the changed parts. Finally, TC prioritisation strategies concern the
identification of an “ideal” ordering of TCs maximizing some desirable
properties (e.g., early fault detection).

In this paper, we introduce Catto (Commit Adaptive Tool for Test suite
Optimization), a tool implementing a TCS strategy for SUTs written in Java
that selects TCs to be re-executed by comparing the call graphs of the two
versions of the SUT (i.e., the versions before and after some changes are made
to the SUT). Unlike other TCS tools (e.g., SPIRITuS [4], Pythia [5], or
TestTube [6]), Catto does not require code coverage information but determines
a link between source code and corresponding test cases using a generated call
graph (see Sect. III). It can be therefore used in application contexts where
code coverage information (e.g., statements covered by TCs) is not available.
Moreover, to allow developers to execute Catto just-in-time before committing
changes to the repository, we implemented a plugin for IntelliJ IDEA [7] that
wraps its functionalities.

Catto was specifically developed with the intention to focus on fast feedback
during the development cycle, preferring technologies that are not resource
intensive, also accepting a lower accuracy of the tool. We conducted a
preliminary evaluation of Catto on seven open-source Java projects to evaluate
the reduction of the test-suite size, the loss of fault-revealing TCs, and the
loss of fault-detection capability.

##  II CATTO Components

Catto consists of two main components: Catto core and Catto IntelliJ IDEA.
Catto core contains the application logic, Catto IntelliJ IDEA is a plugin for
IntelliJ IDEA to provide the features of Catto core during development.

As shown in Fig. 1 (on the left hand side) Catto core performs six sequential
steps, described as follows.

  1. 1.

Dynamic classes loading: the tool loads the classes of the current and
previous version of the project and their dependencies. We rely on Soot, a
third-party component, to transform byte-code in an intermediate
representation (called “JIMPLE” [8]), necessary to have a normalized
representation of the code that is easier to compare.

  2. 2.

Instrumentation: Once all classes are loaded, Catto core dynamically creates a
Java test class for each actual test class, adding to each test method a call
to the fixture methods if they are declared in the class itself or in a parent
class (e.g., setUp() and tearDown()). This step is required to ensure the
creation of a reliable call graph.

  3. 3.

Call graph creation: Once the fake test classes are created, Catto core uses
these as a starting point for the generation of the call graph of the current
version of the project. The generation of the call graph starts from the test
methods and goes through the production code, mapping in this way each
production method to its corresponding test methods.

  4. 4.

Code Analysis: Then, Catto core analyzes the two versions of the project
searching for code changes and marking all the methods and class modified.
Catto core marks a method or class as changed according to the operations
described in Tab. I.

  5. 5.

Test Case Selection: The methods marked in the previous step are used by Catto
core to select the test methods to execute. For each marked method, the
corresponding test methods are selected. Tab. I describes all the criteria the
tool adopts to perform TCS.

  6. 6.

Test Case Execution: Finally, when the test methods are selected, Catto core
executes them and displays the results, as well as the error stack trace in
case of failure.

Table I: Selection criteria description. Operation |  Selected Test Case
---|---
Production Method |
– added or modified |  The respective test methods
– deleted |  Test methods that covered it
– deleted in a hierarchy |  All tests methods covering the actual production methods in hierarchy
[1pt/1pt] Constructor of a production class |
– added, modified or deleted |  All test methods covering the production methods in that class
[1pt/1pt] Static field of a production class |
– added, modified, or deleted |  All test methods covering the production methods in that class
[1pt/1pt] Test Method |
– added |  The new test method
– modified |  The modified test method
[1pt/1pt] Static field, constructor or fixture method of a test class |
– modified |  All test methods in that test class

The component Catto IntelliJ IDEA extends the functionality of Catto core
integrating it in IntelliJ IDEA. This integration not only provides a user
interface of Catto core within a development environment, but also (1) catches
the commit event and prepares Catto core to execute the analysis before the
code is committed; (2) retrieves the previous version of the project (the
version of the project at the time of the last executed commit); (3) builds
the current version of the project; (4) runs Catto core; (5) returns the test
execution summary to the user and asks them whether to proceed with the commit
or not; (6) saves the committed version of the project in a hidden folder for
future analyses. Figure 1 (left hand side) shows the order in which these
steps take place and how the Catto core steps are integrated within the Catto
IntelliJ IDEA to perform TCS.

Figure 1: Activity diagram of Catto and the interaction between its parts

x

Figure 2: Catto architecture at the package level

##  III The CATTO Architecture

Figure 2 depicts the architecture of our tool in form of a UML component
diagram also depicting the relevant packages. Catto core relies on Soot as a
third-party component and Catto IntelliJ IDEA exploits the IntelliJ IDEA
Platform SDK API. Due to space limitations, we discuss only the architecture
of Catto core, being it the core of the system.

Catto core is composed by four main packages: $project$, $code.analyzer$,
$test.selector$, $test.runner$.

The $project$ package manages a single version of the project and contains all
the information about it (e.g., dependencies). It allows distinguishing
between the current and the previous version of a project, setting up Soot
differently depending on the case, in particular creating the call graph only
for the current version of the project.

The $code.analyzer$ package provides change analysis features between two
different code versions. To allow a truthful comparison between two versions
of the same method, Catto checks the name of the package and the header of the
method. When the package name and the header are equal, Catto compares the
body of the methods marking the method as modified if there are some changes
in the body. When the header of the method and the package are different, the
method is marked as new if does not belong to any class of the previous
version, otherwise, it is marked as deleted. By using the byte-code and
transforming this into a Soot normalized intermediate representation, Catto is
also able to ignore cosmetic changes in the code.

The $test.selector$ package analyzes the call graph to find the tests to
select. To minimize the required time to analyze the call graph, Catto
utilizes multi-threading and performs the search starting from the marked
methods, going up the graph until a test method is found. For each test
method, the corresponding sub-call graph is analyzed; the above mentioned
search strategy allows the tool to analyze only those sub-call graphs
containing a marked method.

The $test.runner$ package allows running the selected test methods. To allow
Junit to launch the test methods, the project and its dependencies are loaded
dynamically and added to the JAVA classpath. The use of JUnit [9] to execute
the test methods ensures that all and only the necessary fixture methods
(e.g., methods tagged with @Before or @After) are executed before and after
the selected test methods.

##  IV Typical Usage Scenario

This section describes how developers can use Catto in a typical scenario.
Lets suppose Alice, a developer, is adding a new feature to a system. After
concluding the work, she will commit the changes. At this point, Catto
intercepts the commit event, selects and runs only the test methods that cover
the newly implemented methods (see step  1 and  2 in Figure 3) and shows the
results of the executed test methods in the console (see step  3 in Figure 3).
If some tests fail, Catto notifies the failure to Alice (see step  4 in Figure
3), thus, she can choose whether to commit anyway or to fix the issue(s)
before proceeding with the commit.

Figure 3: Screenshot of an interaction with the Catto IntelliJ IDEA

Now suppose that Alice continuous her work and after a while somebody notices
a bug in the new feature. Alice finds out what has to be changed, updates the
code, adds testing code to cover it and commits the changes. Catto, intercepts
the commit, selects the new test methods and the test methods that cover the
changes in the code, runs these, and, as before, shows the output in the
console and notifies Alice about the results of the regression testing.

In summary, Catto encourages Alice to practice continuous testing intercepting
git [10] commits and visualizing tests results directly within the IDE.

##  V Tool Validation

The validation was performed using seven Java open source systems (denoted
below as S1–S7): Apache Commons IO [11], Apache Commons Beanutils [12], Apache
Commons Codec [13], DBCP [14], JXPath [15], JFreeChart [16] and JGap [17].

We selected these systems because they are Java projects, are open-source,
belong to different domains, and have non-trivial test suites. The validation
was performed using SMUG [18], a mutation generator tool. To simulate source
code changes, for each of the seven considered projects, we created 30 mutated
versions using SMUG (using the default configuration). While creating the
mutated versions, SMUG executes the test methods tracking the failures. We
validated Catto by considering the original version as the previous version
and the $n{th}-$mutated version as the current version. As an outcome, we
expected that all the failed test methods would be selected. For each pair
(original and mutated version) we calculated the following metrics, referring
to the fault revealing selected test methods as $X$ and the fault revealing
test methods as $Y$:

  * •

Test Suite Reduction (TSR): the percentage of reduction of the test suite,
calculated as the proportion between the number of test methods in the
original test suite and the number of test method in the selected test suite.
The higher the value, the smaller the selected test suite. Therefore, the most
desirable value is 1.

  * •

Inclusiveness. (I): the capability to select all the fault-revealing TCs.
$I=\frac{X}{Y},\;if\;Y\neq 0,1\;if\;Y=0$. The most desirable value is 1.

  * •

Reduction in Fault Detection Capability (RFDC): the loss of capacity of the
selected test methods in revealing faults. $RFDC=1-\frac{X}{Y}\;if\;Y\neq
0,1\;if\;Y=0$. The most desirable value is 0.

For each system we calculated the average value of each metric obtained
comparing the original and each mutated version.

The results reported in Table II show that in two systems the mean of the TSR
is more than $0.85$, in one is more than $0.6$, in two is more than $0.3$ and
in two is below $0.2$. For the Inclusiveness, in all the systems the mean is
more than $0.7$, with two cases where is more than $0.95$. Finally, the mean
of RFDC, for all the systems, is between $0$ and $0.15$.

Table II: Validation results | S1 | S2 | S3 | S4 | S5 | S6 | S7
---|---|---|---|---|---|---|---
TSR | 0,63 | 0,31 | 0,90 | 0,86 | 0,25 | 0,40 | 0,09
I | 0,88 | 0,84 | 0,87 | 0,78 | 0,71 | 0,97 | 0,96
RFDC | 0,03 | 0,01 | 0 | 0 | 0,11 | 0 | 0,14

##  VI Related Work

Researchers have proposed several Test Case Selection (TCS) approaches based
on various techniques. Integer programming [19, 20], data-flow analysis [21,
22, 23, 24], graph walking [25, 26, 2, 27], textual difference and information
retrieval [4, 28, 5], modification detection [6], and firewall [29, 30] are
just some of the techniques that the TCS approaches available in the
literature rely on.

Fischer et al. [19, 20] introduced one of the earliest TCS approaches. This
approach used integer programming to represent the TCS problem in the context
of Fortran code. Harrold and Soffa [21] applied data-flow analysis as a test
case selection criterion. Similarly, Taha et al. [22] provided a test case
selection framework based on an incremental data-flow analysis method. Gupta
et al. [23] used program slicing techniques to find definition-use pairs that
were impacted by a code change. Wong et al. [24] integrated a data-flow
selection strategy with coverage-based minimisation and prioritisation.

Rothermel and Harrold proposed TCS approaches based on graph walking. First,
they focused on graph walking of control dependence graphs [25]. Later, they
extended their approach by using program dependence graphs for intra-
procedural selection, and system dependence graphs for inter-procedural
selection [26]. They further extended their work by relying on control flow
[2] and inter-procedural control flow graphs [27].

Other approaches rely on the use of textual difference and information
retrieval. Volkolos and Frankl [5, 28] presented Pythia, a TCS approach based
on the textual difference between the source code of the two versions of the
SUT. Romano et al. [4] presented SPIRITuS, an information retrieval-based TCS
approach that uses method code coverage information and a vector space model
to select test cases to be run. Chen et al. [6] introduced TestTube, a testing
framework that selects test cases based on modification detection. TestTube
tracks the execution of test cases to create links between test cases and the
program components it exercises. Finally, Gligoric et al. [29, 30] proposed
Ekstazi, a firewall-based approach that selects test cases based on the
changes to their dependent files.

##  VII Conclusion and future work

In this paper, we present Catto (Commit Adaptive Tool for Test suite
Optimization), a tool implementing a TCS strategy for Java programs that
selects TCs to be re-executed by comparing the call graphs of the two versions
of the SUT (i.e., the versions before and after a change).

Catto encourages the Agile practice of continuous testing intercepting git
commits and providing tests results directly within the IDE. This relieves the
developer of the burden of constant context switching between development and
testing.

In a Lean context, this tool represents the application of Jidoka, a concept
used in Lean Manufacturing that suggests to “stop the line” (intended is the
production line) in case a problem is detected [31]. Jidoka has the goal of
automating quality assurance processes and to avoid unnecessary rework: it
does this by stopping the entire production until it is clear how to fix an
occurring problem. This strategy is not perfect for everyone, but in context
where the cost of fixing an issue is higher than producing code, it is worth
consideration. Catto implements the concept of “stopping the line” in two
ways: it automatically verifies (tests) the source code change (this cannot be
deactivated) and—in case of a problem—warns the user. In the future, the
strategies for regression testing will be extended—adding also test case
prioritization, to increase the efficiency of the testing tool and to reduce
testing time—as well as the way users are notified about the problem: from
unobtrusive warnings to more aggressive strategy like to forbid a commit in
case of a failing test case.

## References

  * [1] S. Yoo and M. Harman, “Regression testing minimization, selection and prioritization: A survey,” _Softw. Test. Verif. Reliab._ , vol. 22, no. 2, 2012.
  * [2] G. Rothermel and M. J. Harrold, “A safe, efficient regression test selection technique,” _ACM Transactions on Software Engineering and Methodology (TOSEM)_ , vol. 6, no. 2, 1997.
  * [3] H. Erdogmus, G. Melnik, and R. Jeffries, “Test-driven development,” in _Encyclopedia of Software Engineering_. Taylor & Francis, 2010.
  * [4] S. Romano, G. Scanniello, G. Antoniol, and A. Marchetto, “Spiritus: A simple information retrieval regression test selection approach,” _Information and Software Technology_ , vol. 99, 2018.
  * [5] F. I. Vokolos and P. G. Frankl, “Pythia: A regression test selection tool based on textual differencing,” in _Reliability, quality and safety of software-intensive systems_. Springer, 1997\.
  * [6] Y.-F. Chen, D. S. Rosenblum, and K.-P. Vo, “Testtube: A system for selective regression testing,” in _Int. Conf. on Softw. Eng._ IEEE, 1994.
  * [7] JetBrains s.r.o., “IntelliJ IDEA,” https://www.jetbrains.com/idea/.
  * [8] R. Vallee-rai and L. Hendren, “Jimple: Simplifying java bytecode for analyses and transformations,” 01 2004.
  * [9] JUnit contributors, “JUnit,” https://junit.org.
  * [10] GIT contributors, “GIT,” https://git-scm.com.
  * [11] The Apache Software Foundation., “Apache Commons IO,” https://commons.apache.org/proper/commons-io.
  * [12] ——, “Commons BeanUtils,” https://commons.apache.org/proper/commons-beanutils/.
  * [13] ——, “Apache Commons Codec,” https://commons.apache.org/proper/commons-codec.
  * [14] ——, “The DBCP Component,” https://commons.apache.org/proper/commons-dbcp.
  * [15] ——, “The JXPath Component,” https://commons.apache.org/proper/commons-jxpath.
  * [16] D. Gilbert, “JFreeChart,” https://www.jfree.org/jfreechart.
  * [17] K. Meffert, “JGAP,” https://sourceforge.net/projects/jgap/.
  * [18] S. Romano and G. Scanniello, “Smug: a selective mutant generator tool,” in _2017 IEEE/ACM 39th Int. Conf. on Softw. Eng. Companion_ , 2017.
  * [19] K. F. Fischer, “A test case selection method for the validation of software maintenance modifications,” 1977.
  * [20] K. Fischer, F. Raji, and A. Chruscicki, “A methodology for retesting modified software,” in _National Telecomm. Conference B-6-3_ , 1981.
  * [21] M. J. Harrold and M. Souffa, “An incremental approach to unit testing during maintenance,” in _Conf. on Softw. Maintenance_. IEEE Computer Society, 1988.
  * [22] A.-B. Taha, S. M. Thebaut, and S.-S. Liu, “An approach to software fault localization and revalidation based on incremental data flow analysis,” in _International Computer Softw. & Applications Conf._ IEEE, 1989.
  * [23] R. Gupta, M. J. Harrold, and M. L. Soffa, “An approach to regression testing using slicing.” in _Conf. on Softw. Maintenance_ , vol. 92, 1992.
  * [24] W. E. Wong, J. R. Horgan, S. London, and H. Agrawal, “A study of effective regression testing in practice,” in _International Symposium On Software Reliability Engineering_. IEEE, 1997.
  * [25] G. Rothermel and M. J. Harrold, “A safe, efficient algorithm for regression test selection,” in _Conf. on Soft. Maintenance_. IEEE, 1993.
  * [26] ——, “Selecting tests and identifying test coverage requirements for modified software,” in _Int. Symp. on Softw. testing and analysis_ , 1994\.
  * [27] G. Rothermel, M. J. Harrold, and J. Dedhia, “Regression test selection for c++ software,” _Softw. Testing, Verif. and Rel._ , vol. 10, no. 2, 2000.
  * [28] F. I. Vokolos and P. G. Frankl, “Empirical evaluation of the textual differencing regression testing technique,” in _International Conf. on Soft. Maintenance (Cat. No. 98CB36272)_. IEEE, 1998.
  * [29] M. Gligoric, L. Eloussi, and D. Marinov, “Ekstazi: Lightweight test selection,” in _2015 IEEE/ACM 37th IEEE Int. Conf. on Softw. Eng._ , vol. 2, 2015.
  * [30] ——, “Practical regression test selection with dynamic file dependencies,” in _Proceedings of the 2015 International Symposium on Software Testing and Analysis_. ACM, 2015.
  * [31] J. P. Womack and D. T. Jones, _Lean Thinking: Banish Waste and Create Wealth in Your Corporation_ , 2nd ed. Free Press, 2003.