# Logical coherence in 2D compass codes

Balint Pato<EMAIL_ADDRESS>Duke Quantum Center, Duke University,
Durham, NC 27701, USA  Department of Electrical and Computer Engineering, Duke
University, Durham, NC 27708, USA  Judd Will Staples Jr  Duke Quantum Center,
Duke University, Durham, NC 27701, USA  Department of Physics, Duke
University, Durham, NC 27708, USA  Department of Electrical and Computer
Engineering, Duke University, Durham, NC 27708, USA  Kenneth R. Brown  Duke
Quantum Center, Duke University, Durham, NC 27701, USA  Department of
Electrical and Computer Engineering, Duke University, Durham, NC 27708, USA
Department of Physics, Duke University, Durham, NC 27708, USA  Department of
Chemistry, Duke University, Durham, NC 27708, USA

###### Abstract

2D compass codes are a family of quantum error-correcting codes that contain
the Bacon-Shor codes, the X-Shor and Z-Shor codes, and the rotated surface
codes. Previous numerical results suggest that the surface code has a constant
accuracy and coherence threshold under uniform coherent rotation. However,
having analytical proof supporting a constant threshold is still an open
problem. It is analytically proven that the toric code can exponentially
suppress logical coherence in the code distance $L$. However, the current
analytical lower bound on the threshold for the rotation angle $\theta$ is
$|\sin(\theta)|<1/L$, which linearly vanishes in $L$ instead of being
constant. We show that this lower bound is achievable by the Z-Shor code which
does not have a threshold under stochastic noise. Compass codes provide a
promising direction to improve on the previous bounds. We analytically
determine thresholds for two new compass code families with thresholds near
the rotated surface code’s numerically established coherence threshold.
Furthermore, using a Majorana mode-based simulator, we use random families of
compass codes to smoothly interpolate between the Z-Shor codes and the X-Shor
codes.

The main obstacle in unlocking the power of quantum computers is overcoming
noise, a collection of unwanted physical processes in the system. Quantum
error correction threshold theorems [1, 2] state that under probabilistic
(incoherent) models of quantum noise, the rate of error can be suppressed
exponentially by encoding the quantum information into increasingly large
quantum error-correcting codes and carefully curbing the propagation of faults
[3]. Quantum error correction threshold theorems apply only to a specific code
family construction and a specific noise model. The most celebrated analytical
threshold results assume incoherent noise for concatenated [1, 4] and
topological code families [2]. With increasing stabilizer code size, coherent
(unitary) noise has also been shown to be suppressed [5, 6], but an actual
constant threshold has not been established, only a linearly vanishing lower
bound in code size [7]. Numerical threshold results for coherent noise are
limited to small systems or surface codes that can be represented with
Majorana modes. This is because small rotations need either state vector [8,
9] or tensor network simulation [10] or limited Majorana mode simulators [11,
12, 13, 14], in contrast with wide categories of incoherent noise that can be
simulated using the Gottesman-Knill theorem [15]. Coherent noise models
describe a non-stochastic, unitary evolution on the physical qubits. This kind
of unwanted evolution arises from the imperfections of quantum control. The
effect of coherent errors in FTQEC systems can be mitigated with randomized
compilation [16, 17] and other techniques [18, 19, 20]. However, when the
underlying assumptions of these techniques are not perfectly satisfied,
residual coherent errors will still have an impact that we seek to understand.
Beyond modeling coherent errors, coherent physical channels also gained
interest in logical gate design [21, 22, 23, 24].

In this paper, we continue the exploration of the threshold of surface codes
under the uniform coherent rotation channel,
$(e^{-i\frac{\theta}{2}Z})^{\otimes n}$ [11, 7, 12, 25], with a focus on the
rotated surface code [26]. Analytically, the best asymptotic result only
guarantees a threshold for a linearly disappearing range of $\sin(\theta)<1/L$
in code size $L=\sqrt{n}$ by Iverson and Preskill [7] for the toric code [27].
However, Bravyi et al. [11] conjectured a constant threshold of
$\theta\leq\frac{\pi}{5}$ under coherent noise based on numerical evidence
using minimum weight perfect matching (MWPM) decoding [2]. Venn, Behrends, and
Béri [25] found a threshold of $(0.28\pm 0.01)\pi$ for the rotated surface
code by numerically evaluating phases of an equivalent Majorana metal, which
can be interpreted as a maximum likelihood (ML) decoding threshold. These
constant numerical threshold results indicate that the analytical lower bound
should have plenty of room for improvement. Our first result underlines this
conclusion as it shows how the Z-Shor code, which does not have a threshold
for stochastic noise, also suppresses the coherence of the logical channel in
this regime, using ML decoding. In our second contribution, we define
repetition code-like families of 2D compass codes, the Z-stacked Shor codes,
with closed form analytical expressions for their thresholds using ML
decoding. Finally, our third result uses MWPM to decode randomly generated 2D
compass codes that smoothly interpolate on average between the disappearing
threshold of the Z-Shor code and the maximal $\pi/2$ threshold of the X-Shor
code. The random codes are evaluated numerically using a Majorana mode
simulator which is based on the work of Bravyi et al. [11] and is generalized
to compass codes.

Coherent uniform rotation.— We simulate logical quantum memory instead of
computation and assume perfect state preparation and syndrome extraction. We
focus on the performance of encodings of a single logical qubit into a
$[\\![n,1,d]\\!]$ error-correcting code under the channel that consists of
coherent noise, X-syndrome measurement, and recovery. This physical channel
acts on the physical state $\rho$ as
$\mathcal{E}(\rho)=\sum_{s}Z(h_{s})\Pi_{s}\mathcal{N}_{\theta}(\rho)\Pi_{s}Z(h_{s})$,
where $\Pi_{s}$ is the projector to the subspace compatible with measuring
syndrome $s$, the recovery operator $Z(h_{s})$ is defined by applying Pauli Z
operators on the support of the bit-string $h_{s}\in\mathbb{F}_{2}^{n}$, and
$\mathcal{N}_{\theta}(\rho)$ is the uniform Z rotation by angle $\theta$ on
all $n$ physical qubits, $\mathcal{N}_{\theta}(\rho)=U_{Z}\rho
U_{Z}^{\dagger},\text{ with }U_{Z}=(e^{-i\frac{\theta}{2}Z})^{\otimes n}$.

Evaluating the logical channel.— We are interested in how much the logical
channel differs from the identity channel and how this difference grows by
applying the logical channel repeatedly $m$ times. It has been previously
shown that in the limit of large code sizes, the logical channel of stabilizer
codes is close to a stochastic channel, thus well characterized by the loss of
average fidelity [6], and is worthwhile optimizing decoding for. Note that
this is in contrast with physical channels, where gate fidelity might not be
predictive of scalability [28, 29]. Our distance metric is the loss of average
fidelity after $m$ applications of the logical channel,
$r_{m}=1-\int_{\psi}d\psi\langle\psi|\mathcal{E}^{m}(|\psi\rangle\langle\psi|)|\psi\rangle$.

