## Abstract

Geometric phases, generated by cyclic evolutions of quantum systems, offer an inspiring playground for advancing fundamental physics and technologies alike. The exotic statistics of anyons realized in physical systems can be interpreted as a topological version of geometric phases. However, non-Abelian statistics has not yet been demonstrated in the laboratory. Here, we use an all-optical quantum system that simulates the statistical evolution of Majorana fermions. As a result, we experimentally realize non-Abelian Berry phases with the topological characteristic that they are invariant under continuous deformations of their control parameters. We implement a universal set of Majorana-inspired gates by performing topological and nontopological evolutions and investigate their resilience against perturbative errors. Our photonic experiment, though not scalable, suggests the intriguing possibility of experimentally simulating Majorana statistics with scalable technologies.

## INTRODUCTION

The Berry phase is one of the most intriguing concepts in physics (*1*). It inspired numerous investigations toward theoretical frontiers with its possible generalizations (*2*) and technological applications in quantum computation (*3*). At the forefront of research in geometric evolutions is the controlled realization of anyonic statistics in condensed matter systems (*4*–*6*). This is manifested by the cyclic evolution of two anyonic quasiparticles braided around each other. The anyonic quasiparticles are deemed Abelian or non-Abelian depending on the possible geometric evolutions from the exchange being simple global phase factors or noncommuting unitaries, respectively. The statistical character of the exchange evolutions dictates that the resulting geometric phases are topologically robust. This robustness is a very desirable characteristic because it makes non-Abelian anyons a promising platform for fault-tolerant quantum computation (*5*–*8*). In the past decades, non-Abelian anyons have been extensively theorized in condensed matter systems (*9*–*12*). The most promising direction for realizing non-Abelian anyons is the investigation of Majorana zero modes (MZMs). There are already several positive signatures for the realization of MZMs in the laboratory (*13*–*21*). Nevertheless, the experimental realization of braiding operations is still a challenging open problem.

## RESULTS

### Encoding of MZM geometric evolutions

Here, we report the experimental quantum simulation of four MZM braiding evolutions encoded in an all-optical system (*22*). The MZMs are supported at the endpoints of two Kitaev chain models (KCMs) composed of fermions. To perform the encoding, we first transform the fermion system, with Hamiltonian *H*_{KCM}, to a spin-^{1}/_{2} system, with Hamiltonian *H*_{spin}, through a unitary Jordan-Wigner (JW) transformation, *U*_{JW} (*23*, *24*). The spin system is then encoded in the spatial modes of single photons (*25*).

Under the JW transformation, the local Hamiltonians are unitarily connected(1)As a result, the time evolutions of the KCM and the spin system are identical when written in their corresponding basis states. The geometric phases that correspond to the braiding of MZMs are particular cases of time evolutions that are cyclic and adiabatic. Hence, the photonic system can simulate the statistical evolution of four MZMs by simulating the corresponding spin system. The possibility to generate an equivalent quantum evolution is in complete alignment with the spirit of quantum simulation (*26*). The unitary equivalence (Eq. 1) between the KCM and the spin system guarantees that the Berry phase obtained by evolving *H*_{spin} is non-Abelian and topological in nature. Our previous experiment simulated the exchange of two MZMs positioned at the endpoints of the same chain, thus realizing a topological Abelian Berry phase (*25*).

The topological character of the spin model results from the topological character of the KCM. In the latter model, the topological invariance corresponds to the invariance of the geometric evolution against perturbations that are local in position space. As the environment is assumed to act locally in space, the KCM is a promising candidate for performing fault-tolerant quantum computation. The unitary transformation *U*_{JW} inherits the spin model with topologically invariant geometric evolutions, but now with respect to perturbations that are local in the parametric space of the adiabatic evolution. As these perturbations are not necessarily local in the position space, they may not correspond to possible environmental errors in the spin system. In addition, in our photonic experiment, the resulting non-Abelian geometric phases are insensitive of the exact timing of each controlled evolution when it is large enough. This is a highly desirable characteristic that facilitates the experimental realization of the non-Abelian evolution with high fidelity.

