# Variable Star Light Curves in Koopman Space

Nicolas Mekhaël  Mario Pasquato  Gaia Carenini  Vittorio F. Braga  Piero
Trevisan  Giuseppe Bono  Yashar Hezaveh

###### Abstract

We present the first application of data-driven techniques for dynamical
system analysis based on Koopman theory to variable stars. We focus on light
curves of RRLyrae type variables, in the Galactic globular cluster $\omega$
Centauri. Light curves are thus summarized by a handful of complex
eigenvalues, corresponding to oscillatory or fading dynamical modes. We find
that variable stars of the RRc subclass can be summarized in terms of fewer
($\approx 8$) eigenvalues, while RRab need comparatively more ($\approx 12$).
This result can be leveraged for classification and reflects the simpler
structure of RRc light curves. We then consider variable stars displaying
secular variations due to the Tseraskaya–Blazhko effect and find a change in
relevant eigenvalues with time, with possible implications for the physical
interpretation of the effect.

Machine Learning, ICML

##  1 Introduction

In the context of time-domain astronomy and stellar variability, machine
learning techniques are growing in popularity, particularly in light of the
substantial amounts of data generated by current (Kaiser, 2004; Borucki et
al., 2010; Drake et al., 2013, 2014; Gaia Collaboration et al., 2016;
Jayasinghe et al., 2018; van Roestel et al., 2021; Coughlin et al., 2021) and
planned ground- and space-based observing facilities. In the study of variable
stars, these techniques have primarily been applied directly to light curves,
which are represented by appropriately defined features (e.g. see Pashchenko
et al. 2018; Mahabal et al. 2019; Dékány et al. 2021; Barbara et al. 2022 for
optical light curves, but also e.g. Kovačević et al. 2022 for X-ray variable
sources); deep neural networks have also been employed (e.g. Jamal & Bloom,
2020; Bassi et al., 2021). Although these methods produce good predictions,
they are typically not interpretable nor do they necessarily learn a correct
representation of the underlying physics.

Here, we are interested in inherently interpretable techniques that, even
though they remain fully data driven, allow us to get closer to the physics of
the dynamical system producing the data. An example along these lines can be
found in (Pasquato et al., 2022), where the authors use the sparse
identification of nonlinear dynamics (SINDy) method to automatically identify
governing equations for RRab, RRc, and $\delta$-Scuti variables based on
observed light curves. The primary obstacle in this methodology is identifying
an appropriate functional basis for the representation of the dynamical
system. Indeed, this choice is frequently difficult in practice: in fact,
Pasquato et al. (2022) essentially failed at modelling RRab light curves using
a polynomial basis. It follows that, at this stage, featurizing light curves
based on the coefficients learned by SINDy seems unfeasible.

In this paper, we go beyond this limitation employing the Dynamic Mode
Decomposition (DMD) algorithm, a mathematical tool introduced by (Schmid,
2010), and to the best of our knowledge, seldom used in astronomy before
(Darling & Widrow, 2019; Widrow et al., 2020; Linkmann et al., 2020; Hori et
al., 2020; Albidah et al., 2021; Linkmann & Dikpati, 2021; Albidah et al.,
2022). The advantage of this technique is that the extracted dynamic modes can
be naturally interpreted as a generalization of global stability modes and can
be potentially linked to the underlying physical mechanisms captured in the
data sequence. In particular, we model the temporal evolution of the optical
magnitude of a sample of RRLyrae stars belonging to the globular cluster
$\omega$ Centauri. We automatically learn approximations for nonlinear
dynamical systems encoding the time-evolution of the magnitude of each
variable star and verify that the predicted evolution matches the observed
data. Such approximations are expressed in terms of linear systems in suitable
Koopman spaces, an eigenvector base of which is returned directly by the
algorithm. The associated eigenvalues essentially summarize the light curve
and can be in principle used as features for machine learning tasks. We find
that the Koopman space required to describe RRc variable dynamics is smaller
with respect to the one needed for encoding RRab variables dynamics. This
reflects the simpler and more regular silhouettes of RRc curves and provides a
straightforward heuristic for RRab vs RRc classification. Finally, we discuss
an application to stars affected by the Blazhko effect (long term variability;
Blažko, 1907), which can be identified by comparing the eigenvalues
corresponding to light curves measured at different stages in the Blazhko
cycle. In one case we show that the Blazhko effect corresponds to a secular
evolution in a small subset of eigenvalues only, a finding that may have
physical significance.

##  2 Photometric data

For our work, we adopted the optical (BVI-band) photometry of the RRLs in the
Globular cluster $\omega$ Centauri published by Braga et al. (2016, 2019).
This data set is homogeneous in terms of photometric data reduction, even
though it includes images collected during more than 20 years from seven
different 1-to-8 m class telescopes, in a sky area of 57’$\times$56’ (see
Sec.2 in Braga et al. 2016 for more details). Still, to further improve the
consistency of our analysis, we chose to adopt only the photometric data
collected at the same telescope (Danish $1.5$m, at La Silla), during five
years (1995 to 1999), which constitutes the largest part (almost $60\%$) of
the original data set. The resulting Danish subset is a truly homogeneous data
set, with the exception of sporadic positional offsets in the 1998 images. As
a result, the following analysis is based on light curves with $100$ to over
$2000$ phase points in at least two of the three bands (V and B, since I-band
phase points are one order of magnitude less) for $125$ variables.

This subset of the data is comprised of light curves taken from $89$ RRc and
$70$ RRab variables. Of these, $6$ RRc and $2$ RRab light curves were
discarded because we failed to obtain an acceptable interpolation, due either
to outliers or phase gaps. This leaves us with $83$ RRc and $68$ RRab light
curves. Using the _gcvspline_ Python wrapper (Le Losq & Feng, 2007) of a
FORTRAN package for generalized, cross-validatory spline smoothing (Woltring,
1986), we interpolate these light curves repeated $5$ times and picked
equidistant (in phase) snapshots from this spline with $30$ points per phase
which makes a smoothed out, periodic set of $150$ points from which DMD can
build a model.

##  3 Methods

Dynamic Mode Decomposition (DMD) algorithm is a dimensionality reduction
algorithm guaranteed in the framework of Koopman analysis for the study of
nonlinear dynamical systems. The core principle of Koopman analysis is a non
linear coordinate transformation that embeds a nonlinear dynamical system in
an equivalent linear dynamical system of observables. The existence of such an
embedding is due to an intrinsic trade-off between linearity and dimension. In
this framework, it’s necessary to figure out what the coordinate
transformation is and what the dynamical system is turned into. For our
purpose, we are interested to do this from data in one shot. This is possible
thanks to tangent linear approximation of the system and a few arguments used
in iterative methods for computing solutions to linear eigenvalue problems,
that DMD algorithm naturally encodes.

More precisely, given a discrete time series
$V_{1}^{N}=\\{v_{1},\dots,v_{N}\\}$, where $v_{i}\in\mathbb{R}^{m}\hskip
5.69046pt\forall i\in[m]$, it is assumed the existence of a linear mapping
$A\in GL_{n}$ that associates two successive points of the time series, i.e.
$v_{i+1}=Av_{i}$. This last relation defines a linear dynamical system that
stays approximately the same over the sampling period, formally using the
language of matrices $V_{2}^{N}=AV_{1}^{N-1}+re_{N-1}^{T}$, where $r$ is the
vector of residuals that encodes the behaviour not predicted by $A$, $e_{N-1}$
is the $(N-1)$th vector of the canonical base and
$V_{1}^{N-1}=\\{v_{1},\dots,v_{N-1}\\}$ and
$V_{2}^{N}=\\{v_{2},\dots,v_{N}\\}$. Roughly speaking, DMD computes the
eigenvalues and the eigenvectors of $A$. Computing eigenvalues and
eigenvectors is an elementary task for which several subroutines can be used;
commonly, DMD uses Singular Value Decomposition (SVD) algorithm. Eigenvalues
and the eigenvectors of $A$ completely define a set of modes each of which is
associated with a fixed oscillation frequency and decay or growth rate. These
modes are a natural generalization of the global stability modes and inherit
their physical interpretation of encodings of damped or driven sinusoidal
behavior in time.

In this work, we deal with a low dimensional dynamical system, for this
reason, we employ the extension of DMD known as _Higher Order Dynamical Mode
Decomposition_ (HODMD; Le Clainche & Vega, 2017). The modification introduced
by HODMD is the following: instead of assuming $v_{i+1}=Av_{i}$, we consider
an higher order Koopman assumption, i.e. that
$v_{i+d}=A_{1}v_{i}+A_{2}v_{i+1}+\dots+A_{d}v_{i+d-1}$ where $d\geq 1$ is a
tunable parameter. It is not difficult to notice that we are simply
superimposing DMD on a sliding window over the time series. The main advantage
of such an approach lies in enabling the computation of _higher order modes_
enriching the space returned by classical DMD when considering dimensional
systems presenting low _spatial complexity_ but a large number of hidden
frequencies.

In our experiments, the time series $V_{1}^{N}=\\{v_{1},\dots,v_{n}\\}$ is
given by the uniformly sampled value of magnitude measured at regular
intervals over the interpolated light curve as described above.

###  3.1 Implementation details

We use the library PyDMD (Demo et al., 2018). We take $30$ snapshots per phase
(for a total of $150$ snapshots) so that enough snapshots are fed to DMD to
produce a model that fits with the original data but not too much as to model
certain parts of the spline that may be due to noise.

Figure 1: DMD reconstruction (orange dashed line) of the interpolated light
curve (blue points) compared with the original (red points) and time shifted
(green points) raw data for RRab star V$59$. Figure 2: DMD reconstruction
(orange dashed line) of the interpolated light curve (blue points) compared
with the original (red points) and time shifted (green points) raw data for
RRc star V$103$.

##  4 Results

The DMD reconstruction of the light curve for an example RRab is shown in Fig.
1 and for an RRc in Fig. 2.

###  4.1 Separating RRab from RRc variables

As we vary the Koopman dimension $d$, which corresponds to the maximum
allowable number of eigenvectors, we find that DMD models from RRc and RRab
variables respond differently to increasing $d$. In fact, as the spatial
dimension increases, the normalized mean squared error (nMSE; defined here as
the ratio between the mean squared error (MSE) of the reconstructed light
curve and the MSE of a constant fit) for models of RRc variables drops off
steadily compared to models of RRab variables which have a more or less
constant nMSE until about $d=25$ where we can observe a sharp drop. This is
shown in Fig. 3 in the top panel and, for the number of eigenvalues, in the
bottom panel. Note how nMSE starts decreasing immediately with $d$ for the RRc
and keeps decreasing in a linear fashion, while it suddenly drops at about
$d=25$ for the RRab. From observing this phenomenon, we can choose a nMSE
threshold (the nMSE is calculated $10$ phases away from the last snapshot to
promote stability of the DMD model) such that, between RRc and RRab variables,
different numbers of spatial dimensions (and different numbers of eigenvalues)
are sufficient to produce models which yield an error equal or lower than the
threshold.

We find that, for the nMSE to be below $0.45$, models for RRc variables
require between $11$ and $26$ spatial dimensions (d) and between $3$ and $11$
eigenvalues. For RRab variables, between $23$ and $29$ spatial dimensions (d)
and between $7$ and $13$ eigenvalues are needed to yield an nMSE below
threshold. We notice that there is some overlap especially in the numbers of
eigenvalues. Despite that, this difference leads to a straightforward
classification algorithm. In fact, we can find that, most likely, a variable
star is RRc if $d<24$ is sufficient to yield an nMSE below $0.45$ and is RRab
otherwise. The histogram of the values of $d$ needed to achieve nMSE$=0.45$ is
shown in Fig. 4.

