# Histopathological Cancer Detection Using Hybrid Quantum Computing

Reek Majumdar  Civil Engineering Department
Clemson University
Clemson, SC, USA
<EMAIL_ADDRESS>Biswaraj Baral  Quantum Computing Group
Qausal AI
San Ramon, CA, USA
<EMAIL_ADDRESS>Bhavika Bhalgamiya  Dept of Physics and Astronomy
Mississippi State University
MS, USA
<EMAIL_ADDRESS>Taposh Dutta Roy  Quantum Research
SVQCG
San Ramon, CA, USA
<EMAIL_ADDRESS>
###### Abstract

We present an effective application of quantum machine learning in the field
of healthcare. The study here emphasizes on a classification problem of a
histopathological cancer detection using quantum transfer learning. Rather
than using single transfer learning model, the work model presented here
consists of multiple transfer learning models especially ResNet18, VGG-16,
Inception-v3, AlexNet and several variational quantum circuits (VQC) with high
expressibility. As a result, we provide a comparative analysis of the models
and the best performing transfer learning model with the prediction AUC of
$\approx 0.93$ for histopathological cancer detection. We also observed that
for $1000$ images with Resnet18, Hybrid Quantum and Classical (HQC) provided a
slightly better accuracy ($0.885$) than classical ($0.88$).

###### Index Terms:

Quantum machine learning, Artificial neural network, histopathological cancer
detection, quantum transfer learning, variational quantum circuit (VQC).

##  I Introduction

According to American Cancer Society [1] projections for 2023, 1.9 million new
cancer cases and 600k deaths are expected to occur in the United States. A
recent study shows that 19 to 20 million people die each year due to cancer
globally [2]. In such cases, the earliest detection of cancer cells becomes
essential to prevent the loss of lives. Artificial intelligence (AI) has a
wide range of applications, especially in medicine [3, 4]. As of now, several
traditional machine learning methods, including advanced deep learning, self-
supervised learning, and transfer learning have been successfully examined and
proven to be helpful in detecting different types of cancer including breast
cancer [5, 6], burns [7], and histopathological cancers [8].

The work in this study presents an application of hybrid quantum machine
learning in medical image processing. It emphasizes on a classification
problem of histopathological cancer detection using quantum transfer learning
[9]. Rather than using a single learning model, the work model presented here
includes multiple transfer learning models, especially ResNet18 [10], VGG-16
[11], Inception v3 [12], AlexNet [13] and different variational quantum
circuits (VQC) [14]. As a result, we present an efficient and novel method to
develop classification models utilizing hybrid classical and quantum computers
in this Noisy Intermediate Scale Quantum (NISQ) system era [15]. We aspire to
provide comparable prediction accuracy and high expressibility utilizing
variational quantum circuits.

##  II data

The dataset used for this work is a set of digital pathology images from the
benchmark dataset known as PatchCamelyon(PCam) [8]. This is a large-scale
patch-level dataset derived from Camelyon16 [26] data. The aggregate of the
patches make up the slide-level image, which can be used to predict likelihood
of metastases, stage cancer. Example of patch data samples showing likelihood
of cancer is shown in Fig. 1. The data set contains total 100k images.
However, we used 10k images in this work model.

Figure 1: Data (image) Samples: (a) non-cancerous image (b) cancerous image.

##  III Method

The framework of the presented work model here consists of four main units.
The input unit, classical transfer learning models, VQC-based Quantum Neural
Network (QNN), and classical artificial neural network (ANN).

Figure 2: Framework of the workmodel

  * Input unit: The input unit consists of a large data set, up to 100k images. This input data set is divided into train, test, and validation sets. These three sets work as an input for the next unit of the presented work model - transfer learning models, sometimes called multilayer perceptron.

  * Transfer Learning Models: The second unit of this framework is made up of pre-trained transfer learning models [16] trained on the ImageNet data set. Any of the well-known transfer learning models can be utilized in this unit. However, we prefer to analyze ResNet-18, VGG-16, Inception-v3, and AlexNet transfer learning models to start with. Later, we choose the best transfer learning model among these four base on it’s compatibility with the quantum neural network (QNN) [17] and include that in the final work model. Initially, the original image data is resized and inputted into these transfer learning models. In order to resize images, the new pixel size is chosen based on the input image requirements for the selected transfer learning model. These transfer learning models consist of three layers - a convolutional layer, a pooling layer, and a fully connected layer [18]. The final fully connected layer of these models is modified with a QNN. This QNN is sandwiched between two neuron layers and one output neuron layer based on the number of output classes. The goal of using the transfer learning model as an initial layer in the presented work model is to carefully extract crafted features from images. These features can later be used as a source of input for VQC based QNN [19]. This modified architecture enables us to extend our models to currently available quantum hardware, which cannot handle massive data sets simultaneously.

  * VQC based QNN: The classical transfer learning models are preceded by VQC based QNN. This unit comprises input and repeated VQC layers. These layers are tested for multiple configurations of single-qubit rotational and two-qubit controlled gates to build the QNN. The features received from the classical CNN are forwarded and processed by multiple VQCs. After processing features on multiple VQC, we select the best VQC with the highest expressibility. Inherently, VQCs can handle the error caused by the quantum hardware and are used for effective computation on fault-tolerant quantum devices and NISQ devices. As the last step, by performing the quantum measurements, final results from the QNN are obtained .

  * Classical ANN: The last unit of the presented architecture is a fully connected neural network. The output of the quantum unit (VQC based QNN) is mapped into the final output layer of this unit with softmax activation function [20].

  * Hyperparameters Tuning: Hyperparameter tuning for improving model performance is one of the important steps of deep learning model. The hyperparameters considered in the presented hybrid model are the number of qubits required to initialize the VQC layer, batch size, learning rate, step size, and optimizers namely Adam and Stochastic Gradient Descent (SGD). For our hybrid models, we have consistently used $\tanh$ activation function before inputting the data to VQC layer and softmax function for the final layer of hybrid and classical models. VQC Provides an open way to tune model parameters utilizing variety of activation functions.

The final work model includes the combination of best classical CNN and VQC in
order to get an efficient prediction accuracy.

##  IV Results

The TABLE I shows the results of the various experiments done on both
classical as well as hybrid quantum computing. Column I represents the various
classical and hybrid models used in this framework. Number of images used in
each model are shown in column II. Column III provides the percent of accuracy
achieved by each transfer learning model. After analysing the performance of
each model for various VQC, we selected the best VQC. Column V represents VQC
was used (see Fig. 7 in Appendix). Expressibility [28] and number of qubits
for VQC in column V are shown in column VI and VII respectively.

Model | Images | Acc | AUC | VQC | Exp | Qbits
---|---|---|---|---|---|---
Classical CNN | 5000 | 76.10 | 0.82 | N/A | N/A | N/A
Classical CNN2 | 10000 | 79.10 | 0.88 | N/A | N/A | N/A
Classical ResNet18 | 1000 | 88.00 | 0.95 | N/A | N/A | N/A
Classical ResNet18 | 10000 | 89.90 | 0.96 | N/A | N/A | N/A
Hybrid CNN | 10000 | 59.95 | N/A | 6 | 0.011 | 4
Hybrid ResNet18 | 1000 | 88.50 | 0.93 | 1 | 1.431 | 4
Hybrid VGG 16 | 1000 | 55.00 | 0.77 | 2 | 1.078 | 5
Hybrid Inception v3 | 1000 | 79.50 | N/A | 3 | 1.007 | 5
Hybrid AlexNet | 1000 | 63.00 | 0.67 | 4 | 0.201 | 7
Hybrid ResNet18 | 5000 | 83.80 | 0.90 | 5 | 0.201 | 7
Hybrid ResNet18 | 10000 | 82.35 | 0.90 | 1 | 1.431 | 4
HQC ResNet18 | 10000 | 84.30 | 0.90 | 6 | 0.011 | 4
TABLE I: Model Performance and Metric Parameters

We evaluated a total of 12 different major models. For classical transfer
learning models, we chose 4 models with varying size of data in quantum
transfer learning algorithm explained in [9]. For the hybrid classical and
quantum computing models, we evaluated 8 models with different quantum
circuits based on VQC, number of qubits [27] in quantum transfer learning
algorithm [9].

Figure 3: Reliability curve generated from Classical ResNet18 (solid Red) and
Hybrid CQ ResNet18 (solid blue) for total of 1000 images. The ideal
reliability curve is shown by dotted blue line for the comparison.

Reliability curve generated from Classical ResNet18 (solid Red) and Hybrid CQ
ResNet18 (solid blue) for total of 1000 images is shown in Fig. 3. Model
reliability curves [29] [32] provide insights to how the model is calibrated.
In case of binary classification [32] [33], model calibration is essential to
make sure the model outcomes are not undershooting or overshooting. The
central dotted line in Fig. 3 shows a perfectly calibrated model.

Figure 4: ROC curve generated from Classical ResNet18 (solid Red) and Hybrid
CQ ResNet18 (solid blue). The ideal ROC curve is shown by dotted purple line
for the comparison.

ROC curves shown in Fig. 4 shows the False Positive Rate (FPR) vs True
Positive Rate (TPR) at different thresholds of classification. It displays the
ability of model to distinguish positive class from negative class. Higher
area under ROC signifies that the model classifies more positive classes as
positive and negative classes as negative. The central dotted line shows that
a model have no capability to distinguish positive and negative classes.

Figure 5: Precision vs recall curve generated from Classical ResNet18 (solid
Red) and Hybrid CQ ResNet18 (solid blue). The ideal Precision - Recall curve
is shown by dotted purple line for the comparison.

Fig. 5 shows the precision vs recall plot for different thresholds. Like ROC
curve, P-R curve is an important curve to visualize the performance of
classification models. The four possible outcomes from binary classification
are true positive (TP), false positive (FP), true negative (TN) and false
negative (FN). Precision is the ratio of true positives to all the predicted
positives and a recall is the ratio of true positives to all the actual
positives in the data set.

Figure 6: VQC used in the given model with the highest expressibility with
four quantum registers q00, q01, q02, q03, and rotational quantum gates.

##  V Conclusion and Future Work

We have tested different combinations of variational quantum circuits in our
current work with our chosen transfer learning models (ResNet-18, VGG-16,
Inception-V3, and AlexNet). The VQC circuit shown in Figure 4 with the
ResNet-18-based transfer learning model provides a performance accuracy of 85
percent, comparable to the performance of the classical ResNet-18 model of 90
percent with similar architecture. It is the first step in exploring the
benefits of variational quantum circuits to perform quantum machine-learning
tasks for medical image processing.

Currently, we have used the quantum simulators provided by Pennylane[22]. As a
next step, we plan to test our trained quantum circuit on actual quantum
hardware. We also plan to compare the resiliency of these models against
various cyber-attacks, such as adversarial attacks [31]. The distinctive idea
presented here was conceived as a result of the quantum system’s computing
advantages, quantum entanglement’s capacity to uncover a variety of counter-
intuitive patterns, and the advantages of VQCs in the currently available
Noisy-intermediate-scale quantum (NISQ) system. We strongly believe that this
frame work can offer reliable machine-learning models for evaluating medical
images, and that these models’ performance will improve as quantum technology
develops along with classical computing.