By experimentally simulating the braiding of different pairs of MZMs, we can only realize Clifford gates (*27*), such as the Hadamard gate, , and the -phase gate, , which are not universal for quantum computation (*28*). The inclusion of a non-Clifford gate, such as the -phase gate, , can resolve this problem (*29*). We experimentally simulate the -phase gate by moving two MZMs at the same site and exposing them to a controlled local perturbation. We experimentally demonstrate that, unlike the *H* and *R* topological gates, the -phase gate is not immune to local perturbations in MZMs B and C. Nevertheless, “magic state distillation” (*30*) can be used to produce error-corrected -phase gates from noisy ones. When access to an arbitrary number of Kitaev chains is possible, two-qubit topological gates can be realized by using the control procedures presented here.

### Quantum gates based on MZM braiding

The smallest system of two connected Kitaev chains that remains fault-tolerant against local perturbations at all times during the braiding evolution is composed of six fermion sites (*31*). Using six, rather than five, sites guarantees that no pairs of MZMs ever meet at the same site, which would render them unprotected to local perturbations. Here, we describe these fermions through the canonical operators *c*_{j} and , with positions *j* = 1,…, 6, where *j* = 1, 2 constitutes the first chain, *j* = 4, 5, 6 constitutes the second chain, and *j* = 3 corresponds to the link between them, as shown in Fig. 1. The KCM for the two chains is given in terms of Majorana operators, and , by the Hamiltonian(2)The Majorana operators γ_{m} satisfy the relations and γ_{l}γ_{m} + γ_{m}γ_{l} = 2δ_{lm} for *l*, *m* = 1*a*, 1*b*,..., 6*a*, 6*b*. Note that the particular operators γ_{1a}, γ_{2b}, γ_{4a}, and γ_{6b} are not present in Hamiltonian (Eq. 2), so for *j* = 1*a*, 2*b*, 4*a*, 6*b*. As a result, these Majorana modes have zero energy, giving rise to four endpoint MZMs, which we denote as A, B, C, and D in Fig. 1. The logical qubit states are taken to be |0_{L}〉 = |00_{g}〉 and |1_{L}〉 = |11_{g}〉 corresponding to the degenerate ground states of with even fermion parity, given by |00_{g}〉 = *Nf*_{1}*d*_{1}*f*_{2}*d*_{2}*d*_{3}|vac〉 and , where *f*_{1} = (γ_{1a} + *i*γ_{2b})/2, *f*_{2} = (γ_{6b} + *i*γ_{4a})/2, *d*_{1} = (γ_{1b} + *i*γ_{2a})/2, *d*_{2} = (γ_{4b} + *i*γ_{5a})/2, and *d*_{3} = (γ_{5b} + *i*γ_{6a})/2. For convenience, we denote the appropriate normalization constant by *N*.

The Hadamard gate *H* on the logical qubit can be realized by the anticlockwise braiding of MZMs A and C positioned at sites 1 and 4, respectively, as shown in Fig. 1A. The transport of the MZMs around the chain network is performed by adiabatically evolving the system through the following sequence of Hamiltonians, , , , , and , where(3)Section S1B shows a depiction of the resulting MZM transportation. The ground states of these Hamiltonians have the MZMs located at the desired sites. Hence, braiding can be implemented by a set of consecutive imaginary-time evolution (ITE) operators, , , , , and , where *t* is taken to be large enough for these operators to faithfully represent projectors onto the corresponding ground states up to overall normalization (*25*). Because of the topological nature of the produced evolutions, the exact value of *t* does not matter as long as it is long enough to suppress the contribution from the excited states (see Materials and Methods and section S1A). The theoretically expected non-Abelian Berry phase resulting from this set of evolutions is given by when written in the logical basis {|00_{g}〉, |11_{g}〉} (see Materials and Methods).

