Surface code logical operations on a superconducting quantum processor
Data files
Sep 29, 2026 version files 1.51 GB
-
datasets.zip
1.51 GB
-
README.md
11.16 KB
Abstract
Fault-tolerant quantum computation requires logical operations that manipulate encoded information while preserving error-correction protection. In planar surface-code architectures, code deformation and lattice surgery provide a local, measurement-based route to such operations. Here we demonstrate key elements of patch-based logical processing on a 107-qubit superconducting quantum processor. We implement a reusable primitive layer comprising merge and split, patch expansion and shrinkage, and deformations mediated by domain walls and twist defects. We then compose these primitives to realize logical state routing and logical controlled-NOT, Hadamard and phase gates, forming a Clifford-generating set. All operations are implemented on distance-three surface-code patches with multi-round syndrome extraction and neural-network decoding, without post-selection. Our results advance superconducting surface-code experiments from protected logical memory to active, patch-based fault-tolerant logical operations.
Dataset DOI: 10.5061/dryad.j0zpc86z3
Description of the data and file structure
These datasets include data generated in the logical movement / CNOT / H / S experiments, as well as data used in Supplementary Materials Sections B, C, and F of the associated publication.
Files and variables
File: datasets.zip
Description: The structure of these datasets is as follows:
datasets/
├── logical_movement/ # The logical movement experiment.
│ ├── direct/ # The direct-movement protocol implemented
│ │ │ # by code deformation.
│ │ ├── init{init}_meas{meas}/ # An experiment with the initial state
│ │ │ │ # 'init' and the measurement basis 'meas'.
│ │ │ │ # 'i' means the patch is initialized
│ │ │ │ # in |+i>, and 'j' means it is initialized
│ │ │ │ # in |-i>.
│ │ │ ├── circuit.stim # The noisy circuit of this experiment.
│ │ │ └── measurements.b8 # The experimental measurement outcomes.
│ │ └── ...
│ └── lattice_surgery/ # The state-teleportation protocol implemented
│ │ # by lattice surgery.
│ ├── init{init}+_measX{meas}/ # An experiment with the initial state
│ │ │ # 'init' and the measurement basis 'meas'.
│ │ │ # The fixed '+' means that the auxiliary
│ │ │ # patch is initialized in |+>. The fixed
│ │ │ # 'X' means that the input patch is measured
│ │ │ # in the X basis.
│ │ └── ...
│ └── ...
├── logical_CNOT/ # The logical CNOT experiment.
│ ├── init{init}_meas{meas}/ # An experiment with the initial state
│ │ │ # 'init' and the measurement basis 'meas'.
│ │ │ # Both 'init' and 'meas' consist of two
│ │ │ # characters, representing the control
│ │ │ # patch and the target patch, respectively.
│ │ └── ...
│ └── ...
├── logical_H/ # The logical H experiment.
│ ├── init{init}_meas{meas}/ # An experiment with the initial state
│ │ │ # 'init' and the measurement basis 'meas'.
│ │ └── ...
│ └── ...
├── logical_S/ # The logical S experiment.
│ ├── init{init}_meas{meas}/ # An experiment with the initial state
│ │ │ # 'init' and the measurement basis 'meas'.
│ │ └── ...
│ └── ...
├── memory_square/ # The distance-3 logical memory experiment.
│ ├── 0_4/ # The patch coordinate.
│ │ ├── state{state}_r{round}/ # An experiment with the initial state
│ │ │ │ # 'state' and the number of QEC rounds
│ │ │ │ # 'round'.
│ │ │ └── ...
│ │ └── ...
│ └── ...
├── memory_rectangle/ # The rectangular surface code logical memory
│ │ # experiment.
│ ├── horizontal/ # The patch orientation.
│ │ └── ...
│ └── ...
├── primitives/ # The experiments on lattice surgery primitives.
│ ├── merge/ # The merge experiment.
│ │ ├── init{init}_meas{meas}/ # An experiment with the initial state
│ │ │ │ # 'init' and the measurement basis 'meas'.
│ │ │ │ # The 'init' consists of two characters,
│ │ │ │ # representing the two input patches.
│ │ │ └── ...
│ │ └── ...
│ ├── split/ # The split experiment.
│ │ ├── init{init}_meas{meas}/ # An experiment with the initial state
│ │ │ │ # 'init' and the measurement basis 'meas'.
│ │ │ │ # The 'meas' consists of two characters,
│ │ │ │ # representing the two output patches.
│ │ │ └── ...
│ │ └── ...
│ ├── expansion/ # The expansion experiment.
│ │ ├── init{init}_meas{meas}/ # An experiment with the initial state
│ │ │ │ # 'init' and the measurement basis 'meas'.
│ │ │ └── ...
│ │ └── ...
│ └── shrinkage/ # The shrinkage experiment.
│ ├── init{init}_meas{meas}/ # An experiment with the initial state
│ │ │ # 'init' and the measurement basis 'meas'.
│ │ └── ...
│ └── ...
└── SPAM/ # The experiments on state preparation
│ # and measurement in the Pauli bases.
├── FT_XZ/ # The fault-tolerant X/Z-basis memory
│ │ # experiments.
│ ├── trial_0/ # The 0th trial of these experiments.
│ │ │ # Data from all 4 trials are averaged.
│ │ ├── state{state}_r{round}/ # An experiment with the initial state
│ │ │ │ # 'state' and the number of QEC rounds
│ │ │ │ # 'round'.
│ │ │ └── ...
│ │ └── ...
│ └── ...
├── NFT_Y/ # The non-fault-tolerant Y-basis memory
│ │ # experiments.
│ └── ...
├── FT_Y/ # The fault-tolerant Y-basis memory experiments.
│ ├── trial_0/ # The 0th trial of these experiments.
│ │ │ # Data from all 4 trials are averaged.
│ │ ├── state{state}_r{round}/ # An experiment with the initial state
│ │ │ │ # 'state' and the number of QEC rounds
│ │ │ │ # 'round'. The two preparation cycles
│ │ │ │ # and two measurement cycles required
│ │ │ │ # for fault-tolerant Y-basis access are
│ │ │ │ # excluded.
│ │ │ └── ...
│ │ └── ...
│ └── ...
└── FT_Y_BRAIDING/ # The fault-tolerant Y-basis memory experiments
│ # implemented by the twist-braiding protocol.
├── trial_0/ # The 0th trial of these experiments.
│ │ # Data from all 4 trials are averaged.
│ ├── state{state}_r{round}/ # An experiment with the initial state
│ │ │ # 'state' and the number of QEC rounds
│ │ │ # 'round'. The two preparation cycles
│ │ │ # and two measurement cycles required
│ │ │ # for fault-tolerant Y-basis access are
│ │ │ # excluded.
│ │ └── ...
│ └── ...
└── ...
File formats and usage
Each experiment folder contains two files: circuit.stim and measurements.b8. A minimal example of loading them is provided below.
circuit.stim: The noisy circuit of this experiment. It uses the same format as the "stim" files of the Stim library. See the Stim documentation for more details.measurements.b8: The experimental measurement outcomes. It uses the same format as the "b8" files of the Stim library. See the Stim documentation for more details.
The example below uses Python 3 and the free, open-source Stim and NumPy packages. No proprietary software is required. Install the packages with:
python -m pip install stim numpy
Extract the dataset archive and run the following code with datasets as the working directory. Change path to select another experiment folder, keeping the matching circuit.stim and measurements.b8 together.
import pathlib
import numpy as np
import stim
path = pathlib.Path("memory_square/0_4/state+_r03") # Enter the path of a folder here.
# The "circuit.stim" file uses the same format as the "stim" files of the "Stim" library.
# See https://github.com/quantumlib/Stim/blob/main/doc/file_format_stim_circuit.md for more details.
circuit = stim.Circuit.from_file(path / "circuit.stim")
############ Below are 'parse_b8' codes copied from the 'Stim' library ############
# These codes are copied from https://github.com/quantumlib/Stim/blob/main/doc/result_formats.md#b8
from typing import List
def parse_b8(data: bytes, bits_per_shot: int) -> List[List[bool]]:
shots = []
bytes_per_shot = (bits_per_shot + 7) // 8
for offset in range(0, len(data), bytes_per_shot):
shot = []
for k in range(bits_per_shot):
byte = data[offset + k // 8]
bit = (byte >> (k % 8)) % 2 == 1
shot.append(bit)
shots.append(shot)
return shots
########################### End of 'parse_b8' codes ############################
# The "measurements.b8" file uses the same format as the "b8" files of the "Stim" library.
# See https://github.com/quantumlib/Stim/blob/main/doc/result_formats.md#b8 for more details.
with open(path / "measurements.b8", "rb") as f:
meas_b8 = f.read()
meas = np.array(parse_b8(meas_b8, circuit.num_measurements))
# "meas" is a `(num_shots, num_measurements)` bool matrix.
print(f"{circuit.num_measurements = }, {meas.shape = }")
