11institutetext: Key Laboratory of National Ministry of Health for Forensic
Sciences, School of Medicine & Forensics, Health Science Center, Xi’an
Jiaotong University, Xi’an, Shaanxi 710049, China
<EMAIL_ADDRESS>School of Mathematics and Statistics, Xi’an
Jiaotong University, Xi’an, Shaanxi 710149, China
<EMAIL_ADDRESS>Key Laboratory of Biomedical
Information Engineering of Ministry of Education, School of Life Science and
Technology, Xi’an Jiaotong University, Xi’an, Shaanxi 710049, China
<EMAIL_ADDRESS>Tencent AI Lab, Shenzhen, China

# Forensic Histopathological Recognition via a Context-Aware MIL Network
Powered by Self-Supervised Contrastive Learning

Chen Shen 11 Jun Zhang 44 Xinggong Liang 11 Zeyi Hao 11 Kehan Li 33 Fan
Wang(✉) 33 Zhenyuan Wang (✉) 11 Chunfeng Lian(✉) 22

###### Abstract

Forensic pathology is critical in analyzing death manner and time from the
microscopic aspect to assist in the establishment of reliable factual bases
for criminal investigation. In practice, even the manual differentiation
between different postmortem organ tissues is challenging and relies on
expertise, considering that changes like putrefaction and autolysis could
significantly change typical histopathological appearance. Developing AI-based
computational pathology techniques to assist forensic pathologists is
practically meaningful, which requires reliable discriminative representation
learning to capture tissues’ fine-grained postmortem patterns. To this end, we
propose a framework called FPath, in which a dedicated self-supervised
contrastive learning strategy and a context-aware multiple-instance learning
(MIL) block are designed to learn discriminative representations from
postmortem histopathological images acquired at varying magnification scales.
Our self-supervised learning step leverages multiple complementary contrastive
losses and regularization terms to train a double-tier backbone for fine-
grained and informative patch/instance embedding. Thereafter, the context-
aware MIL adaptively distills from the local instances a holistic bag/image-
level representation for the recognition task. On a large-scale database of
$19,607$ experimental rat postmortem images and $3,378$ real-world human
decedent images, our FPath led to state-of-the-art accuracy and promising
cross-domain generalization in recognizing seven different postmortem tissues.
The source code will be released on https://github.com/ladderlab-
xjtu/forensic_pathology.

###### Keywords:

Forensic Pathology Self-Supervised Learning Multiple Instance Learning

##  1 Introduction

Computational pathology powered by artificial intelligence (AI) shows
promising applications in various clinical studies [18, 14], significantly
easing the workload and promoting the development of clinical pathology.
Inspired by such exciting progress, let’s think step by step, so why not
leverage advanced AI techniques to boost the research and applications in
another important discipline, i.e., forensic pathology? Forensic pathology
focuses on investigating the cause, manner, and time of (non-natural) deaths
based on histopathological examinations of postmortem organ tissues [5]. As an
indispensable part of the medicolegal autopsy, it provides critical evidence
from the microscopic aspect to confirm, perfect, or refute macroscopic
findings, establishing a reliable factual basis for future inferences [4].
Histopathological analysis in forensic pathology is challenging and time-
consuming, since postmortem changes (e.g., putrefaction and autolysis)
severely destroy tissues’ typical image appearance, even making the manual
differentiation between the tissues of different organs very difficult.

Although diverse deep-learning approaches have been proposed in clinical
studies to process and analyze histopathological images [18, 14], no similar
work has yet in the forensic pathology community. The main reason could be
three-fold. 1) Forensic and clinical pathology have distinct purposes. The
former case analyzes the tissue images from multiple organs concurrently. In
contrast, clinical diagnosis/prognosis usually focuses on one tissue type in
one task [6]. 2) Due to postmortem changes, histopathological images in
forensic pathology have atypical appearances and more complex distributions
than in clinical pathology, bringing additional challenges to deep
representation learning [21, 25]. 3) Data in forensic pathology are more
difficult to obtain and have relatively lower quality. Therefore, to deploy a
reliable computational pathology system for forensic investigation, fine-
grained discriminative representation learning from complex postmortem
histopathological images is a very precondition.

In this paper, we introduce a deep computational pathology framework (_dubbed
as_ FPath) for forensic histopathological analysis. As shown in Fig. 1, FPath
leverages the idea of self-supervised contrastive learning and multiple
instance learning (MIL) to learn discriminative histopathological
representations. Specifically, we propose a self-supervised contrastive
learning strategy to learn a double-tier backbone network for fine-grained
feature embedding of local image patches (i.e., instances in MIL). After that,
a context-aware MIL block is designed, which adopts a self-attention mechanism
to refine instance-level representations by aggregating contextual
information, and then applies an adaptive-pooling operation to produce a
holistic image-level representation for prediction. Our FPath performs
efficient predictions without the need for tedious pre-processing (e.g.,
foreground extraction/segmentation). To the best of our knowledge, this paper
is the first attempt that shows promising applications of advanced AI
techniques (e.g., self-supervised contrastive learning) to forensic pathology.

The main technical contributions of our work are:

  * 1)

We design a double-tier backbone and a dedicated self-supervised learning
strategy to capture discriminative instance-level histopathological patterns
of postmortem organ tissues. The double-tier backbone combines CNN and
transformer for local and non-local information fusion. To effectively train
such a backbone to handle images acquired with varying microscopic
magnifications, the dedicated self-supervised learning strategy leverages
multiple complementary contrastive losses and regularization terms to
concurrently maximize global and spatially fine-grained similarities between
different views of the same instances/patches in an informative representation
space.

  * 2)

We design a context-aware MIL branch to produce the bag-level discriminative
representations for accurate and efficient postmortem histopathological
recognition. Our MIL branch first refines instance embedding by leveraging a
self-attention mechanism integrating positional embedding to model cross-patch
associations for contextual information enhancement. Thereafter, an adaptive
pooling operation is designed to learn deformable spatial attention to distill
from contextually enhanced patch-level representations a holistic image-level
representation for recognition.

  * 3)

Our FPath was applied to recognize postmortem organ tissues, a fundamental
task in forensic pathology. To this end, we established a relatively large-
scale multi-domain database consisting of an experimental rat postmortem
dataset and a real-world human decedent dataset, each with $19,607$ and
$3,378$ images acquired at a specific microscopic magnification (e.g.,
5$\times$, 10$\times$, 20$\times$, and 40$\times$), respectively. On such a
multi-domain database, our FPath led to promising cross-domain generalization
and state-of-the-art accuracy in recognizing seven different postmortem
organs.

Figure 1: Our FPath that consists of a self-supervised double-tier backbone
(Step 1) and a context-aware MIL branch for postmortem recognition (Step 2).

##  2 Method

The schematic diagram of our FPath is shown in Fig. 1, which consists of two
steps: 1) Self-supervised contrastive learning of a double-tier backbone, and
2) Context-aware multiple instance learning for postmortem tissue recognition.

###  2.1 Self-Supervised Contrastive Patch Embedding

####  2.1.1 Double-Tier Backbone

Given patches from a postmortem histopathological image acquired at a specific
magnification (i.e., 5$\times$, 10$\times$, 20$\times$, or 40$\times$), we
adopt a backbone with a local branch (LB) and a global branch (GB) for
instance/patch feature embedding. The LB is a ResNet50 [10] consisting of $16$
successive bottlenecks, each with three convolutional layers with the kernel
size of $1\times 1$, $3\times 3$, and $1\times 1$, respectively. The GB is a
Swin Transformer [17] that contains of a series of $12$ window-based multi-
head self-attention modules. Let an input patch be
$\mathbf{X}\in\mathbb{R}^{H\times W\times 3}$. The corresponding feature
embedding produced by the double-tier backbone will be
$\mathbf{M}=\mathbf{M}_{\text{LB}}\oplus\mathbf{M}_{\text{GB}}$
($\in\mathbb{R}^{h\times w\times C}$), where $\mathbf{M}_{\text{LB}}$ and
$\mathbf{M}_{\text{GB}}$ denotes the representations from the LB and GB
branch, respectively, and $\oplus$ stands for the channel-wise concatenation
operation.

####  2.1.2 Self-Supervised Contrastive Learning Strategy

We leverage the idea of self-supervised representation learning to establish
the double-tier backbone. Referring to MoCo [9], our self-supervised learning
is constructed by a teacher branch and a student branch. The student branch
consists of six components, including a double-tier backbone (i.e.,
$\mathfrak{f}_{\theta}(\cdot)$), three projection layers (i.e.,
$\mathfrak{g}^{\text{sg}}(\cdot)$, $\mathfrak{g}^{\text{so}}(\cdot)$,
$\mathfrak{g}^{\text{sp}}(\cdot)$), and two prediction layers (i.e.,
$\mathfrak{p}^{\text{sg}}(\cdot)$ and $\mathfrak{p}^{\text{so}}(\cdot)$). The
teacher branch contains four components, including a double-tier backbone
$\mathfrak{f}_{\eta}(\cdot)$, and three projection layers (i.e.,
$\mathfrak{g}^{\text{tg}}(\cdot)$, $\mathfrak{g}^{\text{to}}(\cdot)$, and
$\mathfrak{g}^{\text{tp}}(\cdot)$). By feeding the two branches with different
views of same patches, $\mathfrak{f}_{\theta}(\cdot)$ in the student branch
(i.e., parameterized by $\theta$) is trained via back-propagation to update
$\mathfrak{f}_{\eta}(\cdot)$ in the teacher branch (i.e., parameterized by
$\eta$) in a momentum-based moving average fashion, such as $\eta\leftarrow
m\cdot\eta+(1-m)\cdot\theta$, where $m=0.99$ is the momentum parameter.

Another key issue that determines the quality of the embedding from such a
self-supervised strategy is the formulation of respective contrastive loss
functions and regularization terms. Accordingly, we design a thorough
contrastive learning strategy to capture fine-grained discriminative patterns
of postmortem tissues under varying microscopic magnifications. That is, let
$\mathbf{X}_{\text{s}}$ and $\mathbf{X}_{\text{t}}$ be two different views of
an image patch $\mathbf{X}$ generated by a random data augmentation process.
Our contrastive learning strategy concurrently encourages the _global
similarity_ and _spatially fine-grained similarity_ between the corresponding
feature embedding
$\mathbf{M}_{\text{s}}=\mathfrak{f}_{\theta}(\mathbf{X}_{\text{s}})$ and
$\mathbf{M}_{\text{t}}=\mathfrak{f}_{\eta}(\mathbf{X}_{\text{t}})$
($\in\mathbb{R}^{h\times w\times C}$). Also, _two regularization terms_ are
applied as auxiliary guidance to _protect the informativeness and avoid
collapses_ of the embedding learned by the backbone.

Specifically, the global similarity between $\mathbf{M}_{\text{s}}$ and
$\mathbf{M}_{\text{t}}$ is encouraged by minimizing a general cosine
contrastive loss, such as