We can interpret the logical channel as a probabilistic mixture of logical
rotations for $[\\![n,1,d]\\!]$ CSS codes with $k=1$ and $d$ odd [11, 7].
Following [7], for our Z-rotation-only case, we parameterize the Pauli
Transfer Matrix (PTM) of the logical channel:

$\bar{N}=\left(\begin{array}[]{cccc}1&0&0&0\\\ 0&1-\epsilon&\delta&0\\\
0&-\delta&1-\epsilon&0\\\ 0&0&0&1\\\ \end{array}\right),$

where $\epsilon=\sum_{s}p_{s}(1-\cos(\theta_{s}))$ and
$\delta=\sum_{s}p_{s}\sin(\theta_{s})$ are the weighted averages over $1-\cos$
and $\sin$ of the logical rotation angle $\theta_{s}$ for each syndrome $s$
and corresponding probability $p_{s}$. Intuitively, $\epsilon$ is a measure of
average fidelity, and $\delta$ is a measure of coherence. The fact that we can
define a logical angle $\theta_{s}$ for a given syndrome $s$ comes from the
Pauli-expansion of $U_{Z}$, under the assumptions that there is only a single
logical $\bar{Z}$ operator ($k=1$) and that all the codes in our discussion
have even weight stabilizers and an odd distance, giving rise to an odd-weight
logical $\bar{Z}$. For a derivation, see Lemma 4 in [11].

Analytical approaches to calculate distance metrics for a logical channel
exactly under coherent noise are possible in general for smaller systems [30]
with tensor network-based methods extending the reach by exploiting symmetries
in the codes [31]. As the number of terms grows exponentially with the system,
approximations are required for asymptotic analysis and establishing lower
bounds [30, 7]. For codes with a simpler structure, like repetition codes, one
can get exact results to a larger size by evaluating a number of terms growing
sub-exponentially with system size [7].

Logical channel of the repetition code.— Consider a chain of qubits of length
$d_{z}$. We define repetition codes (or phase flip codes) by their stabilizer
group as $\mathcal{S}=\langle X_{i}X_{i+1}\mid i\in[1,d_{z}-1]\rangle$.
Iverson and Preskill [7] calculated closed-form approximations for the logical
channel parameters $\epsilon$ and $\delta$ as functions of $\theta$:

$\displaystyle\epsilon_{l}(\theta)$ $\displaystyle\approx\sqrt{\frac{2}{\pi
l}}\frac{\sin^{l+1}\theta}{\cos\theta}(1+\mathcal{O}(\frac{1}{l}))$ (1)
$\displaystyle\delta_{l}(\theta)$
$\displaystyle\approx\frac{\cos\theta}{\sin\theta}\epsilon_{l}(\theta)(1+\mathcal{O}(\frac{1}{l})),$
(2)

where the approximation is based on Stirling’s formula, and valid when
$\sin(\frac{\theta}{2})^{2}<1/2$, thus, when $|\theta|<\frac{\pi}{2}$. We
heavily rely on these formulas below to understand quantum codes that can be
decoded as products of repetition codes. As MWPM decoding is equivalent to ML
decoding for repetition codes, our thresholds are considered to be under ML
decoding.

2D compass codes.— 2D compass codes [32, 33] are CSS codes [34] closely
related to the quantum compass model [35, 36], that describes interacting
spins on an $l\times l$ lattice described by a Hamiltonian

$H=-\sum_{r}\sum_{c<l-1}J_{X}X_{r,c}X_{r,c+1}-\sum_{r<l-1}\sum_{c}J_{Z}Z_{r,c}Z_{r+1,c},$

where a Pauli operator $P_{r,c}$ acts on qubits in row $r$ and column $c$.
Compass codes are derived from the Bacon-Shor subsystem code [32, 37] based on
$l^{2}$ physical qubits with a stabilizer group
$S=\langle\prod_{r}X_{r,c}X_{r,c+1},\prod_{c}Z_{r,c}Z_{r+1,c}\rangle$ of
$2l-2$ stabilizer generators and one logical qubit, leaving $l^{2}-2l+1$ gauge
degrees of freedom in the gauge group $\mathcal{G}=\langle
X_{r,c}X_{r,c+1},Z_{r,c}Z_{r+1,c}\rangle$, which are generated by the two-body
terms of the compass model. Gauge operators $g\in\mathcal{G}$ can be “fixed”
[38, 39] by moving $g$ to $S$ and removing all gauge operators from
$\mathcal{G}$ that anti-commute with $g$. Compass codes are constructed
through gauge fixing the Bacon-Shor code. In this paper, we also allow for
rectangular compass codes; furthermore, we fix all gauge degrees of freedom,
and thus our codes have $n-1$ stabilizer generators. We define compass codes
on a $d_{x}\times d_{z}$ grid of qubits, $d_{z}$ odd (even distance codes have
no coherence in their logical channel). Three known families of codes are the
Z-Shor codes/X-Shor codes and the rotated surface code [26]. It is useful to
think of these codes as red (Z-type) and blue (X-type) colorings of a
checkerboard [33].

Coherence threshold for the Z-Shor code.— We first introduce a new measure for
coherence. To leading order, the growth of $r_{m}$ in $m$ is linear for
stochastic channels but quadratic for purely coherent channels, as shown by
Iverson and Preskill [7]. For the purely coherent channel, the approximate
expression for $r_{m}$ (when $\frac{m^{2}\epsilon}{3}$ is small) shows that
$\delta$ drives the quadratic term: $r_{m}=\frac{1}{3}\epsilon
m-\frac{1}{6}m(m-1)(\epsilon^{2}-\delta^{2})+\mathcal{O}(m^{3}\epsilon^{3},m^{3}\epsilon\delta^{2},m^{4}\delta^{4})$.
When $\epsilon$ is small, the $\epsilon^{2}$ term can be ignored, and it is
justifiable to choose
$\kappa(\theta)\equiv\frac{\delta(\theta)^{2}}{\epsilon(\theta)}$ as a simple
measure for coherence representing the strength of the quadratic term in
$r_{m}$ relative to the linear term. Our measure of coherence is then for the
repetition codes based on the approximate $\epsilon$ and $\delta$ values by
Iverson and Preskill:

$\displaystyle\kappa_{l}(\theta)$
$\displaystyle\approx\left(\frac{\cos\theta}{\sin\theta}\right)^{2}\epsilon_{l}(\theta)(1+\mathcal{O}(\frac{1}{l}))$
(3)

For any $\theta<\frac{\pi}{2}$, both $\kappa_{l}(\theta)$ and
$\epsilon_{l}(\theta)$ decrease exponentially in $l$, thus we conclude that
the coherence threshold and the fidelity threshold are both
$\theta_{th}^{rep}=\frac{\pi}{2}$ for the repetition code.

