# Photonic verification of device-independent quantum key distribution against
collective attacks

Wen-Zhao Liu  Yu-Zhe Zhang  Yi-Zheng Zhen  Ming-Han Li  Hefei National
Laboratory for Physical Sciences at Microscale and Department of Modern
Physics, University of Science and Technology of China, Hefei 230026, P. R.
China.  Shanghai Branch, CAS Center for Excellence and Synergetic Innovation
Center in Quantum Information and Quantum Physics, University of Science and
Technology of China, Shanghai 201315, P. R. China.  Shanghai Research Center
for Quantum Sciences, Shanghai 201315, P. R. China.  Yang Liu  Jinan Institute
of Quantum Technology, Jinan 250101, P. R. China  Jingyun Fan  Shenzhen
Institute for Quantum Science and Engineering and Department of Physics,
Southern University of Science and Technology, Shenzhen, 518055, P. R. China
Feihu Xu  Qiang Zhang  Jian-Wei Pan  Hefei National Laboratory for Physical
Sciences at Microscale and Department of Modern Physics, University of Science
and Technology of China, Hefei 230026, P. R. China.  Shanghai Branch, CAS
Center for Excellence and Synergetic Innovation Center in Quantum Information
and Quantum Physics, University of Science and Technology of China, Shanghai
201315, P. R. China.  Shanghai Research Center for Quantum Sciences, Shanghai
201315, P. R. China.

###### Abstract

The security of quantum key distribution (QKD) usually relies on that the
users’s devices are well characterized according to the security models made
in the security proofs. In contrast, device-independent QKD — an entanglement-
based protocol — permits the security even without any knowledge of the
underlying quantum devices. Despite its beauty in theory, device-independent
QKD is elusive to realize with current technologies. Especially in photonic
implementations, the requirements for detection efficiency are far beyond the
performance of any reported device-independent experiments. In this paper, we
employ theoretical and experimental efforts and realize a proof-of-principle
verification of device-independent QKD based on the photonic setup. On the
theoretical side, we enhance the loss tolerance for real device imperfections
by combining different approaches, namely, random post-selection, noisy
preprocessing, and developed numerical methods to estimate the key rate via
the von Neumann entropy. On the experimental side, we develop a high-quality
polarization-entangled photon source achieving a state-of-the-art (heralded)
detection efficiency about $87.5\%$. This efficiency outperforms previous
photonic experiments involving loophole-free Bell tests. Together, we show
that the measured quantum correlations are strong enough to ensure a positive
key rate under the fiber length up to 220 m. Our photonic platform can
generate entangled photons at a high rate and in the telecom wavelength, which
is desirable for high-speed generation over long distances. The results
present an important step towards a full demonstration of photonic device-
independent QKD.

_Introduction. —_ Quantum key distribution (QKD) [bennett1984quantum,
ekert1991quantum] allows two distant users to share secret keys with
information-theoretic security [xu2020secure]. The security of QKD usually
relies on the assumptions that the devices are trusted and well-characterized
[lo1999unconditional, shor2000simple, renner2008security]. However, the
imperfections of the practical devices may provide potential backdoors or side
channels for adversaries [xu2010, Lars2010]. Measurement-device-independent
QKD [lo2012measurement, braunstein2012side] (with a recent development in
[lucamarini2018overcoming]) was proposed to prevent the side-channel attacks
on detectors, but leaves the state-preparation devices to be precisely
calibrated. Device-independent QKD [mayers1998quantum, barrett2005no,
acin2007device, pironio2009device] further relaxes the security assumptions on
the devices. Given the following assumptions [pironio2009device], i.e., (i)
quantum theory is validity, (ii) no unwanted information leakage from
communicating parties to adversaries is allowed, (iii) the communicating
parties have local trusted randomness to decide inputs of their measurement
devices, (iv) the classical post-processing units are trusted, and (v) an
authenticated public classical channel is shared between the communicating
parties, its security can be guaranteed solely based on the violation of Bell
inequalities.

The realization of device-independent QKD is non-trivial with current
technologies, where the loophole-free violations of the Bell inequalities are
usually required [hensen2015loophole, rosenfeld2017event]. Especially in the
photonic implementations, the efficiency loss of photons due to transmission
and detection becomes a key issue. Although distinguished experiments without
the detection loophole have been made [giustina2013bell,
christensen2013detection, shalm2015strong, giustina2015significant,
li2018test, liu2018high, shen2018randomness, bierhorst2018experimentally,
liu2018device, zhang2020experimental, liu2021device, li2021experimental,
shalm2021device], a much higher efficiency (over $90\%$) is normally required
in the realization of device-independent QKD [pironio2009device,
masanes2011secure, reichardt2013classical, vazirani2014fully,
Arnon2018Practical]. Despite recent theoretical progresses have been made in
reducing the required efficiency [fourvalue, tan2020advantage, ho2020noisy,
woodhead2021device, sekatski2021device, gonzales2021device,
brown2021computing, schwonnek2021device, computeDI2021], a practical protocol
for a real platform remains elusive.

Here, we report a proof-of-principle verification of device-independent QKD
based on polarization-entangled photons. We accomplish this via significant
theoretical and experimental efforts. On the theoretical side, we propose a
protocol that greatly enhances the loss tolerance of the experiments, thereby
reducing the efficiency threshold of our setup to about $86\%$. The idea of
our protocol is to post-select the outcomes of the key generation basis
[de2016randomness, xu2021device], and then add noise [ho2020noisy] to the
remaining strings. The lower bound of the key rate is computed via the recent
achievement in estimating the quantum conditional entropy [computeDI2021]. On
the experimental side, we develop an entangled-photon source with the state-
of-the-art efficiency of about $87.5\%$, which surpasses the values reported
in previous full-photonic experiments that performing loophole-free Bell tests
[giustina2013bell, christensen2013detection, shalm2015strong,
giustina2015significant, li2018test, liu2018high, shen2018randomness,
bierhorst2018experimentally, liu2018device, zhang2020experimental,
liu2021device, li2021experimental, shalm2021device], and makes the device-
independent experiments possible. Combining the experimental and theoretical
advances, we present a verification of device-independent QKD under fiber
length up to 220 m. To maintain a high efficiency, our proof-of-principle
experiment does not include the real-time random basis selection
[liu2021device, li2021experimental, shalm2021device] and the finite-key
effect, which are essential to generate real secret keys. However, our
experiment verifies that the measured correlations are strong enough to
guarantee a positive secret key rate, thus presenting an important step
towards a full demonstration.


#  Systematic Computation of Braid Generator Matrix
in Topological Quantum Computing

Abdellah Tounsi<EMAIL_ADDRESS>Constantine Quantum Technologies,
Frères Mentouri University Constantine 1, Ain El Bey Road, Constantine, 25017,
Algeria  Laboratoire de Physique Mathématique et Subatomique, Frères Mentouri
University Constantine 1, Ain El Bey Road, Constantine, 25017, Algeria  Nacer
Eddine Belaloui  Constantine Quantum Technologies,
Frères Mentouri University Constantine 1, Ain El Bey Road, Constantine, 25017,
Algeria  Laboratoire de Physique Mathématique et Subatomique, Frères Mentouri
University Constantine 1, Ain El Bey Road, Constantine, 25017, Algeria
Mohamed Messaoud Louamri  Constantine Quantum Technologies,
Frères Mentouri University Constantine 1, Ain El Bey Road, Constantine, 25017,
Algeria  Theoretical Physics Laboratory, University of Science and Technology
Houari Boumediene, BP 32 Bab Ezzouar, Algiers, 16111, Algeria  Amani Mimoun
Constantine Quantum Technologies,
Frères Mentouri University Constantine 1, Ain El Bey Road, Constantine, 25017,
Algeria  Achour Benslama<EMAIL_ADDRESS>Constantine Quantum
Technologies,
Frères Mentouri University Constantine 1, Ain El Bey Road, Constantine, 25017,
Algeria  Laboratoire de Physique Mathématique et Subatomique, Frères Mentouri
University Constantine 1, Ain El Bey Road, Constantine, 25017, Algeria
Mohamed Taha Rouabah<EMAIL_ADDRESS>Constantine Quantum
Technologies,
Frères Mentouri University Constantine 1, Ain El Bey Road, Constantine, 25017,
Algeria  Laboratoire de Physique Mathématique et Subatomique, Frères Mentouri
University Constantine 1, Ain El Bey Road, Constantine, 25017, Algeria

###### Abstract

We present a systematic numerical method to compute the elementary braiding
operations for topological quantum computation (TQC). Braiding non-Abelian
anyons is a crucial technique in TQC, offering a topologically protected
implementation of quantum gates. However, obtaining matrix representations for
braid generators can be challenging, especially for systems with numerous
anyons or complex fusion patterns. Our proposed method addresses this
challenge, allowing for the inclusion of an arbitrary number of anyons per
qubit or qudit. This approach serves as a fundamental component in a general
topological quantum circuit simulator, facilitating the exploration and
analysis of intricate quantum circuits within the TQC framework. We have
implemented and tested the method using algebraic conditions. Furthermore, we
provide a proof of concept by successfully reproducing the CNOT gate.

##  I Introduction