The relevant confusion matrix for the associated classifier with $d<24$ is
shown in Tab. 1. This is calculated on the same data set on which the
threshold $d=24$ was chosen, so the associated measure of accuracy ($97\%$) is
optimistically biased and should not be used to predict performance on unseen
data. However this is still an indication that the modes identified by DMD are
naturally suited to classification.

---
Figure 3: Left panel: nMSE achieved by the DMD reconstruction against the
original light curve as a function of the spatial dimension of the HODMD
snapshot ($d$ parameter in pyDMD). The black solid line represents the median
curve for the RRab stars, the red solid line for the RRc stars. The lower and
upper boundaries of the black and red shaded areas represent the first and
third quartiles respectively. Right panel: Same as the left panel but nMSE is
plotted as a function of the number of eigenvalues.
---
Figure 4: Top panel: histogram of the minimum values of $d$ needed to achieve
nMSE $=0.45$ (or below) for the RRab (black) and the RRc variables (red).
Right panel: same, but for the number of eigenvalues.

One more point to note is that classification based on the Koopman dimension
$d$ needed to achieve a given level of mean squared error (nMSE=$0.45$), which
depends on the shape of the light curve, overlaps quite well with the
distinction between RRab and RRc variables in the Bailey diagram, as shown in
Fig. 5. Discrepancies between the two could be leveraged to single out
potentially interesting stars, among which perhaps mixed-mode oscillators.

| $d<24$ | $d\geq 24$
---|---|---
RRab | 1 | 67
RRc | 79 | 4
Table 1: Confusion matrix for a classifier based on the minimum Koopman
dimension $d$ needed to achieve nMSE$=0.45$. Figure 5: Bailey diagram with the
Koopman dimension $d$ needed to attain nMSE $=0.45$ color coded.

A different way to look at the data presented in Fig. 5 is shown in Fig. 9,
where we plot $d$ as a function of the amplitude of the magnitude variation of
each star (top panel) and as a function of the period (right panel).
Additionally, in Fig. 10 we show the number of eigenvalues as a function of
the same two quantities. Regarding the dependence on amplitude, both $d$ and
the number of eigenvalues increase with amplitude. Since both are measures of
the complexity of the light curve shape, this is an expected result: higher
amplitude oscillators become increasingly anharmonic. However, the increase is
largely driven, in both cases, by the fact that large amplitude variables are
RRab and small amplitude variables are RRc. Within each class the trend is
weaker but still visible for the RRab, and absent for the RRc. Regarding
period, the general trend is again increasing for both quantities, but it is
decreasing for the RRab. This means that even though RRab stars typically have
both a longer period and a higher number of eigenvalues than RRc, within the
class of the RRab an increasing period corresponds to a _lower_ number of
eigenvalues, i.e. a simpler light curve.

Class: |  | RRab |  | RRc |
---|---|---|---|---|---
Parameter 1 | Parameter 2 | $R$ |  $p$ value | $R$ |  $p$ value
$N_{\mathrm{eig}}$ | Amplitude | $0.45$ | $1.2\times 10^{-4}$ | $0.13$ | $0.26$
$N_{\mathrm{eig}}$ | Period | $-0.68$ | $2.3\times 10^{-10}$ | $-0.08$ | $0.46$
$d$ | Amplitude | $0.45$ | $1.0\times 10^{-4}$ | $0.05$ | $0.68$
$d$ | Period | $-0.71$ | $1.1\times 10^{-11}$ | $0.09$ | $0.41$
Table 2: Spearman correlation coefficients (col. 3, col. 5) between the number
of eigenvalues and $d$ with amplitude and period over each class of variable
stars and the associated p-values (col. 4, col. 6).

This evidence fully supports theoretical and empirical findings concerning the
variation of RRab pulsation properties across the instability strip. The RRab
display a steady decrease when moving from the blue to the red edge of the
instability strip. The variation also applies to the shape of the light
curves, indeed RRab close to the blue edge display a sawtooth shape and a more
sinusoidal shape approaching the red edge. The main culprit causing this
difference is convection, since it becomes more efficient when moving from
hotter (bluer) to cooler (redder) effective temperatures and eventually
quenches the pulsation activity (Bono & Stellingwerf, 1993).

In terms of physical interpretation, it is particularly interesting that the
MSE drops for RRab when $d$ approaches $30$, the number of points sampled
along a period by our interpolation strategy. Since the data we fed to HODMD
repeats exactly after one period, we have that $x_{31}=x_{1}$ and in general
$x_{30+k}=x_{k}$ for every $k$. Thus the vector to which DMD is effectively
applied at $t+1$ is $\mathbf{x}_{t+1}=(x_{2},x_{3},...,x_{30},x_{1})$ and at
$t$ it is $\mathbf{x}_{t}=(x_{1},x_{2},...,x_{29},x_{30})$ and the matrix
$\mathbf{A}$ such that $\mathbf{x}_{t+1}=\mathbf{A}\mathbf{x}_{t}$ becomes
simply $[\mathbf{e}_{30},\mathbf{e}_{1},\cdot\cdot\cdot,\mathbf{e}_{29}]$. The
eigenvalues of this matrix are $\lambda_{k}=e^{ki\pi/30}$ for $k=0,...,29$, so
they are equally spaced on the unit circle and include $\lambda_{0}=1$. We can
thus conclude that the DMD is predicting the future evolution of the light
curve by leveraging solely the periodicity of the data and nothing else; in an
intuitive sense we can claim that an important fraction of the RRab curves is
‘incompressible’.

###  4.2 Blazhko effect

A final application of this description that goes beyond distinguishing
fundamental and first overtone pulsators is related to Blazhko effect. DMD
summarizes a light curve with a handful of complex numbers: do these differ
over time for a Blazhko variable, and how? In Fig. 6 we show the DMD
eigenvalues calculated during the first part of the observation period (top
panel) and during the second part (right panel). Most eigenvalues match
exactly except for a very limited number.

These eigenvalues may correspond to Koopman modes specifically associated to
Blazhko evolution, since V$5$ is a suspected Blazhko. In any case DMD has
revealed a secular change in its light curve. Potentially, this may be used to
automatically detect Blazhko variables without the need for direct visual
inspection of the light curve. For comparison, in Fig. 8 and 7 we show the
same for two more stars that are deemed affected by the Blazhko effect.

---
Figure 6: Top panel: DMD eigenvalues (red points) for variable V$5$ calculated
between Julian time $2449858.7698$ and $2449869.7601$, corresponding to the
beginning of the observation period. The green dashed line corresponds to the
unit circle in the complex plane. Middle panel: DMD eigenvalues (blue points)
for variable V$5$ calculated between Julian time $2450971.5723$ and
$2450985.6906$, corresponding to the end of the observation period. Right
panel: DMD eigenvalues that differ between the two.
---
Figure 7: Top panel: DMD eigenvalues (red points) for variable V$120$
calculated between Julian time $2449858.7468$ and $2449869.7635$,
corresponding to the beginning of the observation period. The green dashed
line corresponds to the unit circle in the complex plane. Middle panel: DMD
eigenvalues (blue points) for variable V$120$ calculated between Julian time
$2450970.5019$ and $2450985.6906$, corresponding to the end of the observation
period. Right panel: DMD eigenvalues that differ between the two.
---
Figure 8: Top panel: DMD eigenvalues (red points) for variable V$115$
calculated between Julian time $2449858.7468$ and $2449869.7635$,
corresponding to the beginning of the observation period. The green dashed
line corresponds to the unit circle in the complex plane. Middle panel: DMD
eigenvalues (blue points) for variable V$115$ calculated between Julian time
$2450971.5723$ and $2450985.6906$, corresponding to the end of the observation
period. Right panel: DMD eigenvalues that differ between the two.
---
Figure 9: Top panel: Koopman space dimension $d$ as a function of amplitude
for RRab (black points) and RRc (red points). Right panel: Koopman space
dimension $d$ as a function of period, same color coding as the top panel.
---
Figure 10: Top panel: number of eigenvalues as a function of amplitude for
RRab (black points) and RRc (red points). Right panel: number of eigenvalues
as a function of period, same color coding as the top panel. It is known that
short period, large amplitude RRab are harder to fit with fourier and in our
case they also need more eigenvalues.

##  5 Conclusions

DMD and related algorithms have recently found application to fluid dynamics
and other branches of physics that deal with high-dimensional snapshots either
from observations or from simulations. In our application to variable stars,
snapshots at a given time contain at most a few values, corresponding to
magnitudes in various filters and possibly their derivatives. We thus applied
the HODMD algorithm, which essentially synthesizes a higher-dimension snapshot
from delayed coordinates. This is the first application of DMD-related methods
to variable star light curves to date. This was done with the goal of
obtaining features from light curves in a principled way that could be
amenable to physical interpretation. In DMD the observed dynamics is
decomposed into modes, similar to normal modes in a coupled oscillator system;
each mode corresponds to an eigenvalue, associated either to exponential decay
(or increase) or to periodic oscillations.

We obtained a reconstructed light curve as a linear combination of the
individual evolution of such modes, and compared it with the original data
over a sample of $151$ stars. We measured the discrepancy between the
reconstructed light curve and the original by means of the mean squared error
normalized to that of a constant fit. We are able to obtain consistently good
fits (with nMSE under $10^{-2}$) if we let the number of eigenvalues increase
as needed. We found that simpler light curves, such as those of RRc variables,
require only a limited number of eigenvalues. Conversely RRab stars, which
have more complex light curve shapes, require the inclusion of more
eigenvalues to be described with good accuracy. We have quantified this,
finding that that the Koopman dimension $d$ needed to achieve a given
normalized MSE in reconstructing the curve behaves differently for RRab and
RRc variables. We used this as a basis for a classifier, choosing a threshold
of $0.45$ normalized MSE, to achieve which the modal RRab star requires $d=27$
(resulting in a mode of $11$ eigenvalues) and the modal RRc star, $d=15$
(corresponding to a mode of $7$ eigenvalues). The threshold value $0.45$
corresponds to the maximum (over all the light curves) of the minimum
normalized MSE reached.

We found that the number of eigenvalues that needs to be included to obtain a
good representation of the curve varies with amplitude and period in accord to
the fact that RRab and RRc stars occupy distinctive loci in the period-
amplitude plane.

While the DMD decomposition bears some resemblance to Fourier methods, which
have been extensively applied to time domain astronomy and variable star light
curves in particular, the advantage of DMD is to identify modes that are
potentially physically meaningful. This is the case of the long term period
variability due to the Blazhko effect, where indeed only a few eigenvalues
found by DMD change between the beginning and the end of the observation
period for the confirmed Blazhko variables in our data set. Whether this is
indeed an indication of DMD finding specific modes associated to Blazhko
evolution will be discussed in further detail in upcoming work.

## Acknowledgments

This work is partially supported by Schmidt Futures, a philanthropic
initiative founded by Eric and Wendy Schmidt as part of the Virtual Institute
for Astrophysics (VIA). M.P. acknowledges financial support from the European
Union’s Horizon 2020 research and innovation program under the Marie
Skłodowska-Curie grant agreement No. 896248.