## References

  * [1] Siegel, RL, Miller, KD, Wagle, NS, Jemal, A, ”Cancer statistics, 2023.”  Cancer J Clin  2023; 73( 1): 17- 48. doi:10.3322/caac.21763.
  * [2] Chhikara, Bhupender S and Parang, Keykavous  ”Global Cancer Statistics 2022: the trends projection analysis”.  Chemical Biology Letters,10.1 (2023): 451-451.
  * [3] Hamamoto, Ryuji, et al  ”Application of artificial intelligence technology in oncology: Towards the establishment of precision medicine”.  Cancers,12.12 (2020): 3532.
  * [4] Yeasmin, Samira.  ”Benefits of artificial intelligence in medicine”.  2019 2nd International Conference on Computer Applications and Information Security (ICCAIS), IEEE, 2019.
  * [5] Bejnordi, Babak Ehteshami, et al.  ”Diagnostic assessment of deep learning algorithms for detection of lymph node metastases in women with breast cancer”.  Jama,318.22 (2017): 2199-2210.
  * [6] Jin, Xu and Huang, Teng and Wen, Ke and Chi, Mengxian and An, Hong.  ”HistoSSL: Self-Supervised Representation Learning for Classifying Histopathology Images”.  Mathematics,11.1 (2022): 110.
  * [7] Deniz, Erkan and Şengür, Abdulkadir and Kadiroğlu, Zehra and Guo, Yanhui and Bajaj, Varun and Budak, Ümit.  ”Transfer learning based histopathologic image classification for breast cancer detection”.  Health information science and systems,6 (2018): 1-7.
  * [8] Veeling, Bastiaan S., et al.  ”Rotation equivariant CNNs for digital pathology”.  Medical Image Computing and Computer Assisted Intervention–MICCAI 2018: 21st International Conference, Granada, Spain, September 16-20, 2018, Proceedings, Part II 11. ,Springer International Publishing, 2018.
  * [9] Mari, Andrea, et al.  ”Transfer learning in hybrid classical-quantum neural networks”.  Quantum, 4 (2020): 340.
  * [10] He, Kaiming and Zhang, Xiangyu and Ren, Shaoqing and Sun, Jian,  ”Deep Residual Learning for Image Recognition”  In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 770–778.IEEE, 2016.
  * [11] Simonyan, Karen and Zisserman, Andrew,  ”Very deep convolutional networks for large-scale image recognition”,  International Conference on Learning Representations, 2014.
  * [12] Szegedy, Christian, et al.  ”Rethinking the inception architecture for computer vision”  In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 2818–2826, 2016.
  * [13] Krizhevsky, Alex and Sutskever, Ilya and Hinton, Geoffrey E,  ”ImageNet classification with deep convolutional neural networks”  Advances in neural information processing systems, pages 1097–1105, 2012.
  * [14] Mitarai, Kosuke, et al.  ”Quantum circuit learning”  Physical Review A, 98.3 (2018): 032309.
  * [15] Preskill, John.  ”Quantum computing in the NISQ era and beyond”,  Verein zur Förderung des Open Access Publizierens in den Quantenwissenschaften
  * [16] Niu, Shuteng, et al.  ”A decade survey of transfer learning (2010–2020)”,  IEEE Transactions on Artificial Intelligence, 1.2 (2020): 151-166..
  * [17] Schuld, Maria and Sinayskiy, Ilya and Petruccione, Francesco,  ”The quest for a quantum neural network”.  Quantum Information Processing, Springer, pages 2567–2586, 2014.
  * [18] Gu, Jiuxiang, et al.  ”Pattern recognition”,  In Elsevier, 2018.
  * [19] Qi, Jun, et al.  ”Theoretical error performance analysis for variational quantum circuit based functional regression”.  Nature Publishing Group UK London, 2023.
  * [20] Goodfellow, Ian and Bengio, Yoshua and Courville, Aaron,  ”Deep learning”.  MIT press, 2016.
  * [21] Sim, Sukin, Peter D. Johnson, and Alán Aspuru‐Guzik, ”Expressibility and entangling capability of parameterized quantum circuits for hybrid quantum‐classical algorithms.”  Advanced Quantum Technologies 2.12 (2019): 1900070.
  * [22] Bergholm, Ville, et al. ”Pennylane: Automatic differentiation of hybrid quantum-classical computations.”  arXiv preprint arXiv:1811.04968  (2018).
  * [23] Wang, Yazhen and Liu, Hongzhi, ”Quantum Computing in a Statistical Context”  Annual Review of Statistics and Its Application  volume 9, pages 479-504, (2022).
  * [24] Biamonte, Jacob, et al., ”Quantum machine learning.”  Nature  549.7671, pages 195-202, (2017).
  * [25] Pirhooshyaran, Mohammad, and Tamas Terlaky., ”Quantum circuit design search.”  Quantum Machine Intelligence 3  pages 1-14, (2021).
  * [26] Babak Ehteshami Bejnordi., et al., ”Diagnostic assessment of deep learning algorithms for detection of lymph node metastases in women with breast cancer.”  JAMA 318(22)  pages 2199–2210, (2017).
  * [27] Schumacher, Benjamin, ”Quantum coding.”  Physical Review A  51.4 (1995): 2738.
  * [28] Yano, Hiroshi, et al., ”Efficient discrete feature encoding for variational quantum classifier.”  2020 IEEE International Conference on Quantum Computing and Engineering (QCE)  IEEE, 2020.
  * [29] Steyerberg, Ewout Willem et al., ”Performance measures for prediction models and markers: evaluation of predictions and classifications”  2020 Revista espanola de cardiologia 64 9  (2011): 788-94.
  * [30] Qi, Jun, Chao-Han Huck Yang, and Pin-Yu Chen., ”Qtn-vqc: An end-to-end learning framework for quantum neural networks.”  arXiv preprint arXiv:2110.03861  (2021)
  * [31] Madry, Aleksander, et al., ”Towards deep learning models resistant to adversarial attacks.”  arXiv preprint arXiv:1706.06083  (2017)
  * [32] Lucena, Brian., ”Spline-based probability calibration.”  arXiv preprint arXiv:1809.07751  (2018)
  * [33] Smola, Alexander J,  ”Probabilities for sv machines.Advances in Large Margin Classifiers, MIT Press”  (2000): 61-73.

Figure 7: Appendix A1. Figures show the 21 (starting from top of the page) -26
(bottom of the page) different variational quantum circuits that were
generated as part of our analysis. We evaluated all these circuits using the
pennylane quantum simulator and selected the better performing ones using the
circuits expressibilty scores.

Figure 8: Appendix A2. ROC curves obtained from different models

Figure 9: Appendix A3. Reliability curves obtained from different models

Figure 10: Appendix A4. PR curves obtained from different models


# Supplementary Online Material for “Mixed-state topological order and the
errorfield double formulation of decoherence-induced transitions”

Yimu Bao  Department of Physics, University of California, Berkeley, CA 94720,
USA  Ruihua Fan  Department of Physics, Harvard University, Cambridge, MA
02138, USA  Ashvin Vishwanath  Department of Physics, Harvard University,
Cambridge, MA 02138, USA  Ehud Altman  Department of Physics, University of
CA, Berkeley, CA 94720, USA  Materials Sciences Division, Lawrence Berkeley
National Laboratory, Berkeley, CA 94720, USA

(January 13, 2023)

###### Contents

  1. SI Phase transition in Toric code subject to incoherent errors
    1. SI.1 Critical point
    2. SI.2 Topological entanglement entropy
  2. SII Mapping decoherence-induced phases to boundary anyon condensates
    1. SII.1 Path integral formulation of the EFD
    2. SII.2 Mapping to (1+1)D boundary phases
    3. SII.3 Examples
    4. SII.4 Generalization to the $n$-th moment

##  SI Phase transition in Toric code subject to incoherent errors

In this section, we provide details of the phase transition in the Toric code
subject to bit-flip errors. In Sec. SI.1, we show that the anyon condensation
transition in the EFD is exactly solvable. It occurs at $p_{c}^{(2)}=0.178$
and is of the 2D classical Ising universality. In Sec. SI.2, we compute the
topological entanglement entropy in the EFD state and show it sharply changes
from $2\log 2$ to $\log 2$ at the condensation transition.

###  SI.1 Critical point

As mentioned in the main text, the bit-flip errors in the Toric code can
induce a condensation of $m\overline{m}$-anyon in the EFD at a finite error
threshold. The transition is exactly solvable and of 2D classical Ising
universality. Here, we provide details on exactly solving the transition.

To start, we consider the EFD state describing the Toric code subject to bit-
flip (Pauli-X) errors

$\mbox{$|\rho\rangle\\!\rangle$}=\prod_{l}\left((1-p)+pX_{l}\otimes
X_{l}\right)\ket{\Psi_{0}}\otimes\ket{\Psi_{0}^{*}}\,\propto
e^{\mu\sum_{i}X_{l}\otimes X_{l}}\ket{\Psi_{0}}\otimes\ket{\Psi_{0}^{*}},$
(S1)

where $p$ is the bit-flip error rate, $\mu=\tanh^{-1}[p/(1-p)]$, $l$ labels
the edges in the square lattice, and $\ket{\Psi_{0}}$ is one of the Toric code
ground states specified below.

We work in a loop picture of the Toric code ground state

$\displaystyle\ket{\Psi_{0}}\propto\prod_{p}\frac{1+B_{p}}{2}\ket{+}\propto\sum_{\\{g\\}}\ket{g},$
(S2)

where $p$ in the subscript labels the plaquette,
$\ket{+}:=\prod_{i}\ket{+}_{i}$ is a product state with each qubit initialized
in the $+1$ eigenstate of Pauli-X operator, i.e. $X_{i}\ket{+}=\ket{+}$. A
product of $B_{p}$ gives $g_{z}$, which is a product of the Pauli-Z operators
along a closed loop. When acting on $\ket{+}$, $g_{z}$ flips qubits into $-1$
eigenstates of $X_{i}$ along a loop $g$ and leads to a product state
$\ket{g}:=g_{z}\ket{+}$. This allows writing the ground state in terms of
closed loops $g$, represented by binary variables.

The EFD can be written in the loop picture accordingly. Before applying the
error channel, the double ground state is expressed as

$\displaystyle\mbox{$|\rho_{0}\rangle\\!\rangle$}=\ket{\Psi_{0}}\otimes\ket{\Psi_{0}^{*}}=\frac{1}{\sqrt{\mathcal{Z}(0)}}\sum_{g,\overline{g}}\mbox{$|g,\overline{g}\rangle\\!\rangle$},$
(S3)

where
$\mbox{$|g,\overline{g}\rangle\\!\rangle$}:=(g_{z}\otimes\overline{g}_{z})\ket{+}\otimes\ket{+}$,
$g$ and $\overline{g}$ label two independent loop configurations in the ket
and bra copy, respectively. The error channel assigns a weight in the
summation of loops and leads to

$\displaystyle\mbox{$|\rho\rangle\\!\rangle$}=\frac{1}{\sqrt{\mathcal{Z}(\mu)}}\sum_{g,\overline{g}}e^{-2\mu|g+\overline{g}|}\mbox{$|g,\overline{g}\rangle\\!\rangle$},$
(S4)

where $g+\overline{g}$ is a binary sum and represents the relative loop
configuration, $\mathcal{Z}(\mu)$ is the normalization factor, and $\mu$ can
be interpreted as the loop tension. We note that only the relative loop
$h:=g+\overline{g}$ acquires a loop tension. Hence, it is more convenient to
rewrite the EFD as

$\displaystyle\mbox{$|\rho\rangle\\!\rangle$}=\frac{1}{\sqrt{\mathcal{Z}(\mu)}}\sum_{g,h}e^{-2\mu|h|}\mbox{$|g,h\rangle\\!\rangle$}.$
(S5)

The anyon condensation transition is detected by the open string operator