Coherence threshold for the Z-Shor code.— The $d_{x}=1$ Z-Shor code is the
length $d_{z}$ phase-flip code. For $d_{x}>1$, the fact that any logical state
$|\psi_{L}\rangle$ is stabilized $Z_{i,j}Z_{i+1,j}$ causes the property that
$e^{-i\frac{\theta}{2}Z_{i,j}}|\psi_{L}\rangle=e^{-i\frac{\theta}{2}Z_{i+1,j}}|\psi_{L}\rangle$.
Using this, in every column $j$, every single qubit Z-rotation on row $i$ can
be equivalent to acting on qubit $1,j$, resulting in an effective rotation of
$e^{-id_{x}\frac{\theta}{2}Z_{1,j}}$, which we refer to as “zipping” of the
rotation along ZZ stabilizers.

Thus, the Z-Shor code under the uniform rotation $U_{Z}(\theta)$ has the same
logical channel as the length $d_{z}$ phase-flip code under the uniform
rotation $U_{Z}(d_{x}\theta)$. It follows that the logical channel parameters
can be simply expressed as the phase-flip parameters at physical angle
$d_{x}\theta$, resulting in the measure of coherence of the Z-Shor code being
$\kappa_{Z,d_{x}\times d_{z}}(\theta)=\kappa_{d_{z}}(d_{x}\theta)$. From here
it is easy to see that for a given $d_{x}$ both $\kappa_{Z,d_{x}\times
d_{z}}(\theta)$ and $\epsilon_{Z,d_{x}\times d_{z}}(\theta)$ are suppressed
exponentially in $d_{z}$ when $\theta<\frac{\pi}{2d_{x}}$. Interestingly, when
$d_{x}=d_{z}=L$, for small $\theta$, this means that
$\theta\approx\sin(\theta)<\frac{\pi}{2}1/L$, the lower bound Iverson and
Preskill derived for the toric code [7]. The Z-Shor code has maximal
coherence, which we expect to be strictly worse than any compass code,
including the surface code. Thus, our result points towards a need for a
better lower bound for the surface code threshold.

Coherence threshold for the X-Shor code.— We can think of the X-Shor code as
$d_{x}$ length-$d_{z}$ phase-flip codes glued together by weight-$2d_{z}$ Z
operators. As such, the logical channel of the X-Shor code is equivalent to
applying $d_{x}$ times the logical channel of the length-$d_{z}$ phase-flip
code. In the Pauli Transfer Matrix representation, the combined PTM of
applying multiple channels is simply the product of the individual channel
PTMs. In our case, the PTM for the X-Shor code’s logical channel is going to
be the product of the PTMs of the phase-flip code logical channel.

To calculate the parameters, we diagonalize the PTM of the phase-flip code.
The eigenvalues are 1, 1, and $1-\epsilon_{l}(\theta)\pm
i\delta_{l}(\theta)\equiv\exp(\lambda_{l}(\theta)\pm i\phi_{l}(\theta))$
expressed in polar form for easier exponentiation, and thus:

$\displaystyle 1-\epsilon_{X,d_{x}\times d_{z}}(\theta)$
$\displaystyle=\exp(d_{x}\lambda_{d_{z}}(\theta))\cos(d_{x}\phi_{d_{z}}(\theta))\approx(1-d_{x}\epsilon_{d_{z}}(\theta))(1-\frac{d_{x}^{2}\delta_{d_{z}}(\theta)^{2}}{2})$
(4) $\displaystyle\delta_{X,d_{x}\times d_{z}}(\theta)$
$\displaystyle=\exp(d_{x}\lambda_{d_{z}}(\theta))\sin(d_{x}\phi_{d_{z}}(\theta))\approx(1-d_{x}\epsilon_{d_{z}}(\theta))(d_{x}\delta_{d_{z}}(\theta)),$
(5)

where the approximations are based on first-order expansions in
$\epsilon_{d_{z}},\lambda_{d_{z}}$ around zero, and thus they apply when these
values are sufficiently small. In this low-noise regime, by further ignoring
negligible third and second-order terms, we find that $\kappa_{X,d_{x}\times
d_{z}}(\theta)\approx d_{x}\kappa_{d_{z}}(\theta)$, which means that the
X-Shor code has the same coherence threshold as the phase-flip code. Thus, for
$\theta$ values below $\theta_{th}=\pi/2$, the X-Shor code suppresses loss of
fidelity and coherence of the logical channel exponentially in $d_{z}$. This
suppression is tempered by a factor of $d_{x}$, which, in the case of square
codes $l=d_{x}=d_{z}$, is a linear slowdown.

(a)

(b)

FIGURE 1: Two members of the Z-stacked Shor code family, $C_{7,2}$ (a) and
$C_{7,3}$ (b). X stabilizers are blue rectangles between two columns of qubits
spanning from top to bottom, while Z stabilizers are red rectangles between
two rows of qubits spanning from left to right. In (b), the second Z-Shor
block shows the uniform Z rotation by $\theta$. The top block shows the
“zipped” view, which is equivalent to the uniform rotation up to the weight-2
Z-stabilizers. Here, qubits in the first row experience a $3\theta$ rotation
while the other two rows do not participate.

Coherence threshold for the Z-stacked Shor codes.— We now define a
generalization of the X-Shor codes, the family of Z-stacked Shor codes, with
members of length $l$ and block-height $h$, denoted $\mathcal{C}_{l,h}$, with
$\mathcal{C}_{l,1}$ being the family of $l\times l$ square X-Shor codes.
Consider the $l\times l$ square grid of qubits. In the first
$l_{h}\equiv\lfloor l/h\rfloor$ rows, we glue together $h\times l$ Z-Shor code
blocks with weight-$2l$ $Z$ stabilizer generators. In the remaining
$t_{h}\equiv l\mod h$ rows, we glue together $1\times l$ Z-Shor code blocks
(which are phase flip codes) with the $Z$ stabilizer generators. Two $l=7$
examples for $h=2$ and $h=3$ are displayed in Fig. 1. As the structure of
these codes is similar to the X-Shor code, the logical channel’s PTM is the
product of the Z-Shor code PTMs. From before, we know that for each Z-Shor
code block, we can use the parameters of the phase-flip code, just replacing
$\theta$ with $h\theta$. Thus, the logical channel parameters for
$\mathcal{C}_{l,h}$ are:

$\displaystyle 1-\epsilon_{\mathcal{C}_{l,h}}(\theta)=$
$\displaystyle\exp(l_{h}\lambda_{l}(h\theta)+t_{h}\lambda_{l}(\theta))\times$
$\displaystyle\cos(l_{h}\phi_{l}(h\theta)+t_{h}\phi_{l}(\theta))$ (6)
$\displaystyle\approx$
$\displaystyle\exp(\frac{l}{h}\lambda_{l}(h\theta))\cos(\frac{l}{h}\phi_{l}(h\theta))$
(7) $\displaystyle\delta_{\mathcal{C}_{l,h}}(\theta)=$
$\displaystyle\exp(l_{h}\lambda_{l}(h\theta)+t_{h}\lambda_{l}(\theta))\times$
$\displaystyle\sin(l_{h}\phi_{l}(h\theta)+t_{h}\phi_{l}(\theta))$ (8)
$\displaystyle\approx$
$\displaystyle\exp(\frac{l}{h}\lambda_{l}(h\theta))\sin(\frac{l}{h}\phi_{l}(h\theta)),$
(9)

where the approximations are valid at large $l$, where $l_{h}\gg t_{h}$, thus
$l_{h}\approx\frac{l}{h}$. In the regime where
$\epsilon_{l}(h\theta),\lambda_{l}(h\theta)$ are both sufficiently small, we
can apply similar approximations as above for the X-Shor code. The resulting
measure of coherence is approximately
$\kappa_{\mathcal{C}_{l,h}}\approx\frac{l}{h}\kappa_{l}(h\theta)$. This result
tells us that the coherence threshold for $\mathcal{C}_{l,h}$ is
$\frac{\pi}{2h}$ and that the exponential suppression of loss of fidelity and
coherence is slowed down by a linear factor of $l/h$. Bounding the rotated
surface code.— Under MWPM decoding, the coherence thresholds $\pi/4$ and
$\pi/6$ of the two families, $\mathcal{C}_{l,2}$ and $\mathcal{C}_{l,3}$,
respectively, serve as bounding cases of the $\pi/5$ coherence threshold of
the surface code which we reproduced as shown in Fig. 2. However, based on
the results of Venn, Behrends, and Béri [25] under ML decoding, the surface
code might be able to reach the threshold of $(0.28\pm 0.01)\pi$, which is
slightly above the threshold of $\mathcal{C}_{l,2}$. While an exact
explanation is left for future work, the number of X and Z stabilizer
generators being the same for the surface code and the $\mathcal{C}_{l,2}$ is
suggestive of an underlying structural reason for the proximity of the two
codes’ thresholds.

FIGURE 2: Infidelity thresholds $\theta_{th}^{r_{1}}$ of different compass
codes. Random compass codes (RCC) are interpolated between the Z-Shor code
(ZSC) and the X-Shor code (XSC) parametrized by the X-check density $q_{shor}$
using numerical experiments to estimate the average threshold. Each data point
for RCC uses 200 random codes and 200 samples for each distance across
$d=9,13,17,21$. The threshold ranges are derived from plots in Appendix A. We
display the analytically determined thresholds for the Z-stacked Shor code
families $\mathcal{C}_{l,2}$ and $\mathcal{C}_{l,3}$, and the numerical values
for the rotated surface code (RSC MWPM) based on our simulation, which agrees
with Bravyi et al.’s result [11]. Finally, the ML decoding upper bound based
on [25] is displayed as RSC ML.

Finding a smoother transition might provide more insight into an analytical
pathway toward a constant lower bound for the surface code threshold. We find
that – at least on average – it is possible to smoothly interpolate between
the extreme thresholds of the rotated surface code and the Z-Shor code
thresholds using random compass codes of different X-check densities (Fig.
2). We simulate random compass code families parameterized with $q_{shor}$,
where $q_{shor}=1.0$ corresponds to the X-Shor code and $q_{shor}=0.0$ to the
Z-Shor code. The parameter represents the portion of the coloring that
comprises X-type (blue) stabilizers. In this parameter manifold
$\mathcal{C}_{l,3}$ is $q_{shor}=1/3$ and both $\mathcal{C}_{l,2}$ and the
rotated surface code are at $q_{shor}=1/2$. For the numerical experiments, we
implemented and generalized for compass codes a Majorana mode simulator
invented by Bravyi et al. [11]. Our code, msim, is open sourced [40]. For MWPM
decoding, we used PyMatching [41].

Conclusions and outlook.— 2D compass codes are promising for exploring the
open problem of proving a constant analytical lower bound for the rotated
surface code threshold under uniform coherent Z-rotation, the worst-case
scenario for coherent noise processes. We showed how the Z-Shor code can
suppress coherent error in the $\sin(\theta)<1/L$ regime, similar to the toric
code [7]. Given that the Z-Shor code does not have a threshold and numerical
evidence by Bravyi et al. [11] points to a constant lower bound for the
rotated surface code, there is room for improvement analytically as well. We
introduced the Z-stacked Shor code families that afford approximate analytical
analysis of the space. Two of these families yield thresholds near the rotated
surface code value. Numerical investigations via the Majorana mode simulator
can now be extended to compass codes with our open-source tool, msim [40].
These simulations show that it is possible to find structural properties that
move the threshold on average. Still, the simple X-check density, $q_{shor}$,
itself fails to have a high enough resolution of the threshold to fully
explain the relationship between the two bounding cases of stacked Z-Shor
codes and the rotated surface code.

Future investigations might identify other structural factors that, when
changed, move the thresholds of compass code families in a strictly monotonic
way. Uncovering such structural property or a combination of properties would
help establish a constant analytical lower bound.

The authors thank D. Debroy and R. Calderbak for useful discussions. This work
was supported by ARO/LPS QCISS program (W911NF-21-1-0005) and the NSF QLCI for
Robust Quantum Simulation(OMA-2120757).

Code and data are available for download at [42].