## References

  * Albidah et al. (2021) Albidah, A. B., Brevis, W., Fedun, V., Ballai, I., Jess, D. B., Stangalini, M., Higham, J., and Verth, G.  Proper orthogonal and dynamic mode decomposition of sunspot data.  _Philosophical Transactions of the Royal Society of London Series A_ , 379(2190):20200181, February 2021.  doi: 10.1098/rsta.2020.0181.
  * Albidah et al. (2022) Albidah, A. B., Fedun, V., Aldhafeeri, A. A., Ballai, I., Brevis, W., Jess, D. B., Higham, J., Stangalini, M., Silva, S. S. A., and Verth, G.  Magnetohydrodynamic Wave Mode Identification in Circular and Elliptical Sunspot Umbrae: Evidence for High-order Modes.  _ApJ_ , 927(2):201, March 2022.  doi: 10.3847/1538-4357/ac51d9.
  * Barbara et al. (2022) Barbara, N. H., Bedding, T. R., Fulcher, B. D., Murphy, S. J., and Van Reeth, T.  Classifying Kepler light curves for 12 000 A and F stars using supervised feature-based machine learning.  _MNRAS_ , 514(2):2793–2804, August 2022.  doi: 10.1093/mnras/stac1515.
  * Bassi et al. (2021) Bassi, S., Sharma, K., and Gomekar, A.  Classification of Variable Stars Light Curves using Long Short Term Memory Network.  _Frontiers in Astronomy and Space Sciences_ , 8:168, November 2021.  doi: 10.3389/fspas.2021.718139.
  * Blažko (1907) Blažko, S.  Mitteilung über veränderliche Sterne.  _Astronomische Nachrichten_ , 175:325, August 1907.  doi: 10.1002/asna.19071752002.
  * Bono & Stellingwerf (1993) Bono, G. and Stellingwerf, R. F.  Cepheid convective models.  _Mem. Soc. Astron. Italiana_ , 64:559, January 1993.
  * Borucki et al. (2010) Borucki, W. J., Koch, D., Basri, G., Batalha, N., Brown, T., Caldwell, D., Caldwell, J., Christensen-Dalsgaard, J., Cochran, W. D., DeVore, E., Dunham, E. W., Dupree, A. K., Gautier, T. N., Geary, J. C., Gilliland, R., Gould, A., Howell, S. B., Jenkins, J. M., Kondo, Y., Latham, D. W., Marcy, G. W., Meibom, S., Kjeldsen, H., Lissauer, J. J., Monet, D. G., Morrison, D., Sasselov, D., Tarter, J., Boss, A., Brownlee, D., Owen, T., Buzasi, D., Charbonneau, D., Doyle, L., Fortney, J., Ford, E. B., Holman, M. J., Seager, S., Steffen, J. H., Welsh, W. F., Rowe, J., Anderson, H., Buchhave, L., Ciardi, D., Walkowicz, L., Sherry, W., Horch, E., Isaacson, H., Everett, M. E., Fischer, D., Torres, G., Johnson, J. A., Endl, M., MacQueen, P., Bryson, S. T., Dotson, J., Haas, M., Kolodziejczak, J., Van Cleve, J., Chandrasekaran, H., Twicken, J. D., Quintana, E. V., Clarke, B. D., Allen, C., Li, J., Wu, H., Tenenbaum, P., Verner, E., Bruhweiler, F., Barnes, J., and Prsa, A.  Kepler Planet-Detection Mission: Introduction and First Results.  _Science_ , 327(5968):977, February 2010.  doi: 10.1126/science.1185402.
  * Braga et al. (2016) Braga, V. F., Stetson, P. B., Bono, G., Dall’Ora, M., Ferraro, I., Fiorentino, G., Freyhammer, L. M., Iannicola, G., Marengo, M., Neeley, J., Valenti, E., Buonanno, R., Calamida, A., Castellani, M., da Silva, R., Degl’Innocenti, S., Di Cecco, A., Fabrizio, M., Freedman, W. L., Giuffrida, G., Lub, J., Madore, B. F., Marconi, M., Marinoni, S., Matsunaga, N., Monelli, M., Persson, S. E., Piersimoni, A. M., Pietrinferni, A., Prada-Moroni, P., Pulone, L., Stellingwerf, R., Tognelli, E., and Walker, A. R.  On the RR Lyrae Stars in Globulars. IV. $\omega$ Centauri Optical UBVRI Photometry.  _AJ_ , 152:170, December 2016.  doi: 10.3847/0004-6256/152/6/170.
  * Braga et al. (2019) Braga, V. F., Stetson, P. B., Bono, G., Dall’Ora, M., Ferraro, I., Fiorentino, G., Iannicola, G., Inno, L., Marengo, M., Neeley, J., Beaton, R. L., Buonanno, R., Calamida, A., Contreras Ramos, R., Chaboyer, B., Fabrizio, M., Freedman, W. L., Gilligan, C. K., Johnston, K. V., Lub, J., Madore, B. F., Magurno, D., Marconi, M., Marinoni, S., Marrese, P. M., Mateo, M., Matsunaga, N., Minniti, D., Monson, A. J., Monelli, M., Nonino, M., Persson, S. E., Pietrinferni, A., Sneden, C., Storm, J., Walker, A. R., Valenti, E., and Zoccali, M.  New near-infrared JHKs light-curve templates for RR Lyrae variables.  _A &A_, 625:A1, May 2019.  doi: 10.1051/0004-6361/201834893.
  * Coughlin et al. (2021) Coughlin, M. W., Burdge, K., Duev, D. A., Katz, M. L., van Roestel, J., Drake, A., Graham, M. J., Hillenbrand, L., Mahabal, A. A., Masci, F. J., Mróz, P., Prince, T. A., Yao, Y., Bellm, E. C., Burruss, R., Dekany, R., Jaodand, A., Kaplan, D. L., Kupfer, T., Laher, R. R., Riddle, R., Rigault, M., Rodriguez, H., Rusholme, B., and Zolkower, J.  The ZTF Source Classification Project - II. Periodicity and variability processing metrics.  _MNRAS_ , 505(2):2954–2965, August 2021.  doi: 10.1093/mnras/stab1502.
  * Darling & Widrow (2019) Darling, K. and Widrow, L. M.  Eigenfunctions of Galactic phase space spirals from dynamic mode decomposition.  _MNRAS_ , 490(1):114–123, November 2019.  doi: 10.1093/mnras/stz2539.
  * Dékány et al. (2021) Dékány, I., Grebel, E. K., and Pojmański, G.  Metallicity Estimation of RR Lyrae Stars From Their I-Band Light Curves.  _ApJ_ , 920(1):33, October 2021.  doi: 10.3847/1538-4357/ac106f.
  * Demo et al. (2018) Demo, N., Tezzele, M., and Rozza, G.  Pydmd: Python dynamic mode decomposition.  _Journal of Open Source Software_ , 3(22):530, 2018.
  * Drake et al. (2013) Drake, A. J., Catelan, M., Djorgovski, S. G., Torrealba, G., Graham, M. J., Belokurov, V., Koposov, S. E., Mahabal, A., Prieto, J. L., Donalek, C., Williams, R., Larson, S., Christensen, E., and Beshore, E.  Probing the Outer Galactic Halo with RR Lyrae from the Catalina Surveys.  _ApJ_ , 763(1):32, January 2013.  doi: 10.1088/0004-637X/763/1/32.
  * Drake et al. (2014) Drake, A. J., Graham, M. J., Djorgovski, S. G., Catelan, M., Mahabal, A. A., Torrealba, G., García-Álvarez, D., Donalek, C., Prieto, J. L., Williams, R., Larson, S., Christen sen, E., Belokurov, V., Koposov, S. E., Beshore, E., Boattini, A., Gibbs, A., Hill, R., Kowalski, R., Johnson, J., and Shelly, F.  The Catalina Surveys Periodic Variable Star Catalog.  _ApJS_ , 213(1):9, July 2014.  doi: 10.1088/0067-0049/213/1/9.
  * Gaia Collaboration et al. (2016) Gaia Collaboration, Brown, A. G. A., Vallenari, A., Prusti, T., de Bruijne, J. H. J., Mignard, F., Drimmel, R., Babusiaux, C., Bailer-Jones, C. A. L., Bastian, U., Biermann, M., Evans, D. W., Eyer, L., Jansen, F., Jordi, C., Katz, D., Klioner, S. A., Lammers, U., Lindegren, L., Luri, X., O’Mullane, W., Panem, C., Pourbaix, D., Randich, S., Sartoretti, P., Siddiqui, H. I., Soubiran, C., Valette, V., van Leeuwen, F., Walton, N. A., Aerts, C., Arenou, F., Cropper, M., Høg, E., Lattanzi, M. G., Grebel, E. K., Holland, A. D., Huc, C., Passot, X., Perryman, M., Bramante, L., Cacciari, C., Castañeda, J., Chaoul, L., Cheek, N., De Angeli, F., Fabricius, C., Guerra, R., Hernández, J., Jean-Antoine-Piccolo, A., Masana, E., Messineo, R., Mowlavi, N., Nienartowicz, K., Ordóñez-Blanco, D., Panuzzo, P., Portell, J., Richards, P. J., Riello, M., Seabroke, G. M., Tanga, P., Thévenin, F., Torra, J., Els, S. G., Gracia-Abril, G., Comoretto, G., Garcia-Reinaldos, M., Lock, T., Mercier, E., Altmann, M., Andrae, R., Astraatmadja, T. L., Bellas-Velidis, I., Benson, K., Berthier, J., Blomme, R., Busso, G., Carry, B., Cellino, A., Clementini, G., Cowell, S., Creevey, O., Cuypers, J., Davidson, M., De Ridder, J., de Torres, A., Delchambre, L., Dell’Oro, A., Ducourant, C., Frémat, Y., García-Torres, M., Gosset, E., Halbwachs, J. L., Hambly, N. C., Harrison, D. L., Hauser, M., Hestroffer, D., Hodgkin, S. T., Huckle, H. E., Hutton, A., Jasniewicz, G., Jordan, S., Kontizas, M., Korn, A. J., Lanzafame, A. C., Manteiga, M., Moitinho, A., Muinonen, K., Osinde, J., Pancino, E., Pauwels, T., Petit, J. M., Recio-Blanco, A., Robin, A. C., Sarro, L. M., Siopis, C., Smith, M., Smith, K. W., Sozzetti, A., Thuillot, W., van Reeven, W., Viala, Y., Abbas, U., Abreu Aramburu, A., Accart, S., Aguado, J. J., Allan, P. M., Allasia, W., Altavilla, G., Álvarez, M. A., Alves, J., Anderson, R. I., Andrei, A. H., Anglada Varela, E., Antiche, E., Antoja, T., Antón, S., Arcay, B., Bach, N., Baker, S. G., Balaguer-Núñez, L., Barache, C., Barata, C., Barbier, A., Barblan, F., Barrado y Navascués, D., Barros, M., Barstow, M. A., Becciani, U., Bellazzini, M., Bello García, A., Belokurov, V., Bendjoya, P., Berihuete, A., Bianchi, L., Bienaymé, O., Billebaud, F., Blagorodnova, N., Blanco-Cuaresma, S., Boch, T., Bombrun, A., Borrachero, R., Bouquillon, S., Bourda, G., Bouy, H., Bragaglia, A., Breddels, M. A., Brouillet, N., Brüsemeister, T., Bucciarelli, B., Burgess, P., Burgon, R., Burlacu, A., Busonero, D., Buzzi, R., Caffau, E., Cambras, J., Campbell, H., Cancelliere, R., Cantat-Gaudin, T., Carlucci, T., Carrasco, J. M., Castellani, M., Charlot, P., Charnas, J., Chiavassa, A., Clotet, M., Cocozza, G., Collins, R. S., Costigan, G., Crifo, F., Cross, N. J. G., Crosta, M., Crowley, C., Dafonte, C., Damerdji, Y., Dapergolas, A., David, P., David, M., De Cat, P., de Felice, F., de Laverny, P., De Luise, F., De March, R., de Martino, D., de Souza, R., Debosscher, J., del Pozo, E., Delbo, M., Delgado, A., Delgado, H. E., Di Matteo, P., Diakite, S., Distefano, E., Dolding, C., Dos Anjos, S., Drazinos, P., Duran, J., Dzigan, Y., Edvardsson, B., Enke, H., Evans, N. W., Eynard Bontemps, G., Fabre, C., Fabrizio, M., Faigler, S., Falcão, A. J., Farràs Casas, M., Federici, L., Fedorets, G., Fernández-Hernández, J., Fernique, P., Fienga, A., Figueras, F., Filippi, F., Findeisen, K., Fonti, A., Fouesneau, M., Fraile, E., Fraser, M., Fuchs, J., Gai, M., Galleti, S., Galluccio, L., Garabato, D., García-Sedano, F., Garofalo, A., Garralda, N., Gavras, P., Gerssen, J., Geyer, R., Gilmore, G., Girona, S., Giuffrida, G., Gomes, M., González-Marcos, A., González-Núñez, J., González-Vidal, J. J., Granvik, M., Guerrier, A., Guillout, P., Guiraud, J., Gúrpide, A., Gutiérrez-Sánchez, R., Guy, L. P., Haigron, R., Hatzidimitriou, D., Haywood, M., Heiter, U., Helmi, A., Hobbs, D., Hofmann, W., Holl, B., Holland, G., Hunt, J. A. S., Hypki, A., Icardi, V., Irwin, M., Jevardat de Fombelle, G., Jofré, P., Jonker, P. G., Jorissen, A., Julbe, F., Karampelas, A., Kochoska, A., Kohley, R., Kolenberg, K., Kontizas, E., Koposov, S. E., Kordopatis, G., Koubsky, P., Krone-Martins, A., Kudryashova, M., Kull, I., Bachchan, R. K., Lacoste-Seris, F., Lanza, A. F., Lavigne, J. B., Le Poncin-Lafitte, C., Lebreton, Y., Lebzelter, T., Leccia, S., Leclerc, N., Lecoeur-Taibi, I., Lemaitre, V., Lenhardt, H., Leroux, F., Liao, S., Licata, E., Lindstrøm, H. E. P., Lister, T. A., Livanou, E., Lobel, A., Löffler, W., López, M., Lorenz, D., MacDonald, I., Magalhães Fernandes, T., Managau, S., Mann, R. G., Mantelet, G., Marchal, O., Marchant, J. M., Marconi, M., Marinoni, S., Marrese, P. M., Marschalkó, G., Marshall, D. J., Martín-Fleitas, J. M., Martino, M., Mary, N., Matijevič, G., Mazeh, T., McMillan, P. J., Messina, S., Michalik, D., Millar, N. R., Miranda, B. M. H., Molina, D., Molinaro, R., Molinaro, M., Molnár, L., Moniez, M., Montegriffo, P., Mor, R., Mora, A., Morbidelli, R., Morel, T., Morgenthaler, S., Morris, D., Mulone, A. F., Muraveva, T., Musella, I., Narbonne, J., Nelemans, G., Nicastro, L., Noval, L., Ordénovic, C., Ordieres-Meré, J., Osborne, P., Pagani, C., Pagano, I., Pailler, F., Palacin, H., Palaversa, L., Parsons, P., Pecoraro, M., Pedrosa, R., Pentikäinen, H., Pichon, B., Piersimoni, A. M., Pineau, F. X., Plachy, E., Plum, G., Poujoulet, E., Prša, A., Pulone, L., Ragaini, S., Rago, S., Rambaux, N., Ramos-Lerate, M., Ranalli, P., Rauw, G., Read, A., Regibo, S., Reylé, C., Ribeiro, R. A., Rimoldini, L., Ripepi, V., Riva, A., Rixon, G., Roelens, M., Romero-Gómez, M., Rowell, N., Royer, F., Ruiz-Dern, L., Sadowski, G., Sagristà Sellés, T., Sahlmann, J., Salgado, J., Salguero, E., Sarasso, M., Savietto, H., Schultheis, M., Sciacca, E., Segol, M., Segovia, J. C., Segransan, D., Shih, I. C., Smareglia, R., Smart, R. L., Solano, E., Solitro, F., Sordo, R., Soria Nieto, S., Souchay, J., Spagna, A., Spoto, F., Stampa, U., Steele, I. A., Steidelmüller, H., Stephenson, C. A., Stoev, H., Suess, F. F., Süveges, M., Surdej, J., Szabados, L., Szegedi-Elek, E., Tapiador, D., Taris, F., Tauran, G., Taylor, M. B., Teixeira, R., Terrett, D., Tingley, B., Trager, S. C., Turon, C., Ulla, A., Utrilla, E., Valentini, G., van Elteren, A., Van Hemelryck, E., van Leeuwen, M., Varadi, M., Vecchiato, A., Veljanoski, J., Via, T., Vicente, D., Vogt, S., Voss, H., Votruba, V., Voutsinas, S., Walmsley, G., Weiler, M., Weingrill, K., Wevers, T., Wyrzykowski, Ł., Yoldas, A., Žerjal, M., Zucker, S., Zurbach, C., Zwitter, T., Alecu, A., Allen, M., Allende Prieto, C., Amorim, A., Anglada-Escudé, G., Arsenijevic, V., Azaz, S., Balm, P., Beck, M., Bernstein, H. H., Bigot, L., Bijaoui, A., Blasco, C., Bonfigli, M., Bono, G., Boudreault, S., Bressan, A., Brown, S., Brunet, P. M., Bunclark, P., Buonanno, R., Butkevich, A. G., Carret, C., Carrion, C., Chemin, L., Chéreau, F., Corcione, L., Darmigny, E., de Boer, K. S., de Teodoro, P., de Zeeuw, P. T., Delle Luche, C., Domingues, C. D., Dubath, P., Fodor, F., Frézouls, B., Fries, A., Fustes, D., Fyfe, D., Gallardo, E., Gallegos, J., Gardiol, D., Gebran, M., Gomboc, A., Gómez, A., Grux, E., Gueguen, A., Heyrovsky, A., Hoar, J., Iannicola, G., Isasi Parache, Y., Janotto, A. M., Joliet, E., Jonckheere, A., Keil, R., Kim, D. W., Klagyivik, P., Klar, J., Knude, J., Kochukhov, O., Kolka, I., Kos, J., Kutka, A., Lainey, V., LeBouquin, D., Liu, C., Loreggia, D., Makarov, V. V., Marseille, M. G., Martayan, C., Martinez-Rubi, O., Massart, B., Meynadier, F., Mignot, S., Munari, U., Nguyen, A. T., Nordlander, T., Ocvirk, P., O’Flaherty, K. S., Olias Sanz, A., Ortiz, P., Osorio, J., Oszkiewicz, D., Ouzounis, A., Palmer, M., Park, P., Pasquato, E., Peltzer, C., Peralta, J., Péturaud, F., Pieniluoma, T., Pigozzi, E., Poels, J., Prat, G., Prod’homme, T., Raison, F., Rebordao, J. M., Risquez, D., Rocca-Volmerange, B., Rosen, S., Ruiz-Fuertes, M. I., Russo, F., Sembay, S., Serraller Vizcaino, I., Short, A., Siebert, A., Silva, H., Sinachopoulos, D., Slezak, E., Soffel, M., Sosnowska, D., Straižys, V., ter Linden, M., Terrell, D., Theil, S., Tiede, C., Troisi, L., Tsalmantza, P., Tur, D., Vaccari, M., Vachier, F., Valles, P., Van Hamme, W., Veltz, L., Virtanen, J., Wallut, J. M., Wichmann, R., Wilkinson, M. I., Ziaeepour, H., and Zschocke, S.  Gaia Data Release 1. Summary of the astrometric, photometric, and survey properties.  _A &A_, 595:A2, November 2016.  doi: 10.1051/0004-6361/201629512.
  * Hori et al. (2020) Hori, K., Tobias, S. M., and Teed, R. J.  Dynamic mode decomposition to retrieve torsional Alfvén waves.  _arXiv e-prints_ , art. arXiv:2009.13095, September 2020.
  * Jamal & Bloom (2020) Jamal, S. and Bloom, J. S.  On Neural Architectures for Astronomical Time-series Classification with Application to Variable Stars.  _ApJS_ , 250(2):30, October 2020.  doi: 10.3847/1538-4365/aba8ff.
  * Jayasinghe et al. (2018) Jayasinghe, T., Kochanek, C. S., Stanek, K. Z., Shappee, B. J., Holoien, T. W. S., Thompson, T. A., Prieto, J. L., Dong, S., Pawlak, M., Shields, J. V., Pojmanski, G., Otero, S., Britt, C. A., and Will, D.  The ASAS-SN catalogue of variable stars I: The Serendipitous Survey.  _MNRAS_ , 477(3):3145–3163, July 2018.  doi: 10.1093/mnras/sty838.
  * Kaiser (2004) Kaiser, N.  Pan-STARRS: a wide-field optical survey telescope array.  In Oschmann, Jacobus M., J. (ed.), _Ground-based Telescopes_ , volume 5489 of _Society of Photo-Optical Instrumentation Engineers (SPIE) Conference Series_ , pp. 11–22, October 2004.  doi: 10.1117/12.552472.
  * Kovačević et al. (2022) Kovačević, M., Pasquato, M., Marelli, M., De Luca, A., Salvaterra, R., and Belfiore, A.  Exploring X-ray variability with unsupervised machine learning. I. Self-organizing maps applied to XMM-Newton data.  _A &A_, 659:A66, March 2022.  doi: 10.1051/0004-6361/202142444.
  * Le Clainche & Vega (2017) Le Clainche, S. and Vega, J. M.  Higher order dynamic mode decomposition.  _SIAM Journal on Applied Dynamical Systems_ , 16(2):882–925, 2017.  doi: 10.1137/15M1054924.  URL https://doi.org/10.1137/15M1054924.
  * Le Losq & Feng (2007) Le Losq, C. and Feng, Y.  gcvsplie.  https://github.com/charlesll/gcvspline, 2007.
  * Linkmann & Dikpati (2021) Linkmann, M. and Dikpati, M.  Symmetry-reduced dynamic mode decomposition of solar tachocline dynamics.  In _AGU Fall Meeting Abstracts_ , volume 2021, pp. SH53C–06, December 2021.
  * Linkmann et al. (2020) Linkmann, M., Dallas, S., and Dikpati, M.  Data-driven low-dimensional modelling of solar tachocline dynamics.  In _AGU Fall Meeting Abstracts_ , volume 2020, pp. SH006–02, December 2020.
  * Mahabal et al. (2019) Mahabal, A., Rebbapragada, U., Walters, R., Masci, F. J., Blagorodnova, N., van Roestel, J., Ye, Q.-Z., Biswas, R., Burdge, K., Chang, C.-K., Duev, D. A., Golkhou, V. Z., Miller, A. A., Nordin, J., Ward, C., Adams, S., Bellm, E. C., Branton, D., Bue, B., Cannella, C., Connolly, A., Dekany, R., Feindt, U., Hung, T., Fortson, L., Frederick, S., Fremling, C., Gezari, S., Graham, M., Groom, S., Kasliwal, M. M., Kulkarni, S., Kupfer, T., Lin, H. W., Lintott, C., Lunnan, R., Parejko, J., Prince, T. A., Riddle, R., Rusholme, B., Saunders, N., Sedaghat, N., Shupe, D. L., Singer, L. P., Soumagnac, M. T., Szkody, P., Tachibana, Y., Tirumala, K., van Velzen, S., and Wright, D.  Machine Learning for the Zwicky Transient Facility.  _PASP_ , 131(997):038002, March 2019.  doi: 10.1088/1538-3873/aaf3fa.
  * Pashchenko et al. (2018) Pashchenko, I. N., Sokolovsky, K. V., and Gavras, P.  Machine learning search for variable stars.  _MNRAS_ , 475(2):2326–2343, April 2018.  doi: 10.1093/mnras/stx3222.
  * Pasquato et al. (2022) Pasquato, M., Abbas, M., Trani, A. A., Nori, M., Kwiecinski, J. A., Trevisan, P., Braga, V. F., Bono, G., and Macciò, A. V.  Sparse Identification of Variable Star Dynamics.  _ApJ_ , 930(2):161, May 2022.  doi: 10.3847/1538-4357/ac5624.
  * Schmid (2010) Schmid, P. J.  Dynamic mode decomposition of numerical and experimental data.  _Journal of Fluid Mechanics_ , 656:5–28, 2010.  doi: 10.1017/S0022112010001217.
  * van Roestel et al. (2021) van Roestel, J., Duev, D. A., Mahabal, A. A., Coughlin, M. W., Mróz, P., Burdge, K., Drake, A., Graham, M. J., Hillenbrand, L., Bellm, E. C., Kupfer, T., Delacroix, A., Fremling, C., Golkhou, V. Z., Hale, D., Laher, R. R., Masci, F. J., Riddle, R., Rosnet, P., Rusholme, B., Smith, R., Soumagnac, M. T., Walters, R., Prince, T. A., and Kulkarni, S. R.  The ZTF Source Classification Project. I. Methods and Infrastructure.  _AJ_ , 161(6):267, June 2021.  doi: 10.3847/1538-3881/abe853.
  * Widrow et al. (2020) Widrow, L. M., Darling, K., and Li, H.  Warps, Waves, and Phase Spirals in the Milky Way.  In Valluri, M. and Sellwood, J. A. (eds.), _Galactic Dynamics in the Era of Large Surveys_ , volume 353, pp. 65–70, January 2020.  doi: 10.1017/S1743921319009049.
  * Woltring (1986) Woltring, H. J.  A fortran package for generalized, cross-validatory spline smoothing and differentiation.  _Advances in Engineering Software (1978)_ , 8(2):104–113, 1986.