$\displaystyle\langle\\!\langle
W_{m\overline{m}}(\mathcal{P})\rangle\\!\rangle=\frac{\mbox{$\langle\\!\langle\rho|$}w_{m}(\mathcal{P})\otimes
w_{\overline{m}}(\mathcal{P})\mbox{$|\rho\rangle\\!\rangle$}}{\mbox{$\langle\\!\langle\rho|\rho\rangle\\!\rangle$}}=\frac{1}{\mathcal{Z}(\mu)}\sum_{g,h}(-1)^{\\#\text{crossing}(\mathcal{P},h)}e^{-4\mu|h|},$
(S6)

where $\\#\text{crossing}(\mathcal{P},h)$ counts the number of crossings
between the open string $\mathcal{P}$ and loop $h$. In this expression, the
open string $\langle\\!\langle
W_{m\overline{m}}(\mathcal{P})\rangle\\!\rangle$ can be interpreted as an
observable in a statistical mechanical model of loops. The normalization
factor $\mathcal{Z}(\mu)$ is the partition function
$\mathcal{Z}(\mu)=\Omega(0)\Omega(\mu)$, where the partition function
$\Omega(0)$ of $g$ loops is a constant independent of $\mu$, and the partition
function of $h$ loop, $\Omega(\mu)=\sum_{h}e^{-H(\mu)}$, has an effective
Hamiltonian $H(\mu)=4\mu|h|$.

We can identify the loop configuration $h$ with domain walls in a spin model
with Ising degrees of freedom living on the plaquettes, i.e.

$\displaystyle\leavevmode\hbox to51.71pt{\vbox
to51.71pt{\pgfpicture\makeatletter\hbox{\hskip 4.56784pt\lower-4.46783pt\hbox
to0.0pt{\pgfsys@beginscope\pgfsys@invoke{
}\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{
}\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{
}\pgfsys@setlinewidth{0.4pt}\pgfsys@invoke{ }\nullfont\hbox
to0.0pt{\pgfsys@beginscope\pgfsys@invoke{ }{{}}
\definecolor{myred}{RGB}{240,83,90}; \definecolor{myblue}{RGB}{93,123,189};
\small {}{{}}{} {}{}\pgfsys@beginscope\pgfsys@invoke{
}\color[rgb]{0.65,0.65,0.65}\definecolor[named]{pgfstrokecolor}{rgb}{0.65,0.65,0.65}\pgfsys@color@gray@stroke{0.65}\pgfsys@invoke{
}\pgfsys@color@gray@fill{0.65}\pgfsys@invoke{
}\definecolor{pgffillcolor}{rgb}{0.65,0.65,0.65}{}\pgfsys@moveto{-4.26784pt}{0.0pt}\pgfsys@lineto{46.94698pt}{0.0pt}\pgfsys@stroke\pgfsys@invoke{
} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope {}{{}}{}
{}{}\pgfsys@beginscope\pgfsys@invoke{
}\color[rgb]{0.65,0.65,0.65}\definecolor[named]{pgfstrokecolor}{rgb}{0.65,0.65,0.65}\pgfsys@color@gray@stroke{0.65}\pgfsys@invoke{
}\pgfsys@color@gray@fill{0.65}\pgfsys@invoke{
}\definecolor{pgffillcolor}{rgb}{0.65,0.65,0.65}{}\pgfsys@moveto{-4.26784pt}{14.93762pt}\pgfsys@lineto{46.94698pt}{14.93762pt}\pgfsys@stroke\pgfsys@invoke{
} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope {}{{}}{}
{}{}\pgfsys@beginscope\pgfsys@invoke{
}\color[rgb]{0.65,0.65,0.65}\definecolor[named]{pgfstrokecolor}{rgb}{0.65,0.65,0.65}\pgfsys@color@gray@stroke{0.65}\pgfsys@invoke{
}\pgfsys@color@gray@fill{0.65}\pgfsys@invoke{
}\definecolor{pgffillcolor}{rgb}{0.65,0.65,0.65}{}\pgfsys@moveto{-4.26784pt}{29.87526pt}\pgfsys@lineto{46.94698pt}{29.87526pt}\pgfsys@stroke\pgfsys@invoke{
} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope {}{{}}{}
{}{}\pgfsys@beginscope\pgfsys@invoke{
}\color[rgb]{0.65,0.65,0.65}\definecolor[named]{pgfstrokecolor}{rgb}{0.65,0.65,0.65}\pgfsys@color@gray@stroke{0.65}\pgfsys@invoke{
}\pgfsys@color@gray@fill{0.65}\pgfsys@invoke{
}\definecolor{pgffillcolor}{rgb}{0.65,0.65,0.65}{}\pgfsys@moveto{-4.26784pt}{44.81322pt}\pgfsys@lineto{46.94698pt}{44.81322pt}\pgfsys@stroke\pgfsys@invoke{
} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope {}{{}}{}
{}{}\pgfsys@beginscope\pgfsys@invoke{
}\color[rgb]{0.65,0.65,0.65}\definecolor[named]{pgfstrokecolor}{rgb}{0.65,0.65,0.65}\pgfsys@color@gray@stroke{0.65}\pgfsys@invoke{
}\pgfsys@color@gray@fill{0.65}\pgfsys@invoke{
}\definecolor{pgffillcolor}{rgb}{0.65,0.65,0.65}{}\pgfsys@moveto{0.0pt}{-4.26784pt}\pgfsys@lineto{0.0pt}{46.94698pt}\pgfsys@stroke\pgfsys@invoke{
} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope {}{{}}{}
{}{}\pgfsys@beginscope\pgfsys@invoke{
}\color[rgb]{0.65,0.65,0.65}\definecolor[named]{pgfstrokecolor}{rgb}{0.65,0.65,0.65}\pgfsys@color@gray@stroke{0.65}\pgfsys@invoke{
}\pgfsys@color@gray@fill{0.65}\pgfsys@invoke{
}\definecolor{pgffillcolor}{rgb}{0.65,0.65,0.65}{}\pgfsys@moveto{14.93762pt}{-4.26784pt}\pgfsys@lineto{14.93762pt}{46.94698pt}\pgfsys@stroke\pgfsys@invoke{
} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope {}{{}}{}
{}{}\pgfsys@beginscope\pgfsys@invoke{
}\color[rgb]{0.65,0.65,0.65}\definecolor[named]{pgfstrokecolor}{rgb}{0.65,0.65,0.65}\pgfsys@color@gray@stroke{0.65}\pgfsys@invoke{
}\pgfsys@color@gray@fill{0.65}\pgfsys@invoke{
}\definecolor{pgffillcolor}{rgb}{0.65,0.65,0.65}{}\pgfsys@moveto{29.87526pt}{-4.26784pt}\pgfsys@lineto{29.87526pt}{46.94698pt}\pgfsys@stroke\pgfsys@invoke{
} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope {}{{}}{}
{}{}\pgfsys@beginscope\pgfsys@invoke{
}\color[rgb]{0.65,0.65,0.65}\definecolor[named]{pgfstrokecolor}{rgb}{0.65,0.65,0.65}\pgfsys@color@gray@stroke{0.65}\pgfsys@invoke{
}\pgfsys@color@gray@fill{0.65}\pgfsys@invoke{
}\definecolor{pgffillcolor}{rgb}{0.65,0.65,0.65}{}\pgfsys@moveto{44.81322pt}{-4.26784pt}\pgfsys@lineto{44.81322pt}{46.94698pt}\pgfsys@stroke\pgfsys@invoke{
} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope {}{{}}{} {}{} {}{} {}{}
{}{}\pgfsys@beginscope\pgfsys@invoke{
}\color[rgb]{0.36328125,0.48046875,0.7421875}\definecolor[named]{pgfstrokecolor}{rgb}{0.36328125,0.48046875,0.7421875}\pgfsys@color@rgb@stroke{0.36328125}{0.48046875}{0.7421875}\pgfsys@invoke{
}\pgfsys@color@rgb@fill{0.36328125}{0.48046875}{0.7421875}\pgfsys@invoke{
}\definecolor[named]{pgffillcolor}{rgb}{0.36328125,0.48046875,0.7421875}\pgfsys@setlinewidth{0.6pt}\pgfsys@invoke{
}{}\pgfsys@moveto{-4.26784pt}{14.93762pt}\pgfsys@lineto{14.93762pt}{14.93762pt}\pgfsys@lineto{14.93762pt}{29.87526pt}\pgfsys@lineto{44.81322pt}{29.87526pt}\pgfsys@lineto{44.81322pt}{46.94698pt}\pgfsys@stroke\pgfsys@invoke{
} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope{}{{}}{}
{}{}\pgfsys@beginscope\pgfsys@invoke{
}\color[rgb]{0.36328125,0.48046875,0.7421875}\definecolor[named]{pgfstrokecolor}{rgb}{0.36328125,0.48046875,0.7421875}\pgfsys@color@rgb@stroke{0.36328125}{0.48046875}{0.7421875}\pgfsys@invoke{
}\pgfsys@color@rgb@fill{0.36328125}{0.48046875}{0.7421875}\pgfsys@invoke{
}\definecolor[named]{pgffillcolor}{rgb}{0.36328125,0.48046875,0.7421875}\pgfsys@setlinewidth{1.5pt}\pgfsys@invoke{
}{}\pgfsys@moveto{14.93762pt}{29.87526pt}\pgfsys@lineto{29.87526pt}{29.87526pt}\pgfsys@stroke\pgfsys@invoke{
} \pgfsys@invoke{\lxSVG@closescope
}\pgfsys@endscope{}{{}}{}{{{}}{}{}{}{}{}{}{}{}}{{}}{}\pgfsys@moveto{22.4066pt}{22.4066pt}\pgfsys@moveto{23.04675pt}{22.4066pt}\pgfsys@curveto{23.04675pt}{22.76015pt}{22.76015pt}{23.04675pt}{22.4066pt}{23.04675pt}\pgfsys@curveto{22.05305pt}{23.04675pt}{21.76645pt}{22.76015pt}{21.76645pt}{22.4066pt}\pgfsys@curveto{21.76645pt}{22.05305pt}{22.05305pt}{21.76645pt}{22.4066pt}{21.76645pt}\pgfsys@curveto{22.76015pt}{21.76645pt}{23.04675pt}{22.05305pt}{23.04675pt}{22.4066pt}\pgfsys@closepath\pgfsys@moveto{22.4066pt}{22.4066pt}\pgfsys@fillstroke\pgfsys@invoke{
}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{}{{ {}{}}}{ {}{}}
{{}{{}}}{{}{}}{}{{}{}} { }{{{{}}\pgfsys@beginscope\pgfsys@invoke{
}\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{25.60631pt}{21.54599pt}\pgfsys@invoke{
}\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{
}\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{
}\hbox{{\scriptsize$\sigma_{i}$}} }}\pgfsys@invoke{\lxSVG@closescope
}\pgfsys@endscope}}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}}
{}{{}}{}{{{}}{}{}{}{}{}{}{}{}}{{}}{}\pgfsys@moveto{22.4066pt}{38.41127pt}\pgfsys@moveto{23.04675pt}{38.41127pt}\pgfsys@curveto{23.04675pt}{38.76482pt}{22.76015pt}{39.05142pt}{22.4066pt}{39.05142pt}\pgfsys@curveto{22.05305pt}{39.05142pt}{21.76645pt}{38.76482pt}{21.76645pt}{38.41127pt}\pgfsys@curveto{21.76645pt}{38.05772pt}{22.05305pt}{37.77112pt}{22.4066pt}{37.77112pt}\pgfsys@curveto{22.76015pt}{37.77112pt}{23.04675pt}{38.05772pt}{23.04675pt}{38.41127pt}\pgfsys@closepath\pgfsys@moveto{22.4066pt}{38.41127pt}\pgfsys@fillstroke\pgfsys@invoke{
}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{}{{ {}{}}}{ {}{}}
{{}{{}}}{{}{}}{}{{}{}} { }{{{{}}\pgfsys@beginscope\pgfsys@invoke{
}\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{25.60631pt}{37.93176pt}\pgfsys@invoke{
}\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{
}\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{
}\hbox{{\scriptsize$\sigma_{j}$}} }}\pgfsys@invoke{\lxSVG@closescope
}\pgfsys@endscope}}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}}
{}{{}}{} {}{}\pgfsys@beginscope\pgfsys@invoke{
}\pgfsys@setdash{1.0pt,2.0pt}{0.0pt}\pgfsys@invoke{
}\pgfsys@setlinewidth{1.0pt}\pgfsys@invoke{
}{}\pgfsys@moveto{22.4066pt}{22.4066pt}\pgfsys@lineto{22.4066pt}{38.41127pt}\pgfsys@stroke\pgfsys@invoke{
} \pgfsys@invoke{\lxSVG@closescope
}\pgfsys@endscope{{}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{
}\color[rgb]{0.36328125,0.48046875,0.7421875}\definecolor[named]{pgfstrokecolor}{rgb}{0.36328125,0.48046875,0.7421875}\pgfsys@color@rgb@stroke{0.36328125}{0.48046875}{0.7421875}\pgfsys@invoke{
}\pgfsys@color@rgb@fill{0.36328125}{0.48046875}{0.7421875}\pgfsys@invoke{
}\definecolor[named]{pgffillcolor}{rgb}{0.36328125,0.48046875,0.7421875}{{}{}{{
{}{}}}{ {}{}} {{}{{}}}{{}{}}{}{{}{}} {\pgfsys@beginscope\pgfsys@invoke{
}\color[rgb]{0.36328125,0.48046875,0.7421875}\definecolor[named]{pgfstrokecolor}{rgb}{0.36328125,0.48046875,0.7421875}\pgfsys@color@rgb@stroke{0.36328125}{0.48046875}{0.7421875}\pgfsys@invoke{
}\pgfsys@color@rgb@fill{0.36328125}{0.48046875}{0.7421875}\pgfsys@invoke{
}\definecolor[named]{pgffillcolor}{rgb}{0.36328125,0.48046875,0.7421875}
\pgfsys@invoke{\lxSVG@closescope
}\pgfsys@endscope}{{{{}}\pgfsys@beginscope\pgfsys@invoke{
}\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{3.0077pt}{36.16127pt}\pgfsys@invoke{
}\hbox{{\definecolor[named]{.}{rgb}{0.36328125,0.48046875,0.7421875}\definecolor[named]{pgfstrokecolor}{rgb}{0.36328125,0.48046875,0.7421875}\pgfsys@color@rgb@stroke{0.36328125}{0.48046875}{0.7421875}\pgfsys@invoke{
}\pgfsys@color@rgb@fill{0.36328125}{0.48046875}{0.7421875}\pgfsys@invoke{
}\hbox{{\definecolor[named]{.}{rgb}{0.36328125,0.48046875,0.7421875}\color[rgb]{0.36328125,0.48046875,0.7421875}\definecolor[named]{pgfstrokecolor}{rgb}{0.36328125,0.48046875,0.7421875}$h_{l}$}}
}}\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}}
\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}}
\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope{{
{}{}{}{}{}}}{}{}\hss}\pgfsys@discardpath\pgfsys@invoke{\lxSVG@closescope
}\pgfsys@endscope\hss}}\lxSVG@closescope\endpgfpicture}},\qquad
h_{l}=\frac{1-\sigma_{i}\sigma_{j}}{2}.$ (S7)