To realize the *R* gate on the logical qubit, we need to anticlockwise braid the MZMs C and D, as shown in Fig. 1B. The experimental simulation of the braiding evolution is performed by switching between the corresponding Majorana Hamiltonians , , and . This time evolution can be implemented by a set of consecutive ITE operators, , , , , and . The detailed process is given in section S1C. The resulting non-Abelian Berry phase is given by in the logical basis. The corresponding braiding with a single chain was realized in the study of Xu *et al*. (*25*). The Hermitian conjugate gates, *H*^{†} and *R*^{†}, are produced by reversing the orientation of the exchanging paths. Realizing the Hadamard gate, *H*, and the -phase gate, *R*, by braiding of MZMs demonstrates the non-Abelian character of the generated Berry phases. When these two operations are performed in reverse order, they give a different composite geometric evolution, because *HR* ≠ *RH*.

To realize the -phase gate, we place two MZMs at the same site and apply a local field. This causes the splitting of the ground-state degeneracy for a certain time, during which the appropriate dynamical phase factor is accumulated (*29*). In particular, we transport the B and C MZMs to site 3 by a set of ITE operations. Then, the population-dependent Hamiltonian *H*_{e} = − *i*γ_{3a}γ_{3b} is operated for a certain time τ, as shown in Fig. 1C. Last, the MZMs are transferred back to their initial position. The details of this process can be found in section S1D. During this evolution, the qubit states are transformed by . With the help of the Hadamard gate, we can obtain the -phase gate as by choosing the time to be . This gate is not protected against noise perturbations acting on site 3 when both MZMs are positioned there. Moreover, unlike the braiding gates, the dynamical gate is sensitive to timing errors.

### Spin encoding of two-chain system

To experimentally simulate the braiding evolutions of MZMs A and C, we transform the fermionic Hamiltonians , , , and of Eqs. 2 and 3, via a JW transformation, into the equivalent spin Hamiltonians, *H*_{0}, *H*_{1}, *H*_{2}, and *H*_{3}, respectively, where(4)During the adiabatic process, the spin system has the same spectrum as the fermion system at all times. Hence, both systems share the same time evolution operators when written in their corresponding basis (*25*). In particular, the non-Abelian geometric phase obtained during the transport of MZMs can be faithfully studied in the equivalent spin system. Because of the commutation relations between the terms of *H*_{0}, *H*_{1}, *H*_{2}, and *H*_{3}, the total process of ITE can be further simplified as, where |ϕ_{0}〉 is the ground state of *H*_{0}. To experimentally simulate the above dynamics, we need, in principle, a 2^{7}-dimensional Hilbert space that corresponds to six spins for the chain network and an extra spin for implementing dissipation. However, because of the character of the ITE, we need to focus only on manipulations that act on the low-energy subspace, which is 2^{5}-dimensional (see Materials and Methods). While our photonic simulator has limited scalability as it does not have a tensor product structure, we successfully managed to encode the full low-energy Hilbert space.

The experimental setup that realizes the adiabatic evolutions between the spin Hamiltonians (Eq. 4) and, as a consequence, the evolutions that correspond to the braiding of MZMs A and C is shown in Fig. 2. We encode the quantum states in the optical spatial modes of photons and manipulate them by beam displacers (BDs). A BD is a birefringent crystal, which separates light beams with horizontal and vertical polarizations by a certain displacement that depends on the length of the crystal (*32*). In our experiment, the polarization of the photons is used as the environmental degree of freedom for the realization of the ITE operations. The coupling between the spatial modes and the photon polarization is achieved using half-wave plates (HWPs) and quarter-wave plates (QWPs), which rotate the polarization of the corresponding modes. A dissipative evolution is accomplished in two steps. Initially, photons are passed through a polarizing beam splitter (PBS), which transmits the horizontal component and reflects the vertical one. Subsequently, photons with vertical polarization are completely dissipated, and only the ones with horizontal polarization are preserved. The resulting states correspond to the ground state of the spin chain system. In this way, the state |ϕ_{0}〉 is initially prepared and is then sent to the ITE operation of *H*_{1}, *H*_{2}, *H*_{3}, and *H*_{0} for the braiding of A and C with the dynamical map shown in Fig. 2A. The ITE operations are realized in Fig. 2, B (see Materials and Methods) and C, with one of the detailed processes shown in Fig. 2E. The combination of HWPs and a QWP in Fig. 2F is used to exchange basis between Pauli operators σ_{y} and σ_{x} (σ_{z}). The setup of basis rotation shown in Fig. 2D is used to rotate the output state onto the same basis of the input state. During the experiment, we need to construct a stable interferometer with 16 spatial modes. The relative phases in the interferometer are compensated by inserting thin glasses in the corresponding paths (not shown in Fig. 2). The effective operator of our setup (with four input modes and four output modes) is reconstructed by quantum process tomography with 256 measurements (*33*). The experimental configurations that demonstrate the braiding of C and D and the -phase gate are similar to the one shown in Fig. 2A and are given in section S2 (A and B). Section S1I shows the cross-section images for the state evolution during the ITE operation.