# A generalized efficiency mismatch attack to bypass detection-scrambling
countermeasure

M A Ruhul Fatin<EMAIL_ADDRESS>Department of Electrical and
Electronic Engineering, Bangladesh University of Engg and Tech., Dhaka,
Bangladesh  Department of Electronics, Carleton University, Ottawa, ON, K1S
5B6, Canada  Shihan Sajeed<EMAIL_ADDRESS>Institute for Quantum
Computing, University of Waterloo, Waterloo, ON, N2L 3G1 Canada  Department of
Physics and Astronomy, University of Waterloo, Waterloo, ON, N2L 3G1 Canada
Department of Electrical and Computer Engineering, University of Toronto, M5S
3G4, Canada

(7 January, 2021)

###### Abstract

The ability of an eavesdropper to compromise the security of a quantum
communication system by changing the angle of the incoming light is well-
known. Randomizing the role of the detectors has been proposed to be an
efficient countermeasure to this type of attack. Here we show that the
proposed countermeasure can be bypassed if the attack is generalized by
including more attack variables. Using the experimental data from existing
literature, we show how randomization effectively prevents the initial attack
but fails to do so when Eve generalizes her attack strategy. Our result and
methodology could be used to security-certify a free-space quantum
communication receiver against all types of detector-efficiency-mismatch type
attacks.