A quantum computer leverages the fundamental principles of quantum mechanics
to solve a class of computationally hard mathematical problems [1, 2, 3, 4,
5]. Instead of using classical Boolean bits, a quantum computer utilizes
qubits, which are quantum states capable of being in superposition and
entangled with each other. Quantum gates are unitary operators that act on the
Hilbert space generated by qubits, thus allowing the manipulation of quantum
information [4]. Experimental realizations of quantum computers are vulnerable
to errors that arise from decoherence, which is the result of the interaction
of qubits with their environment [6]. This phenomenon presents a significant
challenge to the practical implementation of quantum computers. To address
this issue, various approaches are under investigation, including the
isolation of qubits from environmental disturbances and the use of cooling
systems to minimize the effect of decoherence [7, 8, 9], as well as quantum
error mitigation techniques [10]. However, to fully harness the advantages of
quantum computing, fault-tolerant quantum error correction (QEC) is necessary.
Nevertheless, the practical application of QEC is limited by the threshold
theorem, which requires a sufficiently low error rate [11]. Furthermore, the
field of condensed matter physics has witnessed various experimental and
theoretical discoveries in recent decades, revealing intriguing
characteristics of the topological phase of matter [12, 13, 14, 15, 16, 17,
18, 19]. Hence, topological quantum systems are emerging as a promising
platforms to store and process quantum information in a robust manner, through
quantum evolutions that are immune to decoherence [20, 21, 22, 23, 24, 25,
26]. Topological quantum computation (TQC) deals with two-dimensional quantum
systems that support excitations with fractional statistics, known as anyons
[27, 28]. These anyons exhibit statistics that differ from those of fermions
and bosons. A system of $N$ non-abelian anyons possesses a topologically
protected Hilbert space that grows exponentially with the number of anyons,
and quantum information can be processed through the braiding of anyons [29,
30, 31]. Non-abelian anyons promise to offer a fault-tolerant method of
performing universal quantum computation, as information is stored in the
topological, i.e., non-local features of the system, making the quantum state
resilient, in principle, to conventional sources of decoherence [32, 33, 26].

The execution of topological quantum computation can be divided into three
main steps:

  1. 1.

Initialization: pairs of non-abelian anyons are created from the vacuum.
However, the creation of pairs is vulnerable to noise and not naturally
robust. The distillation technique, which relies purely on braiding, can be
employed to establish a suitable code space for initialization [34].

  2. 2.

Processing: the anyons are moved in 2-dimensional space to form braids in a
2+1-dimensional space-time, which corresponds to quantum unitary gates
performed on the anyons’ Hilbert space. The anyons must be kept sufficiently
far apart to minimize errors. Nonetheless, a measurement-only scheme that does
not require any exchange of anyons has also been proposed [35].

  3. 3.

Readout: the adjacent anyon pairs are fused together to close the computation
process, which can be accomplished through the non-abelian anyons
interferometry [36].

This study aims to provide a comprehensive procedure for computing the matrix
elements of the braiding operators, with a specific focus on applying the
foundational principles of anyon model theory in quantum computing. The
methodology for constructing qubits by selecting suitable fusion states of a
set of identical anyons will be described in detail. Additionally, a
generalized formula for systematic calculation of the matrix components of the
braiding operations will be derived. The computational complexity of this
formula will also be analyzed using concrete examples from the Fibonacci anyon
model. Furthermore, the method will be utilized to reproduce the well-known
CNOT gate for the same model. It is worth noting that the results of this
study have been implemented to develop an open-source package called TQSim
[37].

##  II Quantum Computation with Anyons

Particles exhibit a unique statistical behavior when existing in two-
dimensional space. Unlike in three-dimensional space where particles behave as
either bosons or fermions, the statistical behavior of indistinguishable
particles in two-dimensional space is not restricted to these two categories.
The exchange of indistinguishable particles in three dimensions is governed by
the permutation group, where the paths of exchanging two particles are
irrelevant. Namely, the exchange of fermions or bosons results in a scalar
phase factor $e^{i\phi}$ with $\phi=0(\pi)$ for bosons(fermions). However, in
two dimensions, the path of exchanging two particles falls into different
homotopy classes, thereby allowing for particles of any statistical behavior
called anyons [38, 27, 29]. The statistical quantum evolution of anyons is
described by the braid group, which is significant in TQC as the braiding
operation is impervious to dynamical and geometrical perturbations. Two types
of anyons can be distinguished: abelian and non-abelian anyons. Abelian anyons
have abelian phase factor and give rise to a non-degenerate state, whereas
non-abelian anyons have non-abelian phase factor and construct a degenerate
quantum state [23, 39]. This degeneracy is crucial for encoding non-trivial
quantum states. In the context of TQC, quantum information is encoded in the
topology of multiple anyons’ state, rather than being encoded in the dynamical
properties of a system, which can be easily altered by external perturbations
[23]. As a result, the only operations that modify the quantum states
implemented in TQC are non-local operations, which consist of braiding the
world lines of anyonic particles. This approach offers robustness in the
implementation of quantum computation, as the movement of particles around
each other in an undesired way is less likely to occur when the particles are
far apart [40]. Therefore, anyons present an opportunity to perform reliable
quantum computation without the need for extensive error correction overhead.
Additionally, they provide a platform for constructing new quantum algorithms
or reformulating existing algorithms in the TQC framework. One such
breakthrough is the Aharonov-Jones-Landau (AJL) algorithm, which can
approximate the Jones polynomials [41, 26], known to be a BQP-complete problem
[42]. Practically, anyons can exist as quasi-particles in effective two-
dimensional surfaces. The creation of anyons can be accomplished
experimentally by exploiting topological superconducting nanowire devices [43,
44] or the fractional quantum Hall effect (FQHE) [45, 46, 47, 48, 49]. It has
been confirmed that the quasi-particles produced by this latter exhibit
anyonic statistics [50, 51]. Moreover, lattice models such as Kitaev toric
code [21], Kitaev honeycomb model [52], and Levin-Wen model [53, 54] are among
the other potential candidates for the emergence of non-abelian anyons, a
crucial element for the construction of topological quantum computer.

Anyon models serve as the frameworks for TQC, and the appropriate mathematical
language to discuss them is the Unitary Modular Category (UMC) theory. In this
latter, the Jones-Wenzl projectors are utilized to model anyons [55]. Abelian
anyons can be classified based on their braiding statistics, which measure
their interactions when they are braided around one another. On the other
hand, non-Abelian anyons can be further classified by their fusion statistics,
which measure how they combine to form new anyons. Consequently, the fusion
statistics of non-Abelian anyons can be utilized for encoding information, and
it becomes possible to implement a universal set of quantum gates by braiding
them around one another. Specifically, the $SU(2)_{k}$ anyon models for $k>2$
have been shown to be Turing-complete or universal [22]. The rules for
combining two anyons into a larger composite are called fusion rules. For non-
Abelian anyons different fusion channels are possible, which determine the
fusion rules between different types of anyons denoted as $a$ and $b$, each
associated with distinct charges. The allowed fusion outcomes are determined
by the following rule:

$a\times b=\sum_{i}N_{ab}^{i}\ {i}.$ (1)

The value of the integer $N_{ab}^{i}$ refers to the count of distinct ways to
generate the anyon $i$ by fusing together the anyons $a$ and $b$. The vacuum,
represented as 0, fuses trivially with any other anyon such that
$a\times\textbf{0}=a$ for all anyons $a$. Consequently, an anti-anyon
$\bar{a}$ can be defined for each anyon $a$, where
$a\times\bar{a}=\textbf{0}$. The fusion processes comprise a collection of
states that are orthogonal to each other, spanning a Hilbert space denoted as
$\mathcal{F}$ and referred to as the fusion space. Each state in $\mathcal{F}$
specifies the outcomes of the fusion processes of multiple anyons following a
specific order. In the context of anyon models, the quantum information is
encoded in the feasible fusion states of the anyons and manipulated by the
exchange of anyons, a process known as braiding. Importantly, the fusion state
of a pair of anyons is a non-local collective property of that pair which is
not accessible by local observations on either anyon. As such, the quantum
information must be resilient to local perturbations. Let us consider the
fusion space of four anyons described by the following fusion states:

$\ket{(((a,b)_{i},c)_{j},d)_{k}},$ (2)

where the indexed parenthesis represents the fusion process. In this example,
the fusion order is from left to right. This notation is interchangeable with
the diagrammatic fusion tree representation, with the exception of a
normalization factor [36]. The state (2) can also be represented as a tensor
product of all associated fusion processes:

$\ket{(((a,b)_{i},c)_{j},d)_{k}}=\ket{(a,b)_{i}}\otimes\ket{(i,c)_{j}}\otimes\ket{(j,d)_{k}}.$
(3)

Thus, the dimension of the fusion space, $\mathcal{F}_{4}$, of four-anyon
system can be expressed as the summation of all possible ways of fusing anyons
$a$, $b$, $c$ and $d$ through the formula

$\dim(\mathcal{F}_{4})=\sum_{ijk}N_{ab}^{i}N_{ic}^{j}N_{jd}^{k}\ ,$ (4)

where $N_{ab}^{i}$ represents the number of distinct fusion channels of anyons
$a$ and $b$ resulting in the anyon $i$. In the subsequent sections, only
multiplicity-free anyon models, which satisfy $N_{ab}^{i}=0$ or $1$ for all
$a$, $b$, and $i$, will be considered. It is worth noting that most anyon
models encountered in physical contexts fall under this case.