### Realization of quantum gates

To characterize the quantum gates resulting from the braiding of MZMs, we experimentally reconstruct the whole density matrix in the basis of {|00_{g}〉, |01_{g}〉, |10_{g}〉, |11_{g}〉} (see Materials and Methods). The operators can be described in the 16-dimensional basis spanned by Σ^{α} ⊗ Σ^{β}, with Σ^{α(β)} being *I*, *X*, *Y*, and *Z* for α(β) = 0, 1, 2, 3, respectively, corresponding to the identity matrix and the three Pauli operators. The experimental result is shown in Fig. 3, A (real part) and B (imaginary part). The evolution corresponds to a Hadamard gate acting on the Majorana-based encoding qubit. To show this, we express the data in the logical basis {|00_{g}〉, |11_{g}〉}. The result for the corresponding implementation of is shown in Fig. 3, C (real part) and D (imaginary part). The overall fidelity of the Hadamard operator is 93.47 ± 0.02%. For the -phase gate, , the experimental fidelity is 92.57 ± 0.01%. The real and imaginary parts of the density matrix are shown in Fig. 4, A and B, respectively. The -phase gate, , is further demonstrated with a fidelity of 93.44 ± 0.01%. All the density matrices corresponding to these operations are given in section S2D. The uncertainty in the fidelities is deduced from the Poissonian photon counting noise (*25*).

In our photonic experimental system, the main naturally occurring errors include the imperfect interference, the rotation errors of the wave plates, and the photon statistical fluctuation from the source. These errors are well under control, and they lead to the reduction of the fidelity (~93%). On the other hand, these fidelities are largely independent of the exact value of the imaginary time evolution parameter *t* as long as it is large enough to suppress contributions from excited states. Our numerical simulations show that the resulting evolutions stay unaffected even if we increase *t* by a factor of 2. In our experiment, the timing *t* depends on the ratio between the reflected and transmitted parts of the vertical polarization after the PBS in our experiment, which can be higher than 500:1.

### Fault tolerance

During the realization of the *H* and *R* topological gates, the braided MZMs are never positioned at the same site. Thus, these gates are immune to arbitrary single-site perturbative errors in the MZM system (*25*). The -phase gate is not expected to be resilient against perturbations that act on site 3, where the two MZMs are brought together. These perturbations can lift the degeneracy of the logical basis states, thereby causing dephasing of the encoded quantum information.

In our experiment, the ITE operators not only drive the evolutions that result to quantum gates but also induce the effective interaction to supply the protection of the system. To experimentally probe this behavior, we add phase errors in the MZM system, realized by the spin operation (1 + σ^{z})/2, acting on various sites during the control operations on the spin chains that give the -phase gate. The experimental setup is given in section S2B. The effective one-qubit gates in our scheme act on the space spanned by {|00_{g}〉, |11_{g}〉}. Figure 4 shows the final experimental density matrices with errors on different sites. For comparison, Fig. 4 (A and B) shows the real and imaginary parts of the density matrix after the implementation of the -phase gate without adding any errors at all. When local phase errors happen on site 4 during the gate manipulations, only one MZM is disturbed at a time and the operation remains unaffected. This resilience of the encoded information is shown in Fig. 4 (C and D). On the other hand, when the phase error is implemented on site 3, both MZMs are simultaneously disturbed. Hence, the final state is corrupted as the evolution is not topologically protected. A detailed analysis is given in section S1 (E and F).