## References

  * Aharonov and Ben-Or [1996] D. Aharonov and M. Ben-Or (1996), URL http://arxiv.org/abs/quant-ph/9611025.
  * Dennis et al. [2002] E. Dennis, A. Kitaev, A. Landahl, et al., Journal of Mathematical Physics 43, 4452 (2002).
  * Shor [1996] P. W. Shor, Proceedings., 37th Annual Symposium on Foundations of Computer Science pp. 56–65 (1996), URL http://dl.acm.org/citation.cfm?id=874062.875509.
  * Aliferis et al. [2007] P. Aliferis, D. Gottesman, and J. Preskill (2007), URL http://arxiv.org/abs/quant-ph/0703264.
  * Huang et al. [2019] E. Huang, A. C. Doherty, and S. Flammia, Physical Review A 99, 022313 (2019), arXiv:1805.08227 [quant-ph].
  * Beale et al. [2018] S. J. Beale, J. J. Wallman, M. Gutiérrez, et al., Physical Review Letters 121, 190501 (2018), ISSN 0031-9007, 1079-7114, URL https://link.aps.org/doi/10.1103/PhysRevLett.121.190501.
  * Iverson and Preskill [2020] J. K. Iverson and J. Preskill, New Journal of Physics 22, 073066 (2020), ISSN 1367-2630, URL https://iopscience.iop.org/article/10.1088/1367-2630/ab8e5c.
  * Gutiérrez et al. [2016] M. Gutiérrez, C. Smith, L. Lulushi, et al., Physical Review A 94, 042338 (2016), ISSN 2469-9926, 2469-9934, URL http://arxiv.org/abs/1605.03604.
  * Barnes et al. [2017] J. P. Barnes, C. J. Trout, D. Lucarelli, et al., Physical Review A 95, 062338 (2017), ISSN 2469-9926, 2469-9934.
  * Darmawan and Poulin [2017] A. S. Darmawan and D. Poulin, Physical Review Letters 119, 040502 (2017), ISSN 0031-9007, 1079-7114, URL http://link.aps.org/doi/10.1103/PhysRevLett.119.040502.
  * Bravyi et al. [2018] S. Bravyi, M. Englbrecht, R. König, et al., npj Quantum Information 4, 1 (2018), ISSN 2056-6387, URL https://www.nature.com/articles/s41534-018-0106-y.
  * Venn and Béri [2020] F. Venn and B. Béri, Physical Review Research 2, 043412 (2020).
  * Márton and Asbóth [2023] Á. Márton and J. K. Asbóth, Quantum 7, 1116 (2023), arXiv:2303.04672 [quant-ph].
  * Pataki et al. [2024] D. Pataki, Á. Márton, J. K. Asbóth, and A. Pá (2024), arXiv:2401.04530 [cond-mat, physics:quant-ph], URL http://arxiv.org/abs/2401.04530.
  * Gottesman [1998] D. Gottesman, Physical Review A 57, 127 (1998).
  * Jain et al. [2023] A. Jain, P. Iyer, S. D. Bartlett, et al., Physical Review Research 5, 033049 (2023), ISSN 2643-1564.
  * Wallman and Emerson [2016] J. J. Wallman and J. Emerson, Physical Review A 94, 052325 (2016), ISSN 2469-9926, 2469-9934.
  * Debroy et al. [2018] D. M. Debroy, M. Li, M. Newman, et al., Physical Review Letters 121, 250502 (2018), ISSN 0031-9007, 1079-7114, URL https://link.aps.org/doi/10.1103/PhysRevLett.121.250502.
  * Cai et al. [2020] Z. Cai, X. Xu, and S. C. Benjamin, npj Quantum Information 6, 17 (2020), ISSN 2056-6387, URL http://arxiv.org/abs/1906.06270.
  * Hu et al. [2021a] J. Hu, Q. Liang, N. Rengaswamy, et al., arXiv:2011.00197 [quant-ph] (2021a), URL http://arxiv.org/abs/2011.00197.
  * Hu et al. [2021b] J. Hu, Q. Liang, and R. Calderbank, arXiv:2110.11923 [quant-ph] (2021b), URL http://arxiv.org/abs/2110.11923.
  * Hu et al. [2022a] J. Hu, Q. Liang, and R. Calderbank, Quantum 6, 802 (2022a).
  * Hu et al. [2022b] J. Hu, Q. Liang, and R. Calderbank (2022b), URL http://arxiv.org/abs/2204.13176.
  * Akahoshi et al. [2023] Y. Akahoshi, K. Maruyama, H. Oshima, et al. (2023), URL http://arxiv.org/abs/2303.13181.
  * Venn et al. [2023] F. Venn, J. Behrends, and B. Béri, Physical Review Letters 131, 060603 (2023).
  * Bombin and Martin-Delgado [2007] H. Bombin and M. A. Martin-Delgado, Physical Review A 76, 012305 (2007), ISSN 1050-2947, 1094-1622.
  * Bravyi and Kitaev [1998] S. B. Bravyi and A. Y. Kitaev, preprint quant-ph/9811052 (1998).
  * Sanders et al. [2015] Y. R. Sanders, J. J. Wallman, and B. C. Sanders, New Journal of Physics 18, 012002 (2015), URL https://dx.doi.org/10.1088/1367-2630/18/1/012002.
  * Wallman et al. [2015] J. Wallman, C. Granade, R. Harper, et al., New Journal of Physics 17, 113020 (2015), ISSN 1367-2630, URL https://dx.doi.org/10.1088/1367-2630/17/11/113020.
  * Greenbaum and Dutton [2018] D. Greenbaum and Z. Dutton, Quantum Science and Technology 3, 015007 (2018), ISSN 2058-9565, URL https://iopscience.iop.org/article/10.1088/2058-9565/aa9a06.
  * Cao et al. [2023] C. Cao, M. J. Gullans, B. Lackey, et al. (2023), URL http://arxiv.org/abs/2308.05152.
  * Bacon [2006] D. Bacon, Physical Review A 73, 012340 (2006).
  * Li et al. [2019] M. Li, D. Miller, M. Newman, et al., Physical Review X 9, 021041 (2019), ISSN 2160-3308, URL https://link.aps.org/doi/10.1103/PhysRevX.9.021041.
  * Calderbank and Shor [1996] A. R. Calderbank and P. W. Shor, Physical Review A 54, 1098 (1996).
  * Kugel’ and Khomskii [1973] K. I. Kugel’ and D. I. Khomskii, Zh. Eksp. Teor. Fiz pp. 1429–1439 (1973).
  * Dorier et al. [2005] J. Dorier, F. Becca, and F. Mila, Physical Review B 72, 024448 (2005).
  * Shor [1995] P. W. Shor, Physical review A 52, R2493 (1995).
  * Paetznick and Reichardt [2013] A. Paetznick and B. W. Reichardt, Physical Review Letters 111, 090505 (2013), arXiv: 1304.3709.
  * Bombín [2015] H. Bombín, New Journal of Physics 17, 083002 (2015).
  * Pato and Staples [2023] B. Pato and W. Staples, GitLab (2023), URL https://gitlab.com/duke-artiq/error-correction/msim.
  * Higgott and Gidney [2023] O. Higgott and C. Gidney, preprint arXiv:2303.15933 (2023).
  * Pato et al. [2024] B. Pato, J. W. Staples Jr., and K. R. Brown, _Logical coherence in 2D compass codes Supplementary Material_ (2024), URL https://doi.org/10.5281/zenodo.11197690.

##  Appendix A Supporting data for threshold calculations

FIGURE 3: The underlying data for the threshold plot in the main text. We
manually determine the upper and lower bounds for the thresholds by picking a
regime that is clearly below threshold and one that is clearly above. The
bounds are denoted with the two blue vertical lines as well as the numerical
values in the highlighted box. Rows are for the same code families, while
columns represent the single-use channel fidelity $r_{1}$ (left column) and
the diamond distance $d_{\diamond}$ (right column).


# On the recognition of the game type based on physiological signals and eye
tracking