The fusion of more than two anyons is not uniquely determined by any specific
order of pairwise fusion processes due to the variability of intermediate
quantum states that result from different fusion process orders. To account
for the various possible ways of fusing more than two anyons, it is necessary
to introduce fusion matrices, which enable basis transformations.
Specifically, the fusion matrices $F_{abc}^{j}$ are defined as linear
transformations that relate the only two ways of ordering the fusion of anyons
$a$, $b$, and $c$ to the resulting anyon $j$, as follows:

$\ket{((a,b)_{i},c)_{j}}=\sum_{k}(F_{abc}^{j})_{k}^{i}\ket{(a,(b,c)_{k})_{j}}.$
(5)

The index $k$ corresponds to the intermediate charges that are summed over,
and the coefficients $(F_{abc}^{j})_{k}^{i}$ determine the amplitudes of the
possible fusion outcomes. It is essential for these fusion matrices to be
unitary to maintain the normalization of fusion states [36, 52, 23, 25]. On
the other hand, braiding two anyons that fuse in a particular channel cannot
change the fusion channel. This is because the total topological charge of the
pair is not a local property, and it does not depend on the evolution of the
pair. A counterclockwise exchange of particles $a$ and $b$ can be viewed as a
half twist of their fusion outcome $i$ particle i.e the exchange of particles
$a$ and $b$ is equivalent to rotating the particle $i$ by $180$ degrees. The
phase factor $R^{i}_{ab}$ is a property of the anyons $a$, $b$, and $i$. It is
a measure of how the anyons interact when they are braided around each other.
The value of the phase factor $R^{i}_{ab}$ depends on the type of anyons that
are being braided. Therefore, the braiding matrix $R_{ab}$ is defined by its
operation on the state $\ket{(a,b)_{i}}$ as follows [36]:

$R_{ab}\ket{(a,b)_{i}}=R_{ab}^{i}\ket{(b,a)_{i}}.$ (6)

To ensure consistency in an anyon model, the $F$ and $R$ matrices should
satisfy the hexagon and pentagon equations, as demonstrated in any braided
monoidal category [56]. Furthermore, by solving the hexagon and pentagon
identities, one can determine the numerical values of the components of the
$F$ and $R$ matrices [36]. Another method of determining the components of
those matrices for an $SU(2)_{k}$ anyon model with an arbitrary integer $k$,
representing the level of the theory, is mentioned in [55, 36]. The algebraic
theory of such anyon systems is described by the Temperley-Lieb-Jones category
TLJ($A$) for a fixed value of $A=\pm i\exp(\pm i\pi/{2(k+2)})$, and the
associated topological quantum field theory is known as the Jones-Kauffman
theory at level $k$ [57].

The process of exchanging two adjacent anyons is known as braiding, which is a
fundamental operation in anyon models. In particular, the braiding operation
between the $n$-th and $(n+1)$-th particles is referred to as the $\sigma_{n}$
braiding operator. The braid group is generated by the set of all possible
braiding operators between adjacent anyons. These operators satisfy Artin
relations, which include the Yang-Baxter equation or the type III Reidemeister
move [58, 57]. These relations ensure the algebraic consistency of anyon
models [59, 56]. In addition to the hexagon and pentagon equations, Artin
relations are practically useful in the implementation of unit-testing
111Unit-testing involves evaluating each unit of the program separately to
identify potential errors that could propagate to other parts of the program
at an early stage [64]. for numerical packages used to compute braid
generators. The verification process will be explained further in the next
sections. The explicit matrix representation of a braid generator can be
obtained by choosing a fusion space basis according to the fusion process and
then applying the relevant $F$ and $R$ transformations [40]. In general, there
are two schemes to encode quantum information in the fusion states of anyons.
In the dense encoding scheme, a minimal number of anyons is utilized. This
scheme, which is discussed in Ref. [61], enables the systematic construction
of two-qubit and three-qubit controlled phase gates. In the sparse encoding
scheme, we represent each qubit or qudit with a definite number of anyons.
Even though such construction does not allow for optimal use of the fusion
space, it preserves the circuit model of quantum computation. In this study,
we follow the latter. In the following section, we will explicitly demonstrate
how to compute the matrix representations of braid generators acting on the
fusion state of identical anyons grouped in sets of a fixed number of anyons.
Each set in our system consists of four anyons, since it is not recommended to
represent a qubit with more than four anyons because of leakage, as proven for
all anyon models in Ref. [62]. Nevertheless, the method can be extended
systematically to an arbitrary number of anyons per set. It is important to
note that the fusion space of four anyons does not necessarily have the
dimension of a qubit. Instead, it generally corresponds to a qudit.

##  III Calculating Braid Generators

$j_{f-1}$$j_{2}$$j_{1}$$i_{13}$$i_{12}$$i_{11}$$a$$a$$a$$a$$i_{22}$$a$$i_{21}$$a$$a$$i_{23}$$a$$i_{32}$$a$$i_{31}$$a$$a$$i_{33}$$a$$i_{f2}$$a$$i_{f1}$$a$$a$$i_{f3}$$a$
Figure 1: This fusion tree diagram, depicted using the quantum circuit model
of qubits, represents the state of $f$ groups, each containing four identical
anyons and assigned a qudit. Here, ${i_{qp}}$ denotes the consecutive fusion
outcomes of anyons inside the $q$-th qudit, where $q=1,\ldots,f$ and
$p=1,\ldots,3$. Additionally, $j_{q}$, where $q=0,\ldots,(f-1)$, represents
the fusion outcome of $i_{q3}$ and $i_{(q+1)3}$. It’s important to note that
$j_{0}=i_{13}$ since, for negative $q$ values, $j_{q}$ represents the vacuum
charge.

This study is focused on examining the matrix representation of braid
generators that operate on a state $\ket{\psi}$ comprised of identical anyons
arranged in groups of four anyons, with each group representing a single
qubit/qudit. The diagrammatic representation of a typical state of this kind
is depicted in Fig. 1. For simplicity, we can do all calculations for three
qudits represented by four anyons each. Symbolically, such a state can be
written as follows:

$\displaystyle\ket{\psi}=\left|((((((a,a)_{i_{11}},a)_{i_{12}},a)_{i_{13}}),((((a,a)_{i_{21}},a)_{i_{22}},a)_{i_{23}}))_{j_{1}},((((a,a)_{i_{31}},a)_{i_{32}},a)_{i_{33}}))_{j_{2}}\right\rangle.$
(7)

However, recognizing that this notation can be cumbersome, we express the
previous identity in a more concise and simplified form as follows:

$\displaystyle\ket{\psi}=\left(\left(\ket{i_{11},i_{12},i_{13}}\otimes\ket{i_{21},i_{22},i_{23}}\right)_{j_{1}}\otimes\ket{i_{31},i_{32},i_{33}}\right)_{j_{2}}.$
(8)

In this identity, $\ket{i_{q1},i_{q2},i_{q3}}$ is a reduced notation for the
state $\ket{(((a,a)_{i_{q1}},a)_{i_{q2}},a)_{i_{q3}}}$, which represents the
state of the $q$-th set consisting of four anyons of type $a$. The symbols
${i_{q_{1}},i_{q_{2}},i_{q_{3}}}$ denote the successive fusion results of the
anyons within the $q$-th set. Additionally, the notation
$\left(\ket{i_{11},i_{12},i_{13}}\otimes\ket{i_{21},i_{22},i_{23}}\right)_{j_{1}}$
is a more convenient way of writing
$\ket{i_{11},i_{12},i_{13}}\otimes\ket{i_{21},i_{22},i_{23}}\otimes\ket{i_{13},i_{23},{j_{1}}}$
as defined in the Eq. (3). The symbols ${j_{1},j_{2},\cdots,j_{f-1}}$
represent the fusion tree of the outcomes of the anyons ${i_{q3}}$, as shown
in Fig. 1, where $q=1,2,\cdots,f$, and $f$ is the number of qudits, or the
number of anyon groups present in the state $\ket{\psi}$. Also, $i_{q3}$
refers to the overall fusion outcome of the $q$-th anyon group.

The matrix representation of a braid generator $\sigma_{n}$ is established by
its constituent components, which are the likelihood amplitudes of converting
any fusion eigenstate $\ket{i}$ to another fusion eigenstate $\ket{j}$ within
a specified basis by applying the specified operation. This is expressed as
follows:

$\displaystyle\left[\sigma_{n}\right]_{ji}$
$\displaystyle=\bra{j}\sigma_{n}\ket{i}.$ (9)

Ultimately, applying $\sigma_{n}$ to a specific fusion eigenstate falls into
two cases. In the first case, $\sigma_{n}$ interchanges two adjacent anyons
within the same qudit group. The amplitude for this process can be calculated
using the standard braiding matrix $B$ [23, 26]. In the second case,
$\sigma_{n}$ exchanges two adjacent anyons belonging to different qudit
groups. For this scenario, we introduce a mixing matrix $M$. The detailed
calculations for each case will be demonstrated in the following subsections.

###  III.1 The braiding matrix $B$

Consider the case of interchanging two adjacent anyons within the same qudit
set i.e the braid generaotr index $n$ is not a multiple of $4$. Hence, the
braiding operation is only applied to the $q$-th qudit, where $q=n|4+1$ and
$n|4$ is the resulting quotient obtained from dividing $n$ by $4$.
Consequently, applying $\sigma_{n}$ to the state $\ket{\psi}$ is equivalent to
implementing $\sigma_{(n\text{ mod }4)}$ on the state of the $q$-th anyon
group, where $n\text{ mod }4$ is the residue obtained from the Euclidean
division of $n$ by $4$. Let us say that $q=2$. Then,