$\mathcal{L}_{\text{global}}=2-2\cdot\frac{<\mathbf{z}^{\text{g}}_{\text{s}},\mathbf{z}^{\text{g}}_{\text{t}}>}{{||\mathbf{z}^{\text{g}}_{\text{s}}||}_{2}\cdot{||\mathbf{z}^{\text{g}}_{\text{t}}||}_{2}},$
(1)

where
$\mathbf{z}^{\text{g}}_{\text{s}}=\mathfrak{p}^{\text{sg}}(\mathfrak{g}^{\text{sg}}(\text{GAP}(\mathbf{M}_{\text{s}})))$
and
$\mathbf{z}^{\text{g}}_{\text{t}}=\mathfrak{g}^{\text{tg}}(\text{GAP}(\mathbf{M}_{\text{t}}))$,
with $\text{GAP}(\cdot)$ standing for the global average pooling that produces
feature vectors.

In practice, forensic pathologists typically infer postmortem tissue type by
evaluating the cellular compositions in multiple local regions. Accordingly,
inspired by cross-view learning [11], we design a spatially fine-grained
contrastive loss to explicitly encourage multi-parts similarity between
$\mathbf{M}_{\text{s}}$ and $\mathbf{M}_{\text{t}}$. Assume
$\mathbf{M}^{\prime}_{\text{s}}$ and $\mathbf{M}^{\prime}_{\text{t}}$ are two
$(h\cdot w)\times C$ tensors flattened from $\mathbf{M}_{\text{s}}$ and
$\mathbf{M}_{\text{t}}$ across the spatial dimension, respectively. They are
further processed by $\mathfrak{g}^{\text{so}}(\cdot)$ and
$\mathfrak{g}^{\text{to}}(\cdot)$ (followed by softmax normalization),
respectively, to produce two $(h\cdot w)\times K$ attention matrices, i.e.,
$\mathbf{A}_{\text{s}}=\mathfrak{g}^{\text{so}}(\mathbf{M}^{\prime}_{\text{s}})$
and
$\mathbf{A}_{\text{t}}=\mathfrak{g}^{\text{to}}(\mathbf{M}^{\prime}_{\text{t}})$,
where $K$ denotes the predefined number of parts. Thereafter, we aggregate the
backbone representations in terms of the attention matrices to deduce multi-
parts representations, i.e.,
$\mathbf{Z}^{\text{o}}_{\text{s}}=\mathfrak{p}^{\text{so}}(\mathfrak{g}^{\text{sp}}(\mathbf{A}_{\text{s}}^{T}\otimes\mathbf{M}^{\prime}_{\text{s}}))$
and
$\mathbf{Z}^{\text{o}}_{\text{t}}=\mathfrak{g}^{\text{tp}}(\mathbf{A}_{\text{t}}^{T}\otimes\mathbf{M}^{\prime}_{\text{t}})$,
where $\otimes$ denotes tensor multiplication. Finally, the spatially fine-
grained contrastive loss is quantified as

$\mathcal{L}_{\text{parts}}=\sum_{k=1}^{K}\left(2-2\cdot\frac{<\mathbf{Z}^{\text{o}}_{\text{s}}[k,:],\mathbf{Z}^{\text{o}}_{\text{t}}[k,:]>}{{||\mathbf{Z}^{\text{o}}_{\text{s}}[k,:]||}_{2}\cdot{||\mathbf{Z}^{\text{o}}_{\text{t}}[k,:]||}_{2}}\right)$
(2)

where $\mathbf{Z}^{\text{o}}[k,:]$ denotes the $k$th part representation in
$\mathbf{Z}^{\text{o}}\in\mathbb{R}^{K\times D}$.

Besides, two additional regularization terms are further included to stabilize
contrastive representation learning. Following [1], we penalize small changes
between the global representations of different image patches across each
feature dimension. Also, we encourage the global representations to be
diverse/orthogonal across different feature dimensions. Let
$\mathcal{Z}_{\text{s}}^{\text{g}}$ be a set of feature representations for an
input mini-batch of patches in the student branch, and
$\widetilde{\mathcal{Z}_{\text{s}}^{\text{g}}}$ and
$\overline{\mathcal{Z}_{\text{s}}^{\text{g}}}$ denote their channel-wise
variation and mean. The regularization terms are defined as

$\mathcal{L}_{\text{var}}=\frac{1}{D}\sum_{d=1}^{D}\max\left(0,1-\sqrt{\widetilde{\mathcal{Z}_{\text{s}}^{\text{g}}}[d]+\epsilon}\right)$
(3) $\mathcal{L}_{\text{cov}}=\frac{1}{D^{2}-D}\sum_{i\neq
j}\left(\left\\{(\mathbf{z}^{\text{g}}_{\text{s}}-\overline{\mathcal{Z}_{\text{s}}^{\text{g}}})^{T}(\mathbf{z}^{\text{g}}_{\text{s}}-\overline{\mathcal{Z}_{\text{s}}^{\text{g}}})\right\\}[i,j]\right)^{2}$
(4)

where $\epsilon$ is a small scalar to stabilize numerical computation,
$\widetilde{\mathcal{Z}_{\text{s}}^{\text{g}}}[d]$ denotes the $d$th dimension
of $\widetilde{\mathcal{Z}_{\text{s}}^{\text{g}}}$, and
$\\{(\mathbf{z}^{\text{g}}_{\text{s}}-\overline{\mathcal{Z}_{\text{s}}^{\text{g}}})^{T}(\mathbf{z}^{\text{g}}_{\text{s}}-\overline{\mathcal{Z}_{\text{s}}^{\text{g}}})\\}[i,j]$
is the $[i,j]$th element in such a covariance matrix. According to [1], Eqs.
(3) and (4) jointly encourage the diversity across patches and feature
dimensions, thus protecting the informativeness and avoid collapse of self-
supervised contrastive learning.

Overall, we combine Eqs. (1) to (4) as the final loss function to train the
double-tier backbone, such as
$\mathcal{L}_{\text{all}}=\mathcal{L}_{\text{global}}+\mathcal{L}_{\text{parts}}+\gamma\mathcal{L}_{\text{var}}+\lambda\mathcal{L}_{\text{cov}}$,
where $\gamma$ and $\lambda$ are two tuning parameters balancing different
terms.

###  2.2 Context-Aware MIL

Given the patch/instance-level representations of a histopathological image
from the double-tier backbone, we further design a context-aware MIL framework
to aggregate their information for postmortem tissue recognition. Given patch
embeddings of a Microscope image, our context-aware MIL part contains two main
steps, i.e., a multi-head self-attention to refine each patch’s feature and an
adaptive pooling step to distill all patches’ information.

In detail, we first adopt a multi-head self-attention (MSA) mechanism [19]
integrating relative positional embedding to explicitly model cross-patch
associations for contextual enhancement of the instance representations from
the backbone. Let $\mathcal{Z}=\\{\mathbf{z}_{i}\\}_{i=1}^{I}$ be a set of the
contextually enhanced instance embedding from an image. Thereafter, inspired
by Deformable DETR [28], we further design an adaptive pooling operation,
which is simple but effective to distill from $\mathcal{Z}$ a bag-level
holistic representation for the classification purpose. Specifically, the bag-
level holistic representation determined by the adaptive pooling is

$\mathbf{z}_{\text{bag}}=\frac{1}{I}\sum_{i=1}^{I}(softmax(\mathfrak{h}_{\omega_{1}}(\mathbf{z}_{i}))\circ\mathfrak{h}_{\omega_{2}}(\mathbf{z}_{i})),$
(5)

where $\mathfrak{h}_{\omega_{1}}(\cdot)$ and
$\mathfrak{h}_{\omega_{2}}(\cdot)$ are two linear projections with the same
number of output units, symbol $\circ$ denotes the Hadamard product between
two tensors, and $softmax(\cdot)$ is performed across different instances to
filter out uninformative patches and preserve discriminative patches in
quantifying $\mathbf{z}_{\text{bag}}$ for classification.

##  3 Experiments

###  3.1 Data & Experimental Setup

####  3.1.1 Rat postmortem histopathology dataset

Ninety Sprague-Dawley adult male rats were executed by the spinal cord
dislocation and placed in a constant temperature and humidity environment for
6-8 hours. The animal experiments were approved by the Laboratory Animal Care
Committee of the anonymous institution. Seven organs, i.e., brain, heart,
kidney, liver, lung, pancreas, and spleen, were removed and placed in the
formalin solution. Briefly, paraffin sections of these organ tissues were
stained with the H&E solution. The H&E-stained sections were then analyzed by
three forensic pathologists, who used Lercai LAS EZ microscopes to record the
areas according to their expertise. Overall, five to ten images were recorded
from a section at each magnification (i.e., $5\times$, $10\times$, $20\times$,
and $40\times$). Finally, we split the 90 rats as training, validation, and
test sets of 60, 10, and 20 rats, respectively, each with $13,137$, $2,235$,
and $4,325$ images.

####  3.1.2 Human forensic histopathology dataset

The real forensic images were provided by the Forensic Judicial Expertise
Center of the anonymous institution, after getting the informed consent of
relatives. All procedures followed the requirements of local laws and
institutional guidelines, and were approved and supervised by the Ethics
Committee. A total of 32 decedents participated in this study. Four to six
images were recorded at each of three magnifications ($5\times$, $10\times$,
and $20\times$) per H&E stained section. Similar to the rat dataset, the human
dataset was selected from the same seven organs. Finally, the training,
validation and test sets contain $1,691$ images, $628$, and $1059$ images,
corresponding to 16, 6, and 10 different decedents, respectively.

####  3.1.3 Experimental details

Notably, the double-tier backbone was self-supervised and learned on the rat
training set for 100 epochs by setting the mini-batch size as 1024, with the
parameters initialized by the ImageNet pre-trained models. The training data
were augmented by a histopathology-oriented strategy by combining different
kinds of staining jitters, random affine transformation, Gaussian blurring,
resizing, etc. The image(patch) dimension in our implementation was 224*224.
The tuning parameters $\gamma$ and $\lambda$ in $\mathcal{L}_{\text{all}}$
were set as 5 and 0.005, respectively. Thereafter, the MIL blocks on two
different datasets were both trained by minimizing the cross-entropy loss for
20 epochs with the mini-batch size setting as 32. The experiments were
conducted on three PCs with twenty NVIDIA GEFORCE RTX 3090 GPUs.

###  3.2 Results of Self-Supervised Contrastive Learning