Łukasz Czekaj1, Łukasz Radzinski1, Mateusz Kolimaga1, Jakub Domaszewicz1,
Robert Kitłowski1, Mariusz Szwoch2, Włodzisław Duch3 1Aidmed,
https://www.aidmed.ai/, Poland2Faculty of Electronics, Telecommunications and
Informatics, Gdańsk University of Technology, Poland3Dept. of Informatics,
Institute of Engineering and Technology, Faculty of Physics, Astronomy &
Informatics, Nicolaus Copernicus University, Poland

###### ABSTRACT

Automated interpretation of signals yields many impressive applications from
the area of affective computing and human activity recognition (HAR). In this
paper we ask the question about possibility of cognitive activity recognition
on the base of particular set of signals. We use recognition of the game
played by the participant as a playground for exploration of the problem. We
build classifier of three different games (Space Invaders, Tetris, Tower
Defence) and inter-game pause. We validate classifier in the player-
independent and player-dependent scenario. We discuss the improvement in the
player-dependent scenario in the context of biometric person recognition. On
the base of the results obtained in game classification, we consider potential
applications in smart surveillance and quantified self.

KEYWORDS

behavioural science, physiology, man-machine interfaces, statistical analysis,
signal processing

## INTRODUCTION

Easy access to the wide spectrum of wearable and mobile sensors drives
interest of researchers toward automated and continuous recognition of various
human activities. Among the motivations are: activity tracking in such areas
as healthcare and elder care, smart surveillance, intelligent environment,
education, entertainment and virtual reality, biofeedback and wellness
(emotional strain and stress assessment). Implementations of research results
together with Big Data technologies and individual engaged in the self-
tracking manifest as cultural phenomenon of quantifies self movement Swan
(2013)

Affective computing is fast developing multidisciplinary research area
bringing together artificial intelligence, cognitive and social sciences, with
the aim of detection, recognition and interpretation of human affects Tao and
Tan (2005), Poria et al. (2017), Wang et al. (2022). Affective computing
utilize various machine learning techniques in processing data acquired from
wearable and mobile sensors, cameras and other dedicated input devices. Among
its interest are: automated emotion recognition Dzedzickis et al. (2020),
affective gaming Hudlicka (2008) (smart games and player engagement), stress
detection and mental workload Giannakakis et al. (2022).

Closely related is so called mind-reading with impressive results in
recognition of cognitive states from fMRI data Norman et al. (2006) and
generating images from EEG signals Bai et al. (2023).

We were inspired by various results in quantified self Swan (2012), HAR
Bouchabou et al. (2021), mental workload and time pressure detection Nickel
and Nachreiner (2003), games as affective stimulation Chen et al. (2019).

In this paper we focus on the problem of the recognition of cognitive
activity, i.e. classification of what type of cognitive task from a given set
is performed by the person at a given moment. The input to the classifier are
physiological signals along with eye tracking data (for brevity we call them
signals). We simplify this general problem and study it as a task of
distinguishing between different game types and inter-game pause (for short we
refer to this pause extended game type classification as game classification).
Our work aligns with the framework of sensor-based, single-user activity
recognition and the results may be viewed as extension of classical HAR from
physical to mental activities.

The intuitions behind presented research are as follows. Despite the fact that
the participant is sitting in front of the computer screen throughout the
game, and the physical conditions do not change much between different games,
the virtual environment changes a lot. Different games engage participant in
different ways. Theirs dynamics, speed, turns design and time pressure, and
overall concentration level required by the game reflect in signals recorded
during the game. Game specific screen layout is correlated with eye-movement
patterns. The mentioned factors enable identification of the type of game. In
this paper we present XGBoost Chen and Guestrin (2016) based detector (multi-
label classifier) fuelled by the features obtained from the following signals:
electrocardiography (ECG), respiration (RESP), galvanic skin response (GSR)
and eye tracking (EYETR). All those signals can be recorded in non-invasive
way and the applications using such signals do not require professional
training. Moreover, the sensors may be implemented in non-distributive way
without need of wearables (e.g. ECG recording from the steering Warnecke et
al. (2022)).

Figure 1: Data collection and signal processing. The top of the picture
represents a recording session: a player plays multiple rounds of games (round
is depicted as a box, different colours denote different games) separated by
pauses (gray boxes). The recording session is preceded with eye tracker
calibration and short relaxation. During the session, signals (ECG, RESP, GSR,
EYETR) are recorded along with information about game type or a pause. Sliding
window of the width $15$ s and step $1$ s is applied on the signals and is
used for feature extraction. Window is labelled according to its centre.
Subject normalized features vector is passed to the multi-class model. In the
prediction mode, for every data window, models provide 4 probabilities: 1 for
each game type/pause. Then the label corresponding to the class with the
highest probability value is taken.

We build two types of game detectors: player-independent and player-dependent.
Detectors are evaluated using leave-one-out cross-validation (LOOCV) - one
test player is selected in each iteration. For player-independent detector,
recordings for test player are completely excluded from the train dataset. For
player-dependent detectors, recordings from the test player are split between
train and test datasets. The model also learns features specific for the test
player (see FIG. 2 for details). Since we observed better performance of the
player-dependent detector, we asked if that difference should be attributed to
the player’s related clusterisation of recorded signals (e.g. player related
shift of mean HR) or player’s preferences of the specific game playing style
(i.e. clustering of signals recorded for given game which may be interpreted
as playing style). To answer the question we build a biometric player
recognition model Odinaka et al. (2012) that predicted if a given part of
signals belongs to the test user. Our results suggest that player’s related
clustering is important factor in model performance improvement.

## METHODS

Figure 2: Models and Evaluation Scenarios. The top two panels refer to game
classification tasks, the bottom one refers to player recognition. Leave-one-
out cross validation is used for evaluation of game classification: for each
LOOCV iteration, one player is selected as a test player (in bold); in player-
independent scenario \- recordings for test player are completely excluded
from the train dataset; in player-dependent scenario \- recordings from the
test player are split between train and test datasets. In biometric player
recognition one test player is selected as positive and one as negative. Data
from the rest of the players form negative examples in train dataset. Row
depicts recording session for player; colour boxes represent game rounds
(different colours denotes different games); gray boxes represent inter-game
pauses. Dashed lines denote test data and the complement forms training data.

### Data collection