Besides phase errors, we also consider flip errors. In the fermionic system, a flip error happens when a fermion erroneously tunnels between neighboring sites of the wire (*31*). This evolution can be exponentially suppressed by increasing the potential barrier between the two sites. In the spin system, flip errors are realized by (σ^{y}σ^{y} + σ^{x}σ^{x})/2. These errors degrade the encoded information, only if the MZMs are positioned on the same or on neighboring sites to where the flip error acts. To demonstrate this, we implement a flip error between sites 4 and 5 when the MZMs are both on site 3. In this case, the operation remains unchanged, as shown in Fig. 4 (E and F). However, if the flip error acts on sites 3 and 4, while both MZMs are positioned on site 3, then the operation is corrupted, as shown in Fig. 4 (G and H). The theoretical analysis can be found in section S1 (G and H). Apart from the phase and flip errors that have their origin in the MZM system, the geometric phases are actually protected against all noise with ℤ_{2} symmetry of the spin system.

## DISCUSSION

In summary, we have experimentally demonstrated that it is, in principle, possible to implement non-Abelian Berry phases that simulate fault-tolerant quantum computation with MZMs. Our experiment is based on the dissipation method for the implementation of Berry phases introduced in our previous work (*25*). There, we experimentally simulate the evolutions of a single Kitaev chain corresponding to the exchange of its two endpoint MZMs and demonstrate the topological invariance of the resulting Abelian Berry phases. Here, we experimentally simulate the evolutions of two chains with four endpoint MZMs. This setup allows us to generate with high accuracy Berry phases that are both non-Abelian and topological in nature, mirroring the braiding statistics of MZMs. With these evolutions in hand, we can implement several quantum algorithms topologically, such as the Deutsch-Jozsa algorithm (*34*). A detailed protocol is given in section S1I. While our work simulates the evolution operator of Majorana braiding, the physical system we use is not the same but is unitarily equivalent to that of Majorana fermions. In our simulation, the obtained geometric phases are invariant under continuous variations of the control parameters, as is the case with the Majorana braiding. This invariance is of importance to quantum computation applications, as it provides stability against control errors of the experimental parameters.

When more than two Kitaev chains can be encoded, topological quantum computation with MZMs can be simulated by using exactly the same control procedures demonstrated here, applied to arbitrary pairs of chains. Because of the specific nature of our optical experiment, we are able to perform control operations with very high fidelity, but the scalability of our system is limited. Scalable MZM quantum computation can be experimentally simulated by translating our photonic simulator implementation to scalable systems, such as ion traps (*35*), ultracold atoms (*36*), and superconducting circuits (*37*) technologies, where the ITE dissipation methods have already been established.

## MATERIALS AND METHODS

### Performing ITE

Any pure state |ϕ〉 can be expressed in a complete set of eigenstates |*e*_{k}〉 of a certain Hamiltonian *H* as |ϕ〉 = ∑_{k}*q*_{k}|*e*_{k}〉, where *q*_{k} values represent the corresponding complex amplitudes. The ITE operator associated with *H* is given by exp(− *Ht*)∑_{k}*q*_{k}|*e*_{k}〉 = ∑_{k}*q*_{k} exp(− *E*_{k}*t*)|*e*_{k}〉, where *E*_{k} is the eigenvalue corresponding to |*e*_{k}〉. After the ITE, the amplitude *q*_{k} is changed to *q*_{k} exp(− *E*_{k}*t*). The decay of the amplitude depends exponentially on the energy: the higher the energy, the faster the decay of the amplitude. Therefore, for sufficiently large *t*, only the ground state of *H* (with lowest energy) survives with high fidelity.

The implementation of the ITE operations, used to perform the braiding, can be simplified as the terms of the corresponding Hamiltonians that commute with each other. For example, can be decomposed into . The ITE operator of each term can be directly implemented by local unitary operations and dissipation. To perform the dissipation in a controlled way, an environmental degree of freedom was introduced, which is appropriately coupled to the system. The total state of the system and its environment can be written as , where denotes the states that are orthogonal to the ground state |ϕ_{g}〉 of the system. The environmental state |1_{e}〉 was dissipated during the evolution, and only |0_{e}〉 was preserved. Therefore, the ground state of the corresponding Hamiltonian was obtained.