Our self-supervised double-tier backbone was compared with other state-of-the-
art self-supervised learning approaches, including balow twins [27], swin
transformer (SSL) [26], TransPath [23], CTransPath [24],RetCCL [22] and MOCOV3
[3]. To evaluate the discriminative power of these competing methods, we
adopted GAP to aggregate their instance representations from a whole image to
train simple linear classifiers for the recognition of seven different organ
tissues on both the rat and human datasets, with the test performance
quantified in terms of four general classification metrics (i.e., ACC, F1
score, MCC(Matthews Correlation Coefficient), and Precision). The
corresponding results are summarized in Table 2, from which we can have two
observations. _First_ , our self-supervised double-tier backbone consistently
outperformed all other competing methods in terms of all metrics on two
datasets. _Second_ , our method led to better generalization, as the backbone
trained on the rat dataset shows promising performance on the challenging
real-world human dataset (e.g., resulting in an ACC higher than $90\%$). These
results suggest the effectiveness of our self-supervised learning strategy.

Table 1: Linear classification results obtained by different self-supervised
learning approaches on the rat and human testing sets, respectively.

Competing methods | Rat dataset | Human dataset
---|---|---
ACC | F1 | MCC | Precision | ACC | F1 | MCC | Precision
balow twins [27] | 0.9232 | 0.9123 | 0.9076 | 0.9070 | 0.7306 | 0.7311 | 0.6854 | 0.7345
swin transformer(SSL) [26] | 0.9450 | 0.9369 | 0.9299 | 0.9330 | 0.8079 | 0.8088 | 0.7758 | 0.8125
Transpath [23] | 0.7351 | 0.7397 | 0.6958 | 0.7481 | 0.5838 | 0.5657 | 0.5264 | 0.6050
CTransPath [24] | 0.9635 | 0.9610 | 0.9535 | 0.9596 | 0.8794 | 0.8799 | 0.8591 | 0.8842
RetCCL [22] | 0.9794 | 0.9801 | 0.9768 | 0.9810 | 0.7796 | 0.7789 | 0.7448 | 0.7961
MOCOV3 [3] | 0.9732 | 0.9738 | 0.9681 | 0.9745 | 0.8103 | 0.8124 | 0.7790 | 0.8187
Ours | 0.9831 | 0.9831 | 0.9796 | 0.9831 | 0.9049 | 0.9044 | 0.8886 | 0.9056

Table 2: Ablation studies to evaluate the contributions of different self-
supervised contrastive losses and regularization terms.

Loss functions | Rat dataset | Human dataset
---|---|---
$\mathcal{L}_{\text{global}}$ | $\mathcal{L}_{\text{parts}}$ | $\mathcal{L}_{\text{var}}$ | $\mathcal{L}_{\text{cov}}$ | ACC | F1 | MCC | Precision | ACC | F1 | MCC | Precision
$\checkmark$ |  |  |  | 0.9732 | 0.9713 | 0.9660 | 0.9689 | 0.8918 | 0.8913 | 0.8734 | 0.8935
$\checkmark$ | $\checkmark$ |  |  | 0.9817 | 0.9819 | 0.9778 | 0.9822 | 0.8953 | 0.8956 | 0.8779 | 0.8981
$\checkmark$ |  | $\checkmark$ | $\checkmark$ | 0.9793 | 0.9799 | 0.9757 | 0.9806 | 0.8978 | 0.8976 | 0.8802 | 0.8983
$\checkmark$ | $\checkmark$ | $\checkmark$ | $\checkmark$ | 0.9831 | 0.9831 | 0.9796 | 0.9831 | 0.9049 | 0.9044 | 0.8886 | 0.9056

For a more detailed evaluation, we further conducted a series of ablation
studies to evaluate the contributions of the contrastive losses (i.e.,
$\mathcal{L}_{\text{global}}$ and $\mathcal{L}_{\text{parts}}$) and
regularization strategy (i.e.,
$\mathcal{L}_{\text{var}}+\mathcal{L}_{\text{cov}}$). The corresponding
results are summarized in Table 2, from which we can see that, given the
baseline of $\mathcal{L}_{\text{global}}$, both the inclusion of the spatially
fine-grained contrastive loss (i.e., $\mathcal{L}_{\text{parts}}$) and
informativeness regularization (i.e., $\mathcal{L}_{\text{var}}$ and
$\mathcal{L}_{\text{cov}}$) led to respective performance gains. These results
further justify our self-supervised design.

###  3.3 Results of Multiple-Instance Learning

Based upon the double-tier backbone learned on the rat training set, we
compared our context-aware MIL with other MIL methods, including the gated
attention-based approach (i.e., AB-MIL [12], DSMIL [15], Transmil [19] and MSA
[16, 2]) approaches with/without different positional embedding strategies,
i.e., relative position embedding (MSA-RP [17]), learnable position embedding
(MSA-LP [7]), and 2D sine-cosine position embedding (MSA-SP [8]). Notably, our
approach used MSA-RP as the baseline, based on which an adaptive pooling
operation is designed to produce the final bag-level representation. To check
the efficacy of adaptive pool, we further conducted a corresponding set of
ablation studies by replacing it with other operations, including max pool,
and soft pool [20]. These comparison and ablations results are shown in Table
3, from which we can observe that our method led to the best results on both
datasets, with relatively more significant improvements on the challenging
human dataset. Also, compared with other pooling operations, the adaptive pool
design brought consistent performance gains. These results suggest the
efficacy of our context-aware MIL for postmortem tissue recognition.

Table 3: Multiple-instance learning results obtained by the competing methods
and our Context-Aware MIL with different pooling strategies.

Competing methods | Rat dataset | Human dataset
---|---|---
ACC | F1 | MCC | Precision | ACC | F1 | MCC | Precision
AB-MIL[12] | 0.9815 | 0.9828 | 0.9793 | 0.9844 | 0.9011 | 0.9005 | 0.8838 | 0.9050
DSMIL [15] | 0.9951 | 0.9948 | 0.9937 | 0.9945 | 0.9176 | 0.9166 | 0.9030 | 0.9170
Transmil [19] | 0.9899 | 0.9888 | 0.9875 | 0.9878 | 0.8824 | 0.8813 | 0.8622 | 0.8821
MSA [16, 2] | 0.9875 | 0.9883 | 0.9861 | 0.9892 | 0.9082 | 0.9082 | 0.8921 | 0.9100
MSA-LP [7] | 0.9879 | 0.9875 | 0.9853 | 0.9873 | 0.9097 | 0.9087 | 0.8945 | 0.9109
MSA-SP [8] | 0.9851 | 0.9839 | 0.981 | 0.9832 | 0.8915 | 0.8905 | 0.8748 | 0.8948
MSA-RP [17] | 0.9915 | 0.9915 | 0.9896 | 0.9916 | 0.9218 | 0.9213 | 0.9085 | 0.9218
Ours + Max pool | 0.9910 | 0.9909 | 0.9888 | 0.9909 | 0.9144 | 0.9147 | 0.9001 | 0.9191
Ours + Soft pool [20] | 0.9935 | 0.9929 | 0.9915 | 0.9924 | 0.9047 | 0.9023 | 0.8883 | 0.9056
Ours + Adaptive pool | 0.9956 | 0.9952 | 0.9943 | 0.9949 | 0.9229 | 0.9218 | 0.9093 | 0.9263

Figure 2:  Explainability analysis based on LayerCAM [13] for representative
postmortem tissue images acquired at different microscopic scales.

In addition, we conducted LayerCAM-based analysis [13] to check the
explainability and reliability of our postmortem histopathological recognition
results. From the representative examples shown in Fig. 2, we can have an
interesting observation that our method tends to focus on tissue-specific
postmortem patterns at different microscopic scales. For example, the spatial
attention maps reliably highlighted the meningeal structures of the brain
tissue, the glomeruli in the kidney cortex, and the central vein area between
the liver lobules. On the other hand, based on the pancreas example, we can
see that our network can sensitively localize the pancreas glandular structure
while filtering out the uninformative background in an end-to-end fashion,
without the need for any pre-processing to segment first the foreground. These
observations support our assumption that the proposed method is reliable and
efficient in learning discriminative histopathological representations of
postmortem organ tissues.

##  4 Conclusion

In this study, we have proposed a context-aware MIL framework powered by self-
supervised contrastive learning to learn fine-grained discriminative
representations for postmortem histopathological recognition. The dedicated
self-supervised learning strategy concurrently maximizes multiple contrastive
losses and regularization terms to deduce informative and discriminative
instance embedding. Thereafter, the context-aware MIL framework adopts MSA
followed by an adaptive pooling operation to distill from all instances a
holistic bag/image-level representation. The experimental results on a
relatively large-scale database suggest the state-of-the-art postmortem
recognition performance of our method.