Then, the loop model reduces to the square lattice Ising model up to a
constant

$\displaystyle H=\sum_{\langle i,j\rangle}-2\mu\sigma_{i}\sigma_{j}.$ (S8)

Thus, the condensation transition in the EFD is of the 2D classical Ising
universality class. The critical point is exactly solvable and determined by
the Kramers-Wannier duality, $\mu_{c}=(1/4)\log(1+\sqrt{2})$, i.e.
$p_{c}^{(2)}=0.178$. We remark that this critical point is associated with the
partition function $\mathcal{Z}(\mu)=\operatorname{tr}\rho^{2}$ and indicates
the singularity in the second moment of $\rho$.

###  SI.2 Topological entanglement entropy

Another diagnostic of the anyon condensation is the topological entanglement
entropy (TEE) of the EFD state. In the case of the Toric code subject to
incoherent errors, the EFD state can be written as the ground state of a
gapped local Hamiltonian. One can therefore use TEE to detect the transition .
In this subsection, we first construct the parent Hamiltonian of the EFD. We
then compute the Rényi-$n$ entropy of the EFD and show that the subleading
topological term undergoes a transition from $2\log 2$ to $\log 2$ upon the
condensation of $m\overline{m}$ regardless of the Rényi order $n$. This
indicates a singularity also in the topological term of von Neumann entropy
($n\to 1$). We remark that, in a related problem of the Toric code undergoing
imaginary time evolution, the TEE changes sharply from $\log 2$ to zero across
the phase transition as shown in Ref. Castelnovo and Chamon (2008).

The EFD describing the Toric code subject to bit-flip errors is the ground
state of a local parent Hamiltonian 111We thank Meng Cheng for pointing this
out to us.

$\displaystyle\tilde{H}=V^{-1}H_{0}VVH_{0}V^{-1},$ (S9)

where $V=e^{\mu\sum_{i}X_{i}\otimes X_{i}}$, and $H_{0}$ is a projector
Hamiltonian given by

$\displaystyle
H_{0}=\sum_{s}\frac{1-A_{s}\otimes\mathbb{I}}{2}+\frac{1-\mathbb{I}\otimes
A_{s}}{2}+\sum_{p}\frac{1-B_{p}\otimes\mathbb{I}}{2}+\frac{1-\mathbb{I}\otimes
B_{p}}{2}.$ (S10)

Here, the eigenvalue of $\tilde{H}$ is non-negative. One can show
$|\rho\rangle\\!\rangle$ is a zero eigenstate of $\tilde{H}$ and therefore is
the ground state. It is then legitimate to use the TEE to characterize the
topological order in the EFD. The TEE sharply changes when the gap of
$\tilde{H}$ closes.

We now compute the TEE in the EFD and show it undergoes a transition when
tuning the error rate. First, we show the TEE takes distinct values in two
limits, the error rate $p=0$ and $p=1/2$. To gain an understanding away from
these two limits, we then consider the Rényi-$n$ entropy and map it to the
free energy cost of spin pinning in a classical spin model. We show its
subleading term undergoes a transition at the critical point and take the
analytic limit $n\to 1$ to extract the behavior of the TEE. We remark that, as
far as the entanglement entropy of a finite disk is concerned, the boundary
condition of the total system is not important and will not be specified
explicitly throughout the entire calculation.

In the limits $p=0,1/2$, the EFD state is a stabilizer state, and the TEE can
be easily determined. In the absence of errors, the EFD contains two copies of
decoupled Toric code states and exhibits a TEE $\gamma=2\log 2$. In the case
of $p=1/2$, the tension $\mu\to\infty$ imposes the stabilizers $X_{i}\otimes
X_{i}$ in the EFD. The resulting EFD is the mutual eigenstate of stabilizers

$\\{A_{s}\otimes\mathbb{I},\quad\mathbb{I}\otimes A_{s},\quad X_{i}\otimes
X_{i},\quad B_{p}\otimes B_{p}\\}.$

For a simply connected region $A$, its entanglement entropy is given by

$\displaystyle S_{A}/\log 2=2|A|-\\#\text{stabilizer}(\text{supp}(s)\in A)$
(S11)

where $2|A|$ counts the total number of degrees of freedom in region $A$, and
$\\#\text{stabilizer}(\text{supp}(s)\in A)$ is the number of stabilizers whose
support is completely in $A$. One can show $S_{A}=(|\partial A|-1)\log 2$, and
the TEE $\gamma=\log 2$. The distinct values of TEE in two limits indicate its
potential singularity as a function of error rate.

To understand the TEE away from two limits, we consider the Rényi-$n$
entropies of a simply connected region $A$ and develop a classical spin model
description. The first step is to write down the reduced density matrix. Here,
we separate the loop configuration $g$ ($h$) into two parts $g_{A}$ and
$g_{\overline{A}}$ ($h_{A}$ and $h_{\overline{A}}$), which support on region
$A$ and its complement $\overline{A}$, respectively. To form a closed loop
configuration, two parts must agree on the boundary of $A$, i.e., $\partial
g_{A}=\partial g_{\overline{A}}=b$, and $\partial h_{A}=\partial
h_{\overline{A}}=c$.

$g_{A}$$g_{\overline{A}}$

The reduced density matrix can be written as

$\displaystyle\varrho_{A}(\mu)$
$\displaystyle=\operatorname{Tr}_{\overline{A}}\mbox{$|\rho(\mu)\rangle\\!\rangle$}\mbox{$\langle\\!\langle\rho(\mu)|$}$
$\displaystyle=\frac{1}{\mathcal{Z}(\mu)}\sum_{b,c}\sum_{\begin{subarray}{c}g_{A},\tilde{g}_{A},\\\
\partial
g_{A}=\partial\tilde{g}_{A}=b\end{subarray}}\sum_{\begin{subarray}{c}h_{A},\tilde{h}_{A},\\\
\partial
h_{A}=\partial\tilde{h}_{A}=c\end{subarray}}\Omega_{\overline{A}}(0;b)\Omega_{\overline{A}}(\mu;c)e^{-2\mu|h_{A}|-2\mu|\tilde{h}_{A}|}\mbox{$|g_{A},h_{A}\rangle\\!\rangle$}\mbox{$\langle\\!\langle\tilde{g}_{A},\tilde{h}_{A}|$},$
(S12)

where $\Omega_{\overline{A}}(0;b)$ and $\Omega_{\overline{A}}(\mu;c)$ are the
partition function of $g$ and $h$ loops in region $\overline{A}$ with a given
boundary condition $b$ and $c$, respectively,

$\displaystyle\Omega_{\overline{A}}(\mu;c)=\sum_{h_{\overline{A}},\,\partial
h_{\overline{A}}=c}e^{-4\mu|h_{\overline{A}}|}.$ (S13)

The normalization factor $\mathcal{Z}(\mu)=\Omega(0)\Omega(\mu)$ can be
written accordingly as

$\displaystyle\Omega(\mu)=\sum_{c}\Omega_{A}(\mu;c)\Omega_{\overline{A}}(\mu;c).$
(S14)

Next, we write down the $n$-th moment of the reduced density matrix

$\displaystyle\operatorname{Tr}\varrho_{A}^{n}(\mu)=\Gamma_{A}(0)\Gamma_{A}(\mu),$
(S15)

where $\Gamma_{A}(0)$ and $\Gamma_{A}(\mu)$ are associated with $g$ and $h$
loops, respectively, and

$\displaystyle\Gamma_{A}(\mu)=\frac{1}{\Omega^{n}(\mu)}\sum_{c}\Omega_{A}^{n}(\mu;c)\Omega_{\overline{A}}^{n}(\mu;c).$
(S16)

Equation (S16) can be viewed as a ratio between two partition functions. The
denominator represents the partition function of $n$ copies of loop models,
while the loop model in the numerator is further subject to the constraint
that loops in different copies have the same boundary condition $c$.

The Rényi entropy therefore can also be interpreted as the excess free energy
related to the above constraint

$\displaystyle
S_{A}^{(n)}=\frac{1}{1-n}\log\operatorname{Tr}\varrho_{A}^{n}(\mu)=\frac{1}{n-1}\left(F_{A}^{(n)}(0)-nF_{0}(0)\right)+\frac{1}{n-1}\left(F_{A}^{(n)}(\mu)-nF_{0}(\mu)\right)$
(S17)

where $F_{0}(\mu)=-\log\Omega(\mu)$ is the free energy of the loop model with
tension $\mu$,
$F_{A}^{(n)}(\mu)=-\log\sum_{c}\Omega_{A}^{n}(\mu;c)\Omega_{\overline{A}}^{n}(\mu;c)$
is the free energy of $n$ copies of the loop model subject to the constraint.

The scaling of the excess free energy is easier to analyze when formulating
the loop model in terms of Ising spins. We again identify the loop
configuration with Ising domain walls

$\displaystyle g^{(s)}_{l}=\frac{1-\sigma_{i}^{(s)}\sigma_{j}^{(s)}}{2},\quad
h_{l}^{(s)}=\frac{1-\sigma^{\prime(s)}_{i}\sigma^{\prime(s)}_{j}}{2},\quad
s=1,2,\cdots,n$ (S18)

Furthermore, we redefine the Ising variables

$\displaystyle\sigma_{i}^{(s)}:=\sigma_{i}^{(1)}\tau_{i}^{(s-1)},\quad\sigma^{\prime(s)}_{i}:=\sigma^{\prime(1)}_{i}\tau^{\prime(s-1)}_{i},\quad
s=2,3,\cdots,n.$ (S19)

The constraints on the loop configurations require $n$ copies of the Ising
spins, $\sigma^{(s)}$ and $\sigma^{\prime(s)}$, on the boundary of the region
$A$ having the same domain wall configurations. Thus, they require the
relative Ising spin $\tau^{(s)}_{i}$ and $\tau^{\prime(s)}_{i}$ having no
domain wall on the boundary of $A$, i.e. pointing in the same direction. There
are $(n-1)$ such constraints in $F_{A}^{(n)}(\mu)$, therefore
$F_{A}^{(n)}(\mu)=nF_{0}(\mu)+(n-1)\Delta F(\mu)$, where $\Delta F$ is the
excess free energy for aligning one copy of the $\tau$ spins on the boundary
of $A$. Correspondingly, the Rényi entropy $S_{A}^{(n)}=\Delta F(0)+\Delta
F(\mu)$.