### Experimental procedure for implementing the ITE of H_{1}

Consider the eigenvectors , , and of the Pauli operators σ^{x} (*X*), σ^{y} (*Y*), and σ^{z} (*Z*), with eigenvalues {1, − 1}, respectively. Then, the ground state of *H*_{0} in Eq. 4 is given by(5)where α, β, μ, and ν are complex amplitudes satisfying |α|^{2} + |β|^{2} + |μ|^{2} + |ν|^{2} = 1. Experimentally, the ground state (Eq. 5) of *H*_{0} is represented as four spatial modes of single photons, as shown in the initial step of Fig. 2B. To evolve this state to the ground state of *H*_{1}, we only needed to implement the additional ITE operations of and . Particle 4 is expressed in the basis , as and . This change of basis transformation was implemented by HWPs in the initial four spatial modes. Eight spatial modes were created after splitting them by a BD30. The polarization of the terms with |*z*_{4}〉, which represent states with higher energy, was set to be vertical with HWPs. The polarization of the terms with was set to be horizontal.

The dissipative evolution was realized by passing photons through a PBS, where only four terms with horizontal polarization remain at the end. Similarly, for the ITE of , the basis of particle 1 was rotated from to with the assistance of a combination of two HWPs and a QWP, as shown in Fig. 2F. Each of the spatial modes was horizontally split into two other modes with a BD30. For particle 2, the basis was rotated from to . The eight spatial modes were further vertically split into 16 modes with a BD60. The terms with the same form were combined with a BD30. Last, the basis of particle 3 was changed to be , in which 16 spatial modes were obtained with another BD30. After passing through a PBS, only the terms , , , , , , and remain, and the output state corresponds to the ground state of *H*_{2}. The ITE operations of the other Hamiltonians that are part of the cyclic evolution are found in section S1A.

After the basis rotation shown in Fig. 2D, the final state is expressed in the same basis as the initial state and takes the form(6)To show the gate operation in the logical basis, we translated the basis by , , , and . The logical basis is given by , , , and . The initial state (ground state of *H*_{0}) is given in the logical basis by(7)where, for simplicity, we omitted the overall normalization. After the anticlockwise braiding, the final state becomes(8)The unitary transformation that corresponds to the anticlockwise braiding of MZMs A and C reads(9)written in the basis {|00_{g}〉, |01_{g}〉, |10_{g}〉, |11_{g}〉}. If we focus on the even fermion parity sector spanned by |00_{g}〉 and |11_{g}〉, the unitary transformation becomes(10)As a result, the braiding of A and C corresponds to a generalized form of the Hadamard gate operation, related to the standard Hadamard gate by *U* ⋅ *R*^{2}.

### Experimental quantum process tomography

In our experiment, we used the quantum process tomography to identify the efficiency of the performed gate operations (*33*). The experimental measurement basis is chosen to be {*hh*, *hv*, *vh*, *vv*}, where *h*, *v*, *r*, and *d* represent the horizontal, vertical, right-hand circular, and diagonal polarizations, respectively. For each input state, we needed to reconstruct the final output state by two–qubit state tomography with 16 measurement configurations, as shown in fig. S13. To reconstruct the quantum process, we needed 16 different input states. As a result, there are 16^{2} measurement settings. By expanding the output state E(ρ) in terms of the Pauli basis operators {*Ê*_{m}} = {*II*, *IX*, *IY*, *IZ*, *XI*, *XX*, *XY*, *XZ*, *YI*, *YX*, *YY*, *YZ*, *ZI*, *ZX*, *ZY*, *ZZ*}, the quantum process can be expressed as E(*ρ*) = ∑_{mn}χ_{mn}*Ê*_{m}ρ*Ê*_{n}^{†}. The physical process E is uniquely characterized by the 16-by-16 matrix χ.