## References

  * [1] Bardes, A., Ponce, J., LeCun, Y.: Vicreg: Variance-invariance-covariance regularization for self-supervised learning. arXiv preprint arXiv:2105.04906 (2021)
  * [2] Chen, R.J., Chen, C., Li, Y., Chen, T.Y., Trister, A.D., Krishnan, R.G., Mahmood, F.: Scaling vision transformers to gigapixel images via hierarchical self-supervised learning. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 16144–16155 (2022)
  * [3] Chen, X., Xie, S., He, K.: An Empirical Study of Training Self-Supervised Vision Transformers. arXiv e-prints (2021)
  * [4] De La Grandmaison, G.L., Charlier, P., Durigon, M.: Usefulness of systematic histological examination in routine forensic autopsy. Journal of Forensic sciences 55(1), 85–88 (2010)
  * [5] DiMaio, D., DiMaio, V.J.: Forensic pathology. CRC press (2001)
  * [6] Dolinak, D., Matshes, E., Lew, E.O.: Forensic pathology: principles and practice. Elsevier (2005)
  * [7] Dosovitskiy, A., Beyer, L., Kolesnikov, A., Weissenborn, D., Zhai, X., Unterthiner, T., Dehghani, M., Minderer, M., Heigold, G., Gelly, S., et al.: An image is worth 16x16 words: Transformers for image recognition at scale. arXiv preprint arXiv:2010.11929 (2020)
  * [8] He, K., Chen, X., Xie, S., Li, Y., Dollár, P., Girshick, R.: Masked autoencoders are scalable vision learners. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 16000–16009 (2022)
  * [9] He, K., Fan, H., Wu, Y., Xie, S., Girshick, R.: Momentum Contrast for Unsupervised Visual Representation Learning. arXiv e-prints (2019)
  * [10] He, K., Zhang, X., Ren, S., Sun, J.: Deep residual learning for image recognition. In: 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR). pp. 770–778 (2016)
  * [11] Huang, L., You, S., Zheng, M., Wang, F., Qian, C., Yamasaki, T.: Learning where to learn in cross-view self-supervised learning. In: CVPR (2022)
  * [12] Ilse, M., Tomczak, J.M., Welling, M.: Attention-based Deep Multiple Instance Learning. arXiv e-prints (2018)
  * [13] Jiang, P.T., Zhang, C.B., Hou, Q., Cheng, M.M., Wei, Y.: Layercam: Exploring hierarchical class activation maps for localization. IEEE Transactions on Image Processing 30, 5875–5888 (2021)
  * [14] Lee, Y., Park, J.H., Oh, S., Shin, K., Sun, J., Jung, M., Lee, C., Kim, H., Chung, J.H., Moon, K.C., Kwon, S.: Derivation of prognostic contextual histopathological features from whole-slide images of tumours via graph deep learning. Nat Biomed Eng (2022)
  * [15] Li, B., Li, Y., Eliceiri, K.W.: Dual-stream multiple instance learning network for whole slide image classification with self-supervised contrastive learning. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 14318–14328 (2021)
  * [16] Li, H., Yang, F., Zhao, Y., Xing, X., Zhang, J., Gao, M., Huang, J., Wang, L., Yao, J.: Dt-mil: deformable transformer for multi-instance learning on histopathological image. In: Medical Image Computing and Computer Assisted Intervention–MICCAI 2021: 24th International Conference, Strasbourg, France, September 27–October 1, 2021, Proceedings, Part VIII 24. pp. 206–216. Springer (2021)
  * [17] Liu, Z., Lin, Y., Cao, Y., Hu, H., Wei, Y., Zhang, Z., Lin, S., Guo, B.: Swin Transformer: Hierarchical Vision Transformer using Shifted Windows. arXiv e-prints (2021)
  * [18] Lu, M.Y., Williamson, D.F.K., Chen, T.Y., Chen, R.J., Barbieri, M., Mahmood, F.: Data-efficient and weakly supervised computational pathology on whole-slide images. Nature Biomedical Engineering (2021)
  * [19] Shao, Z., Bian, H., Chen, Y., Wang, Y., Zhang, J., Ji, X., et al.: Transmil: Transformer based correlated multiple instance learning for whole slide image classification. Advances in Neural Information Processing Systems 34, 2136–2147 (2021)
  * [20] Stergiou, A., Poppe, R., Kalliatakis, G.: Refining activation downsampling with softpool. In: Proceedings of the IEEE/CVF international conference on computer vision. pp. 10357–10366 (2021)
  * [21] Wang, G., Wu, H., Yang, C., Li, Z., Chen, R., Liang, X., Yu, K., Li, H., Shen, C., Liu, R., Wei, X., Sun, Q., Zhang, K., Wang, Z.: An emerging strategy for muscle evanescent trauma discrimination by spectroscopy and chemometrics. Int J Mol Sci (2022)
  * [22] Wang, X., Du, Y., Yang, S., Zhang, J., Wang, M., Zhang, J., Yang, W., Huang, J., Han, X.: Retccl: Clustering-guided contrastive learning for whole-slide image retrieval. Medical Image Analysis 83, 102645 (2023)
  * [23] Wang, X., Yang, S., Zhang, J., Wang, M., Zhang, J., Huang, J., Yang, W., Han, X.: Transpath: Transformer-based self-supervised learning for histopathological image classification. In: International Conference on Medical Image Computing and Computer-Assisted Intervention. pp. 186–195. Springer (2021)
  * [24] Wang, X., Yang, S., Zhang, J., Wang, M., Zhang, J., Yang, W., Huang, J., Han, X.: Transformer-based unsupervised contrastive learning for histopathological image classification. Medical Image Analysis (2022)
  * [25] Wu, H., Li, Z., Liang, X., Chen, R., Yu, K., Wei, X., Wang, G., Cai, W., Li, H., Sun, Q., Wang, Z.: Pathological and atr-ftir spectral changes of delayed splenic rupture and medical significance. Spectrochim Acta A Mol Biomol Spectrosc (2022)
  * [26] Xie, Z., Lin, Y., Yao, Z., Zhang, Z., Dai, Q., Cao, Y., Hu, H.: Self-Supervised Learning with Swin Transformers. arXiv preprint arXiv:2105.04553 (2021)
  * [27] Zbontar, J., Jing, L., Misra, I., LeCun, Y., Deny, S.: Barlow twins: Self-supervised learning via redundancy reduction. arXiv preprint arXiv:2103.03230 (2021)
  * [28] Zhu, X., Su, W., Lu, L., Li, B., Wang, X., Dai, J.: Deformable DETR: Deformable Transformers for End-to-End Object Detection. arXiv e-prints (2020)


Parity Measurements using Dispersive Shifts for Surface Codes

Aneirin J. Baker
SUPA, Institute of Photonics and Quantum Sciences,
Heriot-Watt University, Edinburgh EH14 4AS, United Kingdom

Parity measurements are central to quantum error correction (QEC). In current implementations measurements of stabilizers are performed using a number of Controlled Not (CNOT) gates. This implementation suffers from an exponential decrease in fidelity as the number of CNOT gates increases thus the stabilizer measurements also suffer a severe decrease in fidelity and increase in gate time. Speeding up and improving the fidelity of this process will improve error rates of these stabilizer measurements thus increasing the coherence times of logical qubits. We propose a single shot method useful for stabilizer readout based on dispersive shifts. We show a possible set up for this method and simulate a 4 qubit system showing that this method is an improvement over the previous CNOT circuit in both fidelity and gate time. We find a fidelity of $99.8\%$ and gate time of $600$ ns using our method and investigate the effects of higher order Z interactions on the system.

§ INTRODUCTION

As quantum computers progress, the need for quantum error correction (QEC) becomes ever clearer. Having a system whose lifetime and error rates exceed the levels of the individual physical qubits is essential for the future of quantum computing. Current developments within QEC have been focused on an implementation called the surface code [1, 2], however other implementations have been explored such as the colour code and the Steane code [3, 4, 5]. At the heart of these implementations are measurements of stabilizers elements, these stabilizers are used to determine if an error has occurred in the system. Here we focus our attention on the surface code, a planar implementation of Kitaev’s Toric code [6]. This code is promising due to its high threshold for correctable errors in the system of around 1% [7], and is amenable to implementation in 2D architectures, making it a promising contender to reach fault tolerant quantum computation.
Currently stabilizer measurements are measured via a series of CNOT gates that maps their eigenvalues onto the $Z$ eigenvalue of an ancilla qubit [8]. In current superconducting implementations of surface codes the CNOT gates which make up these stabilizer measurements have fidelities of  98.5% [1] when we consider that stabilizer measurements require between 2 and 4 CNOT gates simple calculations brings us to an estimated fidelity of 97% and 94% respectively for the stabilizer. Other implementations of the CNOT (or equivalent two qubit gates) in larger qubit devices are much lower than the required fidelity for effective stabilizer interactions [9, 10, 2, 11].

$\ket{a}$         1     1      1      1

$\ket{q_1}$                    1   1   1

$\ket{q_2}$                       1   1

$\ket{q_3}$                          1

Plaquette operator which is the basis for the error correcting codes. It comprises 4 CNOT gates with the ancilla as the target qubit.

For QEC to be successful these error rates must be improved. A potential way, which has been investigated before in the context of the iToffoli gate [12, 13], is to implement a single shot measurement of this stabilizer. This single shot measurement has the advantage of not being effected by exponential scaling of fidelities for small stabilizer measurements and shows a modest improvement in gate time over its CNOT decomposition. We also find that it is easy to modify this single shot gate to other geometries of surface code.

We utilize dispersive shifts that can be engineered in superconducting circuits (SCCs) through the ZZ couplings between qubits [14, 15, 16, 12]. Here, we use these shifts to enact parity measurements on ensembles of qubits. We aim to find a regime where a subset of all two body dispersive shifts dominate and are of equal size. The subset we choose determines the operations we wish to perform.  For our example system we choose 4 qubit setup with 3 control qubits and one ancilla qubit. We choose to measure the odd parity of this system to show that the more complex situation of two drives is feasible.

To create a parity measurement we must detune the transitions $\ket{1001} \leftrightarrow \ket{1000},\ket{0101}\leftrightarrow \ket{0100} \text{ and }\ket{0011} \leftrightarrow \ket{0010}$ (where we have adopted the notation $\ket{\text{Qubit1, Qubit2, Qubit3, Ancilla}}$) from all other transitions of the ancilla. We then drive the ancilla at the detuned transition frequency ($\omega_{d} = \omega_a + \chi$, where $\chi$ is the dispersive shift we have engineered) only these three transitions will be driven and all the rest will be unaffected. If we also ensure that all other dispersive shifts are suppressed then we can use the same technique to drive higher order transitions for example, $\ket{1110} \leftrightarrow \ket{1111}$ with the drive $\omega_d = \omega_a + 3\chi$. Choosing the combination of drives correctly we can then generate a parity measurement on an ensemble of qubits.

This paper is organised as follows in Section <ref> we discuss the physical implementation of the model where we shall theoretically describe the system, in Section <ref> we shall present the simulations of the of the model in the previous section. In Section <ref> we shall discuss the implementation highlighting its advantages over other implementations and and discussing some of its drawbacks.

§ PHYSICAL IMPLEMENTATION AND MODEL

a.)Example of an effective lattice that tessellates the qubit frequencies over the surface to ensure that all qubits are sufficiently detuned from one another. We colour code the qubits to show which qubits would have different transition frequencies.
In this diagram the Q's represent the data Qubits and the A represents the ancilla qubits. b.) Representation of the circuit we shall be simulating in this chapter. Squares represent qubits and circles represent couplers. Each qubits is colour coded to represent a different transition frequency. This pattern can be tessellated over the plane so that all patches of qubits can have the correct dispersive shift to execute the parity check. c.) Legend for the circuit depicted above showing the qubits and couplers used in this chapter. In this chapter we use fixed frequency qubits and frequency qubit couplers.

The readout of a stabilizer in QEC requires the data qubits to be connected to an ancilla - or measurement qubit. A recent realizations of simple QEC codes implement these gates using static capacitive coupling [1]. This allowed for fast CZ gates to be implemented in 100ns. In our implementation we propose a lattice of qubits coupled via tunable couplers. This gives us the freedom to turn off interactions and adjust the strength of interaction by tuning the frequency of the couplers. This tunability also gives us access to different interaction regimes where we can perform gates specific to that regime. The lattice in Fig. <ref> shows the qubit layout we propose, we note that this is very similar to current implementations [2, 17] thus we are expanding the capabilities of these types of Superconducting Circuits - SCCs.
We describe the Hamiltonian of a unit cell in terms of creation and annihilation operators and begin with the following model of the circuit in Fig. <ref>

\begin{equation}
H = \sum_{i=1}^4 H_0 (q_i) + \sum_{j=1}^5 H_0 (c_j) + H_0 (a) + H_{\text{int,q}} + H_{\text{int,c}}.
\end{equation}

Where we have defined

\begin{eqnarray}
H_0 (X_i) &=& \omega_i X_i^{\dag} X_i + \frac{\alpha_i}{2} X_i^{\dag} X_i^{\dag} X_i X_i .
\end{eqnarray}

Here $X_i$($X_i^{\dagger}$) represents a general annihilation (creation) operator.