The excess free energy has two contributions. The energetic part is always
proportional to $|\partial A|$. The entropic part counts the loss of degrees
of freedom due to spin aligning. In the ferromagnetic phase, the spins can
fluctuate below the scale of correlation length $\xi$. Thus, $\Delta
F\propto|\partial A|/\xi$ exhibits a strict area-law scaling. In the
paramagnetic phase, the spins can both fluctuate freely above the scale of
correlation length $\xi$. At the leading order, the free energy cost is
proportional to $|\partial A|$. However, the aligned spin can fluctuate
globally giving rise to a subleading correction, i.e. $\Delta F=a|\partial
A|-\log 2$. Thus, the subleading term sharply changes at the ferromagnetic
transition.

The above analysis indicates the Rényi entropy exhibits an area-law scaling
$S_{A}^{(n)}=a|\partial A|-\gamma^{(n)}$, and the topological term
$\gamma^{(n)}$ distinguishes two phases of the effective spin model. When
$\mu<\mu_{c}$, both spin models for $\sigma$ and $\sigma^{\prime}$ are in the
paramagnetic phase, giving rise to $\gamma^{(n)}=2\log 2$. When $\mu>\mu_{c}$,
the spin model for $\sigma^{\prime}$ (i.e. the loop model for $h$) is in the
ferrmagnetic phase, reducing $\gamma^{(n)}$ to $\log 2$. The result holds for
an arbitrary Rényi order $n$ and also in the replica limit $n\to 1$. Hence,
the TEE of the EFD state sharply changes from $2\log 2$ to $\log 2$ when
$m\overline{m}$ condenses at $p_{c}^{(2)}$.

We make an important remark that the effective model for the Rényi-$n$ entropy
of the EFD is merely $n$ decoupled loop models. The partition function
$\mathcal{Z}^{n}(\mu)=(\operatorname{tr}\rho^{2})^{n}$. Therefore, the
transition occurs at the same critical threshold $p_{c}^{(2)}$ regardless of
$n$. This is fundamentally different from the transition in the $n$-th moment
$\operatorname{tr}\rho^{n}$ of the corrupted density matrix, which occurs at a
different critical threshold $p_{c}^{(n)}$.

The Toric code state subject to Pauli-Y and Z errors can be similarly
analyzed. These errors can induce a condensation of $f\overline{f}$ and
$e\overline{e}$ in the EFD at the same critical threshold $p_{c}^{(2)}$. We
also note that, anyon bound states $\alpha\overline{\alpha}$ and
$\beta\overline{\beta}$ are mutual bosons and therefore can condense
independently. When two types of anyons are condensed, e.g. $e\overline{e}$
and $m\overline{m}$, the rest one $f\overline{f}$ is also condensed as
$e\times m=f$. The resulting EFD no longer contains condensed loop objects and
will exhibit a vanishing TEE.

##  SII Mapping decoherence-induced phases to boundary anyon condensates

In this section, we map the decoherence-induced phases in the EFD to the
boundary phases of a topologically ordered system. In Sec. SII.1, we start
with the path integral formulation of the EFD state. In Sec. SII.2, we map the
decoherence-induced phases to the boundary phases of topologically ordered
systems. In particular, we establish the classification scheme for the
possible phases in abelian topological order subject to incoherent errors. In
Sec. SII.3, we carry out the classification in three examples, the Toric code,
double semion, and $\nu=1/3$ Laughlin state with incoherent errors. The
results are summarized in Table I of the main text. Section SII.4 generalizes
the field theory description for the second moment to the $n$-th moment
$\operatorname{tr}\rho^{n}$. We remark that, for abelian topological order
with incoherent errors, the number of possible phases is independent of $n$.
The possible phases in the EFD have one-to-one correspondence to that in the
replica limit $n\to 1$.

###  SII.1 Path integral formulation of the EFD

Here, we develop a path integral formulation of the EFD
$|\rho\rangle\\!\rangle$. The double ground state
$\ket{\Psi_{0}}\otimes\ket{\Psi_{0}^{*}}$ in the EFD can be prepared using an
infinite imaginary time evolution from an arbitrary state, which is
equivalently a Euclidean path integral in spacetime region $\tau<0$. The
wavefunction component at $\tau=0$ can be formally written as

$\begin{aligned}
\mathcal{Z}_{\tau<0}&[\varphi,\overline{\varphi}]:=\big{(}\bra{\varphi}\otimes\bra{\overline{\varphi}}\big{)}\big{(}\ket{\Psi_{0}}\otimes\ket{\Psi_{0}^{*}}\big{)}=\int\displaylimits_{(\varphi^{\prime},\overline{\varphi}^{\prime})|_{\tau=0^{-}}=(\varphi,\overline{\varphi})}\mathcal{D}(\varphi^{\prime},\overline{\varphi}^{\prime})e^{-\mathcal{S}(\varphi^{\prime})-\mathcal{S}^{*}(\overline{\varphi}^{\prime})}\end{aligned},$
(S20)

where $\varphi$ and $\overline{\varphi}$ are the dynamical variables in the
ket and bra Hilbert space, the path integral is defined in the past spacetime
region $\tau<0$, $\mathcal{S}(\varphi^{\prime})$ and
$\mathcal{S}^{*}(\overline{\varphi}^{\prime})$ are a pair of conjugate
Euclidean actions that yield the ground states $\ket{\Psi_{0}}$ and
$\ket{\Psi_{0}^{*}}$, respectively. The EFD $|\rho\rangle\\!\rangle$ is then
obtained by turning on the error channel which couples the field $\varphi$ and
$\overline{\varphi}$ at $\tau=0$ time slice locally [illustrated in Fig. 1(b)
of the main text].

The norm $\langle\\!\langle\rho|\rho\rangle\\!\rangle$ is accordingly written
as a Euclidean path integral in the entire spacetime, i.e. two path integrals
in the future ($\tau>0$) and past ($\tau<0$) glued at $\tau=0$:

$\mbox{$\langle\\!\langle\rho|\rho\rangle\\!\rangle$}=\int\mathcal{D}(\varphi_{p},\overline{\varphi}_{p},\varphi_{f},\overline{\varphi}_{f})\,\mathcal{Z}_{\tau>0}[\varphi_{f},\overline{\varphi}_{f}]\mathcal{Z}_{\tau<0}[\varphi_{p},\overline{\varphi}_{p}]e^{-\mathcal{S}_{int}(\varphi_{f},\overline{\varphi}_{f},\varphi_{p},\overline{\varphi}_{p})},$
(S21)

where $\varphi_{f(p)}$ and $\overline{\varphi}_{f(p)}$ denote the future
(past) field variables at the time slice $\tau=0^{+}$ ($\tau=0^{-}$). The
future and past fields are coupled by the error channel, and the coupling is
formally written as

$\displaystyle
e^{-\mathcal{S}_{int}(\varphi_{f},\overline{\varphi}_{f},\varphi_{p},\overline{\varphi}_{p})}=\mbox{$\langle\\!\langle\varphi_{f},\overline{\varphi}_{f}|$}\mathcal{N}^{\dagger}\mathcal{N}\mbox{$|\varphi_{p},\overline{\varphi}_{p}\rangle\\!\rangle$}\,.$

In the absence of errors, $\mathcal{N}=\mathbb{I}$ and
$e^{-\mathcal{S}_{int}}=\delta_{\varphi_{p},\varphi_{f}}\delta_{\overline{\varphi}_{p},\overline{\varphi}_{f}}$
becomes a constraint. We further remark that individual Kraus operators and
$\mathcal{N}$ are generally non-Hermitian. However, $\mathcal{S}_{int}$ only
contains terms determined by the Hermitian combination
$\mathcal{N}^{\dagger}\mathcal{N}$, which guarantees
$\langle\\!\langle\rho|\rho\rangle\\!\rangle$ being a real number.

###  SII.2 Mapping to (1+1)D boundary phases

In this subsection, we take advantage of the path-integral formulation and
work with the topological quantum field theory (TQFT) describing the long-
distance physics of topological orders. The invariance of TQFT under the
$\pi/2$ spacetime rotation allows mapping decoherence-induced phases in the
EFD to $(1+1)$D quantum phases on the edge of topologically ordered systems.
Here, we consider specifically the abelian topological order described by the
Chern-Simons (CS) theory. In the case of incoherent errors, we carry out a
classification of the possible decoherence-induced phases using the effective
theory on the edge. We demonstrate our general ideas with two concrete
examples, the Toric code and double semion, and find five phases in each
model. The possible phases in the case of coherent errors are also commented.

We consider the EFD for the Abelian topologically ordered ground state subject
to incoherent errors. The ground state $\ket{\Psi_{0}}$ is described by a
$U(1)^{M}$ Chern-Simons theory with the following Lagrangian

$\mathcal{L}_{CS}[a]=\frac{1}{4\pi}\sum_{I,J=1}^{M}K_{IJ}\,a^{I}\wedge\mathrm{d}a^{J}+\cdots\,,$
(S22)

where $K$ is a symmetric $M\times M$ integer matrix and $a^{I=1,2,\ldots,M}$
are the $U(1)$ gauge fields, the ellipsis denotes parts that involve matter
fields Read (1990); Wen and Zee (1992); Frohlich and Zee (1991); Wen (1995).
Matter fields are gapped and do not enter the dynamics at long distances, yet,
they are necessary in giving rise to the anyonic excitations. Accordingly,
$\ket{\Psi_{0}^{*}}$ carries the conjugate topological order and is described
by the same Lagrangian except that the $K$-matrix has an additional minus
sign. To better distinguish them, we use $\overline{a}^{I=1,2,\ldots,M}$ to
denote the gauge fields for $\ket{\Psi_{0}^{*}}$. We can combine these two
parts and write the path integral $\mathcal{Z}_{\tau<0}$ or
$\mathcal{Z}_{\tau>0}$ in terms of the following Lagrangian

$\mathcal{L}_{CS}[\mathbf{a}]=\frac{1}{4\pi}\sum_{I,J=1}^{2M}\mathbb{K}_{IJ}\,\mathbf{a}^{I}\wedge\mathrm{d}\mathbf{a}^{J}+\cdots,$
(S23)

where $\mathbb{K}=K\oplus(-K)$, and $\mathbf{a}=[a,\overline{a}]^{T}$ is a
$2M$ component vector of the gauge fields in the Hilbert space
$\mathcal{H}\otimes\mathcal{H}$.

Studying the decoherence-induced phases and the potential phase transitions in
the EFD in the current form is not convenient. On one hand, in general,
anyonic excitations created by local errors explicitly involve matter fields
and are complicated to analyze. On the other hand, the transition, which
happens at the temporal interface, is different from a ground state problem
and largely unexplored.

These technical difficulties necessitate our following trick. We perform a
spacetime rotation to exchange the imaginary time $\tau$ and the spatial
coordinate $x$ [Fig. 1(c) of the main text], i.e.,

$\tau\rightarrow-x\,,\quad x\rightarrow\tau\,,\quad y\rightarrow y\,,$ (S24)

where $x,y$ denote the spatial coordinates. The rotation turns the temporal
interface at $\tau=0$ into a spatial one at $x=0$. The original path integral
(S21) can be formally rewritten as

$\mbox{$\langle\\!\langle\rho|\rho\rangle\\!\rangle$}=\int\mathcal{D}(\varphi_{L},\overline{\varphi}_{L},\varphi_{R},\overline{\varphi}_{R})\,\mathcal{Z}_{x>0}[\varphi_{R},\overline{\varphi}_{R}]\mathcal{Z}_{x<0}[\varphi_{L},\overline{\varphi}_{L}]e^{-\tilde{\mathcal{S}}_{int}(\varphi_{R},\overline{\varphi}_{R},\varphi_{L},\overline{\varphi}_{L})}\,,$

where $\mathcal{Z}_{x<0}$, obtained by rotating $\mathcal{Z}_{\tau<0}$, is the
path integral on the left side of the spatial interface $x=0^{-}$, and
$(\varphi_{L},\overline{\varphi}_{L})$ specify the value of the fields at the
spatial interface. The meaning of $\mathcal{Z}_{x>0}$ and
$(\varphi_{R},\overline{\varphi}_{R})$ is similar. $\tilde{\mathcal{S}}_{int}$
describes the coupling between the two half systems at the spatial interface
and generally takes a different form from the original one
$\mathcal{S}_{int}$.

After the rotation, the path integral is translationally invariant in the new
time direction and describes the norm of a $(2+1)$D ground state [Fig. 1(c) of
the main text]. In the rotated picture, the decoherence-induced phases
correspond to the $(1+1)$D phases on the 1D defect at $x=0$.