In our experiment, the spin basis is represented as , which corresponds to the polarization basis of {*hh*, *hv*, *vh*, *vv*}. The computation basis is chosen to be {|00_{g}〉, |01_{g}〉, |10_{g}〉, |11_{g}〉}. The transformation between the experimental basis and the computation basis is(11)The output state in the computation basis can be represented as(12)where(13)A further restriction to the even parity sector can be performed by the projector *P*_{e} = (|00_{g}〉〈00_{g}| + |11_{g}〉〈11_{g}|)/2. This results in 4-by-4 reduced density matrices expressed in the logical basis {|00_{g}〉, |11_{g}〉}, as shown in Figs. 3 and 4.

## SUPPLEMENTARY MATERIALS

Supplementary material for this article is available at http://advances.sciencemag.org/cgi/content/full/4/10/eaat6533/DC1

Section S1. Theoretical details

Section S2. Experimental details

Fig. S1. The circuit of one-step cooling algorithm.

Fig. S2. The process of anticlockwise braiding of MZMs A and C.

Fig. S3. The process of clockwise braiding of MZMs A and C.

Fig. S4. The process to anticlockwise braiding of MZMs C and D.

Fig. S5. The process of clockwise braiding of MZMs C and D.

Fig. S6. The process for implementing the phase gate based on the dynamics of MZMs.

Fig. S7. Spatial modes of the output states for the exchange of MZMs A and C.

Fig. S8. Spatial modes of the output states corresponding to the basis rotation.

Fig. S9. Spatial modes of the output states for the exchange of MZMs C and D.

Fig. S10. Spatial modes of the output states for the -phase operation.

Fig. S11. The process to implement the Deutsch-Jozsa algorithm with the braiding of MZMs.

Fig. S12. Experimental setup for the exchange of MZMs C and D.

Fig. S13. Experimental setup for the implementation of -phase gate and error operations.

Fig. S14. Experimental setup for the quantum process tomography.

Fig. S15. Experimental density matrices resulting from the -phase gate operation.

Fig. S16. Experimental density matrices resulting from the gate operations in the full basis.

Fig. S17. Experimental density matrices resulting from the -phase gate in the full basis.

Fig. S18. The state evolution in the Deutsch-Jozsa algorithm.

This is an open-access article distributed under the terms of the Creative Commons Attribution-NonCommercial license, which permits use, distribution, and reproduction in any medium, so long as the resultant use is **not** for commercial advantage and provided the original work is properly cited.

## REFERENCES AND NOTES

**Acknowledgments:**

**Funding**

**:**This work was supported by the National Key Research and Development Program of China (grant no. 2016YFA0302700); National Natural Science Foundation of China (grant nos. 61725504, 11474267, 61327901, 11774335, and 61322506); Anhui Initiative in Quantum Information Technologies (grant nos. AHY060300 and AHY020100); Key Research Program of Frontier Science, CAS (grant no. QYZDYSSW-SLH003); the Fundamental Research Funds for the Central Universities (grant nos. WK2470000020, WK2470000026, and WK2030380015); Youth Innovation Promotion Association and Excellent Young Scientist Program CAS; and the UK EPSRC (grant nos. EP/I038683/1 and EP/R020612/1).

**Author contributions:**Y.-J.H. proposed this project. J.-S.X. and K.S. designed the experiment. K.S. performed the experiment with the assistance of J.-S.X. J.K.P. contributed to the theoretical analysis. J.-S.X., K.S., Y.-J.H., and J.K.P. wrote the manuscript. Y.-J.H. supervised the theoretical part of the project. C.-F.L. and G.-C.G. supervised the project. All authors read the paper and discussed the results.

**Competing interests:**The authors declare that they have no competing interests.

**Data and materials availability:**All data needed to evaluate the conclusions in the paper are present in the paper and/or the Supplementary Materials. Additional data related to this paper may be requested from the authors.

- Copyright © 2018 The Authors, some rights reserved; exclusive licensee American Association for the Advancement of Science. No claim to original U.S. Government Works. Distributed under a Creative Commons Attribution NonCommercial License 4.0 (CC BY-NC).