\begin{eqnarray}
H_{\text{int,q}} &=& \sum_{i<j} g_{ij} (q_i - q_i^{\dag})(q_j - q_j^{\dag}),
\\
H_{\text{int,c}} &=& \sum_{i=1}^4 g_{i,ci} (q_i - q_i^{\dag})(c_i - c_i^{\dag})
\\ \nonumber
&+& g_{i+1,ci} (q_{i+1} - q_{i+1}^{\dag})(c_i - c_i^{\dag})
\\ \nonumber
&+& g_{i,c5} (q_i - q_i^{\dag})(c_5 - c_5^{\dag})
\\ \nonumber
&+& g_{a,c5} (a - a^{\dag})(c_5 - c_5^{\dag}) .
\end{eqnarray}

In the above Hamiltonian $q_i$ ($c_i$,$a$)/$q_i^{\dag}$ ($c_i^{\dag}$,$a^{\dag}$) represent the annihilation/creation operators for the qubits (couplers, ancilla) which obey the commutation relations

\begin{eqnarray}\label{eq:commutation_relations}
&&[q_i,\qd_j] = [c_i,c^{\dagger}_j] = \delta_{ij} , \quad [a,a^{\dagger}] = 1.
\end{eqnarray}

All the other combinations of the operators are defined to be 0. In this model $\omega_i$/$\alpha_i$ ($\omega_{ci}$/$\alpha_{ci}$, $\omega_{a}$/$\alpha_{a}$) are the qubit (coupler, ancilla) transition frequencies and anharmonicities respectively. Here $g_{nm}$ denotes the coupling between qubit $n$ and $m$ (the exact form of the coupling can be found in Appendix <ref>) and $g_{i,cj}$ describes the coupling between the i-th qubit and the j-th coupler.
This model describes a full unit cell in the lattice in Fig. <ref>. We can create an effective model for this by performing successive Schrieffer–Wolff transformations [18] eliminating sets of couplers along the way. At each point we ensure that the approximations made are small enough that we can make these approximations - see Appendix <ref> for further details. For the first approximation we eliminate the couplers along the edges of the unit cell with the transformation

\begin{equation}
H \to \tilde{H} = e^{i S_{\text{edge}}} H e^{-i S_{\text{edge}}},
\end{equation}

\begin{equation}
S_{\text{edge}} = \sum_{i=1}^4 \bigg( \frac{g_{i,c_i}}{\Delta_{i,ci}} (\qd_i c_i - q_i \cd_i) - \frac{g_{i,c_i}}{\Sigma_{i,ci}} (\qd_i \cd_i - q_i c_i)
+ \frac{g_{i+1,c_i}}{\Delta_{i+1,ci+1}} (\qd_{i+1} c_i - q_{i+1} \cd_i)
- \frac{g_{i+1,c_i}}{\Sigma_{i+1,ci+1}} (\qd_{i+1} \cd_i - q_{i+1} c_i)\bigg).
\end{equation}

Here we have defined $\Delta_{i,j} = \omega_i - \omega_j$, $\Sigma_{i,j} = \omega_i + \omega_j$ and we have used a notation where the indices are defined modulo 4 to reflect the periodic nature of the system. We then apply a similar transformation

\begin{eqnarray}
\tilde{H} \to \Bar{H} = e^{i S_{\text{center}}} \tilde{H} e^{-i S_{\text{center}}},
\end{eqnarray}

with the argument now

\begin{eqnarray}
\nonumber
S_{\text{center}} &=& \sum_{i=1}^4 \frac{\tilde{g}_{i,c_5}}{\tilde{\Delta}_{i5}} (\qd_i c_5 - q_i \cd_5) - \frac{\tilde{g}_{i,c_5}}{\tilde{\Sigma}_{i5}} (\qd_i \cd_5 - q_i c_5)
\\
&+& \frac{\tilde{g}_{a,c_5}}{\tilde{\Delta}_{a5}} (\ad c_5 - a \cd_5) - \frac{\tilde{g}_{a,c_5}}{\tilde{\Sigma}_{a5}} (\ad \cd_5 - a c_5),
\end{eqnarray}

to eliminate the central coupler. Here we have defined $\tilde{\Delta}_{i,j} = \tilde{\omega}_i - \tilde{\omega}_j$, $\tilde{\Sigma}_{i,j} = \tilde{\omega}_i + \tilde{\omega}_j$. This results in the final Hamiltonian of

\begin{eqnarray} \label{eq:final_hamiltonian}
\Bar{H} &=& \sum_{i=1}^5 \Bar{H}_0 (c_i) + \sum_{j=1}^4 \Bar{H}_0 (q_i)
\\ \nonumber
&+&\Bar{H}_{\text{int,q}} + O(\frac{g^2}{\Delta_{i,5}^2}),
\\
\Bar{H}_0 (X_i) &=& \Bar{\omega}_i X_i^{\dag} X_i + \frac{\Bar{\alpha}_i}{2} X_i^{\dag} X_i^{\dag} X_i X_i ,
\\
\Bar{H}_{\text{int,q}} &=& \sum_{i<j} \Bar{g}_{ij} (q_i - q_i^{\dag})(q_j - q_j^{\dag}).
\end{eqnarray}

Here $\Bar{\omega}_{n}$, $\Bar{\alpha}_{n}$ and $\Bar{g}_{nm}$ are shifted frequencies, nonlinearities and couplings - see appendix <ref> for the explicit expressions.

We pause here to note that other implementations of this system are possible. It is conceivable that a multi qubit coupler [19, 20] could be used to create the same interactions as we have here and in a simpler manner. We choose this setup due to the flexibility gained from the tunable couplers and hence the ability to correct for the phase errors that could occur in the system.

Schrieffer–Wolff Commutation Errors
As we have performed two successive SW transformations we must examine whether these two operators commute as these are still unitary transformations and so when we apply them to the Hamiltonian there will be some error accumulated if the two transformations do not commute. We see that these indeed do not commute since they both contain the qubit operators $q_i$ and $\qd_j$ which do not commute when $i=j$. According to the Baker–Campbell–Hausdorff formula the error due to these two operators will be proportional to $\frac{1}{2!}[S_{\text{edge}},S_{\text{Center}}]$ which will be proportional to $\frac{g^2}{2 \Delta^2}$. As we have been considering only Hamiltonians at less than second order in $g$ then we are safely able to ignore this error it has a strength of $\leq 1$ MHz.

§.§ Dispersive Shifts and parity measurement

With the model of the system now in place we derive the conditional shifts that form the basis of our gate. As done previously [12, 21] we treat the interaction term as a perturbation to the system and apply perturbation theory with $V = \Bar{H}_{\text{int,q}}$ to determine the qubit transition frequencies up to $n$-th order in perturbation theory. Using these expressions we can determine the dispersive shifts present in the system. Specifically we are looking for the $n$-body dispersive shifts - defined in Appendix <ref>. In previous explorations of dispersive shifts only three body shifts were considered as were only, at most, three qubits coupled together. However, for our system and therefore extensions of our system we must consider $n$-body shifts. For example in the simulations below we need to consider 4-body dispersive shift in $n$-th order perturbation theory defined by

\begin{align}
\nonumber
\chi_{1234}^{\text{bare},\text{(n)}} &= (E_{\ket{1111}}^{\text{(n)}} - E_{\ket{0000}}^{\text{(n)}}) - (E_{\ket{1000}}^{\text{(n)}} - E_{\ket{0000}}^{\text{(n)}}) - (E_{\ket{0100}}^{\text{(n)}} - E_{\ket{0000}}^{\text{(n)}}) - (E_{\ket{0010}}^{\text{(n)}} - E_{\ket{0000}}^{\text{(n)}})
- (E_{\ket{0001}}^{\text{(n)}} - E_{\ket{0000}}^{\text{(n)}})
\\
&= E_{\ket{1111}}^{\text{(n)}} - E_{\ket{1000}}^{\text{(n)}} - E_{\ket{0100}}^{\text{(n)}} - E_{\ket{0010}}^{\text{(n)}}- E_{\ket{0001}}^{\text{(n)}} + 3E_{\ket{0000}}^{\text{(n)}}.
\end{align}

We denote the above dispersive shift as the “bare" shift since this shift also contains contributions from lower order dispersive shifts which can be expressed as

\begin{equation}\label{eqt:Dispersive_shifts_Full}
\chi_{1234}^{\text{(n)}} = \chi_{1234}^{\text{\text{bare},\text{(n)}}} - \sum_{i\neq j \neq k} \chi_{ijk}^{\text{\text{bare},\text{(n)}}} - \sum_{i \neq j} \chi_{ij}^{\text{(n)}}.
\end{equation}

Here $\chi_{ijk...}^{(m)}$ is the Dispersive shift on the qubits $ijk...$ to $m$-th order in perturbation theory and similarly $E_{\ket{n}}^{(m)}$ is the energy of state $\ket{n}$ to $m$-th order in perturbation theory. Using these expressions we can estimate the effects of these dispersive shifts to find a regime where we can suppress the unwanted interactions.

\begin{align}
&\chi_{1234}^{(2)} =
\\ \nonumber
& \frac{-4 g_{1,a}^2}{\alpha_1+\alpha_a+\Sigma_{1,a}}
+\frac{2 g_{1,a}^2}{\alpha_1+\Sigma_{1,a}}
-\frac{2 g_{1,a}^2}{\alpha_1+\Delta_{1,a}}
+\frac{2 g_{1,a}^2}{\alpha_a+\Sigma_{1,a}}
-\frac{2 g_{1,a}^2}{\alpha_a -\Delta_{1,a}}
\\ \nonumber
&-\frac{4 g_{2,a}^2}{\alpha_2+\alpha_a+\Sigma_{2,a}}
+\frac{2 g_{2,a}^2}{\alpha_2+\Sigma_{2,a}}
-\frac{2 g_{2,a}^2}{\alpha_2+\Delta_{2,a}}
+\frac{2 g_{2,a}^2}{\alpha_a+\Sigma_{2,a}}
-\frac{2 g_{2,a}^2}{\alpha_a- \Delta_{2,a}}
\\ \nonumber
&-\frac{4 g_{3,a}^2}{\alpha_3+\alpha_a+\Sigma_{3,a}}
+\frac{2 g_{3,a}^2}{\alpha_3+\Sigma_{3,a}}
-\frac{2 g_{3,a}^2}{\alpha_3+\Delta_{3,a}}
+\frac{2 g_{3,a}^2}{\alpha_a+\Sigma_{3,a}}
-\frac{2 g_{3,a}^2}{\alpha_a-\Delta_{3,a}}
\\ \nonumber
&+ \text{Counter Rotating Terms},
\\ \nonumber
&= \chi_{12}^{(2)} + \chi_{13}^{(2)} + \chi_{14}^{(2)} + \text{Counter Rotating Terms}.
\end{align}