The Lagrangian that describes the 1D defect has three contributions

$\displaystyle\mathcal{L}=\mathcal{L}_{0}+\mathcal{L}_{1}+\mathcal{L}_{\mathcal{N}},$
(S25)

where $\mathcal{L}_{0}$ describes the low energy edge excitations for the
$(2+1)D$ theory in the region $x>0$ and $x<0$. The interaction on the defect
is derived from $\tilde{S}_{int}$ and contains two parts. The first part
originates from the definition of path integral and couples degrees of freedom
on the left and the right given by $\mathcal{L}_{1}$, which is present even in
the absence of a quantum channel. The second part $\mathcal{L}_{\mathcal{N}}$
is introduced by the quantum channel. In what follows, we explicitly write
down the three terms in the Lagrangian and analyze the possible phases.

We start with the low energy edge theory $\mathcal{L}_{0}$ for the CS theory
in the bulk. We consider how the path integral for the past
$\mathcal{Z}_{\tau<0}$ changes under the rotation:

  * •

Originally, $\mathcal{Z}_{\tau<0}[\varphi_{p},\overline{\varphi}_{p}]$
describes the path integral that prepares the ground state of a system on a
whole plane, where $\varphi_{p},\overline{\varphi}_{p}$ specifies the
component of the wavefunction. Note that $\varphi_{p}$ and
$\overline{\varphi}_{p}$ includes both the CS gauge fields and the matter
fields, and thus they are complicated to deal with.

  * •

The spacetime rotation transforms it into
$\mathcal{Z}_{x>0}[\varphi_{R},\overline{\varphi}_{R}]$, a path integral
defined on the half-space but the entire time domain, and
$\varphi_{R},\overline{\varphi}_{R}$ specifies the boundary value of the
fields. The bulk part of the path integral contains the same CS action as that
before the rotation and the part involving matter fields. The boundary has a
simple description in terms of compact bosons, which is the main reason why
the rotation trick can be useful.

  * •

From now on, we will replace $\varphi_{R}$ and $\overline{\varphi}_{R}$ by the
compact boson fields $\phi_{R},\overline{\phi}_{R}$, which correspond to the
bulk gauge fields $a,\overline{a}$. Then, the low-energy dynamics of the
boundary of the CS theory is governed by the following effective Lagrangian

$\mathcal{L}_{R}[\Phi_{R}]=\frac{1}{4\pi}\sum_{I,J=1}^{2M}-\mathbb{K}_{IJ}\mathrm{i}\partial_{\tau}\Phi_{R}^{I}\partial_{y}\Phi_{R}^{J}-\mathbb{V}_{IJ}\partial_{y}\Phi_{R}^{I}\partial_{y}\Phi_{R}^{J},$
(S26)

where $\Phi_{R}:=[\phi_{R},\overline{\phi}_{R}]$, $\mathbb{K}$ is the same
K-matrix as the one for the bulk CS action, and $\mathbb{V}$ is a positive
semi-definition matrix that determines the velocity of the boson fields. The
path integral with fixed boundary values of the boson fields is then
determined by $\mathcal{L}_{R}[\Phi_{R}]$ classically:

$\mathcal{Z}_{x<0}[\Phi_{R}]=\exp\left(-\int\mathrm{d}\tau\mathrm{d}y\mathcal{L}_{R}[\Phi_{R}]\right)\,.$
(S27)

The transformation of the path integral for the future $\mathcal{Z}_{\tau>0}$
can be analyzed similarly. The result is related to what we have obtained
above by a spatial reflection

$\mathcal{L}_{L}[\Phi_{L}]=\frac{1}{4\pi}\sum_{I,J=1}^{2M}\mathbb{K}_{IJ}\mathrm{i}\partial_{\tau}\Phi_{L}^{I}\partial_{y}\Phi_{L}^{J}-\mathbb{V}_{IJ}\partial_{y}\Phi_{L}^{I}\partial_{y}\Phi_{L}^{J},$

where $\Phi_{L}:=[\phi_{L},\overline{\phi}_{L}]$, and the minus sign in front
of the $K$-matrix comes from the spatial reflection. The path integral
$\mathcal{Z}_{x>0}[\Phi_{L}]$ can also be determined classically

$\mathcal{Z}_{x>0}[\Phi_{L}]=\exp\left(-\int\mathrm{d}\tau\mathrm{d}y\mathcal{L}_{L}[\Phi_{L}]\right)\,.$
(S28)

We combine the low-energy excitations from the left and the right and obtain
the Lagrangian describing the edge of the quadruple topological order

$\mathcal{L}_{0}[\phi]=\frac{1}{4\pi}\sum_{I,J}\mathbb{K}_{IJ}^{(2)}\mathrm{i}\partial_{\tau}\phi^{I}\partial_{y}\phi^{J}-\mathbb{V}_{IJ}^{(2)}\partial_{y}\phi^{I}\partial_{y}\phi^{J}\,,$
(S29)

where the $4M\times 4M$ $K$-matrix
$\mathbb{K}^{(2)}=\mathbb{K}\oplus\mathbb{K}$, velocity matrix
$\mathbb{V}^{(2)}=\mathbb{V}\oplus\mathbb{V}$, and
$\phi:=[\overline{\phi}_{R},\phi_{R},\phi_{L},\overline{\phi}_{L}]$.

Next, we discuss the interaction in the effective theory. The first part
$\mathcal{L}_{1}$ is associated with the definition of path integral and
couples $\phi_{L}$ to $\phi_{R}$ and $\overline{\phi}_{L}$ to
$\overline{\phi}_{R}$. It leads to a gapped phase of the defect in the absence
of errors. The second part $\mathcal{L}_{\mathcal{N}}$ is introduced by the
error channel. It couples the bosonic fields from the same copy of the density
matrix (or equivalently EFD), namely $\phi_{s}$ to $\overline{\phi}_{s}$ for
$s=L,R$.

To explicitly write down the interaction in terms of the compact bosons, we
first list the excitations in the effective theory $\mathcal{L}_{0}$. The
excitations are labeled by integer vectors $\bm{l}_{\alpha}$ and are created
by $e^{\mathrm{i}\bm{l}_{\alpha}^{T}\cdot\phi}$. They have anyonic statistics,
and the braiding of two anyons $\bm{l}_{\alpha}$ and $\bm{l}_{\beta}$ yields a
phase

$\theta_{\alpha\beta}=2\pi\bm{l}_{\alpha}^{T}(\mathbb{K}^{(2)})^{-1}\bm{l}_{\beta}.$
(S30)

We remark that, in general, a single anyon cannot be created using a local
operator. Instead, a pair of anyon $\alpha$ and its antiparticle
$\alpha^{\prime}$ can be created using a local operator, which is described by
$\Psi_{\Lambda}:=e^{\mathrm{i}(\mathbb{K}^{(2)}\Lambda)^{T}\cdot\phi}$ with
$\Lambda$ being an integer vector. Such excitation has trivial braiding with
other excitations, i.e. $\theta_{\alpha,\mathbb{K}^{(2)}\Lambda}=0\mod
2\pi,\forall\alpha$.

Furthermore, the form of the interaction is limited by the global
$\mathcal{G}^{(2)}=\mathbb{Z}_{2}\times\mathbb{Z}_{2}^{\mathbb{H}}$ symmetry
of 1D defect. The first $\mathbb{Z}_{2}$ is an anti-unitary symmetry generated
by the hermitian conjugation in the double Hilbert space. The path integral
represents the norm of the EFD, which is a real number. Thus, the effective
theory is invariant under the transformation

$\displaystyle\phi_{L}^{I}$
$\displaystyle\leftrightarrow\phi_{R}^{I},\quad\overline{\phi}_{L}^{I}\leftrightarrow\overline{\phi}_{R}^{I}.$
(S31)

In addition, the EFD represents the density matrix, which is hermitian in the
original Hilbert space. Thus, edge theory exhibits another anti-unitary
$\mathbb{Z}_{2}^{\mathbb{H}}$ symmetry due to the hermiticity of the density
matrix, which acts as

$\displaystyle\phi_{s}^{I}$
$\displaystyle\leftrightarrow\overline{\phi}_{s}^{I},\quad s=L,R.$ (S32)

We remark that the K-matrix $\mathbb{K}^{(2)}$ flips the sign under the anti-
unitary symmetry, however, the Lagrangian $\mathcal{L}_{0}$ is invariant as
the minus sign cancels that from the imaginary identity.

We are now ready to explicitly write down the interaction in terms of edge
excitations. The first part $\mathcal{L}_{1}$ from the definition of path
integral can be written in terms of the back-scattering between the left and
the right fields. It is generally given by a hopping term between the left and
the right

$\displaystyle\sum_{\Lambda}\frac{B_{\Lambda}(y)e^{\mathrm{i}\theta(y)}}{2}\left(\Psi_{L,\Lambda}^{\dagger}\Psi_{R,\Lambda}+\overline{\Psi}_{R,\Lambda}^{\dagger}\overline{\Psi}_{L,\Lambda}\right)+h.c.,$
(S33)

where $\Psi_{L,\Lambda}:=e^{\mathrm{i}(K\Lambda)^{T}\phi_{L}}$,
$\Psi_{R,\Lambda}:=e^{-\mathrm{i}(K\Lambda)^{T}\phi_{R}}$,
$\overline{\Psi}_{L,\Lambda}:=e^{\mathrm{i}(-K\Lambda)^{T}\overline{\phi}_{L}}$,
and
$\overline{\Psi}_{R,\Lambda}:=e^{\mathrm{i}(K\Lambda)^{T}\overline{\phi}_{R}}$
are local operators on the edge, $\Lambda$ is a $M$-component integer vector,
the real coefficient $B_{\Lambda}$ and phase factor $\theta$ have spatial
dependence in general. In terms of the compact boson fields, the back-
scattering takes the form

$\mathcal{L}_{1}=\sum_{\Lambda}B_{\Lambda}\Big{[}\cos\Big{(}\sum_{I=1}^{M}(K\Lambda)_{I}(\phi_{L}^{I}+\phi_{R}^{I})+\theta\Big{)}+\cos\Big{(}\sum_{I=1}^{M}(K\Lambda)_{I}(\overline{\phi}_{L}^{I}+\overline{\phi}_{R}^{I})+\theta\Big{)}\Big{]}.$
(S34)

We remark that the coefficients for two cosine terms are forced to the same
real number due to the global symmetry $\mathcal{G}^{(2)}$. With large
coefficients, such cosine terms tend to pin the bosonic fields
$\phi+\overline{\phi}$ and lead to a gapped phase of the defect without any
error channel. These interaction terms only create anyon bound states on the
left and the right in the form
$\alpha_{L}\alpha^{\prime}_{R}=e^{\mathrm{i}\bm{l}^{T}\cdot(\phi_{L}+\phi_{R})}$
and
$\overline{\alpha}_{L}\overline{\alpha}^{\prime}_{R}=e^{-\mathrm{i}\bm{l}^{T}\cdot(\overline{\phi}_{L}+\overline{\phi}_{R})}$.

The second part $\mathcal{L}_{\mathcal{N}}$ of the interaction is introduced
by the quantum channel and couples the fields from the same copy of the
density matrix. For incoherent error channels, before the rotation, only anyon
bound states $\alpha\overline{\alpha}$ are created in the EFD. In the rotated
picture, the quantum channel creates excitations
$\alpha_{s}\overline{\alpha}_{s}=e^{\mathrm{i}\bm{l}^{T}\cdot(\phi_{s}-\overline{\phi}_{s})}$.
At the 1D defect, it corresponds to the cosine term

$\displaystyle\mathcal{L}_{\mathcal{N}}=\sum_{\Lambda}C_{\Lambda}\sum_{s=L,R}\cos\left(\sum_{I=1}^{M}(K\Lambda)_{I}(\phi_{s}^{I}-\overline{\phi}_{s}^{I})\right),$
(S35)

where $C_{\Lambda}$ is a real coefficient with spatial dependence. We remark
that the coefficient of the different cosine terms for $s=L,R$ are the same
due to the $\mathbb{Z}_{2}$ symmetry.