##  I Introduction

Recent trends in quantum technologies suggest a future of quantum computers
(QC) having superior computational power Knight (2017); Castelvecchi (2017).
Such computational power can efficiently solve hard mathematical problems that
are the foundations of security for certain public-key cryptosystems. QCs thus
pose a serious threat to our current cryptographic infrastructure. One
possible solution can be post-quantum cryptography Merkle (1979); Mceliece
(1978); Hoffstein  _et al._ (1998) – classical algorithms thought to be secure
against quantum attacks – but there is no mathematical proof that these
algorithms provide information theoretic security. Thus, in an effort to fight
quantum with quantum the trend is towards quantum cryptography Bennett and
Brassard (1984); Gisin  _et al._ (2002); Scarani  _et al._ (2009) – more
popularly known as quantum key distribution (QKD).

QKD Gisin  _et al._ (2002); Scarani  _et al._ (2009) uses the laws of quantum
mechanics to generate a secret key between two distant parties Alice and Bob.
This key then can be used for encryption using one-time-pad and guarantee
secure communication. In theory, QKD provides mathematical proof of security
by modeling the device behaviors and using the laws of quantum mechanics.
However, in practice, devices often behave differently than the assumed model,
leaving a gap between theory and practice that can be exploited by an
eavesdropper. This gap can be anywhere in the system implementation such as
measurement devices Lydersen  _et al._ (2010); Gerhardt  _et al._ (2011),
monitoring systems Sajeed  _et al._ (2015a), assumption in the security proofs
Sajeed  _et al._ (2016), leakage of information Jain  _et al._ (2014); Sajeed
_et al._ (2017); Pinheiro  _et al._ (2018), change of characteristics Makarov
_et al._ (2016); Bugge  _et al._ (2014), imperfect sources Bennett  _et al._
(1992); Xu  _et al._ (2015), imperfect detector characteristics Makarov  _et
al._ (2006); Sajeed  _et al._ (2015b); Rau  _et al._ (2015); Chaiwongkhot  _et
al._ (2019) etc. It is essential for QKD security to explore and identify
these gaps and characterize them in order to assess the threat. In this work
we analyze one such gap – detector-efficiency mismatch Makarov  _et al._
(2006); Qi  _et al._ (2007); Sajeed  _et al._ (2015b); Chaiwongkhot  _et al._
(2019)– and analyze its effects.

A fundamental assumption in QKD security proofs is that the measurement
outcomes should be independent of the measurement bases and Eve should not
have any control over them. In ideal QKD, it is impossible for Eve to control
the measurement outcomes without introducing errors called quantum bit error
rate (QBER). However, in practice, there might be implementation
vulnerabilities that allow Eve to have this control. For example, if there is
a sensitivity mismatch among the detectors for a certain degree of freedom of
the incoming photons, Eve can modify that degree of freedom so that one
detector becomes more sensitive compared to another Qi  _et al._ (2007);
Makarov and Skaar (2008); Sajeed  _et al._ (2015b); Rau  _et al._ (2015). This
can happen in the time degree of freedom: implementation vulnerability may
make one detector more sensitive in a particular time window than the others.
In this case, Eve can shift the arrival time of certain pulses to coincide
with that window. Thus, detection events occurring in that particular time-
window have a higher chance of occurring in the sensitive detector and a bias
is achieved. Similarly, if the detector sensitivity varies with spatial-mode
of the incoming light Makarov  _et al._ (2006), Eve can send light at certain
angle ($\phi$,$\theta$) to create a bias among the detector sensitivity and
achieves a control. The demonstration of exploiting such spatial-mode-
sensitivity-mismatch was shown in Sajeed  _et al._ (2015b); Rau  _et al._
(2015).

A countermeasure to this loophole, _detector scrambling_ , was proposed in
Refs. da Silva  _et al._ (2014) that involves randomly changing the roles of
the detectors to hash out any mismatch in the detection system and reduce
efficiency mismatch. In this paper, we scrutinize the effectiveness of this
countermeasure. In Sec. II, we introduce and review some necessary details of
the spatial-mode-efficiency-mismatch attack reported in Sajeed  _et al._
(2015b). In Sec. III, we simulate a detector scrambling countermeasure and
show the countermeasure blocks the side-channel. Then in Sec. V, we show how
the scrambling countermeasure can be bypassed by resorting to a more general
attack strategy. We conclude in Sec. V.

##  II Review of detection efficiency mismatch

We shall assume a polarization-encoded Bennett-Brassard (BB84) QKD scheme with
passive basis-choice implementation as shown in Fig. 1a. The beam splitter
(BS) is used for selecting the _HV_ or _DA_ bases and the polarization beam
splitters (PBSs) followed by two detectors are used to measure the
polarization in a basis. Detectors _h_ and _v_ are used for measuring the
incoming _H_ and _V_ polarized light while detectors _d_ and _a_ are used for
measuring _D_ and _A_ polarized light respectively.

The efficiency-mismatch side-channel is explained with the help of Fig. 1b.
Here we show how the sensitivity of the $h$ and $v$ detectors varies in
response to the angle of the incoming light. The circle on the left (right)
shows the sensitive area of detector $h(v)$. Outside the circle the
sensitivity is zero (in practical detectors, sensitivity does not go to zero
so abruptly, but this simple assumption serves the purpose to explain the
concept). In the overlapping (green) region, both the detectors are equally
sensitive. However, if the light is sent towards the red (blue) region,
detector $v(h)$ has a higher sensitivity than the $h(v)$ detector. Eve can
stage a faked-stage attack to exploit this bias.

a)
b)

Figure 1: a) Schematic of a typical BB84 receiver setup with four
photodetectors. The labels indicate the case when there is incoming
$H$-polarized light.b) Spatial efficiency mismatch in detectors _h_ and _v_
when looked from the channel. Blue and Red regions indicate the efficiencies –
as a function of illumination angle ($\phi$, $\theta$) – of the _h_ and _v_
detectors respectively where one detector is on while the other is off . The
green region indicates ranges of ($\phi$,$\theta$), where both detectors are
equally sensitive. None of the detectors are sensitive in the white region.
For a mismatch of this kind, an adversary can utilize this to get some
information about the key.

The faked-state attack considered in refSajeed  _et al._ (2015b) is based on
the following assumptions. Eve is present outside Alice’s lab. She intercepts
and measures the signal going towards Bob. Then she reproduces another pulse
with the same polarization as her measurement outcome but with different mean
photon number, and sends it towards Bob at an angle where the target detector
has a higher sensitivity compared to others. More specifically, if Eve’s
measurement outcome is $j$, she reproduces $j$ polarized light with mean
photon number $\mu_{j}$ and sends it at an angle where detector $j$ has a
higher sensitivity than the other three detectors. This angle is referred to
as the _attack angle_ for detector $j$. She uses a lossless channel to
overcome the channel loss and maximize her target detection probabilities. The
sifted key rate and QBER in Eve’s presence become

$\displaystyle R_{e}=\frac{1}{4}\sum_{j=H,V,D,A}R_{e}(j),$ (1)
$\displaystyle\text{QBER}_{e}=\frac{1}{4R_{e}}\sum_{j=H,V,D,A}E_{j}.$

In order to remain hidden, Eve’s first target would be to match the sifted key
rate $R_{e}$ to the expected key rate $R_{ab}$, i.e., $R_{ab}=R_{e}$. The next
target would be to minimize $QBER_{e}$ to maximize the amount of leaked
information. Thus, the problem can be turned into an optimization problem with
the goal of minimizing $QBER_{e}$ with the constraints $R_{ab}=R_{e}$. The
parameters to optimize are the four mean photon numbers which Eve can
manipulate to minimize the error. A harder constraint can also be chosen.
Instead of matching only total key rate, the key rate at each channel can also
be matched. Both of these optimizations were done in Ref. Sajeed  _et al._
(2015b) and the result is reproduced in Fig. 2.

##  III Detector Scrambling countermeasure