To second order we find that these higher order dispersive shifts can be decomposed into second order terms with cross terms which are proportional to the counter rotating terms.
These counter rotating terms will not contribute much to the dispersive shifts since they are proportional to $\propto \frac{1}{\omega_i + \omega_j}$ which, for our parameters, will be small. These are the higher order shifts present in the summation terms of Eq. (<ref>).

Using these expressions we find parameter regimes (by sweeping over a large parameter set within the dispersive regime) where all the pairwise dispersive shifts that include the ancilla are equal, any higher order interaction are highly suppressed and finally all other two body shifts are highly suppressed - see section <ref> for exact shifts. Once we have found these regimes we can simulate the dynamics of the system choosing the number of drives and their frequencies according to the parity measurement we wish to execute.

§.§ Simulations

We now simulate a system with 3 data qubits,one ancilla qubit and two drives to demonstrate the proposed mechanism. As the Hamiltonian we derived has different behaviours for different initial states we apply two drives to the system to measure the parity. These drives will excite the central ancilla qubits if and only if the data qubits are in the parity state we wish to measure. To select a specific parity state we choose the frequencies of the external drives to match the shifts we have induced in the system. To measure the effectiveness of these simulations we define the ideal evolution to be the evolution  where the transitions $\ket{0000} \leftrightarrow \ket{1000}$, $\ket{0110} \leftrightarrow \ket{1110}$, $\ket{0101} \leftrightarrow \ket{1101}$ and $\ket{0011} \leftrightarrow \ket{1011}$ occur, and all other states are unchanged. Using the definition of process fidelity as $F_p(U_1,U_2) = |\text{Tr} (U_1^\dag , U_2)|/d$ ($d=16$ being the dimension of the Hilbert space) we can quantify how well our scheme realizes a stabilizer measurement and so compare it to other implementations of parity/stabilizer measurements. We choose the parameters shown in Table. <ref> such that all the higher order shifts are suppressed and only the shifts we require are active. These parameters result in dispersive shifts of $\chi = \chi_{12} = \chi_{13} = \chi_{14} = -5$ MHz while all other dispersive shifts have absolute values $\leq 0.4$ MHz.

We simulate the system in Eq. (<ref>) using 3 data qubits and 1 measurement qubit. Two drives are applied to the system with frequencies of $\omega_{d1} = \Bar{\omega}_a + \chi$ and $\omega_{d2} = \Bar{\omega}_a + 3\chi$, these drives are what executes the parity measurement. There is still some small amount of population left in the odd parity states. This is due to the non-zero unwanted dispersive shifts. Above we show the absolute values of the unitary produced from this simulation.

Parameter     Value $[GHz]$
$[\omega_1 , \omega_2 , \omega_3 , \omega_4]$

$[\alpha_1 , \alpha_2 , \alpha_3 , \alpha_4]$     $[-0.3,-0.2,-0.2,-0.19]$

$[g_{12} , g_{13} , g_{14} ]$     $[0.02165,0.032,0.0385]$

$[g_{23} , g_{24} , g_{34} ]$     $[0.001,0.001,0.001]$

$[\Omega_1 , \Omega_2 ]$     $[0.00159,0.00159]$

$[\omega_{d1} , \omega_{d2} ]$     $[4.938,4.929]$

Table outlining the parameters used in the simulations in Fig <ref>. In this system $\omega_1$ represents the ancilla/measurement qubit and qubits 2-4 represent data qubits. This system produces a dispersive shift of $\chi =\chi_{12} = \chi_{13} = \chi_{14} = -5 MHz$. Whilst this is small it is enough to detune the transitions frequencies such that no other excitations occur when we apply the drives $\omega_{d1} = \Bar{\omega}_a + \chi$ and $\omega_{d2} = \Bar{\omega}_a + 3\chi$.

Fig. <ref> shows the resulting unitary from simulations of  Eq. (<ref>) with two drives where $\omega_{d1} = E_{\ket{1100}} - E_{\ket{0100}}$ and $\omega_{d2} = E_{\ket{1111}} - E_{\ket{0111}}$. The overall process fidelity of this operation was calculated to be $F_p = 99.8\%$ with a total execution time of $t_{\text{gate}} = 600$ ns.

A pictorial illustration of the approximations we are making where green squares are the qubits, purple squares are the couplers (SQUIDS) and the black links are the capacitive couplings between the elements. At each stage the arrows represent the SW transformations outlined above. The aim of these approximations is to get an approximate theory of the system with the couplers eliminated and all the qubits connected to the ancilla.

The reduction in fidelity of $\approx 0.2 \%$ can be attributed to the population leakage to other states. We estimate a $0.1\%$ fidelity reduction due to leakage to states within the computational subspace and the other $0.1\%$ due to leakage to higher order states.

As the gate time of our operation is reasonably large we estimate that decoherence may play a significant role in reducing fidelity. Current dephasing and detuning times are approaching the $100 \mu s$ mark [11, 22]. Whilst these coherence times are constantly improving, these current values would reduce the fidelity of our operation to $\approx 99.2\%$ (using a $100 \mu$s $T_1$ time), which is still much higher than the fidelities currently possible through the CNOT decomposition method.

In our simulations and fidelity calculations we have assumed perfect correction of the phases accumulated by the dispersive shifts we are using. In reality this is not the case, these gates have finite fidelities. However a modest change to our parameters solves this problem rather elegantly. It is feasible that we can arrange the parameters such that $\chi t_{\text{gate}} = 2 \pi$ (the disperisve shift between the ancilla and the data qubits). For our case this would involve a modest increase in the dispersive shift to $-7.5$ MHz and an increase in the gate time to $~830$ns however this would completely negate the issue of accumulated phase for this system.

§ DISCUSSION

We have shown that it is possible to execute higher order parity measurements in a single step. This technique can be extended further by adding extra qubits to the unit cell, connected to their neighbours and ancilla via tunable couplers. Our single shot measurement strategy eliminates the need for multiple CNOT gates reducing the effect of multiplying gate errors, this reduction in gate errors comes with the potential for faster parity gates. We also reduce other errors such as errors occurred during the idle time whilst other qubits wait for the CNOT gates to execute.

This technique can be extended to more qubits in two different ways. Firstly  we can ensure that all two body shifts that are required for the larger parity measurements are dominant and equal whilst also ensuring that other (unwanted) shifts are sufficiently suppressed. We then pick the correct number of drives for the parity measurement required. In doing this we would have to suppress all Z-shifts at orders between 2 and n (where n is the number of qubits in the cluster we are measuring) provided the system is in the dispersive regime.

Alternatively we can concatenate these lower order parity measurements together to create a higher order parity measurement. This follows the same mechanism as the current parity decomposition to CNOT gates where the CNOT gates measure the individual parity of each qubit-ancilla pair. Hence, if we know the parity of two “sub clusters" we can infer the parity of the entire cluster, making this proposal useful for much larger parity measurements.

For the operation to retain the high fidelity we have predicted, we require a balance between the size of the drive and the gate time. This balance is determined by the coherence time of the qubits. We require that the gate be short enough that decoherence doesn't play a significant role in the reduction of fidelity but long enough that the drive can remain small enough that we remain in the weak driving regime. We also require that the parameters be chosen such that higher order interactions are suppressed so that the transitions we aim to execute are not significantly detuned from the drives.

Whilst we have only discussed the Z stabilizer measurements it is possible to turn these into an X stabilizer measurement. We can use the fact that one can exchange the roles of control and target qubits in CNOT gates by sandwiching it between Hadamard gates. Using this relation we can then turn the X syndrome measurement into a parity measurement with Hadamard gates applied to the data qubits instead of the measurement qubits. This results in the circuit in Eq. (<ref>). With this transformation it is easy to see that the method outlined above can be used to perform both X and Z stabilizer measurements.

\begin{equation}
\nonumber
\begin{quantikz}
\lstick{$\ket{a}$}& \gate{H}  & \targ{}   & \targ{}   & \targ{}   & \targ{}   & \gate{H}  & \qw \\
\lstick{$\ket{q_1}$}& \ghost{H} & \ctrl{-1} & \qw       & \qw       & \qw       & \qw       & \qw\\
\lstick{$\ket{q_2}$}& \ghost{H} & \qw       & \ctrl{-2} & \qw       & \qw       & \qw       & \qw\\.
\lstick{$\ket{q_3}$}& \ghost{H} & \qw       & \qw       & \ctrl{-3} & \qw       & \qw       & \qw\\
\lstick{$\ket{q_4}$}& \ghost{H} & \qw       & \qw       & \qw       & \ctrl{-4} & \qw       & \qw
\end{quantikz}
\leftrightarrow
\begin{quantikz}
& \qw       & \ctrl{1}  & \ctrl{2}  & \ctrl{3}  & \ctrl{4}  & \qw       & \qw \\
& \gate{H}  & \targ{}   & \qw       & \qw       & \qw       & \gate{H}  & \qw \\
& \gate{H}  & \qw       & \targ{}   & \qw       & \qw       & \gate{H}  & \qw\\
& \gate{H}  & \qw       & \qw       & \targ{}   & \qw       & \gate{H}  & \qw\\
& \gate{H}  & \qw       & \qw       & \qw       & \targ{}   & \gate{H}  & \qw
\end{quantikz}
\label{fig:X_stabalizer_decomp}
\end{equation}

Circuit diagrams showing the transformation of an X stabilizer (RHS) into a Z stabilizer (LHS) and vice versa. The transformation inverts the target of a CNOT gate through the use of Hadamard interactions. On the left-hand side the effect of the middle four CNOT gates is to produce parity measurements, the same measurement we have been developing here. This circuit represents the Z stabilizer measurement circuit, on the right we have the X stabilizer measurement. Shown here is the ability to transform between the two. This transformation allows us to create both of the possible stabilizers and others in between. One can imagine only performing the CNOT transformation applied here to two of the qubits thus creating a $XZZX$ stabilizer.

$\ket{q_1}$        [3]3-Parity

$\ket{q_4}$                    [2]2-Parity

$\ket{a}$        -3             -1

Example of the concatenation of multiple parity gates together to create a five fold parity measurement gate. We have broken the gate down into two gates a three qubit parity gates (3-parity gate) and a single two qubit parity gate (2-parity gate). This is a natural extension of the CNOT method outlined in Figure <ref> where we can consider the CNOT gate as a single parity measurement gate or 1-parity measurement gate.

§ CONCLUSION

In conclusion, we have analysed the effectiveness of a single shot stabilizer measurement within superconducting circuits. We have shown the fidelity to be well above current estimates for CNOT decomposition's that are suggested in most implementations of quantum error correction. We discussed the errors associated with this system highlighting the effects of higher order Z interactions which could be corrected for in this system due to the connectivity of the circuit we have proposed. This system uses tunable couplers to couple the qubits together giving the system a large amount of tunability that can be used to execute different types of stabilizer interactions along with the ones we have proposed. Whilst this system shows the use of higher order Z interactions for quantum error correction the explanation of this through perturbation theory may be lacking slightly as 4th order perturbation theory has recently been shown to fail for certain values of the coupler frequency. A more thorough analysis of the higher order interactions is needed to fully understand these interactions and their uses.