The possible phases of the defect are classified by the inequivalent ways of
gapping out $\mathcal{L}_{0}$ in Eq. (S29) by condensing bosonic excitations.
For abelian topological order, the bosonic objects form a group, dubbed the
Lagrangian subgroup $\mathcal{M}$ Levin (2013); Barkeshli  _et al._ (2013).
Thus, the phases of abelian topological order subject to incoherent errors are
classfied by the subgroup $\mathcal{M}$ that satisfying the following
criteria:

  1. 1.

$e^{\mathrm{i}\theta_{\bm{m}\bm{m^{\prime}}}}=1,\forall\bm{m},\bm{m^{\prime}}\in\mathcal{M}$;

  2. 2.

$\forall\bm{l}\notin\mathcal{M}$, $\exists\bm{m}$ s.t.
$e^{\mathrm{i}\theta_{\bm{ml}}}\neq 1$;

  3. 3.

$\forall\bm{m}\in\mathcal{M}$, $g\bm{m}g^{-1}\in\mathcal{M},\forall
g\in\mathcal{G}^{(2)}$;

  4. 4.

(Incoherent error)
$[\bm{1},\bm{1},-\bm{1},-\bm{1}]^{T}\cdot\bm{m}=0\mod\mathbb{K}^{(2)}\Lambda,\forall\bm{m}\in\mathcal{M}$,

where $\Lambda$ is a $4M$-component integer vector, $\bm{1}$ is an
$M$-component vector with each element being unity. Here, the third criterion
originates from the symmetry constraints, i.e. the excitations related by
symmetry transformations must condense simultaneously. The last criterion is
due to incoherent errors. The interaction on the edge only creates anyon bound
states $\alpha_{L}\overline{\alpha}_{L}$, $\alpha_{R}\overline{\alpha}_{R}$,
$\alpha_{L}\alpha^{\prime}_{R}$,
$\overline{\alpha}_{L}\overline{\alpha}^{\prime}_{R}$ and their fusion
results. Therefore, the condensed objects satisfy the last criterion.

In the case of coherent errors, the phases are still classified by the
Lagrangian subgroup. However, since the Kraus operators can, for example,
create anyon excitation $\alpha$ and $\overline{\alpha}$ in a single copy, the
condensed objects need not to satisfy the last criterion. Correspondingly, in
the Lagrangian, the coherent errors can introduce the cosine terms,
$\cos((K\Lambda)^{T}\cdot\phi_{s})$ and
$\cos((K\Lambda)^{T}\cdot\overline{\phi}_{s})$, which solely depends on the
compact boson in an individual copy of the topological order. This can
possibly lead to additional decoherence-induced phases.

Each edge condensate corresponds to a distinct phase of the EFD, and its
condensed objects also determine the capability of encoding information in the
error-corrupted state. In the main text, we mention that the logical operator
$W_{\alpha\overline{\alpha}}(\ell)$ can no longer encode quantum information
in the condensate of anyon bound state $\alpha\overline{\alpha}$ in the EFD,
which is equivalent to condensing $\alpha_{s}\overline{\alpha}_{s}$ with
$s=L,R$ in the $(1+1)$D theory of the defect. Hence, examining whether
$\alpha_{s}\overline{\alpha}_{s}$ is condensed on the edge can determine the
encoding properties in the error-corrupted state.

###  SII.3 Examples

Here, we classify the possible phases by enumerating the Lagrangian subgroups
in three examples, 2D Toric code, double semion model, and $\nu=1/3$ Laughlin
state, subject to incoherent errors. We comment on the information encoding in
each phase. The results are summarized in Table I of the main text.

_Example 1: Toric code._ — The first example we consider is the 2D Toric code
subject to incoherent errors. We find five distinct gapped phases [see Table I
222Here and in the following, Table I refers to the table in the main text.].

To start with, the low energy excitations in 2D Toric code are described by
the CS theory with K-matrix

$\displaystyle K_{TC}=\begin{pmatrix}0&2\\\ 2&0\end{pmatrix}.$ (S36)

The Toric code has four superselection sectors: $1,e,m,f$. Here, $e$ and $m$
are self-boson and exhibit mutual semionic statistics. The fermion $f$ is a
composite object of $e$ and $m$. These anyonic quasiparticles are labeled by
integer vectors

$\displaystyle\bm{l}_{e}=\begin{pmatrix}1\\\
0\end{pmatrix},\quad\bm{l}_{m}=\begin{pmatrix}0\\\
1\end{pmatrix},\quad\bm{l}_{f}=\begin{pmatrix}1\\\ 1\end{pmatrix}.$ (S37)

The first gapped phase is achieved when no error is present. In this case, the
definition of path integral introduces the cosine terms in Eq. (S34)

$\displaystyle\mathcal{L}_{1}=\sum_{I=1,2}B_{I}\Big{[}$
$\displaystyle\cos\left(2(\phi_{L}^{I}+\phi_{R}^{I})+\theta\right)+(\phi_{s}\leftrightarrow\overline{\phi}_{s})\Big{]}+\cdots.$
(S38)

Here, the ellipses represent the less relevant terms. With sufficiently large
coefficients $B_{I}$, these cosine terms can induce an edge condensate of
$e_{L}e_{R},\overline{e}_{L}\overline{e}_{R},m_{L}m_{R}$, and
$\overline{m}_{L}\overline{m}_{R}$ (Phase I in Table I). The corrupted density
matrix in this phase can encode quantum information because
$\alpha_{s}\overline{\alpha}_{s}$ is not condensed.

The incoherent error channel can induce distinct edge phases. Here, we have
three cosine terms in the form of Eq. (S35)

$\displaystyle\mathcal{L}_{\mathcal{N},e}$
$\displaystyle=C_{e}\sum_{s=L,R}\cos\left(2(\bm{l}_{e}^{T}\cdot\phi_{s}-\bm{l}_{e}^{T}\cdot\overline{\phi}_{s})\right),$
(S39) $\displaystyle\mathcal{L}_{\mathcal{N},m}$
$\displaystyle=C_{m}\sum_{s=L,R}\cos\left(2(\bm{l}_{m}^{T}\cdot\phi_{s}-\bm{l}_{m}^{T}\cdot\overline{\phi}_{s})\right),$
$\displaystyle\mathcal{L}_{\mathcal{N},f}$
$\displaystyle=C_{f}\sum_{s=L,R}\cos\left(2(\bm{l}_{f}^{T}\cdot\phi_{s}-\bm{l}_{f}^{T}\cdot\overline{\phi}_{s})\right),$

which are generated by the incoherent channels that create $e$, $m$, and $f$,
respectively. With a sufficiently large coefficient, any one of three cosine
terms can develop a classical value leading to a condensate of
$\alpha_{s}\overline{\alpha}_{s}$ with $\alpha=e,m,f$, which corresponds to
Phase II-IV in Table I, respectively. In these phases, the remaining logical
operators mutually commute, and the corrupted state is a classical memory.

Finally, when two cosine terms develop a classical value, the remaining one
also achieves a classical value (Phase V in Table I). Here, the corrupted
state is a trivial state, and one cannot encode any information.

Allowing coherent errors may lead to additional gapped phases beyond the above
five possibilities. For example, the amplitude-damping channel

$\displaystyle\mathcal{K}_{1,i}=\frac{1+\sqrt{1-\kappa}}{2}\mathbb{I}+\frac{1-\sqrt{1-\kappa}}{2}Z_{i},\quad\mathcal{K}_{2,i}=\frac{\sqrt{\kappa}}{2}(X_{i}+\mathrm{i}Y_{i}),$
(S40)

which can generate
$e_{s},\overline{e}_{s},m_{s},\overline{m}_{s},e_{s}\overline{m}_{s},m_{s}\overline{e}_{s}$
for $s=L,R$ in the effective theory. These anyons cannot be created by
incoherent errors; condensing a subset of them can lead to distinct phases.
This possibly leads to additional phases of the 1D defect labeled by the
Lagrangian subgroups with following generators:

  * •

$e_{s},\overline{e}_{s}\text{ for }s=L,R$;

  * •

$m_{s},\overline{m}_{s}\text{ for }s=L,R$;

  * •

$e_{s}\overline{m}_{s},m_{s}\overline{e}_{s}\text{ for }s=L,R$.

However, as the coherent channel creates all these anyons together with the
anyon bound state $\alpha_{s}\overline{\alpha}_{s}$, these possible phases
will compete. It requires numerical simulation to determine which anyon
condenses at low energy. It remains open whether a specific coherent error
channel can realize any of these phases.

We make a few remarks. First, the phase with $e$ or $m$ anyon condensed in
individual copies can be obtained by an imaginary time evolution of the Toric
code ground state. For example, $\ket{\Psi_{0}}\rightarrow
e^{\mu\sum_{i}Z_{i}}\ket{\Psi_{0}}$ can realize the edge condensate of $e_{s}$
and $\overline{e}_{s}$. Second, the above three phases are studied in the
context of 1D defect phases in double Toric code and are referred to as the
“cut-open” and “SPT” boundary Lichtman  _et al._ (2021).

_Example 2: Double semion._ — The second example we consider is the double
semion model subject to incoherent errors Levin and Gu (2012). Again, we
enumerate the possible Lagrangian subgroups that characterize the distinct
phases. We find five phases summarized in Table I.

The low-energy theory for double semion topological order is the abelian CS
theory with K-matrix

$\displaystyle K_{DS}=\begin{pmatrix}2&0\\\ 0&-2\end{pmatrix}.$ (S41)

The double semion model has four superselection sectors: $1,m_{a},m_{b},b$,
where $m_{a}$ is a semion, $m_{b}$ is an anti-semion, and the boson $b$ is a
composite object of $m_{a}$ and $m_{b}$. The semion $m_{a}$ and anti-semion
$m_{b}$ are mutual boson. These anyons are characterized by the integer
vectors

$\displaystyle\bm{l}_{m_{a}}=\begin{pmatrix}1\\\
0\end{pmatrix},\quad\bm{l}_{m_{b}}=\begin{pmatrix}0\\\
1\end{pmatrix},\quad\bm{l}_{b}=\begin{pmatrix}1\\\ 1\end{pmatrix}.$ (S42)

The double semion model on the torus has a four-fold degenerate ground state
that can encode two logical qubits. The logical operators are the loop
operators $w_{\alpha}(\ell)$ transporting $\alpha=m_{a},m_{b}$ along two
inequivalent large loops $\ell=\ell_{1},\ell_{2}$. Distinct from the case of
Toric code, the operators along different loops, $w_{\alpha}(\ell_{1})$ and
$w_{\alpha}(\ell_{2})$ for $\alpha=m_{a},m_{b}$, anti-commute due to the anyon
self-statistics and therefore serve as Pauli-X and Z operators for a logical
qubit.

The first gapped phase (Phase I in Table I) of the defect is realized when no
error is present. The backscattering term $\mathcal{L}_{1}$ condenses the
anyon bound states $\alpha_{L}{\alpha}^{\prime}_{R}$ and
$\overline{\alpha}_{L}\overline{\alpha}^{\prime}_{R}$ for
$\alpha=m_{a},m_{b},b$. This phase can encode two qubits of quantum
information.

The incoherent channel in the double semion model can introduce the following
cosine terms:

$\displaystyle\mathcal{L}_{\mathcal{N},m_{a}}$
$\displaystyle=C_{m_{a}}\sum_{s=L,R}\cos\left(2(\bm{l}_{m_{a}}^{T}\cdot\phi_{s}-\bm{l}_{m_{a}}^{T}\cdot\overline{\phi}_{s})\right),$
(S43) $\displaystyle\mathcal{L}_{\mathcal{N},m_{b}}$
$\displaystyle=C_{m_{b}}\sum_{s=L,R}\cos\left(2(\bm{l}_{m_{b}}^{T}\cdot\phi_{s}-\bm{l}_{m_{a}}^{T}\cdot\overline{\phi}_{s})\right),$
$\displaystyle\mathcal{L}_{\mathcal{N},b}$
$\displaystyle=C_{b}\sum_{s=L,R}\cos\left(2(\bm{l}_{b}^{T}\cdot\phi_{s}-\bm{l}_{b}^{T}\cdot\overline{\phi}_{s})\right),$