The data collection process is depicted in FIG. 1. Each player participated in
one recording session. The recording session was preceded with eye tracker
calibration and a short relaxation (for the purpose of heart rate and breath
rate stabilisation). The recording session consisted of game rounds interwoven
with pauses. Game round took $\sim 5$ mins and pause took $\sim 1$ min. There
were $4$ consecutive rounds for each game. Participants played in $3$ games:
Space Invaders, Tetris and Tower Defense. Games differ in graphical layout and
dynamics: (i) Space Invaders is characterized by spawning waves of enemies;
(ii) in Tetris the gameplay speeds up and the time pressure increases at the
end of each round; (iii) Tower Defense is a sub-genre of turn-based strategy
game. Data collection during recording session was performed with following
devices: ECG and respiration (bioimpedance method) were recorded with the
Aidmed One recorder (Czekaj et al. (2020)), GSR was recorded with Shimmer
device (https://shimmersensing.com/), eye positions were collected with Talon
(https://talonvoice.com/) and Tobii Eye Tracker (https://gaming.tobii.com/).
Data was collected from $20$ volunteers in age 20-40 years, 5 female. All the
data was collected in the same laboratory station. The participants were
instructed about data collection protocol. Desktop application developed in
Python was used to control the protocol. Data were collected in a separate
room in a quiet, isolated environment.

### Detector

In this paper we present results for 3 classification tasks: game
classification for i) player-independent and ii) player-dependent scenario,
iii) biometric player recognition. For each task we built XGBoost based model
fed by features extracted from the signals (see FIG. 1). For tasks i) and ii)
we developed multiclass models (multi:softmax) with game type including pause
as a label. For task iii) we used binary loss (binary:logistic) and label
denotes selected player. Biometric player recognition mimics player-dependent
scenario in the way of data split, however the goal is to recognize player on
the base of signals sample. We applied class balancing with example weighting
in all models. For details of train and test datasets preparation see FIG. 2.

For all tasks we build separate models for 3 sets of features derived from
increasing number of signals: I) SIG-1: ECG, RESP; II) SIG-2: ECG, RESP, GSR;
III) SIG-3: ECG, RESP, GSR, EYETR. Our motivation here was to evaluate a
hierarchy of signals/sensors from less to more intrusive: Aidmed One recorder
is chest belt wearable, GSR requires fingers attached electrodes and eye
tracking requires special camera placed in front of player or the use of
special glasses. Signal processing and feature extraction pipeline was the
same in all models.