After the conclusion of this work the authors were made aware of an independent work [23] based on a very similar effect.

This project has received funding from EPSRC DTP grant EP/R513040/1, I would also like to thank my supervisor M.Hartmann for his advise on this work.

§ MODEL

§.§ SW transformation

When performing the SW approximations we eliminate terms which we deem too small to contribute to the overall dynamics. Here we show the full transformations highlighting the approximations and calculating the contributions that these will make and showing that they will be small enough not to contribute. We keep terms only to second order in the coupling as higher terms are considered small enough to not contribute to the dynamics of the system.

§.§ Elimination of edge couplers

We begin by eliminating the coupler connecting the qubits along the edges of the unit cell. We use the transformation stated in the main text

\begin{eqnarray}\label{eq:SW_expansion_commutator}
H \to \tilde{H} &=& e^{i S_{\text{edge}}} H e^{-i S_{\text{edge}}}
\\ \nonumber
e^{i S_{\text{edge}}} &H& e^{-i S_{\text{edge}}} = H + [S_{\text{edge}},H]
\\ \nonumber
&+& \frac{1}{2!} [S_{\text{edge}},[S_{\text{edge}},H]] + ...
\end{eqnarray}

\begin{align}
\\ \nonumber
S_{\text{edge}} = \sum_{i=1}^4 \bigg( \frac{g_{i,c_i}}{\Delta_{i,ci}} (\qd_i c_i - q_i \cd_i) - \frac{g_{i,c_i}}{\Sigma_{i,ci}} (\qd_i \cd_i - q_i c_i)
+ \frac{g_{i+1,c_i}}{\Delta_{i+1,ci+1}} (\qd_{i+1} c_i - q_{i+1} \cd_i)
- \frac{g_{i+1,c_i}}{\Sigma_{i+1,ci+1}} (\qd_{i+1} \cd_i - q_{i+1} c_i)\bigg).
\end{align}

Here we have defined $\Delta_{i,j} = \omega_i - \omega_j$, $\Sigma_{i,j} = \omega_i + \omega_j$. We also have defined $(q_i, c_i,a) / (\qd_i, \cd_i,a^{\dagger})$ to be the qubit, coupler and ancilla annihilation/creation operators. In addition, we have defined $g_{nm}$ to denote the coupling between qubit $n$ and $m$ (the exact form can be found in the supplementary material) and $g_{i,cj}$ describes the coupling between the i-th qubit and the j-th coupler. For later use we shall also define the transition frequencies and anharmonicities for the ith qubit, coupler and the ancilla to be $\omega_i, \omega_{ci}$ and $\omega_a$.

The full calculation is long and obtuse, so we will only state the final result in this section. The calculation is similar to many other SW transformations to eliminate tunable couplers, which can e.g. be found in [19, 24]. Keeping terms up to second order in the coupling we obtain the Hamiltonian

\begin{eqnarray}
\tilde{H} &=& \sum_{i=1}^4 \tilde{H}_0 (q_i) + \sum_{j=1}^5 \tilde{H}_0 (c_j) + \tilde{H}_0 (a)
\\ \nonumber
&+& \tilde{H}_{\text{int,q}} + \tilde{H}_{\text{int,c}},
\end{eqnarray}

with the functions now defined as

\begin{eqnarray}
\tilde{H}_0 (X_i) &=& \tilde{\omega}_i X_i^{\dag} X_i + \frac{\tilde{\alpha}_i}{2} X_i^{\dag} X_i^{\dag} X_i X_i,
\\
\tilde{H}_{\text{int,q}} &=& \sum_{i<j} \tilde{g}_{ij} (q_i - q_i^{\dag})(q_j - q_j^{\dag}),
\\
\tilde{H}_{\text{int,c}} &=& \tilde{g}_{i,c5} (q_i - q_i^{\dag})(c_5 - c_5^{\dag}) ,
\\ \nonumber
&+& \tilde{g}_{ci,c5} (c_i - \cd_i)(c_5 \cd_5)
\\ \nonumber
&+& \tilde{g}_{ci+1,c5} (c_{i+1} - \cd_{i+1})(c_5 - \cd_5).
\end{eqnarray}

\begin{eqnarray} \label{eqt:Dressed_variables_tilde}
\tilde{\omega}_{i} &=& \omega_{i} +  g_{i,ci}^2 (\frac{1}{\Delta_{i,ci}} +\frac{1}{\Sigma_{i,ci}})
\\ \nonumber
&+& g_{i-1,ci-1}^2 (\frac{1}{\Delta_{i-1,ci-1}} + \frac{1}{\Sigma_{i-1,ci-1}}),
\\ \nonumber
\tilde{\omega}_{ci} &=& \omega_{ci} +  g_{i,ci}^2 (\frac{1}{\Delta_{i,ci}} + \frac{1}{\Sigma_{i,ci}})
\\ \nonumber
&+& g_{i+1,ci+1}^2 (\frac{1}{\Delta_{i+1,ci+1}} + \frac{1}{\Sigma_{i+1,ci+1}}),
\\ \nonumber
\tilde{\omega}_a &=& \omega_a ,
\\ \nonumber
\tilde{g}_{ij} &=& g_{ij} +  g_{i,ci} g_{j,cj}\left(\frac{1}{\Delta_{i,ci}} + \frac{1}{\Delta_{j,cj}} - \frac{1}{\Sigma_{i,ci}} - \frac{1}{\Sigma_{j,cj}} \right),
\\ \nonumber
\tilde{g}_{ci,c5} &=& g_{i,ci} g_{i,c5} \left(\frac{1}{\Delta_{i,ci}} + \frac{1}{\Sigma_{i,ci}} \right),
\\ \nonumber
\Tilde{\alpha}_i &\approx& \alpha_i,
\quad \text{,} \quad
\Tilde{\alpha}_{ci} \approx \alpha_{ci},
\quad \text{,} \quad
\Tilde{\alpha}_{a} \approx \alpha_{a}.
\end{eqnarray}

Here we have defined the shifted or “first-dressed" system variables $\tilde{\omega},\tilde{\alpha}$ and $\tilde{g}$ where these represent the approximate transition frequency, anharmonicity and coupling of the new dressed system.

We note that there is some effective coupling between the couplers and the central coupler but this term in proportional to $g_{i,ci} g_{i+1,c5}(\frac{1}{\Delta_{i,ci}} + \frac{1}{\Sigma_{i,ci}})$. Estimating this strength we find that for our parameters this coupling will have a reasonably large interaction strength. However the couplers should never gain any excitations as they are detuned from the qubits and are far detuned from any drive.

We also find counter rotating terms $c_i c_i + c_i^{\dagger} c_i^{\dagger}$ that have strength given by $\frac{g_{i,ci}^2}{\Delta_{i,ci}}$. In a rotating frame these operators will rotate at the sum of their transition frequencies thus their dynamics will not affect the system and will average out to no contribution in the course of this interaction.

§.§ Elimination of central coupler

Now that we have eliminated the edge couplers we move to eliminate the central coupler. This is again done with a Schrieffer–Wolff transformation but this time with the argument

\begin{align}
S_{\text{center}} = \sum_{i=1}^4 \frac{\tilde{g}_{i,c_5}}{\tilde{\Delta}_{i5}} (\qd_i c_5 - q_i \cd_5) - \frac{\tilde{g}_{i,c_5}}{\tilde{\Sigma}_{i5}} (\qd_i \cd_5 - q_i c_5)
+ \frac{\tilde{g}_{a,c_5}}{\tilde{\Delta}_{a5}} (\ad c_5 - a \cd_5) - \frac{\tilde{g}_{a,c_5}}{\tilde{\Sigma}_{a5}} (\ad \cd_5 - a c_5).
\end{align}

We perform the transformation

\begin{eqnarray}
\tilde{H} \to \Bar{H} = e^{i S_{\text{center}}} \tilde{H} e^{-i S_{\text{center}}},
\end{eqnarray}

using the commutations relations in Eq.(<ref>) as stated in the main text and the commutator expansion Eq. <ref> we obtain

\begin{equation}
\end{equation}

\begin{align}
= &- \sum_{i=1}^4 \tilde{g}_{i,c5} (q_i \cd_5 + \qd_i c_5) + \tilde{g}_{i,c5} (q_i c_5 + \qd_i \cd_5)
\\ \nonumber
&- \tilde{g}_{a} (a \cd_5 + \ad c_5) + \tilde{g}_{a} (a c_5 + \ad \cd_5)
\\ \nonumber
&-\sum_{i=1}^4 \sum_{j<k} (\frac{\tilde{g}_{i,c5} \tilde{g}_{jk}}{\tilde{\Delta}_{i,c5}} + \frac{\tilde{g}_{i,c5} \tilde{g}_{jk}}{\tilde{\Sigma}_{i,c5}})((q_k - \qd_k)(c_5 - \cd_5) \delta_{ij}
\\\nonumber
&+ (q_j - \qd_j)(c_5 - \cd_5) \delta_{ik})
\\\nonumber
&+\sum_{i,j} \tilde{g}_{i,c5} \tilde{g}_{j,c5}(\frac{1}{\tilde{\Delta}_{i,c5}} - \frac{1}{\tilde{\Sigma}_{i,c5}})(q_j - \qd_j)(q_i - \qd_i)
\\\nonumber
&- (c_5 - \cd_5)^2
\\\nonumber
&+\sum_{i} \tilde{g}_{i,c5} \tilde{g}_{a}(\frac{1}{\tilde{\Delta}_{i,c5}} - \frac{1}{\tilde{\Sigma}_{i,c5}})(a-\ad)(q_i - \qd_i)
\\\nonumber
&+ \tilde{g}_a^2(\frac{1}{\tilde{\Delta}_{a,c5}} - \frac{1}{\tilde{\Sigma}_{a,c5}})((a-\ad)^2-(c_5 - \cd_5)^2).
\end{align}

\begin{equation}
\end{equation}