In this section we discuss the general detector scrambling countermeasure
outlined in da Silva  _et al._ (2014) and investigate its effectiveness in
preventing the attack. Let us assume that a half-wave plate (HWP) is placed in
front of the BS in Fig. 1. By rotating the axis of the HWP Bob can rotate the
incoming polarization by
$\theta_{B}=0~{}\mathrm{\SIUnitSymbolDegree},45~{}\mathrm{\SIUnitSymbolDegree},90~{}\mathrm{\SIUnitSymbolDegree}$
and $135~{}\mathrm{\SIUnitSymbolDegree}$. When
$\theta_{B}=0~{}\mathrm{\SIUnitSymbolDegree}$, the detectors marked by _h,v,d_
and _a_ are used to detect incoming horizontal _(H)_ , vertical _(V)_ ,
diagonal _(D)_ and anti-diagonal _(A)_ polarized lights respectively. When
$\theta_{B}=90~{}\mathrm{\SIUnitSymbolDegree}$ , the bases are unchanged but
the roles of each detector is inverted, i.e, detector marked _h_ measures _V_
and vice versa. In case of $\theta_{B}=45~{}\mathrm{\SIUnitSymbolDegree}$, the
roles of each basis is flipped and finally for
$\theta_{B}=135~{}\mathrm{\SIUnitSymbolDegree}$ both the roles of each basis
and each detector is flipped, i.e, a detector marked _h_ measures _D_ and _A_
when $\theta_{B}=45~{}\mathrm{\SIUnitSymbolDegree}$ and
$\theta_{B}=135~{}\mathrm{\SIUnitSymbolDegree}$ respectively. Thus, by
randomly changing the incoming polarization by a HWP, it is possible for Bob
to scramble the roles of both his bases and detectors.

Figure 2: Simulated QBER vs line loss. The lower two solid curve (red and
blue) indicates the results obtained in Sajeed  _et al._ (2015b). The blue
curve shows the optimized $QBER_{e}$ when Eve matches the Bob compares the
total sifted key rate with the expected Alice-Bob sifted key rate $R_{ab}$.
The red curve shows the optimized $QBER_{e}$ when Eve matches the rate for
individual channels like $R_{ab}=R_{e}(j)$ where $j\in\\{\mathrm{h,v,d,a}\\}$.
The upper solid curve shows the optimized QBER in presence of detector
scrambling countermeasure. It can be seen that Bob can smoke out Eve’s
presence with this countermeasure.

In the following, we assume Bob scrambles his detectors with equal a-priori
probability. The sifted key rate $R_{e}(j|\theta_{B})$ and error rate
$E_{j|\theta_{B}}$ in the presence of Eve given she sends $j$ polarized light
– towards attack angle $j$ with mean photon number $\mu_{j}$ – and Bob applies
$\theta_{B}$ rotation, can be derived similar to Eqs. 7, 8 and 9 as presented
in Appendix B. Thus, the total sifted key rate $R_{e}^{s}$ and $QBER_{e}^{s}$
with Eve’s attack and Bob applying scrambling countermeasure become (derived
in Appendix B) :

$\begin{split}&R_{e}^{s}=\frac{1}{4}\sum_{j=H,V,D,A}\frac{1}{4}\sum_{\theta=0^{\circ},45^{\circ},90^{\circ},135^{\circ}}R_{e}(j|\theta)\\\
&QBER_{e}^{s}=\frac{1}{4R_{e}}\sum_{j=H,V,D,A}\frac{1}{4}\sum_{\theta=0^{\circ},45^{\circ},90^{\circ},135^{\circ}}E_{j|\theta},\end{split}$
(2)

As discussed in Sec. II, the terms $E_{j|\theta}$ and $R_{e}$ are dependent on
mean photon number chosen by Eve. Thus, we perform similar optimization using
the four mean photon numbers as the free parameters to minimize $QBER_{e}^{s}$
with the constraint $R_{e}^{s}=R_{ab}$. Our result is shown with the black
curve in Fig. 2. The presence of scrambling makes $QBER_{e}^{s}>25\%$ and no
successful key generation is possible. In the simulation, the efficiency of
the detectors, the mismatch values, background counts and all other parameters
are taken from Sajeed  _et al._ (2015b). This result highlights that as soon
as Bob employs detector scrambling technique, Eve cannot manipulate the four
mean photon numbers to achieve a QBER less than $25\%$ while satisfying the
constraints of matching the rates. This shows the effectiveness of the
scrambling countermeasure.

##  IV Detector-scrambling-bypass strategy

Figure 3: QBER versus line loss with Eve’s improved attack. Eve can keep the
error rate below 5% for line loss upto 17 dB with the detection-scrambling-
bypass strategy. The blue and red curves indicate $QBER_{e}$ when Bob matches
$R_{ab}$ with total sifted key rate and individual channel rates respectively.

So far, we have assumed that when Eve sends a $j$ polarized light, it is
always sent towards attack angle $j$ with mean photon number $\mu_{j}$. In
this section, we discard this assumption to generalize the attack. In
particular, we assume, when Eve sends a $j$ polarized light, it can be
directed towards any of the four attack angles $k\in\\{h,v,d,a\\}$ with mean
photon number $\mu_{j}^{k}$ and probability $f_{j}^{k}$ with
$\sum_{k}f_{j}^{k}=1$. Let $p_{i}^{k}(j|\theta_{B})$ be the raw click
probability at Bob’s detector $i$, given Eve sent a $j$-polarized light
towards attack angle $k$ with mean photon number $\mu_{j}^{k}$ that has been
rotated by an angle $\theta_{B}$ during scrambling.

$\begin{split}p_{h}^{k}(H|0^{\circ})\approx
c_{h}+1-exp(-\frac{\mu_{H}^{k}F\eta_{k}(H)}{2})\end{split}$ (3)

Let $R_{e}^{k}(j|\theta_{B})$ be the sifted key rate when Eve sends _j_
polarized light at _k_ attack angle with Bob rotating the polarization by
angle $\theta_{B}$. By deriving $R_{e}^{k}(j|\theta_{B})$ using similar
analysis as Eq. 17-20 we get,

$\begin{split}R_{e}(H|\theta_{B})=&[f_{h}^{h}.R_{e}^{h}(H|\theta_{B})+f_{h}^{v}.R_{e}^{v}(H|\theta_{B})+\\\
&f_{h}^{d}.R_{e}^{d}(H|\theta_{B})+f_{h}^{a}.R_{e}^{a}(H|\theta_{B})]\end{split}$
(4)

The above equation takes into consideration the attack angles for every
polarized light sent by Eve. Thus, we now have new variables such as
$P_{hv}^{h}(V)$ (instead of $P_{hv}(V)$) that indicates the probability –
after squashing – that Bob selects an outcome in the $hv$ basis given the
incoming light is $V$-polarized sent at $h$-attack angle. We can now plug in
Eq. 4 in Eq. 2 and calculate the QBER values for this detection-scrambling-
bypass strategy. In the attack model in Sajeed  _et al._ (2015b), when Eve
sent a $j$ polarized light she sent it at $j$ attack angle with mean photon
number $\mu_{j}$ which left her with only four free parameters to minimize the
error while satisfying the constraint. However, in the strategy presented in
this section, when Eve decides to send a $j$ polarized light, she can send
towards attack angles $k$ with probability $f_{j}^{k}$ and mean photon number
$\mu_{j}^{k}$. So there are 16 different values of $\mu_{j}^{k}$ and
$f_{j}^{k}$ equipping her with a total of $32$ free parameters to perform the
optimization. We have solved the optimization problem for this detection-
scrambling-bypass strategy with the same efficiency, Fidelity and dark count
values taken from Ref. Sajeed  _et al._ (2015b). For matching the total rates,
Eve follows the constraint $R_{ab}=R_{e}$ and for individual rates she follows
$R_{ab}=R_{e}(j)$ where $j\in\\{h,v,d,a\\}$. With these 32 free parameters at
hand the optimization program is executed and the result is shown in Fig. 3.
We see that by having more free parameters, Eve can indeed adjust their values
to keep the QBER less than $5\%$ for a loss up to 17 dB.

a)  b)

Figure 4:  a) Scatter plot of probability $f_{j}^{k}$ at channel loss of 6 dB.
In the detection-scrambling-bypass strategy Eve would send a specific
polarized light at all attack angles with a specific probability distribution.
Each column indicates the attack angles and each row represents the
polarization of light sent by Eve. We see that in most of the cases Eve sends
$H$-polarized light at $h$ attack angle and so on. b) Scatter plot of mean
Photon number at a channel loss of 6 dB with same column and row
representation. In this case, if Eve wants to manage a successful attack, she
needs to send $V$-polarized light more at $H$-attack angle than that at
$V$-polarized light. Thus, depending on the window where there is total
efficiency mismatch Eve needs to deploy her faked states following a specific
blueprint.

Figure 4a and Fig. 4b show the optimized probabilities $f_{j}^{k}$ and mean
photon number per pulse chosen by Eve for a channel loss of 6 dB respectively.
For a certain channel loss, Eve has to follow a specific blueprint to attack
the system. For example, the probability plot in Fig. 4a) shows that Eve sends
_V_ polarized light at _V_ attack angle with higher probability than others.
On the other hand, Eve has to send _V_ polarized light with higher mean photon
number than other polarizations as shown in Fig. 4b). For different channel
loss the value of the optimized free parameters will be different. Moreover,
These scenarios are entirely dependent on the specific mismatch present in the
system.

##  V Conclusion

In this work, we have shown that randomizing the roles of the detectors cannot
function as an efficient countermeasure against detector-efficiency-mismatch
type attacks. Although it can prevent the original attack proposed in Ref.
Sajeed  _et al._ (2015b), it fails to do so when a more general strategy is
followed. The general strategy works even when Bob uses any non-uniform a
priori scrambling probabilities.

We note that no two practical setups will have an exact mismatch, and hence it
would not be possible for Eve to acquire one prototype to learn the mismatch
of the target system. However, according to Kerckhoff’s principle Kerckhoffs
(1883) quantum cryptography assumes that except for the key, Eve knows all the
system’s imperfections. So, to guarantee unconditional security in theory, we
need to assume that Eve knows the exact details of the mismatch and Bob’s
scrambling countermeasure to optimize her attack. From a practical point of
view, Eve can listen to Bob’s classical communication channel while sending a
small fraction of faked states at different spatial angles to get an estimate
of the efficiency mismatch Makarov and Hjelme (2005). Eve can pursue a similar
strategy to estimate Bob’s detector scrambling statistics. Thus, unless new
techniques are proposed to strengthen the existing detector-scrambling
countermeasure strategies, it cannot guarantee security against detector
efficiency mismatch based attacks. Our result and methodology could be used to
security-certify a free-space quantum communication receiver against all types
of detector-efficiency-mismatch type attacks.