Based on ECG, we calculated heart rate variability (HRV) features using
(https://github.com/Aura-healthcare) Pham et al. (2021). GSR signal was
decomposed into phasic and tonic components and analysed with Neurokit
Makowski et al. (2021) toolkit. A detailed list of features is presented
below.

ECG based features:

  * •

AVG_HR_15s \- average HR from 15 s window

  * •

AVG_HR_5s \- average HR from central 5 s range

  * •

AVG_HR_RATIO \- ratio of AVG_HR_5s-to-AVG_HR_15s

  * •

AVG_HR_DIFF \- difference between average HR of left and right half of the
signal window

  * •

SDNN \- standard deviation of inter-beat intervals

  * •

RMSSD \- root-mean-square of successive differences

  * •

LF_POWER \- relative power of the low-frequency band ($\leq 0.15$ Hz)

  * •

HF_POWER \- relative power of the low-frequency band ($0.15-0.4$ Hz)

  * •

LF_HF_RATIO \- ratio of LF-to-HF power

  * •

TOTAL_POWER \- total power of the heart rate signal

Respiration based features:

  * •

RESP_AMP \- respiration amplitude

  * •

RESP_DOM_FREQ \- dominant frequency of respiration signal (estimation of
respiration rate)

  * •

RESP_PEAKS \- peaks number in respiration signal (estimation of respiration
rate)

GSR based features (features are calculated separately for the tonic and
phasic components):

  * •

AVG_GSR_15s \- average value of GSR component from 15 s window

  * •

AVG_GSR_5s \- average value of GSR component from central 5 s range

  * •

AVG_GSR_RATIO \- ratio of AVG_GSR_5s-to-AVG_GSR_15s

  * •

AVG_MEAN_GSR_DIFF \- difference between average GSR component of left and
right half of the signal window

  * •

STD_GSR \- standard deviation of GSR signal component

  * •

GSR_PEAKS \- number of peaks in GSR (raw signal)

Eye tracking based features (gaze position in the screen coordinate, gaze
outside the screen was filtered out):

  * •

BLINKS \- blinks number

  * •

GAZE_OUTSIDE \- pc. of time when gaze was not located on screen

  * •

AVG_POSITION \- average of eye position

  * •

STD_POSITION \- standard deviation of gaze position

  * •

KURT_POSITION \- kurtosis of gaze position

  * •

AVG_VELOCITY \- average of gaze position difference

  * •

STD_VELOCITY \- standard deviation of gaze position difference

  * •

KURT_VELOCITY \- kurtosis of gaze position difference

Computations were performed using Python 3.8 Van Rossum and Drake (2009).

## EXPERIMENTS AND RESULTS

Figure 3: Detector output for player-dependent scenario Figure presents
fragment of recording sessions containing Space Invaders and pauses (blue
rectangles). Top and bottom panels show output of Space Invaders and pause
detector, respectively. Please note that for clarity we only plot the
probabilities of 2 from 4 class. Colour lines represent result for different
set of signals (SIG-1: ECG, RESP; SIG-2: ECG, RESP, GSR; SIG-3: ECG, RESP,
GSR, EYETR).

Results for the player-independent classification, player-dependent
classification and biometric player recognition are summarized in TAB. 1, TAB.
2 and TAB. 3 respectively. Raw output of the models is presented in FIG. 3.
For each experiment we present results of random model (random) as a baseline
and then results for selected sets of signals: SIG-1, SIG-2, SIG-3. For each
experiment we reported accuracy, precision, recall and F1 score. Data from
different games and cross validation iterations were aggregated using
multiclass macro averaging and balanced accuracy score Mosley (2013).

All game classification models significantly outperform baseline random
classifier - even simple ECG and respiration based one. Adding GSR features do
not improve player-independent classifier, but they help in the player-
dependent classifier. Adding features extracted from eye tracking help a lot
in both game classification scenarios, but do not improve player recognition
much. All sets of signals carry information about player identity. Our
interpretation of the results is that the ECG, respiration and GSR features
are more specific to the user and the technologies for cognitive activity
recognition based on that signals will require user specific calibration of
the model. On the other hand eye tracking carry information about game
specific layout and the reaction on visual signals generalize between users.

Table 1: Player-independent classification. signals | acc. | prec. | rec. | F1
---|---|---|---|---
random | 0.25 | 0.25 | 0.25 | 0.25
SIG-1 | 0.50 | 0.46 | 0.48 | 0.47
SIG-2 | 0.52 | 0.48 | 0.49 | 0.48
SIG-3 | 0.71 | 0.68 | 0.70 | 0.69
Table 2: Player-dependent classification. signals | acc. | prec. | rec. | F1
---|---|---|---|---
random | 0.25 | 0.25 | 0.25 | 0.25
SIG-1 | 0.62 | 0.58 | 0.58 | 0.58
SIG-2 | 0.76 | 0.75 | 0.74 | 0.75
SIG-3 | 0.89 | 0.88 | 0.89 | 0.89
Table 3: Biometric player recognition signals | acc. | prec. | rec. | F1
---|---|---|---|---
random | 0.5 | 0.5 | 0.5 | 0.5
SIG-1 | 0.78 | 0.82 | 0.78 | 0.78
SIG-2 | 0.84 | 0.88 | 0.84 | 0.84
SIG-3 | 0.87 | 0.90 | 0.87 | 0.87

## CONCLUSIONS

Using the example of game type/pause classification during play we have
demonstrated the possibility of cognitive activity recognition. We have
discovered the user specific characteristic of the heart rate, respiration and
GSR signal. Our results may find applications in tasks related with smart
surveillance (e.g. in profession like flight control where mental
overload/fatigue may be crucial factor for safety and performance), affect-
aware video games and smart games (e.g. feedback provided to student about
focus) and e-learning software, and new methods for human-machine
interactions. Cognitive activity recognition implemented as a part of
quantified self application may be used as qualitative feedback loops for
behavior change.

Since each player participated in only one recording session, more research is
required to assess the necessity of detector calibration between recording
sessions and how it is related to the detector calibration for the player.

## ACKNOWLEDGMENT

This work is a part of the project ‘Development of Software Development Kit
for utilizing biosignals from wearable sensor to improve user’s interaction in
gaming‘, financed by the National Centre for Research and Development (NCBiR),
Poland, under the agreement POIR.01.02.00-00-0212. We would like to thank
PICTEC team and AIDMED team for their involvement in this project.

## References

  * Bai et al. (2023) Bai Y.; Wang X.; Cao Y.; Ge Y.; Yuan C.; and Shan Y., 2023.  _DreamDiffusion: Generating High-Quality Images from Brain EEG Signals_.  _arXiv preprint arXiv:230616934_.
  * Bouchabou et al. (2021) Bouchabou D.; Nguyen S.M.; Lohr C.; LeDuc B.; and Kanellos I., 2021.  _A Survey of Human Activity Recognition in Smart Homes Based on IoT Sensors Algorithms: Taxonomies, Challenges, and Opportunities with Deep Learning_.  _Sensors_ , 21, no. 18.
  * Chen and Guestrin (2016) Chen T. and Guestrin C., 2016.  _XGBoost: A Scalable Tree Boosting System_.  In _Proc. of the 22nd ACM SIGKDD Int. Conf. on Knowledge Discovery and Data Mining_. 785–794.
  * Chen et al. (2019) Chen Y.C.; Hsiao C.C.; Zheng W.D.; Lee R.G.; and Lin R., 2019.  _Artificial neural networks-based classification of emotions using wristband heart rate monitor data_.  _Medicine_ , 98, no. 33.
  * Czekaj et al. (2020) Czekaj L.; Domaszewicz J.; Radzinski L.; Jarynowski A.; Kitlowski R.; and Doboszynska A., 2020.  _Validation and usability of AIDMED-telemedical system for cardiological and pulmonary diseases_.  _E-methodology_ , 7, no. 7, 125–139.
  * Dzedzickis et al. (2020) Dzedzickis A.; Kaklauskas A.; and Bucinskas V., 2020.  _Human Emotion Recognition: Review of Sensors and Methods_.  _Sensors_ , 20, no. 3.
  * Giannakakis et al. (2022) Giannakakis G.; Grigoriadis D.; Giannakaki K.; Simantiraki O.; Roniotis A.; and Tsiknakis M., 2022.  _Review on Psychological Stress Detection Using Biosignals_.  _IEEE Transactions on Affective Computing_ , 13, no. 1, 440–460.
  * Hudlicka (2008) Hudlicka E., 2008.  _Affective computing for game design_.  In _Proceedings of the 4th Intl. North American Conference on Intelligent Games and Simulation_. McGill University Montreal, 5–12.
  * Makowski et al. (2021) Makowski D.; Pham T.; Lau Z.J.; Brammer J.C.; Lespinasse F.; Pham H.; Schölzel C.; and Chen S.H.A., 2021.  _NeuroKit2: A Python toolbox for neurophysiological signal processing_.  _Behavior Research Methods_ , 53, no. 4, 1689–1696.
  * Mosley (2013) Mosley L., 2013.  _A balanced approach to the multi-class imbalance problem_.  _Iowa State University Digital Repository_.
  * Nickel and Nachreiner (2003) Nickel P. and Nachreiner F., 2003.  _Sensitivity and Diagnosticity of the 0.1-Hz Component of Heart Rate Variability as an Indicator of Mental Workload_.  _Human Factors_ , 45, no. 4, 575–590.
  * Norman et al. (2006) Norman K.A.; Polyn S.M.; Detre G.J.; and Haxby J.V., 2006.  _Beyond mind-reading: multi-voxel pattern analysis of fMRI data_.  _Trends in cognitive sciences_ , 10, no. 9, 424–430.
  * Odinaka et al. (2012) Odinaka I.; Lai P.H.; Kaplan A.D.; O’Sullivan J.A.; Sirevaag E.J.; and Rohrbaugh J.W., 2012.  _ECG biometric recognition: A comparative analysis_.  _IEEE Transactions on Information Forensics and Security_ , 7, no. 6, 1812–1824.
  * Pham et al. (2021) Pham T.; Lau Z.J.; Chen S.H.A.; and Makowski D., 2021.  _Heart Rate Variability in Psychology: A Review of HRV Indices and an Analysis Tutorial_.  _Sensors_ , 21, no. 12.
  * Poria et al. (2017) Poria S.; Cambria E.; Bajpai R.; and Hussain A., 2017.  _A review of affective computing: From unimodal analysis to multimodal fusion_.  _Information fusion_ , 37, 98–125.
  * Swan (2012) Swan M., 2012.  _Sensor mania! the internet of things, wearable computing, objective metrics, and the quantified self 2.0_.  _Journal of Sensor and Actuator networks_ , 1, no. 3, 217–253.
  * Swan (2013) Swan M., 2013.  _The quantified self: Fundamental disruption in big data science and biological discovery_.  _Big data_ , 1, no. 2, 85–99.
  * Tao and Tan (2005) Tao J. and Tan T., 2005.  _Affective computing: A review_.  In _International Conference on Affective computing and intelligent interaction_. Springer, 981–995.
  * Van Rossum and Drake (2009) Van Rossum G. and Drake F.L., 2009.  _Python 3 Reference Manual_.  CreateSpace, Scotts Valley, CA.
  * Wang et al. (2022) Wang Y.; Song W.; Tao W.; Liotta A.; Yang D.; Li X.; Gao S.; Sun Y.; Ge W.; Zhang W.; and Zhang W., 2022.  _A systematic review on affective computing: emotion models, databases, and recent advances_.  _Information Fusion_ , 83-84, 19–52.
  * Warnecke et al. (2022) Warnecke J.M.; Ganapathy N.; Koch E.; Dietzel A.; Flormann M.; Henze R.; and Deserno T.M., 2022.  _Printed and Flexible ECG Electrodes Attached to the Steering Wheel for Continuous Health Monitoring during Driving_.  _Sensors_ , 22, no. 11.