\begin{align}
\nonumber
&-\sum_{i,j} \tilde{g}_{i,c5} \tilde{g}_{j,c5} (q_i + \qd_i)(q_j+ \qd_j) (\frac{1}{\Sigma_{i,c5}} + \frac{1}{\Delta_{i,c5}})
\\ \nonumber
&-\sum_{i,j} \tilde{g}_{i,c5} \tilde{g}_{j,c5} (\frac{1}{\Sigma_{i,c5}} + \frac{1}{\Delta_{i,c5}})\delta_{ij} ((c_5 \cd_5 - \cd_5 c_5) + (c_5 c_5 + \cd_5 \cd_5))
\\ \nonumber
&-\sum_{j} \tilde{g}_{a} \tilde{g}_{j,c5} (\frac{1}{\Sigma_{a,c5}} + \frac{1}{\Delta_{a,c5}})(a-\ad)(a-\ad)
\\ \nonumber
&-\sum_{j} \tilde{g}_{a} \tilde{g}_{j,c5} (\frac{1}{\Sigma_{a,c5}} + \frac{1}{\Delta_{a,c5}}) (c_5 + \cd_5)^2
\\ \nonumber
&-\sum_{i,j}\tilde{g}_{a,c5} \tilde{g}_{i,c5} (\frac{1}{\Sigma_{a,c5}} + \frac{1}{\Delta_{a,c5}}) ((q_i \ad + \qd_i) - (q_i a - \qd_i \ad))
\\ \nonumber
&-\sum_{i,j}\tilde{g}_{a,c5} \tilde{g}_{j,c5} (\frac{1}{\Sigma_{j,c5}} + \frac{1}{\Delta_{j,c5}})((\qd_j a + \ad q_j) + (a q_j - \ad \qd_j)).
\\ \nonumber
\end{align}

with these calculations we find the final Hamiltonian to be

\begin{align} \label{eq:final_hamiltonian_app}
&\Bar{H} = \sum_{i=1}^5 \Bar{H}_0 (c_i) + \sum_{j=1}^4 \Bar{H}_0 (q_i) +\Bar{H}_0 (a)
\\ \nonumber
&+\Bar{H}_{\text{int,q}} + O(\frac{g^2}{\Delta^2}),
\\\nonumber
&\Bar{H}_0 (X_i) = \Bar{\omega}_i X_i^{\dag} X_i + \frac{\Bar{\alpha}_i}{2} X_i^{\dag} X_i^{\dag} X_i X_i,
\\\nonumber
&\Bar{H}_{\text{int,q}} = \sum_{i<j} \Bar{g}_{ij} (q_i - q_i^{\dag})(q_j - q_j^{\dag}).
\end{align}

Where we define

\begin{eqnarray} \label{eqt:Dressed_variables_bar}
\Bar{\omega}_{qi} &=& \tilde{\omega}_{qi} +  \tilde{g}_{i,c5}^2 (\frac{1}{\tilde{\Delta}_{i,c5}} + \frac{1}{\tilde{\Sigma}_{i,c5}}),
\\ \nonumber
\Bar{\omega}_{c5} &=& \tilde{\omega}_{c5} + \sum_{i=1}^4 \tilde{g}_{i,c5}^2 (\frac{1}{\tilde{\Delta}_{i,c5}} + \frac{1}{\tilde{\Sigma}_{i,c5}}),
\\ \nonumber
\omega_a &=& \tilde{\omega}_a+ g_{a,c5}\left(\frac{1}{\tilde{\Delta}_{a,c5}} + \frac{1}{\tilde{\Sigma}_{a,c5}}\right),
\\ \nonumber
\Bar{g}_{ij} &=& \tilde{g}_{ij} +  \tilde{g}_{i,c5} \tilde{g}_{j,c5}\left(\frac{1}{\tilde{\Delta}_{i,c5}} + \frac{1}{\tilde{\Delta}_{j,c5}} - \frac{1}{\tilde{\Sigma}_{i,c5}} - \frac{1}{\tilde{\Sigma}_{j,c5}} \right),
\\ \nonumber
\Bar{\alpha}_i &\approx& \tilde{\alpha}_i
\quad \text{,} \quad \Bar{\alpha}_a \approx \tilde{\alpha}_a .
\end{eqnarray}

Here we have $\tilde{\Delta}_{i,j} = \tilde{\omega}_i - \tilde{\omega}_j$, $\tilde{\Sigma}_{i,j} = \tilde{\omega}_i + \tilde{\omega}_j$. In addition, we now have the “second-dressed" variables being $\Bar{\omega}_{n}$ and $\Bar{\alpha}_{n}$ and $\Bar{g}_{nm}$ are shifted frequencies, anharmonicities and couplings respectively.

§ DISPERSIVE SHIFTS

In the main text we described how we derived the dispersive shifts and gave some expressions relating the bare and true dispersive shifts. The expressions for these shifts get larger the more qubits are added to the system. We have included a link to a repository with a Mathematica notebook where these expressions can be generated and explored [25].

§ PARAMETERS

Here we give some example parameters which would allow for the tessellation shown in Figure <ref>. Since there are many other parameters associated with the lattice namely the coupler frequencies which will affect the couplings between the qubits, we only give the qubit frequencies. These frequencies have been shown to give dispersive shifts as described in the main text with all other (higher order and unwanted) shifts suppressed to below $0.5 $MHz.

Qubit     Transition Frequency $[GHz]$     Anharmoncity $[GHz]$
$Q_1$      5.28     -0.13

$Q_2$      5.35     -0.15

$Q_3$      5.43     -0.27

$Q_4$      5.5     -0.26

$Q_5$      5.24     -0.26

$Q_6$      5.4     -0.2

$Q_7$      5.31     -0.22

$A_1$     5.02     -0.17

$A_2$     4.96     -0.21

$A_3$     5.06     -0.27

$A_4$     4.93     -0.2

Table outlining the parameters that provide equal dispersive shifts within each unit cell as described in Fig. <ref>. The rest of the dispersive shifts are higher suppressed. Here we have labelled the ancilla qubits as $A_i$ and the qubits as $Q_i$.

§ DISPERSIVE SHIFTS

We show the all of the dispersive shifts that were calculated in our simulations these shifts were tuned within reason so that the unwanted shifts were small enough and the data qubit - ancilla shifts were equal and dominant. We give each shift to three decimal places.

Dispersive Shift     Strength [MHz]
$\chi_{12}$      -5.005

$\chi_{13}$      -5.079

$\chi_{14}$      -5.050

$\chi_{23}$      0.030

$\chi_{24}$      -0.212

$\chi_{34}$      0.079

$\chi_{123}$      0.246

$\chi_{124}$      0.359

$\chi_{134}$      0.072

$\chi_{234}$      -0.024

$\chi_{1234}$      0.002

Complete list of dispersive shifts in our simulations.

[1]
Sebastian Krinner, Nathan Lacroix, Ants Remm, et al.
Realizing repeated quantum error correction in a distance-three surface code, 2021.

[2]
Frank Arute, Kunal Arya, Ryan Babbush, et al.
Quantum supremacy using a programmable superconducting processor.
Nature, 574(7779):505–510, 2019.

[3]
Lukas Postler, Sascha Heuen, Ivan Pogorelov, et al.
Demonstration of fault-tolerant universal quantum gate operations.
Nature, 605(7911):675–680, may 2022.

[4]
Chris N. Self, Marcello Benedetti, and David Amaro.
Protecting expressive circuits with a quantum error detection code, 2022.

[5]
Dolev Bluvstein, Harry Levine, Giulia Semeghini, et al.
A quantum processor based on coherent transport of entangled atom arrays.
Nature, 604(7906):451–456, 2022.

[6]
A.Yu. Kitaev.
Fault-tolerant quantum computation by anyons.
Annals of Physics, 303(1):2–30, Jan 2003.

[7]
Robert Raussendorf and Jim Harrington.
Fault-tolerant quantum computation with high threshold in two dimensions.
Physical Review Letters, 98(19), may 2007.

[8]
Austin G Fowler, Matteo Mariantoni, John M Martinis, and Andrew N Cleland.
Surface codes: Towards practical large-scale quantum computation.
Physical Review A, 86(3):032324, 2012.

[9]
Sebastian Krinner, Nathan Lacroix, Ants Remm, et al.
Realizing repeated quantum error correction in a distance-three surface code, 2021.

[10]
Eyob A. Sete, Nicolas Didier, Angela Q. Chen, et al.
Parametric-resonance entangling gates with a tunable coupler.
Phys. Rev. Applied, 16:024050, Aug 2021.

[11]
IBM Quantum.
<https://quantum-computing.ibm.com/>, 2022.

[12]
Aneirin J Baker, Gerhard BP Huber, Niklas J Glaser, et al.
Single shot i-toffoli gate in dispersively coupled superconducting qubits.
Applied Physics Letters, 120(5):054002, 2022.

[13]
Yosep Kim, Alexis Morvan, Long B. Nguyen, et al.
High-fidelity three-qubit itoffoli gate for fixed-frequency superconducting qubits.
Nature Physics, 18(7):783–788, 2022.

[14]
Xuexin Xu and M.H. Ansari.
Zz freedom in two-qubit gates.
Phys. Rev. Applied, 15:064074, Jun 2021.

[15]
Michele C. Collodo, Anton Poto ččnik, Simone Gasparinetti, et al.
Observation of the crossover from photon ordering to delocalization in tunably coupled resonators.
Phys. Rev. Lett., 122:183601, May 2019.

[16]
Youngkyu Sung, Leon Ding, Jochen Braumüller, et al.
Realization of high-fidelity cz and zz-free iswap gates with a tunable coupler.
Phys. Rev. X, 11:021058, Jun 2021.

[17]
Yulin Wu, Wan-Su Bao, Sirui Cao, et al.
Strong quantum computational advantage using a superconducting quantum processor.
Phys. Rev. Lett., 127:180501, Oct 2021.

[18]
Sergey Bravyi, David P. DiVincenzo, and Daniel Loss.
Schrieffer–wolff transformation for quantum many-body systems.
Annals of Physics, 326(10):2793–2826, Oct 2011.

[19]
Mahdi Sameti, Anton Poto ččnik, Dan E. Browne, Andreas Wallraff, and Michael J. Hartmann.
Superconducting quantum simulator for topological order and the toric code.
Phys. Rev. A, 95:042330, 4 2017.

[20]
N E Frattini, U Vool, S Shankar, et al.
3-wave mixing Josephson dipole element.
Applied Physics Letters, 110(22):222603, 2017.

[21]
Guanyu Zhu, David G. Ferguson, Vladimir E. Manucharyan, and Jens Koch.
Circuit qed with fluxonium qubits: Theory of the dispersive regime.
Phys. Rev. B, 87:024510, Jan 2013.

[22]
Alysson Gold, JP Paquette, Anna Stockklauser, et al.
Entanglement across separate silicon dies in a modular superconducting qubit device.
npj Quantum Information, 7(1):1–10, 2021.

[23]
Matthew J. Reagor, Thomas C. Bohdanowicz, David Rodriguez Perez, Eyob A. Sete, and William J. Zeng.
Hardware optimized parity check gates for superconducting surface codes, 2022.

[24]
Fei Yan, Philip Krantz, Youngkyu Sung, et al.
Tunable Coupling Scheme for Implementing High-Fidelity Two-Qubit Gates.
Physical Review Applied, 10(5), 2018.

[25]
Aneirin Baker.
Dispersive Shifts within QEC.
<https://github.com/nyeBaker/QEC_With_Dispersive_Shifts/>, March 2022.