$\displaystyle\sigma_{n}\ket{\psi}=$
$\displaystyle\left(\left(\ket{i_{11},i_{12},i_{13}}\otimes\sigma_{(n\text{
mod
}4)}\ket{i_{21},i_{22},i_{23}}\right)_{j_{1}}\otimes\ket{i_{31},i_{32},i_{33}}\right)_{j_{2}}.$
(10)

In the case where $n$ satisfies the congruence $n=1\pmod{4}$, the $R$ matrix
definition can be used to determine the action of the braiding operator
$\sigma_{1}$ on a basis state of four anyons, denoted as $\ket{i,j,k}$.
Specifically, the action of $\sigma_{1}$ on $\ket{i,j,k}$ can be expressed
using the tensorial form (3) and the definition of the $R$ matrix given in Eq.
(6) as

$\displaystyle\sigma_{1}\ket{i,j,k}=$
$\displaystyle\sigma_{1}\ket{(((a,b)_{i},c)_{j},d)_{k}},$ $\displaystyle=$
$\displaystyle R_{ab}^{i}\ket{i,j,k}.$ (11)

Therefore, the diagonal elements of the matrix $[\sigma_{1}]$ are equal to
$R^{i}_{ab}$.

When $n$ satisfies the congruence $n=2\pmod{4}$, the action of $\sigma_{2}$ on
a four-anyon basis state $\ket{i,j,k}$ can be determined using the $F$ and $R$
transformations. Specifically, the action of $\sigma_{2}$ on $\ket{i,j,k}$ can
be expressed as

$\displaystyle\sigma_{2}\ket{i,j,k}=$
$\displaystyle\sigma_{2}\ket{(((a,b)_{i},c)_{j},d)_{k}},$ $\displaystyle=$
$\displaystyle\sum_{ml}(F_{abc}^{j})_{l}^{i}R_{bc}^{l}(F_{acb}^{\dagger
j})_{m}^{l}\ket{(((a,c)_{m},b)_{j},d)_{k}},$ (12)

which involves a linear product of matrices. Since the $R$ matrix is diagonal,
Eq. (III.1) can be written in term of the braiding matrix elements as:

$\displaystyle\sigma_{2}\ket{(((a,b)_{i},c)_{j},d)_{k}}=\sum_{m}\left(B^{j}_{abc}\right)_{m}^{i}\ket{(((a,c)_{m},b)_{j},d)_{k}},$
(13)

where

$\displaystyle\left(B^{j}_{abc}\right)_{m}^{i}=\sum_{l}(F_{abc}^{j})_{l}^{i}R_{bc}^{l}(F_{acb}^{\dagger
j})_{m}^{l}\ ,$ (14)

with the braiding matrix $B_{abc}^{j}$ being defined as
$B^{j}_{abc}=F_{abc}^{j}R_{bc}F_{acb}^{\dagger j}$. Note that in contrast to
$\sigma_{1}$, which is limited to phase operations and cannot perform
superpositions, the braiding operator $\sigma_{2}$ can mix between the fusion
eigenstates and execute the desired superposition operations in the chosen
fusion basis.

In the case where $n=3\pmod{4}$, the braiding operator $\sigma_{3}$ can be
obtained by applying the operator $\sigma_{2}$ to the state
$\ket{((i,c)_{j},d)_{k}}$. This means that, based on the expression in Eq.
(13), we have:

$\displaystyle\sigma_{3}\ket{i,j,k}$
$\displaystyle=\sum_{m}\left(B^{k}_{icd}\right)_{m}^{j}\ket{(((a,b)_{i},d)_{m},c)_{k}}.$
(15)

In general, the braiding matrix $B_{abc}^{i}$ computes all possible braiding
operations between two adjacent anyons within the same qudit group, even if
the number of anyons per qudit is greater than four. Furthermore, $\sigma_{1}$
can be represented as $B_{\textbf{0}ab}^{a}$. Namely,

$\displaystyle\sigma_{n}\ket{((\cdot\cdot((a_{1},a_{2})_{i_{1}},a_{3})_{i_{2}},\cdot\cdot
a_{f})_{i_{f-1}},a_{f+1})_{i_{f}}}=$
$\displaystyle\sum_{m}\left(B^{i_{n}}_{i_{n-2}a_{n}a_{n+1}}\right)_{m}^{i_{n-1}}$
$\displaystyle\ket{((\cdots((a_{1},a_{2})_{i_{1}},a_{3})_{i_{2}},\cdots{a_{n-1})_{i_{n-2}},{a_{n+1})}_{m},a_{n})_{i_{n}},}\cdots
a_{f+1})_{i_{f}}}.$ (16)

###  III.2 The mixing matrix $M$

In the second case, we assume that $n$ is a multiple of four ($n=4m$). In this
scenario, the operator $\sigma_{n}$ acts on the joint state of the $m$-th and
$(m+1)$-th neighboring groups by exchanging the adjacent edge anyons. To apply
this operator, one may first use an $F$ transformation to decouple the joint
state of the two groups. For simplicity, let us illustrate the steps for $m=2$
in which case the braiding operator writes:

$\displaystyle\sigma_{n}\ket{\psi}=$ $\displaystyle\sigma_{4\times
2}\left(\left(\ket{i_{11},i_{12},i_{13}}\otimes\ket{i_{21},i_{22},i_{23}}\right)_{j_{1}}\otimes\ket{i_{31},i_{32},i_{33}}\right)_{j_{2}},$
(17) $\displaystyle=$
$\displaystyle\sum_{k}\left(F_{j_{0}i_{23}i_{33}}^{j_{2}}\right)^{j_{1}}_{k}\left(\ket{i_{11},i_{12},i_{13}}\otimes\sigma_{4}\left(\ket{i_{21},i_{22},i_{23}}\otimes\ket{i_{31},i_{32},i_{33}}\right)_{k}\right)_{j_{2}}.$
(18)

Notice that in the above relation $j_{0}=i_{13}$ and in general $j_{n}$
represents the vacuum charge for all $n<0$. In doing so, the scenario has
shifted to the application of the braiding operation on a shared state of two
neighboring qudits. By repeatedly performing $F$ moves, the resulting sequence
of transformations on the joint state of these two qudits will be as follows:

$\displaystyle\sigma_{4}\left(\ket{i_{21},i_{22},i_{23}}\otimes\ket{i_{31},i_{32},i_{33}}\right)_{k}=$
$\displaystyle\sigma_{4}\ket{((((a,a)_{i_{21}},a)_{i_{22}},a)_{i_{23}},(((a,a)_{i_{31}},a)_{i_{32}},a)_{i_{33}})_{k}},$
(19) $\displaystyle=$
$\displaystyle\sigma_{4}\sum_{p_{3}p_{2}p_{1}}\left(F_{i_{23}i_{32}a}^{\dagger
k}\right)^{i_{33}}_{p_{3}}\left(F_{i_{23}i_{31}a}^{\dagger
p_{3}}\right)^{i_{32}}_{p_{2}}\left(F_{i_{23}aa}^{\dagger
p_{2}}\right)^{i_{31}}_{p_{1}}$
$\displaystyle\times\ket{(((((((a,a)_{i_{21}},a)_{i_{22}},a)_{i_{23}},a)_{p_{1}},a)_{p_{2}},a)_{p_{3}},a)_{k}}.$
(20)

Upon application of the braiding matrix $B$ as defined in Eq. (14) to the
state $\ket{(i_{m2},a,a)_{p_{1}}}$, an immediate outcome can be obtained,
which is as follows:

$\displaystyle\sigma_{4}\left(\ket{i_{21},i_{22},i_{23}}\otimes\ket{i_{31},i_{32},i_{33}}\right)_{k}=$
$\displaystyle\sum_{p_{3}p_{2}p_{1}}\left(F_{i_{23}i_{32}a}^{\dagger
k}\right)^{i_{33}}_{p_{3}}\left(F_{i_{23}i_{31}a}^{\dagger
p_{3}}\right)^{i_{32}}_{p_{2}}\left(F_{i_{23}aa}^{\dagger
p_{2}}\right)^{i_{31}}_{p_{1}}\sum_{i^{\prime}_{23}}\left(B_{i_{22}aa}^{p_{1}}\right)^{i_{23}}_{i^{\prime}_{23}}$
$\displaystyle\times\ket{(((((((a,a)_{i_{21}},a)_{i_{22}},a)_{i^{\prime}_{23}},a)_{p_{1}},a)_{p_{2}},a)_{p_{3}},a)_{k}}.$
(21)

The subsequent step involves the conversion of the state back into its
original basis form, which can be achieved by employing the suitable $F$
transformations and the braiding matrix $B$, as follows:

$\displaystyle\sigma_{4}\left(\ket{i_{21},i_{22},i_{23}}\otimes\ket{i_{31},i_{32},i_{33}}\right)_{k}=$
$\displaystyle\sum_{i^{\prime}_{23}i^{\prime}_{31}i^{\prime}_{32}i^{\prime}_{33}}\left(L^{k}_{i_{22}i_{23}i_{31}i_{32}i_{33}}\right)_{i^{\prime}_{23}i^{\prime}_{31}i^{\prime}_{32}i^{\prime}_{33}}$
$\displaystyle\times\ket{((((a,a)_{i_{21}},a)_{i_{22}},a)_{i^{\prime}_{23}},(((a,a)_{i^{\prime}_{31}}),a)_{i^{\prime}_{32}},a)_{i^{\prime}_{33}})_{k}},$
(22)