which creates anyon bound states $\alpha_{s}\overline{\alpha}_{s}$ for
$\alpha=m_{a},m_{b},b$, respectively. Condensing each one of these terms
induces Phase II-IV in Table I, respectively. In Phase II [III], one can
encode information in $w_{m_{a}}(\ell)$ [$w_{m_{b}}(\ell)$] for
$\ell=\ell_{1},\ell_{2}$. These logical operators do not mutually commute and
therefore can encode one qubit of quantum information. In Phase IV, the
corrupted state can still encode one qubit of quantum information, despite
that $w_{m_{a}}$ and $w_{m_{b}}$ are identified due to the condensation of
$b_{s}\overline{b}_{s}$. Condensing two terms in Eq. (S43) indicates the third
is condensed and leads to Phase V, which cannot encode information.

Introducing coherent errors can potentially realize an additional phase by
condensing the boson in individual copies, $b_{s}$ and $\overline{b}_{s}$.
Again, designing a specific coherent error channel to possibly realize this
phase is left for future study.

_Example 3: $\nu=1/3$ Laughlin state.—_ The third example is $\nu=1/3$
Laughlin state Laughlin (1983) with incoherent errors. In this case, we find
two phases summarized in Table I.

The low-energy excitations in the Laughlin state is described by the abelian
CS theory with K-matrix $K_{1/3}=(3)$. It contains three superselection
sectors $\\{1,\eta,\eta^{2}\\}$. $\eta$ and $\eta^{2}$ are the quasiparticle
and quasihole, and they are labeled by the charge vector $\bm{l}_{\eta}=(1)$
and $\bm{l}_{\eta^{2}}=(2)$ and carry charge $e/3$ and $-e/3$, respectively.

There is only one type of incoherent channel; its Kraus operators create a
pair of quasiparticle and quasihole. When the error is below the threshold,
the corrupted state is a quantum memory characterized by the Lagrangian
subgroup generated by $\eta_{L}\eta_{R}^{2}$ and
$\overline{\eta}_{L}\overline{\eta}_{R}^{2}$ (Phase I in Table I). When error
proliferates, we obtain a trivial phase with a subgroup generated by
$\eta_{L}\overline{\eta}_{L}$ and $\eta_{R}\overline{\eta}_{R}$ (Phase II in
Table I).

###  SII.4 Generalization to the $n$-th moment

(a)1D defect2 $\times$ (topo.
order)(b)Folding$\phi_{1}$$\overline{\phi}_{1}$$\phi_{2}$$\overline{\phi}_{2}$(c)$\phi_{1}$$\overline{\phi}_{1}$$\phi_{2}$$\overline{\phi}_{2}$$\vdots$$\phi_{n}$$\overline{\phi}_{n}$
Figure S1: (a) The path integral represents the norm of the ground state of
double 2D topological order with 1D defect (red region). (b) Folding the
double topological order around the 1D defect results in quadruple topological
order with a 1D boundary. The red regions represent the coupling
$\mathcal{L}_{\mathcal{N}}$ induced by the quantum channel. The couplings
between $\phi_{1}$ and $\overline{\phi}_{2}$ (also $\overline{\phi}_{1}$ and
$\phi_{2}$) are denoted by $\mathcal{L}_{1}$ inherited from the definition of
path integral. (c) The edge theory associated with the $n$-th moment
$\operatorname{tr}\rho^{n}$ of the density matrix. The generalized swap
interaction $\mathcal{L}_{1}^{(n)}$ couples the compact bosons in the
neighboring copies, i.e. $\overline{\phi}_{s}$ and $\phi_{s+1}$ for
$s=1,2,\cdots,n$.

So far, the analysis focuses on the distinct phases in the EFD, which pertains
to analyzing the second moment of the density matrix, i.e. the norm of the EFD
$\mbox{$\langle\\!\langle\rho|\rho\rangle\\!\rangle$}=\operatorname{tr}\rho^{2}$.
In this subsection, we generalize the problem to the $n$-th moment
$\operatorname{tr}\rho^{n}$ and map the decoherence-induced phases to $(1+1)$D
boundary phases.

Before discussing the $n$-th moment, we develop an equivalent formulation of
the second moment $\operatorname{tr}\rho^{2}$. The phases of the $(1+1)$D
defect can be converted to the $(1+1)$D edge phases by folding around the
defect as shown in Fig. S1(b) Beigi  _et al._ (2011); Kapustin and Saulina
(2011). In the folded picture, we have four copies of the topological order.
On the edge, we relabel the bosonic fields as

$\displaystyle\phi:=[\overline{\phi}_{R},\phi_{R},\phi_{L},\overline{\phi}_{L}]=[\phi_{1},\overline{\phi}_{1},\phi_{2},\overline{\phi}_{2}],$
(S44)

where $\phi_{1(2)}$ and $\overline{\phi}_{1(2)}$ denote the fields associated
with the copy-$1(2)$ of the density matrix.

The path integral describing the ground state of quadruple topological order
with an edge corresponds to an overlap in the quadruple Hilbert space
$\mathcal{H}^{\otimes 4}$ before the rotation

$\displaystyle\operatorname{tr}\rho^{2}=\mbox{$\langle\\!\langle\mathbb{C}^{(2)}|$}\left(\mbox{$|\rho\rangle\\!\rangle$}\otimes\mbox{$|\rho\rangle\\!\rangle$}\right):=\int\mathcal{D}(\varphi_{1},\varphi_{2})\left(\bra{\varphi_{1}}\otimes\bra{\varphi_{2}}\right)\otimes\mbox{$|\rho\rangle\\!\rangle$}\,\left(\bra{\varphi_{2}}\otimes\bra{\varphi_{1}}\right)\otimes\mbox{$|\rho\rangle\\!\rangle$},$
(S45)

where $\langle\\!\langle\mathbb{C}^{(2)}|$ is a “swap” reference state that
couples the fields in the ket and bra Hilbert space of the different copies of
the EFD.

The overlap is readily generalized to describe the $n$-th moment
$\operatorname{tr}\rho^{n}$. Here, in $2n$ copies of the Hilbert space
$\mathcal{H}^{\otimes 2n}$, we consider

$\displaystyle\operatorname{tr}\rho^{n}=\mbox{$\langle\\!\langle\mathbb{C}^{(n)}|$}\left(\mbox{$|\rho\rangle\\!\rangle$}^{\otimes
n}\right):=\int\mathcal{D}(\varphi_{1},\varphi_{2},\cdots,\varphi_{n})\prod_{s=1}^{n}\left(\bra{\varphi_{s}}\otimes\bra{\varphi_{s+1}}\right)\otimes\mbox{$|\rho\rangle\\!\rangle$},$
(S46)

where $\varphi_{n+1}:=\varphi_{1}$, and $\langle\\!\langle\mathbb{C}^{(n)}|$
is a generalized swap reference state.

We can similarly develop a path integral formulation of the overlap. In the
rotated picture, it corresponds to the ground state of $2n$ copies of the
topological order with an $(1+1)$D edge. The effective edge theory also
contains three parts

$\mathcal{L}^{(n)}=\mathcal{L}_{0}^{(n)}+\mathcal{L}_{1}^{(n)}+\mathcal{L}_{\mathcal{N}}^{(n)}.$
(S47)

The first part $\mathcal{L}_{0}^{(n)}$ describes the low-energy excitations in
$2n$ copies of the topological order

$\displaystyle\mathcal{L}_{0}^{(n)}[\phi]=\frac{1}{4\pi}\sum_{I,J}\mathbb{K}_{IJ}^{(n)}\mathrm{i}\partial_{\tau}\phi^{I}\partial_{y}\phi^{J}-\mathbb{V}_{IJ}^{(n)}\partial_{y}\phi^{I}\partial_{y}\phi^{J}$
(S48)

where the compact bosonic field
$\phi:=[\phi_{1},\overline{\phi}_{1},\phi_{2},\overline{\phi}_{2},\cdots,\phi_{n},\overline{\phi}_{n}]$
is a $2nM$-component vector, $\mathbb{K}^{(n)}=[K\oplus(-K)]^{\oplus n}$ , and
$\mathbb{V}^{(n)}=V^{\oplus 2n}$. The second part $\mathcal{L}_{1}^{(n)}$ is
the interaction introduced by the reference state, which takes a general form

$\displaystyle\mathcal{L}_{1}^{(n)}=\sum_{\Lambda}B_{\Lambda}\sum_{s=1}^{n}\cos\left(\sum_{I}(K\Lambda)_{I}(\phi_{s}^{I}+\overline{\phi}_{s+1}^{I})+\theta\right).$
(S49)

where $\overline{\phi}_{n+1}:=\overline{\phi}_{1}$. The last part
$\mathcal{L}_{\mathcal{N}}^{(n)}$ describes the error channel. For incoherent
errors, we have

$\displaystyle\mathcal{L}_{\mathcal{N}}^{(n)}=\sum_{\Lambda}C_{\Lambda}\sum_{s=1}^{n}\cos\left(\sum_{I}(K\Lambda)_{I}(\phi_{s}^{I}-\overline{\phi}_{s}^{I})\right).$
(S50)

The edge theory exhibits a global symmetry
$\mathcal{G}^{(n)}=\mathbb{Z}_{n}\times\mathbb{Z}_{2}^{\mathbb{H}}$. We note
that the $\mathbb{Z}_{n}$ symmetry is a unitary symmetry generated by the
cyclic permutation over $n$ copies of the density matrix

$\displaystyle\phi_{s}\leftrightarrow\phi_{s+1},\quad\overline{\phi}_{s}\leftrightarrow\overline{\phi}_{s+1}.$
(S51)

In the case of $n=2$, $\mathcal{G}^{(n)}$ reduces to $\mathcal{G}^{(2)}$ in
Sec. SII.2 as the permutation over two copies of the density matrix is a
combination of the Hermitian conjugation of the EFD and that of the density
matrix.

We remark that the incoherent errors can induce condensation of
$\alpha_{s}\overline{\alpha}_{s}$ for $s=1,2,\cdots n$ on the edge. Since the
different anyon bound states $\alpha_{s}\overline{\alpha}_{s}$ and
$\beta_{s^{\prime}}\overline{\beta}_{s^{\prime}}$ are mutual bosons, different
incoherent channels do not compete with each other. Thus, the number of
possible condensates is independent of the replica index $n$, and so is the
classification for abelian topological with incoherent errors. Hence, we
expect each phase of $\operatorname{tr}\rho^{2}$ in Table I has a
correspondence in the replica limit $n\to 1$.

## References

  * Castelnovo and Chamon (2008) C. Castelnovo and C. Chamon, Phys. Rev. B 77, 054433 (2008), arXiv:0707.2084 [cond-mat.str-el] .
  * Note (1) We thank Meng Cheng for pointing this out to us.
  * Read (1990) N. Read, Phys. Rev. Lett. 65, 1502 (1990).
  * Wen and Zee (1992) X. G. Wen and A. Zee, Phys. Rev. B 46, 2290 (1992).
  * Frohlich and Zee (1991) J. Frohlich and A. Zee, Nucl. Phys. B 364, 517 (1991).
  * Wen (1995) X.-G. Wen, Adv. Phys. 44, 405 (1995), arXiv:cond-mat/9506066 .
  * Levin (2013) M. Levin, Phys. Rev. X 3, 021009 (2013), arXiv:1301.7355 [cond-mat.str-el] .
  * Barkeshli  _et al._ (2013) M. Barkeshli, C.-M. Jian, and X.-L. Qi, Phys. Rev. B 88, 235103 (2013), arXiv:1305.7203 [cond-mat.str-el] .
  * Note (2) Here and in the following, Table I refers to the table in the main text.
  * Lichtman  _et al._ (2021) T. Lichtman, R. Thorngren, N. H. Lindner, A. Stern, and E. Berg, Phys. Rev. B 104, 075141 (2021), arXiv:2003.04328 [cond-mat.str-el] .
  * Levin and Gu (2012) M. Levin and Z.-C. Gu, Phys. Rev. B 86, 115109 (2012), arXiv:1202.3120 [cond-mat.str-el] .
  * Laughlin (1983) R. B. Laughlin, Phys. Rev. Lett. 50, 1395 (1983).
  * Beigi  _et al._ (2011) S. Beigi, P. W. Shor, and D. Whalen, Communications in Mathematical Physics 306, 663 (2011), arXiv:1006.5479 [quant-ph] .
  * Kapustin and Saulina (2011) A. Kapustin and N. Saulina, Nuclear Physics B 845, 393 (2011), arXiv:1008.0654 [hep-th] .