## References

  * Knight (2017) W. Knight,  _IBM Raises the Bar with a 50-Qubit Quantum Computer_, Tech. Rep. (MIT Technology Review, 2017).
  * Castelvecchi (2017) D. Castelvecchi,  _Quantum computers ready to leap out of the lab in 2017_ , Tech. Rep. (Nature News, 2017).
  * Merkle (1979) R. C. Merkle,  _Secrecy, authentication, and public key systems_ , Ph.D. thesis, Stanford University (1979).
  * Mceliece (1978) R. J. Mceliece, Coding Thv 4244, 114 (1978).
  * Hoffstein  _et al._ (1998) J. Hoffstein, J. Pipher, and J. H. Silverman, in  _International Algorithmic Number Theory Symposium_ (Springer, 1998) pp. 267–288.
  * Bennett and Brassard (1984) C. H. Bennett and G. Brassard, in  _Proceedings of IEEE International Conference on Computers, Systems, and Signal Processing_ (IEEE Press, New York, Bangalore, India, 1984) pp. 175–179.
  * Gisin  _et al._ (2002) N. Gisin, G. Ribordy, W. Tittel, and H. Zbinden, Rev. Mod. Phys. 74, 145 (2002).
  * Scarani  _et al._ (2009) V. Scarani, H. Bechmann-Pasquinucci, N. J. Cerf, M. Dušek, N. Lütkenhaus, and M. Peev, Rev. Mod. Phys. 81, 1301 (2009).
  * Lydersen  _et al._ (2010) L. Lydersen, C. Wiechers, C. Wittmann, D. Elser, J. Skaar, and V. Makarov, Nat. Photonics 4, 686 (2010).
  * Gerhardt  _et al._ (2011) I. Gerhardt, Q. Liu, A. Lamas-Linares, J. Skaar, C. Kurtsiefer, and V. Makarov, Nat. Commun. 2, 349 (2011).
  * Sajeed  _et al._ (2015a) S. Sajeed, I. Radchenko, S. Kaiser, J.-P. Bourgoin, A. Pappa, L. Monat, M. Legré, and V. Makarov, Phys. Rev. A 91, 032326 (2015a).
  * Sajeed  _et al._ (2016) S. Sajeed, A. Huang, S. Sun, F. Xu, V. Makarov, and M. Curty, Phys. Rev. Lett. 117, 250505 (2016).
  * Jain  _et al._ (2014) N. Jain, E. Anisimova, I. Khan, V. Makarov, C. Marquardt, and G. Leuchs, New J. Phys. 16, 123030 (2014).
  * Sajeed  _et al._ (2017) S. Sajeed, C. Minshull, N. Jain, and V. Makarov, Sci. Rep. 7, 8403 (2017).
  * Pinheiro  _et al._ (2018) P. V. P. Pinheiro, P. Chaiwongkhot, S. Sajeed, R. T. Horn, J.-P. Bourgoin, T. Jennewein, N. Lütkenhaus, and V. Makarov, Opt. Express 26, 21020 (2018).
  * Makarov  _et al._ (2016) V. Makarov, J.-P. Bourgoin, P. Chaiwongkhot, M. Gagné, T. Jennewein, S. Kaiser, R. Kashyap, M. Legré, C. Minshull, and S. Sajeed, Phys. Rev. A 94, 030302 (2016).
  * Bugge  _et al._ (2014) A. N. Bugge, S. Sauge, A. M. M. Ghazali, J. Skaar, L. Lydersen, and V. Makarov, Phys. Rev. Lett. 112, 070503 (2014).
  * Bennett  _et al._ (1992) C. H. Bennett, F. Bessette, L. Salvail, G. Brassard, and J. Smolin, J. Cryptology 5, 3 (1992).
  * Xu  _et al._ (2015) F. Xu, K. Wei, S. Sajeed, S. Kaiser, S. Sun, Z. Tang, L. Qian, V. Makarov, and H.-K. Lo, Phys. Rev. A 92, 032305 (2015).
  * Makarov  _et al._ (2006) V. Makarov, A. Anisimov, and J. Skaar, Phys. Rev. A 74, 022313 (2006), erratum ibid. 78, 019905 (2008).
  * Sajeed  _et al._ (2015b) S. Sajeed, P. Chaiwongkhot, J.-P. Bourgoin, T. Jennewein, N. Lütkenhaus, and V. Makarov, Phys. Rev. A 91, 062301 (2015b).
  * Rau  _et al._ (2015) M. Rau, T. Vogl, G. Corrielli, G. Vest, L. Fuchs, S. Nauerth, and H. Weinfurter, IEEE J. Quantum. Electron. 21, 6600905 (2015).
  * Chaiwongkhot  _et al._ (2019) P. Chaiwongkhot, K. B. Kuntz, Y. Zhang, A. Huang, J.-P. Bourgoin, S. Sajeed, N. Lütkenhaus, T. Jennewein, and V. Makarov, Phys. Rev. A 99, 062315 (2019).
  * Qi  _et al._ (2007) B. Qi, C.-H. F. Fung, H.-K. Lo, and X. Ma, Quant. Inf. Comp. 7, 73 (2007).
  * Makarov and Skaar (2008) V. Makarov and J. Skaar, Quant. Inf. Comp. 8, 622 (2008).
  * da Silva  _et al._ (2014) T. F. da Silva, G. C. do Amaral, G. B. Xavier, G. P. Temporão, and J. P. von der Weid, IEEE Journal of Selected Topics in Quantum Electronics 21, 159 (2014).
  * Kerckhoffs (1883) A. Kerckhoffs, Journal des sciences militaires IX, 5 (1883).
  * Makarov and Hjelme (2005) V. Makarov and D. R. Hjelme, J. Mod. Opt. 52, 691 (2005).
  * Beaudry  _et al._ (2008) N. J. Beaudry, T. Moroder, and N. Lütkenhaus, Phys. Rev. Lett. 101, 093601 (2008).
  * Tsurumaru and Tamaki (2008) T. Tsurumaru and K. Tamaki, Phys. Rev. A 78, 032302 (2008).
  * Gittsovich  _et al._ (2014) O. Gittsovich, N. J. Beaudry, V. Narasimhachar, R. R. Alvarez, T. Moroder, and N. Lütkenhaus, Phys. Rev. A 89, 012325 (2014).

##  Appendix A Sifted key rate and QBER during attack

To derive the key rate and QBER formula in Eve’s presence, Ref Sajeed  _et
al._ (2015b) started with a system with only Eve and Bob. Let us consider Eve
is sending a $j$-polarized pulse to Bob with mean photon number $\mu_{j}$
towards the attack angles $j$. Let $p_{i}(j)$ be the raw click probability at
detector $i$ while incoming light is $j$ polarized. For Eve sending $H$
polarized light, these probabilities are:

$\displaystyle p_{h}(H)\approx~{}c_{h}+1-\exp(-\frac{\mu_{H}F\eta_{h}(H)}{2})$
(5) $\displaystyle
p_{v}(H)\approx~{}c_{v}+1-\exp(-\frac{\mu_{H}(1-F)\eta_{v}(H)}{2})$
$\displaystyle
p_{d(a)}(H)\approx~{}c_{d(a)}+1-\exp(-\frac{\mu_{H}\eta_{d(a)}(H)}{4})$

Here, $c_{i}$ is the dark count probability per bit slot at the $i$-th
detector, F is the fidelity and $\eta_{i}(j)$ is the probability of detection
at Bob’s $i$-th detector given Eve sent $j$-polarized light. We assume that
when Bob registers a multiple click, he performs a squashing operationBeaudry
_et al._ (2008); Tsurumaru and Tamaki (2008); Gittsovich  _et al._ (2014).
Table 1 shows the cases where Bob makes his decisions based on the clicks on
his detectors. All other cases are discarded in the squashing model. Let
$\mathrm{P_{k}(l)}$ (where $k\in\\{hv,da\\}$, $l\in\\{H,V,D,A\\}$) be the
probability that Bob measures in the $k$ basis given the incoming light is $l$
polarized. Then $P_{hv}(H)$ can be computed from cases $1$, $2$ and $5$ in
Table 1 as:

$\begin{split}P_{hv}(H)&=p_{h}(H)[1-p_{d}(H)][1-p_{a}(H)][1-p_{v}(H)]\\\
&\quad+p_{v}(H)[1-p_{d}(H)][1-p_{a}(H)][1-p_{h}(H)]\\\
&\quad+p_{v}(H)p_{h}(H)[1-p_{d}(H)][1-p_{a}(H)]\\\
&=[1-p_{d}(H)][1-p_{a}(H)]\\\
&\quad\times[p_{h}(H)+p_{v}(H)-p_{h}(H)p_{v}(H)].\end{split}$ (6)

Table 1: Possible outcome of events after squashing. Case # | $h$ | $v$ | $d$ | $a$ | Decision after squashing
---|---|---|---|---|---
1 | $\checkmark$ | $\times$ | $\times$ | $\times$ | click on $h$
2 | $\times$ | $\checkmark$ | $\times$ | $\times$ | click on $v$
3 | $\times$ | $\times$ | $\checkmark$ | $\times$ | click on $d$
4 | $\times$ | $\times$ | $\times$ | $\checkmark$ | click on $a$
5 | $\checkmark$ | $\checkmark$ | $\times$ | $\times$ | decision random $h$ or $v$
6 | $\times$ | $\times$ | $\checkmark$ | $\checkmark$ | decision random $d$ or $a$

The probabilities $P_{hv}(V),P_{da}(D),P_{da}(A)$ can be calculated similarly.
Now we include Alice into the picture. We first assume the case where Alice
sends a $H$-polarized light. The possible scenarios are shown in Fig. 5. It is
sufficient to consider only the cases when Bob measures in same basis as Alice
(HV in this case) as the other cases will be discarded during sifting. Here we
assume, Eve measures Alice’s outgoing signal in $HV$ or $DA$ basis with equal
a-priory probability using a measurement setup having perfect detection
efficiency and no dark count. Thus, with $50\%$ probability she measures in
the correct (incorrect) basis and sends the correct (incorrect) state to Bob.
Let $R_{e}(j)$ be the sifted key rate with Eve’s presence given Alice sent a
$j$ polarized light. Following Fig. 5, $R_{e}(j)$ can be given by,

$R_{e}(H)\approx\frac{1}{2}P_{hv}(H)+\frac{1}{4}P_{hv}(D)+\frac{1}{4}P_{hv}(A)$
(7)

The error rate with Eve given Alice sends a $H$ polarized light can also be
calculated with the help of Fig. 5. When Eve measures in the same basis as
Alice, she introduces no error (assuming perfect fidelity at Bob). However,
when she measures in the wrong basis (in this case, $DA$) there is some
probability of error. Let $\mathrm{P_{i}(j)}$ be the probability that, after
squashing, Bob decides on outcome $i$ given incoming light was $j$-polarized
light. Thus, $\mathrm{P_{v}(H)}$ would be,

$\mathrm{P_{v}(H)}=[p_{v}(H)-\frac{p_{h}(H)p_{v}(H)}{2}][1-p_{d}(H)][1-p_{a}(H)]$
(8)

Figure 5: A Bayesian network showing the possible scenarios if Alice sends
$H$-polarized light and Bob measure in $HV$-basis. This only portrays a
scenario where fidelity is 1.0 with no dark counts.

Hence, the error rate during attack given Alice sends a $H$-polarized light
is,

$E_{H}=\frac{1}{8}\mathrm{P_{v}(D)}+\frac{1}{8}\mathrm{P_{v}(A)}$ (9)

In deriving Eqs. 7, 8 and 9, we have assumed simplified cases. In a more
general scenario, we also need to consider $P_{hv}(V)$ since the setup may
have imperfect fidelity and dark counts in the photodetectors. Let $P_{c}^{e}$
and $P_{w}^{e}$ be the probability that Eve measures Alice’s signal in the
correct basis and gets a click in the correct and wrong photodetector
respectively. Let, $P_{nc}^{e}$ be the probability that Eve measures in the
non-compatible or wrong basis. We can then modify equation 7 for the case of
sifted key rate when there is incoming $H$-polarized light. Thus, the sifted
key rate can be written from Sajeed  _et al._ (2015b) in the following form

$\begin{split}R_{e}(H)\approx&P_{c}^{e}P_{hv}(H)+P_{w}^{e}P_{hv}(V)+P_{nc}^{e}[P_{hv}(D)+P_{hv}(A)]\\\
&+(1-P_{c}^{e}-P_{w}^{e}-2P_{nc}^{e})(c_{h}+c_{v}-c_{h}c_{v})\end{split}$ (10)