where the resulting transformation is represented by a new braiding matrix
$L$, which represents the effect of braiding two edge anyons in a joint state
of neighboring qudits. The $L$ matrix is defined as follows:

$\displaystyle\left(L^{k}_{i_{22}i_{23}i_{31}i_{32}i_{33}}\right)_{i^{\prime}_{23}i^{\prime}_{31}i^{\prime}_{32}i^{\prime}_{33}}=\sum_{p_{3}p_{2}p_{1}}\left(F_{i_{23}i_{32}a}^{\dagger
k}\right)^{i_{33}}_{p_{3}}\left(F_{i_{23}i_{31}a}^{\dagger
p_{3}}\right)^{i_{32}}_{p_{2}}\left(F_{i_{23}aa}^{\dagger
p_{2}}\right)^{i_{31}}_{p_{1}}\left(B_{i_{22}aa}^{p_{1}}\right)^{i_{23}}_{i^{\prime}_{23}}\left(F_{i^{\prime}_{23}aa}^{p_{2}}\right)_{i^{\prime}_{31}}^{p_{1}}\left(F_{i^{\prime}_{23}i^{\prime}_{31}a}^{p_{3}}\right)_{i^{\prime}_{32}}^{p_{2}}\left(F_{i^{\prime}_{23}i^{\prime}_{32}a}^{k}\right)_{i^{\prime}_{33}}^{p_{2}}.$
(23)

After performing computations on the joint state of the two qudits, it is
necessary to transform the resulting state back to the original form specified
by Eq. (17) using the inverse $F$ transformations. Additionally, it is
necessary to introduce another braiding matrix, denoted by $M$ the mixing
matrix, that accounts for all feasible fusion states achieved by exchanging
anyons shared by adjacent qudit groups. This is demonstrated in the ensuing
equation:

$\displaystyle\sigma_{4\times 2}\ket{\psi}=$
$\displaystyle\sum_{j^{\prime}_{1}i^{\prime}_{23}i^{\prime}_{31}i^{\prime}_{32}i^{\prime}_{33}}\left(M^{j_{0}j_{1}j_{2}}_{i_{22}i_{23}i_{31}i_{32}i_{33}}\right)_{j^{\prime}_{1}i^{\prime}_{23}i^{\prime}_{31}i^{\prime}_{32}i^{\prime}_{33}}\left(\left(\ket{i_{11},i_{12},i_{13}}\otimes\ket{i_{21},i_{22},{i^{\prime}}_{23}}\right)_{{j^{\prime}}_{1}}\otimes\ket{{i^{\prime}}_{31},{i^{\prime}}_{32},{i^{\prime}}_{33}}\right)_{j_{2}}.$
(24)

The components of the introduced matrix $M$ are defined by a specific linear
combination of the components of $L$ as follows:

$\displaystyle\left(M^{j_{0}j_{1}j_{2}}_{i_{22}i_{23}i_{31}i_{32}i_{33}}\right)_{j^{\prime}_{1}i^{\prime}_{23}i^{\prime}_{31}i^{\prime}_{32}i^{\prime}_{33}}=\sum_{k}\left(F_{j_{0}i_{23}i_{33}}^{j_{2}}\right)^{j_{1}}_{k}\left(L^{k}_{i_{22}i_{23}i_{31}i_{32}i_{33}}\right)_{i^{\prime}_{23}i^{\prime}_{31}i^{\prime}_{32}i^{\prime}_{33}}\left(F_{j_{0}i^{\prime}_{23}i^{\prime}_{33}}^{\dagger
j_{2}}\right)_{j^{\prime}_{1}}^{k}.$ (25)

In summary, by computing the $B$, $L$, and $M$ matrices from the $F$ and $R$
matrices, we can determine the effect of any braiding operator acting on a
state of multiple groups of anyons, where each group represents a qudit. In
other words, the calculation of the right-hand side of Eq. (9) has become
straightforward for any number of qubits due to the availability of the
aforementioned transformations. The general formula for the $L$ and $M$
matrices, along with their application to a fusion state involving an
arbitrary number of anyons per qudit and arbitrary size, are provided in the
supplementary material.

In order to ensure the reliability of our method, it is crucial to meet
rigorous testing conditions that guarantee the accuracy of the formulas and
their programmatic implementation. To achieve this, we will refer to the
algebra of the braid group known as Artin relations, which serves as a
foundation for our approach [59]:

$\begin{array}[]{rcll}\sigma_{i}\sigma_{i+1}\sigma_{i}&=&\sigma_{i+1}\sigma_{i}\sigma_{i+1}\
,&\\\ \sigma_{i}\sigma_{j}&=&\sigma_{j}\sigma_{i}\ ,&\left|i-j\right|>1,\\\
\sigma_{i}\sigma_{i}^{-1}&=&I.&\end{array}$ (26)

To verify Artin relations numerically, we should ensure that the distance
between the left and right sides of the relations is negligible, meaning it is
in the order of the floating-point precision of the specific device and
programming language being used. Additionally, it is necessary to substitute
the third relation with the unitarity condition since our focus is on quantum
computing applications [57]. In order to calculate the difference between two
unitaries, we employ the spectral distance, which will be defined in the
upcoming section. We have performed numerical verification to validate the
formulas presented in this section using Artin algebra for up to 24 anyons
within the Fibonacci and Ising anyon models. The tests reveal a difference in
the order of 1e-15 between the left and right sides of the relations. In
addition, it is convenient to reproduce quantum gates previously compiled
using well-known anyon models, such as Fibonacci or Ising models. This will be
the main goal of the next section.

##  IV Implementation of topological CNOT gate

In this section, our primary objective is to replicate the braid compilation
of the CNOT gate, which was initially introduced by Bonesteel et al.,
utilizing the injection method [31]. We have specifically selected this gate
as it allows for a rigorous demonstration of the composition of six anyons for
two-qubit controlled gates into three anyon braiding operations.

Index |  | Logical State |  | Fusion State
---|---|---|---|---
$0$ |  | $\ket{2}$ |  | $\ket{((\textbf{1},\textbf{1})_{\textbf{1}},\textbf{1})_{\textbf{0}}}$
$1$ |  | $\ket{0}$ |  | $\ket{((\textbf{1},\textbf{1})_{\textbf{0}},\textbf{1})_{\textbf{1}}}$
$2$ |  | $\ket{1}$ |  | $\ket{((\textbf{1},\textbf{1})_{\textbf{1}},\textbf{1})_{\textbf{1}}}$
Table 1: There are exclusively three allowed fusion states for three Fibonacci
anyons. We can assign a logical state to each one of them. Howver, the states
$\ket{0}$ and $\ket{1}$ are linearily independent of $\ket{2}$ since their
sector i.e. global fusion outcome are different. Consequently, in the sector
1, we can represent qubit exactly without extra dimensions. However, the
Hilbert space of three Fibonacci anyons in the sector 0 is trivial and cannot
represent a qubit.

#### The anyon model.

In that study, the CNOT quantum gate is designed using six Fibonacci anyons
with three anyons per qubit. The Fibonacci model includes one anyonic charge
labeled as 1 and the vacuum 0, and the non-trivial fusion rule of these anyons
is $\textbf{1}\times\textbf{1}=\textbf{0}+\textbf{1}$ [63]. Hence, given three
anyons, the possible fusion states are as shown in Tab. 1. Note that the
logical states $\ket{0}$ and $\ket{1}$ are naturally independent of $\ket{2}$
due to their different global fusion outcomes. Taking into consideration that
a single qubit can be effectively represented by three Fibonacci anyons,
resulting in a collective outcome of 1, it follows that the state $\ket{2}$ is
non-computational. Considering six anyons, the fusion basis can be ordered as
shown in Tab. 2. Similarly, we have two separate sectors in the fusion space,
which are differentiated by their global fusion outcomes. Consequently, we can
choose one of two possible computational bases:
$\left\\{\ket{00}_{\textbf{0}}\ket{10}_{\textbf{0}}\ket{01}_{\textbf{0}}\ket{11}_{\textbf{0}}\right\\}$
or
$\left\\{\ket{00}_{\textbf{1}}\ket{10}_{\textbf{1}}\ket{01}_{\textbf{1}}\ket{11}_{\textbf{1}}\right\\}$,
while all other states that include one of the qubits in state $\ket{2}$ are
considered non-computational.

Index |  | Logical State |  | Fusion State
---|---|---|---|---
$0$ |  | $\ket{22}_{\textbf{0}}$ |  | $\ket{(((\textbf{1},\textbf{1})_{\textbf{1}},\textbf{1})_{\textbf{0}},((\textbf{1},\textbf{1})_{\textbf{1}},\textbf{1})_{\textbf{0}})_{\textbf{0}}}$
$1$ |  | $\ket{00}_{\textbf{0}}$ |  | $\ket{(((\textbf{1},\textbf{1})_{\textbf{0}},\textbf{1})_{\textbf{1}},((\textbf{1},\textbf{1})_{\textbf{0}},\textbf{1})_{\textbf{1}})_{\textbf{0}}}$
$2$ |  | $\ket{10}_{\textbf{0}}$ |  | $\ket{(((\textbf{1},\textbf{1})_{\textbf{1}},\textbf{1})_{\textbf{1}},((\textbf{1},\textbf{1})_{\textbf{0}},\textbf{1})_{\textbf{1}})_{\textbf{0}}}$
$3$ |  | $\ket{01}_{\textbf{0}}$ |  | $\ket{(((\textbf{1},\textbf{1})_{\textbf{0}},\textbf{1})_{\textbf{1}},((\textbf{1},\textbf{1})_{\textbf{1}},\textbf{1})_{\textbf{1}})_{\textbf{0}}}$
$4$ |  | $\ket{11}_{\textbf{0}}$ |  | $\ket{(((\textbf{1},\textbf{1})_{\textbf{1}},\textbf{1})_{\textbf{1}},((\textbf{1},\textbf{1})_{\textbf{1}},\textbf{1})_{\textbf{1}})_{\textbf{0}}}$
$5$ |  | $\ket{02}_{\textbf{1}}$ |  | $\ket{(((\textbf{1},\textbf{1})_{\textbf{0}},\textbf{1})_{\textbf{1}},((\textbf{1},\textbf{1})_{\textbf{1}},\textbf{1})_{\textbf{0}})_{\textbf{1}}}$
$6$ |  | $\ket{12}_{\textbf{1}}$ |  | $\ket{(((\textbf{1},\textbf{1})_{\textbf{1}},\textbf{1})_{\textbf{1}},((\textbf{1},\textbf{1})_{\textbf{1}},\textbf{1})_{\textbf{0}})_{\textbf{1}}}$
$7$ |  | $\ket{20}_{\textbf{1}}$ |  | $\ket{(((\textbf{1},\textbf{1})_{\textbf{1}},\textbf{1})_{\textbf{0}},((\textbf{1},\textbf{1})_{\textbf{0}},\textbf{1})_{\textbf{1}})_{\textbf{1}}}$
$8$ |  | $\ket{21}_{\textbf{1}}$ |  | $\ket{(((\textbf{1},\textbf{1})_{\textbf{1}},\textbf{1})_{\textbf{0}},((\textbf{1},\textbf{1})_{\textbf{1}},\textbf{1})_{\textbf{1}})_{\textbf{1}}}$
$9$ |  | $\ket{00}_{\textbf{1}}$ |  | $\ket{(((\textbf{1},\textbf{1})_{\textbf{0}},\textbf{1})_{\textbf{1}},((\textbf{1},\textbf{1})_{\textbf{0}},\textbf{1})_{\textbf{1}})_{\textbf{1}}}$
$10$ |  | $\ket{10}_{\textbf{1}}$ |  | $\ket{(((\textbf{1},\textbf{1})_{\textbf{1}},\textbf{1})_{\textbf{1}},((\textbf{1},\textbf{1})_{\textbf{0}},\textbf{1})_{\textbf{1}})_{\textbf{1}}}$
$11$ |  | $\ket{01}_{\textbf{1}}$ |  | $\ket{(((\textbf{1},\textbf{1})_{\textbf{0}},\textbf{1})_{\textbf{1}},((\textbf{1},\textbf{1})_{\textbf{1}},\textbf{1})_{\textbf{1}})_{\textbf{1}}}$
$12$ |  | $\ket{11}_{\textbf{1}}$ |  | $\ket{(((\textbf{1},\textbf{1})_{\textbf{1}},\textbf{1})_{\textbf{1}},((\textbf{1},\textbf{1})_{\textbf{1}},\textbf{1})_{\textbf{1}})_{\textbf{1}}}$
Table 2: The fusion states presented in this table represent the exclusive
possible states with six Fibonacci anyons. Logical states can be assigned to
each fusion state, considering the sector of these states, i.e., the overall
outcome. It is observed that a computational space of four states, namely
$\left\\{\ket{00}_{\textbf{0}}\ket{10}_{\textbf{0}}\ket{01}_{\textbf{0}}\ket{11}_{\textbf{0}}\right\\}$
or
$\left\\{\ket{00}_{\textbf{1}}\ket{10}_{\textbf{1}}\ket{01}_{\textbf{1}}\ket{11}_{\textbf{1}}\right\\}$
in the 0 and 1 sectors respectively, can represent two qubits. An index is
assigned to each state to facilitate the indexing of braid matrices.

$\sigma_{1}$

$\sigma_{2}$

$\sigma_{3}$

$\sigma_{4}$

$\sigma_{5}$

$\sigma_{1}^{-1}$

$\sigma_{2}^{-1}$

$\sigma_{3}^{-1}$

$\sigma_{4}^{-1}$

$\sigma_{5}^{-1}$

Figure 2: Matrix representations of the braid generators for a system of two
qubits composed of six Fibonacci anyons, organized with a grouping of three
anyons per qubit. Given six anyons, we should obtain five possible braid
generators along with their inverses. The clockwise braid generators (up raw),
along with their respective inverses (bottom raw), are depicted using the
color map scale in Fig. 3(d). To ensure their correctness, Artin braid group
relations have been verified. The ordering of the fusion states in this figure
follows the same convention as the one presented in Tab. 2.

(a)

(b)

(c)

(d)

Figure 3: (a) Matrix representation of the CNOT gate based on the braid
sequence approximated by Bonesteel et al. The braid operators composing the
sequence were generated using our systematic method applied on the fusion
basis state of two qubits composed of three anyons each. The states are
labeled in the same manner as shown in Eq. (1). (b), (c) Submatrices
corresponding to the application of the approximated CNOT braid sequence on
the computational space corresponding to sector 0 and sector 1, respectively.
The indices correspond to the computational states as illustrated in Tab. 2.
(d) Color map.

#### Computation of braid operators.

Since the $F$ and $R$ matrices are known for the Fibonacci model [63], it is
possible to obtain the braid generators that operate on the above fusion basis
states using the systematic method explained in the previous section. The
explicit matrix representations of the braid generators are shown in Fig. 2.
Note that the braid operations $\sigma_{1}$ and $\sigma_{2}$ apply to the
first qubit, while $\sigma_{4}$ and $\sigma_{5}$ act on the state of the
second qubit. Furthermore, the braid operator $\sigma_{3}$ is responsible for
the interaction between the two qubits. However, this interaction comes at a
cost, as $\sigma_{3}$ mixes computational states with non-computational
states, inducing information leakage [62]. For the sake of performance, it is
worth noting that the computation of such braid generators can be carried out
the two possible sectors.

#### Implementation of topological CNOT gate.

At this stage, we have attained the capability to simulate the unitary
evolution of such anyonic system after a given braid sequence. As an
illustrative instance, we opt for a braid sequence that approximates the CNOT
gate implemented with 280 successive braiding operations using an injection
method [31], allowing us to verify our approach. Computing the matrix
representation of the given braid sequence results in a $13\times 13$ matrix
that includes the two possible computational sectors, as explained earlier. We
obtain a braid-based Controlled-NOT operation, where the second qubit controls
the application of the NOT gate on the first qubit, as shown in Fig. 3. The
accuracy and leakage of this approximation with respect to the conventional
CNOT quantum gate [4] can be measured directly from the matrix representation.
The spectral distance
$\mathcal{D}(U_{1},U_{2})=\sqrt{\text{maxEigenvalue}(AA^{\dagger})}$ is used
to measure accuracy, where $A$ is the difference between the unitaries $U_{1}$
and $U_{2}$ after eliminating the global phases [31]. Furthermore, leakage is
measured by the quantity $1-\sqrt{\text{minEigenvalue}(UU^{\dagger})}$, where
the second term is the minimum factor by which the matrix $U$ can change the
norm of a quantum state [26]. The accuracy of the topological CNOT gate as
approximated in sector 0 and sector 1 is 1.73e-3 and 1.24e-3, respectively,
with an estimated leakage of 1.17e-06 and 2.54e-06, respectively. The
preceding example reveals that the systematic method we present in this study
yields a commensurate level of accuracy as the original work [31].

##  V Conclusion

Quantum information can be encoded, manipulated, and protected in a
topologically robust manner, by performing braiding operations. In this paper,
we presented a systematic approach for generating braid operators in any qubit
or qudit-based quantum computation that incorporates anyons. Our approach can
be applied to any specified anyon model, providing a structured framework for
producing the necessary braid generators. This systematic method enables
effective implementation and analysis of quantum computations with qubits or
qudits involving anyons. The significance of our study lies in its relevance
to the compilation of quantum circuits on topological systems that utilize
anyonic states [63]. While our focus is primarily on sparse encoding in qubit-
based circuit models, applying a similar approach to different encoding
schemes has the potential to yield a general formula for braid matrices, which
would be highly valuable. The formalism introduced in this work ensures a
systematic method for computing braid generators with the assistance of
computational units. However, it is important to note that this method does
not guarantee a reduction in computational complexity since the size of the
braid generator grows exponentially with the number of anyons, in the order of
$O(d_{a}^{2n})$, where $d_{a}$ represents the quantum dimension of the anyon
$a$, and $n$ is the number of anyons. In order to enhance performance, the
method can be parallelized. Additionally, the majority of braid generators can
be stored as sparse matrices, as only the braid operations between different
qubits have a significant number of non-zero components. Moreover, we validate
the introduced formalism through numerical verification using algebraic braid
relations. Furthermore, our study demonstrates the successful reproduction of
a previously established topological CNOT gate compiled with braiding
Fibonacci anyons. The matrix representation and accuracy of our method align
consistently with the original work [31]. The method described in this paper
has been successfully implemented for the Fibonacci anyon model in an open-
source numerical library named TQSim, developed by the authors of this paper
[37]. Importantly, our method can be systematically extended to encompass all
$SU(2)_{k}$ anyon models and other significant ones by determining the $F$ and
$R$ matrices through the solution of consistency equations. In conclusion, the
simulation of topological quantum computation using this method proves highly
valuable for testing quantum gate compilation and developing topologically
protected quantum circuits.