Similarly, we can modify equation 9 to calculate the error rate with Eve in
between, when Alice sends $H$-polarized light. If Bob has a click in the $v$
photodetector with incoming $H$-polarized light then that would be an error
case with Eve measuring Alice’s signal in the correct basis. Similarly, for
other cases where Eve measures in the correct basis but gets a click in the
wrong photodetector and Eve measuring in the wrong basis, if Bob gets a click
in the $v$ photodetector that would count as an error and can be expressed in
the following form:

$\begin{split}E_{H}\approx&P_{c}^{e}\mathrm{P_{v}(H)}+P_{w}^{e}\mathrm{P_{v}(V)}+P_{nc}^{e}[\mathrm{P_{v}(D)}+\mathrm{P_{v}(A)}]\\\
&+(1-P_{c}^{e}-P_{w}^{e}-2P_{nc}^{e})(c_{v}-\frac{c_{v}c_{h}}{2})\end{split}$
(11)

Sifted key rates and QBERs during attack given Alice sends $V$, $D$ and $A$
polarized light can be calculated similarly. The total sifted key rate and
QBER in Eve’s presence become

$\displaystyle R_{e}=\frac{1}{4}\sum_{j=H,V,D,A}R_{e}(j),$ (12)
$\displaystyle\text{QBER}_{e}=\frac{1}{4R_{e}}\sum_{j=H,V,D,A}E_{j}.$

##  Appendix B Sifted key rate and QBER with scrambling countermeasure

Figure 6: Bob’s measurement setup during scrambling

Let $p_{i}(j|\theta_{B})$ be the raw click probability at Bob’s $i$-th
detector given Eve sends $j$ polarized light with mean photon number $\mu_{j}$
directed towards attack angle $j$ which is rotated by Bob by an angle
$\theta_{B}$. The probabilities for
$\theta_{B}=0\mathrm{\SIUnitSymbolDegree},45~{}\mathrm{\SIUnitSymbolDegree},90~{}\mathrm{\SIUnitSymbolDegree}$
and $135~{}\mathrm{\SIUnitSymbolDegree}$ can be derived similar to Eq. 5. When
$\theta_{B}=0~{}\mathrm{\SIUnitSymbolDegree}$:

$\displaystyle
p_{h}(H|0^{\circ})\approx~{}c_{h}+1-\exp(-\frac{\mu_{H}F\eta_{h}(H)}{2})$ (13)
$\displaystyle
p_{v}(H|0^{\circ})\approx~{}c_{v}+1-\exp(-\frac{\mu_{H}(1-F)\eta_{v}(H)}{2})$
$\displaystyle
p_{d(a)}(H|0^{\circ})\approx~{}c_{d(a)}+1-\exp(-\frac{\mu_{H}\eta_{d(a)}(H)}{4})$

When $\theta_{B}=45~{}\mathrm{\SIUnitSymbolDegree}$ the $H$-polarized light is
rotated to a $D$-polarized light and corresponding raw click probabilities
become:

$\displaystyle p_{d}(H|45^{\circ})\approx
c_{d}+1-exp(-\frac{\mu_{H}F\eta_{d}(H)}{2})$ (14) $\displaystyle
p_{a}(H|45^{\circ})\approx c_{a}+1-exp(-\frac{\mu_{H}(1-F)\eta_{a}(H)}{2})$
$\displaystyle p_{h(v)}(H|45^{\circ})\approx
c_{h(v)}+1-exp(-\frac{\mu_{H}\eta_{h(v)}(H)}{4})$

For $\theta_{B}=90~{}\mathrm{\SIUnitSymbolDegree}$:

$\displaystyle p_{v}(H|90^{\circ})\approx
c_{v}+1-exp(-\frac{\mu_{H}F\eta_{v}(H)}{2})$ (15) $\displaystyle
p_{h}(H|90^{\circ})\approx c_{h}+1-exp(-\frac{\mu_{H}(1-F)\eta_{h}(H)}{2})$
$\displaystyle p_{d(a)}(H|90^{\circ})\approx
c_{d(a)}+1-exp(-\frac{\mu_{H}\eta_{d(a)}(H)}{4})$

and finally for $\theta_{B}=135~{}\mathrm{\SIUnitSymbolDegree}$:

$\displaystyle p_{a}(H|135^{\circ})\approx
c_{a}+1-exp(-\frac{\mu_{H}F\eta_{a}(H)}{2})$ (16) $\displaystyle
p_{d}(H|135^{\circ})\approx c_{d}+1-exp(-\frac{\mu_{H}(1-F)\eta_{d}(H)}{2})$
$\displaystyle p_{h(v)}(H|135^{\circ})\approx
c_{h(v)}+1-exp(-\frac{\mu_{H}\eta_{h(v)}(H)}{4})$

Let $R_{e}(j|\theta_{B})$ be the sifted key rate in the presence of Eve given
she sends $j$ polarized light – towards attack angle $j$ with mean photon
number $\mu_{j}$ – and Bob applies $\theta_{B}$ rotation on it. Using similar
analysis used for deriving Eq. 10, we can find the rates for different
$\theta_{B}$. For example,

$\begin{split}R_{e}(H|&0^{\circ})\approx
P_{c}^{e}P_{hv}(H|0^{\circ})+P_{w}^{e}P_{hv}(V|0^{\circ})\\\
&+P_{nc}^{e}[P_{hv}(D|0^{\circ})+P_{hv}(A|0^{\circ})]\\\
&+(1-P_{c}^{e}-P_{w}^{e}-2P_{nc}^{e})(c_{h}+c_{v}-c_{h}c_{v})\end{split}$ (17)

$\begin{split}R_{e}(H|&90^{\circ})\approx
P_{c}^{e}P_{hv}(H|90^{\circ})+P_{w}^{e}P_{hv}(V|90^{\circ})\\\
&+P_{nc}^{e}[P_{hv}(D|90^{\circ})+P_{hv}(A|90^{\circ})]\\\
&+(1-P_{c}^{e}-P_{w}^{e}-2P_{nc}^{e})(c_{h}+c_{v}-c_{h}c_{v})\end{split}$ (18)

$\begin{split}R_{e}(H|&45^{\circ})\approx
P_{c}^{e}P_{da}(H|45^{\circ})+P_{w}^{e}P_{da}(V|45^{\circ})\\\
&+P_{nc}^{e}[P_{da}(D|45^{\circ})+P_{da}(A|45^{\circ})]\\\
&+(1-P_{c}^{e}-P_{w}^{e}-2P_{nc}^{e})(c_{d}+c_{a}-c_{d}c_{a})\end{split}$ (19)

$\begin{split}R_{e}(H|&135^{\circ})\approx
P_{c}^{e}P_{da}(H|135^{\circ})+P_{w}^{e}P_{da}(V|135^{\circ})\\\
&+P_{nc}^{e}[P_{da}(D|135^{\circ})+P_{da}(A|135^{\circ})]\\\
&+(1-P_{c}^{e}-P_{w}^{e}-2P_{nc}^{e})(c_{d}+c_{a}-c_{d}c_{a})\end{split}$ (20)

We assume in our model that Bob is scrambling the role of the photodetectors
with equal a-priori probabilities. Thus, modifying equation 1 and averaging
Bob’s rate for each $\theta_{B}$ (that accounts for the extra $\frac{1}{4}$
factor), we obtain Bob’s total sifted key rate:

$\begin{split}&R_{e}^{s}=\frac{1}{4}\sum_{j=H,V,D,A}\frac{1}{4}\sum_{\theta=0^{\circ},45^{\circ},90^{\circ},135^{\circ}}R_{e}(j|\theta)\end{split}$
(21)

The error rates conditioned on Alice sending $H$-polarized light and Eve
applying
$\theta_{B}\in\\{0~{}\mathrm{\SIUnitSymbolDegree},45~{}\mathrm{\SIUnitSymbolDegree},90~{}\mathrm{\SIUnitSymbolDegree},135~{}\mathrm{\SIUnitSymbolDegree}\\}$
rotation can be calculated similar to Eq. 11 in previous section. They are:

$\begin{split}E_{H|0^{\circ}}&\approx
P_{c}^{e}\mathrm{P_{v}(H|0^{\circ})}+P_{w}^{e}\mathrm{P_{v}(V|0^{\circ})}\\\
&+P_{nc}^{e}[\mathrm{P_{v}(D|0^{\circ})}+\mathrm{P_{v}(A|0^{\circ})}]\\\
&+(1-P_{c}^{e}-P_{w}^{e}-P_{nc}^{e})(c_{v}-\frac{c_{v}c_{h}}{2})\end{split}$
(22)

$\begin{split}E_{H|90^{\circ}}&\approx
P_{c}^{e}\mathrm{P_{h}(H|90^{\circ})}+P_{w}^{e}\mathrm{P_{h}(V|90^{\circ})}\\\
&+P_{nc}^{e}[\mathrm{P_{h}(D|90^{\circ})}+\mathrm{P_{h}(A|90^{\circ})}]\\\
&+(1-P_{c}^{e}-P_{w}^{e}-P_{nc}^{e})(c_{v}-\frac{c_{v}c_{h}}{2})\end{split}$
(23)

$\begin{split}E_{H|45^{\circ}}&\approx
P_{c}^{e}\mathrm{P_{a}(H|45^{\circ})}+P_{w}^{e}\mathrm{P_{a}(V|45^{\circ})}\\\
&+P_{nc}^{e}[\mathrm{P_{a}(D|45^{\circ})}+\mathrm{P_{a}(A|45^{\circ})}]\\\
&+(1-P_{c}^{e}-P_{w}^{e}-P_{nc}^{e})(c_{v}-\frac{c_{v}c_{h}}{2})\end{split}$
(24)

$\begin{split}E_{H|135^{\circ}}&\approx
P_{c}^{e}\mathrm{P_{d}(H|135^{\circ})}+P_{w}^{e}\mathrm{P_{d}(V|135^{\circ})}\\\
&+P_{nc}^{e}[\mathrm{P_{d}(D|135^{\circ})}+\mathrm{P_{d}(A|135^{\circ})}]\\\
&+(1-P_{c}^{e}-P_{w}^{e}-P_{nc}^{e})(c_{v}-\frac{c_{v}c_{h}}{2})\end{split}$
(25)

Here, $\mathrm{P_{i}(j|\theta_{B})}$ is the probability that outcome $i$ is
selected by Bob after squashing given that Eve has sent $j$-polarized light
which was rotated by Bob by an angle $\theta_{B}$. So, modifying Eq. 6 we get,

$\begin{split}\mathrm{P_{v}(H|\theta)}&=[p_{v}(H|\theta)-\frac{p_{h}(H|\theta)p_{v}(H|\theta)}{2}]\\\
&\times[1-p_{d}(H|\theta)][1-p_{a}(H|\theta)]\end{split}$ (26)

The total QBER in Eve’s presence becomes:

$\displaystyle
QBER_{e}^{s}=\frac{1}{4R_{e}}\sum_{j=H,V,D,A}\frac{1}{4}\sum_{\theta=0^{\circ},45^{\circ},90^{\circ},135^{\circ}}E_{j|\theta}$
(27)

In a plausible scenario, if Bob applies
$\theta_{B}=45~{}\mathrm{\SIUnitSymbolDegree}$ and expects an incoming _H_
polarized light from Alice, he will be expecting a click in his _d_ detector.
But if the light is coming from Eve, it will be directed towards, the _H_
attack angle where the _h_ detector has the highest efficiency. This increases
the error rate. Simulations also verify that, scrambling the role of detectors
can smoke out Eve’s presence.