## Acknowledgments

This document has been produced with the financial assistance of the European
Union (Grant no. DCI-PANAF/2020/420-028), through the African Research
Initiative for Scientific Excellence (ARISE), pilot programme. ARISE is
implemented by the African Academy of Sciences with support from the European
Commission and the African Union Commission. We are grateful to the Algerian
Ministry of Higher Education and Scientific Research and DGRST for the
financial support.

## References

  * [1] Y. Manin.  _Computable and uncomputable_.  Sovetskoye Radio, Moscow, 128, 1980.
  * [2] P. Benioff.  _The computer as a physical system: A microscopic quantum mechanical hamiltonian model of computers as represented by turing machines_.  Journal of Statistical Physics, 22(5):563–591, May 1980.  doi:10.1007/BF01011339.
  * [3] R. P. Feynman.  _Simulating physics with computers_.  International Journal of Theoretical Physics, 21(6):467–488, June 1982\.  doi:10.1007/BF02650179.
  * [4] M. A. Nielsen et al.  _Quantum Computation and Quantum Information: 10th Anniversary Edition_.  Cambridge University Press, 2010.  doi:10.1017/CBO9780511976667.
  * [5] F. Arute et al.  _Quantum supremacy using a programmable superconducting processor_.  Nature, 574(7779):505–510, October 2019.  doi:10.1038/s41586-019-1666-5.
  * [6] M. Schlosshauer.  _Decoherence, the measurement problem, and interpretations of quantum mechanics_.  Rev. Mod. Phys., 76:1267–1305, February 2005.  doi:10.1103/RevModPhys.76.1267.
  * [7] K. Khodjasteh et al.  _Fault-tolerant quantum dynamical decoupling_.  Phys. Rev. Lett., 95:180501, October 2005.  doi:10.1103/PhysRevLett.95.180501.
  * [8] A. Morello, et al.  _Pairwise decoherence in coupled spin qubit networks_.  Phys. Rev. Lett., 97:207206, November 2006.  doi:10.1103/PhysRevLett.97.207206.
  * [9] F. A. Zwanenburg, et al.  _Silicon quantum electronics_.  Rev. Mod. Phys., 85:961–1019, July 2013.  doi:10.1103/RevModPhys.85.961.
  * [10] Z. Cai, et al.  _Quantum error mitigation_ , 2022.  doi:10.48550/arXiv.2210.00921.
  * [11] D. Aharonov et al.  _Fault-tolerant quantum computation with constant error rate_.  SIAM Journal on Computing, 38(4):1207–1282, 2008.  doi:10.1137/S0097539799359385.
  * [12] X. Chen, et al.  _Symmetry protected topological orders and the group cohomology of their symmetry group_.  Phys. Rev. B, 87:155114, April 2013.  doi:10.1103/PhysRevB.87.155114.
  * [13] A. Mesaros et al.  _Classification of symmetry enriched topological phases with exactly solvable models_.  Phys. Rev. B, 87:155115, April 2013.  doi:10.1103/PhysRevB.87.155115.
  * [14] N. Goldman, et al.  _Topological quantum matter with ultracold gases in optical lattices_.  Nature Physics, 12(7):639–645, June 2016.  doi:10.1038/nphys3803.
  * [15] F. D. M. Haldane.  _Nobel lecture: Topological quantum matter_.  Rev. Mod. Phys., 89:040502, October 2017.  doi:10.1103/RevModPhys.89.040502.
  * [16] X.-G. Wen.  _Colloquium: Zoo of quantum-topological phases of matter_.  Rev. Mod. Phys., 89:041004, December 2017.  doi:10.1103/RevModPhys.89.041004.
  * [17] D.-W. Zhang, et al.  _Topological quantum matter with cold atoms_.  Advances in Physics, 67(4):253–402, March 2018.  doi:10.1080/00018732.2019.1594094.
  * [18] H. Tasaki.  _Topological phase transition and $\mathbb{Z}_{2}$ index for $s=1$ quantum spin chains_.  Phys. Rev. Lett., 121:140604, October 2018.  doi:10.1103/PhysRevLett.121.140604.
  * [19] X. C. B. Zeng, et al.  _Quantum Information Meets Quantum Matter: From Quantum Entanglement to Topological Phase in Many-Body Systems_.  Springer, New York, NY, 2019.  doi:10.1007/978-1-4939-9084-9.
  * [20] E. Dennis, et al.  _Topological quantum memory_.  Journal of Mathematical Physics, 43(9):4452–4505, August 2002.  doi:10.1063/1.1499754.
  * [21] A. Kitaev.  _Fault-tolerant quantum computation by anyons_.  Annals of Physics, 303(1):2 – 30, January 2003.  doi:10.1016/S0003-4916(02)00018-0.
  * [22] M. H. Freedman, et al.  _Topological quantum computation_.  Bull. Amer. Math. Soc., 40:31–38, 2003.  doi:10.1090/S0273-0979-02-00964-3.
  * [23] J. K. Pachos.  _Introduction to Topological Quantum Computation_.  Cambridge University Press, 2012.  doi:10.1017/CBO9780511792908.
  * [24] V. Lahtinen et al.  _A Short Introduction to Topological Quantum Computation_.  SciPost Phys., 3:021, September 2017.  doi:10.21468/SciPostPhys.3.3.021.
  * [25] T. D. Stanescu.  _Introduction to Topological Quantum Matter & Quantum Computation_.  Boca Raton: CRC Press, 2017.  doi:10.1201/9781315181509.
  * [26] B. Field et al.  _Introduction to topological quantum computation with non-abelian anyons_.  Quantum Science and Technology, 3(4):045004, July 2018.  doi:10.1088/2058-9565/aacad2.
  * [27] F. Wilczek.  _Quantum mechanics of fractional-spin particles_.  Phys. Rev. Lett., 49:957–959, October 1982.  doi:10.1103/PhysRevLett.49.957.
  * [28] A. Khare.  _Fractional Statistics and Quantum Theory_.  World Scientific, 2nd edition, 2005.  doi:10.1142/5752.
  * [29] A. Lerda.  _Anyons, Quantum Mechanics of Particles with Fractional Statistics_.  Springer-Verlag Berlin Heidelberg, 1992.  doi:10.1007/978-3-540-47466-1.
  * [30] L. H. Kauffman et al.  _Braiding operators are universal quantum gates_.  New Journal of Physics, 6:134–134, October 2004.  doi:10.1088/1367-2630/6/1/134.
  * [31] N. E. Bonesteel, et al.  _Braid topologies for quantum computation_.  Phys. Rev. Lett., 95:140503, September 2005.  doi:10.1103/PhysRevLett.95.140503.
  * [32] G. P. Collins.  _Computing with quantum knots_.  Scientific American, 294(4):56–63, April 2006.  ISSN 00368733, 19467087.  http://www.jstor.org/stable/26061414.
  * [33] S. D. Sarma, et al.  _Majorana zero modes and topological quantum computation_.  npj Quantum Information, 1(1):15001, October 2015.  doi:10.1038/npjqi.2015.1.
  * [34] R. König.  _Composite anyon coding and the initialization of a topological quantum computer_.  Phys. Rev. A, 81:052309, May 2010.  doi:10.1103/PhysRevA.81.052309.
  * [35] P. Bonderson, et al.  _Measurement-only topological quantum computation via anyonic interferometry_.  Annals of Physics, 324(4):787–826, April 2009.  ISSN 0003-4916.  doi:10.1016/j.aop.2008.09.009.
  * [36] P. H. Bonderson.  _Non-Abelian Anyons and Interferometry_.  Ph.D. thesis, California Institute of Technology, 2007.
  * [37] A. Tounsi, et al.  _TQSim, a topological quantum computing simulator based on anyon models_ , 2022.  {https://github.com/Constantine-Quantum-Tech/tqsim}.
  * [38] J. Leinaas et al.  _On the theory of identical particles_.  Il Nuovo Cimento, 37B(1), 1977.
  * [39] S. M. Bhattacharjee, et al., editors.  _Topology and Condensed Matter Physics_.  Springer Singapore, 2017.  doi:10.1007/978-981-10-6841-6.
  * [40] L. Hormozi, et al.  _Topological quantum compiling_.  Phys. Rev. B, 75:165310, April 2007.  doi:10.1103/PhysRevB.75.165310.
  * [41] D. Aharonov, et al.  _A polynomial quantum algorithm for approximating the jones polynomial_.  Algorithmica, 55(3):395–421, Nov 2009.  ISSN 1432-0541.  doi:10.1007/s00453-008-9168-0.
  * [42] G. Kuperberg.  _How hard is it to approximate the jones polynomial?_ Theory of Computing, 11(1):183–219, 2015.  doi:10.4086/toc.2015.v011a006.
  * [43] V. Mourik, et al.  _Signatures of majorana fermions in hybrid superconductor-semiconductor nanowire devices_.  Science, 336(6084):1003–1007, 2012.  doi:10.1126/science.1222360.
  * [44] M. Aghaee, et al.  _Inas-al hybrid devices passing the topological gap protocol_ , 2022\.  doi:10.48550/ARXIV.2207.02472.
  * [45] T. Chakraborty et al.  _The Quantum Hall Effects_.  Springer Berlin Heidelberg, 1995.  doi:10.1007/978-3-642-79319-6.
  * [46] D. Yoshioka.  _The Quantum Hall Effect_.  Springer-Verlag Berlin Heidelberg, 2002.  doi:10.1007/978-3-662-05016-3.
  * [47] S. Bravyi.  _Universal quantum computation with the $\nu=5/2$ fractional quantum hall state_.  Phys. Rev. A, 73:042313, April 2006.  doi:10.1103/PhysRevA.73.042313.
  * [48] A. Stern.  _Anyons and the quantum hall effect—a pedagogical review_.  Annals of Physics, 323(1):204–249, 2008.  ISSN 0003-4916.  doi:10.1016/j.aop.2007.10.008.  January Special Issue 2008.
  * [49] R. L. Willett, et al.  _Magnetic-field-tuned Aharonov-Bohm oscillations and evidence for non-abelian anyons at $\nu$=5/2_.  Phys. Rev. Lett., 111:186401, October 2013.  doi:10.1103/PhysRevLett.111.186401.
  * [50] H. Bartolomei, et al.  _Fractional statistics in anyon collisions_.  Science, 368(6487):173–177, 2020.  doi:10.1126/science.aaz5601.
  * [51] J. Nakamura, et al.  _Direct observation of anyonic braiding statistics_.  Nature Physics, 16(9):931–936, Sep 2020.  ISSN 1745-2481.  doi:10.1038/s41567-020-1019-1.
  * [52] A. Kitaev.  _Anyons in an exactly solved model and beyond_.  Annals of Physics, 321(1):2 – 111, January 2006.  ISSN 0003-4916.  doi:10.1016/j.aop.2005.10.005.  January Special Issue.
  * [53] M. A. Levin et al.  _String-net condensation: A physical mechanism for topological phases_.  Phys. Rev. B, 71:045110, January 2005.  doi:10.1103/PhysRevB.71.045110.
  * [54] Y.-J. Liu, et al.  _Methods for simulating string-net states and anyons on a digital quantum computer_.  PRX Quantum, 3:040315, Nov 2022.  doi:10.1103/PRXQuantum.3.040315.
  * [55] E. Génetay Johansen et al.  _Fibonacci anyons versus majorana fermions: A monte carlo approach to the compilation of braid circuits in $\mathrm{SU}(2{)}_{k}$ anyon models_.  PRX Quantum, 2:010334, Mar 2021.  doi:10.1103/PRXQuantum.2.010334.
  * [56] B. Bakalov et al.  _Lectures on tensor categories and modular functors_.  Amer. Math. Soc. Univ. Lect. Ser., 21, January 2001.
  * [57] C. Delaney, et al.  _Local unitary representations of the braid group and their applications to quantum computing_.  Revista Colombiana de Matemáticas, 50(2):211, January 2017.  doi:10.15446/recolma.v50n2.62211.
  * [58] L. H. Kauffman.  _Knots and Physics_.  WORLD SCIENTIFIC, 3rd edition, 2001.  doi:10.1142/4256.
  * [59] E. Artin.  _Theory of braids_.  The Annals of Mathematics, 48(1):101, January 1947.  doi:10.2307/1969218.
  * [60] Unit-testing involves evaluating each unit of the program separately to identify potential errors that could propagate to other parts of the program at an early stage [64].
  * [61] H. Xu et al.  _Unified approach to topological quantum computation with anyons: From qubit encoding to Toffoli gate_.  Phys. Rev. A, 84:012332, July 2011.  doi:10.1103/PhysRevA.84.012332.
  * [62] R. Ainsworth et al.  _Topological qubit design and leakage_.  New Journal of Physics, 13(6):065030, June 2011.  doi:10.1088/1367-2630/13/6/065030.
  * [63] M. T. Rouabah, et al.  _Compiling single-qubit braiding gate for fibonacci anyons topological quantum computation_.  Journal of Physics: Conference Series, 1766(1):012029, January 2021.  doi:10.1088/1742-6596/1766/1/012029.
  * [64] D. Huizinga et al.  _Automated Defect Prevention_.  Wiley-IEEE Press, September 2007.  doi:10.1002/9780470165171.

## Supplementary Materials

The following formulas represent the mixing matrices $M$ and $L$ defined for a
fusion state of an arbitrary number of qudits with identical $N=q+1$ anyons
per qudit. The $M$ matrix describes the effect of braiding two adjacent anyons
shared between two neighboring qudits $m$ and $m+1$. Moreover, braiding two
adjacent anyons within the same qudit is described by the braid matrix $B$ as
explained in the paper.

$\displaystyle\left(M^{j_{m-2}j_{m-1}j_{m}}_{i_{m(q-1)}i_{mq}i_{(m+1)1}\cdots
i_{(m+1)q}}\right)_{{j^{\prime}}_{m-1}{i^{\prime}}_{mq}i^{\prime}_{(m+1)1}\cdots
i^{\prime}_{(m+1)q}}=$
$\displaystyle\sum_{k}\left(F_{j_{m-2}i_{mq}i_{(m+1)q}}^{j_{m}}\right)^{j_{m-1}}_{k}\left(L^{k}_{i_{m(q-1)}i_{mq}i_{(m+1)1}\cdots
i_{(m+1)q}}\right)_{i^{\prime}_{mq}i^{\prime}_{(m+1)1}\cdots
i^{\prime}_{(m+1)q}}\left(F_{j_{m-2}i^{\prime}_{mq}i^{\prime}_{(m+1)q}}^{\dagger
j_{m}}\right)_{j^{\prime}_{m-1}}^{k}.$ (27)

$\displaystyle\left(L^{k}_{i_{m(q-1)}i_{mq}i_{(m+1)1}\cdots
i_{(m+1)q}}\right)_{i^{\prime}_{mq}i^{\prime}_{(m+1)1}\cdots
i^{\prime}_{(m+1)q}}=\sum_{p_{q}p_{q-1}\cdots
p_{2}p_{1}}\left(F_{i_{mq}i_{(m+1)(q-1)}a}^{\dagger
k}\right)^{i_{(m+1)q}}_{p_{q}}\left(F_{i_{mq}i_{(m+1)(q-2)}a}^{\dagger
p_{q}}\right)^{i_{(m+1)(q-1)}}_{p_{q-1}}\times\cdots$
$\displaystyle\cdots\times\left(F_{i_{mq}i_{(m+1)1}a}^{\dagger
p_{3}}\right)^{i_{(m+1)2}}_{p_{2}}\left(F_{i_{mq}aa}^{\dagger
p_{2}}\right)^{i_{(m+1)1}}_{p_{1}}\left(B_{i_{m(q-1)}aa}^{p_{1}}\right)^{i_{mq}}_{i^{\prime}_{mq}}\left(F_{i^{\prime}_{mq}aa}^{p_{2}}\right)_{i^{\prime}_{(m+1)1}}^{p_{1}}\left(F_{i^{\prime}_{mq}i^{\prime}_{(m+1)1}a}^{p_{3}}\right)_{i^{\prime}_{(m+1)2}}^{p_{2}}\times\cdots$
$\displaystyle\cdots\times\left(F_{i^{\prime}_{mq}i^{\prime}_{(m+1)(q-2)}a}^{p_{q}}\right)_{i^{\prime}_{(m+1)(q-1)}}^{p_{q-1}}\left(F_{i^{\prime}_{mq}i^{\prime}_{(m+1)(q-1)}a}^{k}\right)_{i^{\prime}_{(m+1)q}}^{p_{q}}.$
(28)

Consequently, the general action of the braid operator $\sigma_{n}$ on an
arbitrary fusion state such as $n=mN$ is given as follows:

$\displaystyle\sigma_{mN}(\cdots(\cdots(\cdots\otimes\underbrace{\left|i_{m1},i_{m2},\cdots
i_{mq}\right\rangle}_{m\text{-th
qudit}})_{j_{m-1}}\otimes\underbrace{\ket{i_{(m+1)1},i_{(m+1)2},\cdots
i_{(m+1)q}}}_{(m+1)\text{-th qudit}})_{j_{m}}\otimes\cdots)_{j_{f-1}}$
$\displaystyle=$
$\displaystyle\sum_{j^{\prime}_{m-1}i^{\prime}_{mq}i^{\prime}_{(m+1)1)}\cdots
i^{\prime}_{(m+1)q}}\left(M^{j_{m-2}j_{m-1}j_{m}}_{i_{m(q-1)}i_{mq}i_{(m+1)1}\cdots
i_{(m+1)q}}\right)_{{j^{\prime}}_{m-1}{i^{\prime}}_{mq}i^{\prime}_{(m+1)1}\cdots
i^{\prime}_{(m+1)q}}$
$\displaystyle\left(\cdots\otimes\ket{i_{m1},i_{m2},\cdots
i_{m(q-1)}i^{\prime}_{mq}})_{j^{\prime}_{m-1}}\otimes\ket{i^{\prime}_{(m+1)1},i^{\prime}_{(m+1)2},\cdots
i^{\prime}_{(m+1)q}})_{j_{m}}\otimes\cdots\right)_{j_{f-1}}$ (29)