# Efficient and optimal quantum state discrimination via quantum belief propagation

Christophe Piveteau, Joseph M Renes

<figure><img src="image_1.png" /></figure>

## To cite this version:

Christophe Piveteau, Joseph M Renes. Efficient and optimal quantum state discrimination via quantum belief propagation. 2026. hal-05467914

HAL Id: hal-05467914

https://hal.science/hal-05467914v1

Preprint submitted on 20 Jan 2026

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_2.png" /></figure>

Distributed under a Creative Commons CC BY-SA 4.0 - Attribution - ShareAlike - International
License
Efficient and optimal quantum state discrimination via
quantum belief propagation

Christophe Piveteau¹ and Joseph M. Renes²

¹Inria, France

²Institute for Theoretical Physics, ETH Zürich, Switzerland

We present an efficient quantum algorithm for a structured state discrimination problem we call the subspace decoding task. Building on this, we show that the algorithm enables efficient and optimal decoding of certain families of structured classical linear codes transmitted over binary-input classi-cal-quantum pure-state channels. Such decoders can substantially enhance the performance of quan-tum algorithms based on Regev’s reduction, such as decoded quantum interferometry. In particular, we obtain optimal and efficient quantum decoders for all classical codes with efficient trellis repre-sentations. As an application, we design a quantum decoder for turbo codes and, through density evolution, demonstrate decoding thresholds that surpass the Shannon bound and closely approach the Holevo bound.

# 1 Introduction

Quantum state discrimination is a fundamental task in quantum information theory. It arises in nu-merous settings, including quantum metrology and learning, quantum communication, and quantum computation. In some of these applications, the involved families of states are structured in some way, which makes it possible to accomplish the discrimination task with an efficient quantum algorithm. Understanding when and how such structured state discrimination can be carried out efficiently is of both foundational and practical importance.

In this work, we study a family of state discrimination problems that originate from coding theory. Specifically, consider an $[n, k]$ binary linear code $\mathcal{C}$ with generator matrix $G \in \mathbb{F}_2^{k \times n}$. A uniformly random source string $u \in \mathbb{F}_2^k$ is encoded as $u^T G$ and then transmitted over a collection of binary-input pure state classical-quantum channels $W_{\omega}^{\otimes n}$ defined as

$$W_{\omega}(x) := \sqrt{1-\omega}|x\rangle + \omega|1-x\rangle \quad \text{for } x \in \mathbb{F}_2, \omega \in [0, 1/2]. \qquad (1)$$

The discrimination task, which we refer to as the subspace decoding task, is to estimate a given sub-string of the input $u$ by measuring the channel outputs. Here we develop a new quantum algorithm to efficiently solve subspace decoding problems for certain structured codes and substrings of small size.

When the goal is to estimate the entire bit string $u$, subspace decoding becomes the decoding prob-lem for $\mathcal{C}$ over $W_{\omega}$, sometimes referred to as the quantum decoding problem [1]. We then show how our algorithm can be applied to efficiently and optimally solve the quantum decoding problem for codes that exhibit a certain tree-like structure, such as an efficient trellis representation. Importantly, this allows us to optimally solve the quantum decoding task on convolutional codes. Our decoder can be seen as a quantum analogue of both the Viterbi [2] and BCJR [3] algorithms, the standard decoders in classical trellis-based coding theory. Finally, we utilize our optimal convolutional decoder to construct a quantum decoder for turbo codes. Using density evolution simulations, we show that this decoder exhibits a threshold which closely approaches the channel capacity, given by the Holevo bound.

The recent development of quantum algorithms based on the technique of Regev’s reduction [4–9] has kindled interest in finding efficient algorithms to solve the quantum decoding problem. As a promi-nent example, the quantum algorithm called decoded quantum interferometry (DQI) was recently pro-posed as a potential candidate for a quantum advantage in solving certain combinatorial optimization problems [7]. The central step in DQI consists of solving a specific classical decoding task in coherent superposition. However, it has been noted that algorithms based on Regev’s reduction, including DQI,
<figure><img src="image_3.png" /><figcaption>Figure 1: Comparison of the Shannon capacity $C(\omega)$ of the BSC and the Holevo capacity $\chi(\omega)$ of the binary-input pure state CQ channel $W_\omega$.</figcaption></figure>

can be significantly improved by utilizing a *quantum* decoder (i.e. by solving the quantum decoding problem), instead of running a classical decoder in superposition [1, 5, 7]. The quality of DQI's solution depends directly on the performance of the underlying decoder — if the decoder can tolerate more noise, then DQI will produce higher quality solutions. This motivates the search for efficient quantum decoders tailored to structured codes.

There are few previous results on efficiently solving the quantum decoding problem. To our knowledge, the only known algorithm that genuinely exploits the quantum superposition of the error configurations is *belief propagation with quantum messages (BPQM)* introduced in [10] and subsequently improved and extended in [11–15]. One can recover BPQM as a special case of our algorithm. As such, we consider our algorithm to be a generalization of BPQM, and we will also refer to it using the same name. Unlike the original algorithm, which was fundamentally limited to codes with a tree (or locally tree-like) Tanner graph, our generalized BPQM removes this limitation. While our improvements immediately impact convolutional and turbo codes, they also lay the groundwork for efficiently tackling quantum decoding for a wider range of structured codes.<fnref n="1" /> Expanding the set of codes that can be decoded efficiently and accurately increases the potential for achieving practical quantum advantages using algorithms based on Regev’s reduction.

## 1.1 Background and motivation

**CQ channel coding with pure-state channels** Consider the task of achieving reliable communication of classical information over the binary-input pure state CQ channel $W_\omega$. Assume that the $k$-bit data is encoded into $n$ bits using an $[n, k]$ binary linear code $C$. If the sender transmits the codeword $x \in C$, the receiver obtains an $n$-qubit system in the state $|\Psi_x\rangle := W_\omega^{\otimes n}(x)$. The quantum decoding problem consists of estimating $x$ given this received quantum system. It can be understood as the problem of discriminating the family of $2^k$ pure states $\{|\Psi_x\rangle | x \in C\}$.

A simple strategy to solve the quantum decoding problem is to measure each received qubit in the computational basis, which optimally estimates whether the input bit was more likely to be 0 or 1. This effectively turns the pure-state channel $W_\omega$ into a binary symmetric channel (BSC) $BSC_\omega$ with error probability $\omega$, and the decoding can henceforth be achieved with a classical decoder designed for the BSC. This strategy is fundamentally limited by the Shannon capacity $C(\omega) = 1 - h(\omega)$ of the induced BSC, where $h$ is the binary entropy function. However, the celebrated Holevo-Schumacher-Westmoreland theorem states that the maximal possible rate at which classical information can be transmitted over $W_\omega$ is not given by $C(\omega)$, but rather by the Holevo capacity $\chi(\omega) = h(\frac{1}{2} - \sqrt{\omega(1-\omega)})$. The difference between the Shannon capacity of $BSC_\omega$ and the Holevo capacity of $W_\omega$ as a function of $\omega$ is depicted in Figure 1. Note that the ratio between the capacities $\chi(\omega)/C(\omega)$ diverges as $\omega$ approaches 1/2.

In order to realize coding schemes which approach the Holevo capacity, it is therefore crucial to design truly quantum decoders which exploit the quantum superposition in the channel output. In this paper, we will explicitly construct such decoders for various families of codes.

<footnote n="1">¹For example, the discussion in Section 6.2 should allow us to handle codes with a Tanner graph that has only few cycles locally.</footnote>
**Regev's reduction with quantum decoders** Regev's reduction is a foundational result in lattice-based cryptography, showing that the learning with errors problem is as hard to solve as certain worst-case lattice problems [16]. In recent years, the reduction has gained renewed attention as a technique to design new quantum algorithms [4-9]. When phrased in the context of coding theory, Regev's reduction can be viewed as using an efficient decoder for an $[n, k]$ linear code $C \subset \mathbb{F}_q^n$ to construct a quantum algorithm that samples low-weight codewords from the shifted dual code $C^\perp + v$ for a given $v \in \mathbb{F}_q^n$. For simplicity, we will restrict ourselves to the binary case $q = 2$. Let $f: \mathbb{F}_2^n \to \mathbb{R}_{\ge 0}$ be a function such that $\|f\|_2 = 1$ and such that the state $\sum_{e \in \mathbb{F}_2^n} f(e)|e\rangle$ can be efficiently prepared. Then, Regev's reduction proceeds as follows [1]:

$$ \sum_{e \in \mathbb{F}_2^n} f(e) |e\rangle \otimes \frac{1}{\sqrt{2^k}} \sum_{c \in C} (-1)^{v \cdot c} |c\rangle \xrightarrow{(1)} \frac{1}{\sqrt{2^k}} \sum_{c \in C} (-1)^{v \cdot c} \sum_{e \in \mathbb{F}_2^n} f(e) |c+e\rangle \otimes |c\rangle \quad (2) $$

$$ \xrightarrow{(2)} \frac{1}{\sqrt{2^k}} \sum_{c \in C} (-1)^{v \cdot c} \sum_{e \in \mathbb{F}_2^n} f(e) |c+e\rangle \otimes |0\rangle \quad (3) $$

$$ \xrightarrow{(3)} \sqrt{2^k} \sum_{d \in C^{\perp+\nu}} \hat{f}(d) |d\rangle \otimes |0\rangle . \quad (4) $$

First, the state $\sum_e f(e)|e\rangle$ is prepared together with a uniform superposition of the codewords of $C$. In step (1), the second register is added to the first register. In step (2), we utilize a decoder for $C$ in order to uncompute the second register. Finally, in step (3), we apply a Hadamard transform on the first register. By measuring the first register, we obtain a random codeword $d \in C^\perp + v$ with a probability proportional to $\hat{f}(d)^2$ where $\hat{f}$ is the Fourier transform of $f$. Typically, if we choose $f$ to have support on high-weight codewords, then $\hat{f}$ will concentrate on low-weight codewords, effectively allowing us to sample low-weight codewords from the shifted dual code. Therefore, using a decoder which tolerates stronger noise directly leads to a lower weight of the sampled dual codewords. A natural choice for the noise function $f$ is to take i.i.d. Bernoulli noise [1, 8], i.e., $f(e)^2 = (1-\omega)^{n-w(e)}\omega^{w(e)}$ where $\omega \in [0, 1/2]$ and $w(e)$ is the Hamming weight of $e \in \mathbb{F}_2^n$. The Fourier transform $\hat{f}$ is then also given by Bernoulli noise, but with noise strength $\omega^\perp := \frac{1}{2} - \sqrt{\omega(1-\omega)}$.

The uncomputation in step (2) can be achieved by either executing a classical decoder in superposition, mapping $|c+e\rangle \otimes |c\rangle \mapsto |c+e\rangle \otimes |0\rangle$ for any $c \in C$ and correctable error $e \in \mathbb{F}_2^n$, or by a quantum decoder which coherently recovers $c$ from $\sum_e f(e)|c+e\rangle$. When choosing $f$ as Bernoulli noise, these two decoding problems precisely correspond to decoding $C$ transmitted over $\text{BSC}_\omega$, or over $W_\omega$, respectively. Since a quantum decoder can tolerate stronger noise rates $\omega$ (because it is limited by the Holevo bound of $W_\omega$ instead of the Shannon bound of $\text{BSC}_\omega$), it can significantly improve the quality of the sampled output from Regev's reduction. For example, in the context of solving max-XORSAT with DQI, the threshold $\omega_*$ of a (classical or quantum) decoder directly determines the fraction of satisfied equations in the solution, which is precisely $\omega_*^\perp$ [17].

In summary, any classical code $C$, combined with a quantum decoder whose threshold exceeds the Shannon bound, provides a promising avenue for finding a quantum advantage within DQI. Finding such code-decoder pairs is precisely the goal of this paper. One should note, however, that when $C$ possesses some strong structure, the associated combinatorial optimization problem solved by DQI may become somewhat artificial and of limited practical relevance.

## 1.2 Overview of technical results

**Subspace decoding problem** Our main technical contribution is an efficient algorithm to solve the subspace decoding problem, which is concretely defined as follows. Fix some nonnegative integers $n \ge k \ge l$, a full-rank matrix $G \in \mathbb{F}_2^{k \times n}$, and a probability distribution $P$ over $n$ bits. Define $F_{l,G}$ as a random encoding channel which maps the bit string $x \in \mathbb{F}_2^l$ to $(x \| r)^T G$ where $r \in \mathbb{F}_2^{k-l}$ is chosen uniformly at random and $x \| r$ denotes bit string concatenation. Furthermore, for an $n$-bit distribution $P$, let $\text{SPSC}[P]$ be the symmetric pure state CQ channel which maps $y \in \mathbb{F}_2^n$ to $\text{SPSC}[P](y) := Z^y |\varphi\rangle\langle\varphi| Z^y$ where $|\varphi\rangle := \sum_{z \in \mathbb{F}_2^n} \sqrt{P(z)} |z\rangle$ and $Z^y := Z^{y_1} \otimes \dots \otimes Z^{y_n}$. The subspace decoding task $\text{SDT}(n, k, l, G, P)$ consists of recovering a uniformly random input $x \in \mathbb{F}_2^l$ from an $n$-qubit system prepared in the state $W(x)$, where $W := \text{SPSC}[P] \circ F_{l,G}$. It is unlikely that every instance $\text{SDT}(n, k, l, G, P)$ can be efficiently
<figure><img src="image_4.png" /><figcaption>Figure 2: Decomposition of the channel $W$ in the subspace decoding task. In this example, the channel $F_{\ell,G}$, shown in red, decomposes into a concatenation of the four channels $F_{\ell_i, G_i}$ for $i = 1, 2, 3, 4$. The output of $F_{\ell_1, G_1}$ is split into two bit strings, one of which is then used as input for $F_{\ell_2, G_2}$, and the other as input for $F_{\ell_3, G_3}$. Subsequently, the output of $F_{\ell_3, G_3}$ is again split up and one part of the bit string is sent through the channel $F_{\ell_4, G_4}$. The channel $\text{SPSC}[P]$, shown in blue, decomposes into a product channel $\text{SPSC}[P] = \text{SPSC}[P_1] \otimes \text{SPSC}[P_2] \otimes \text{SPSC}[P_3]$. Double edges represent quantum systems. The nodes and edges contained in the red box make up the MPG representation of $F_{\ell,G}$.</figcaption></figure>

solved. However, we show that the task significantly simplifies if a specific instance exhibits some additional structure in the form of the following two requirements, which are depicted in Figure 2:

1. The channel $F_{\ell,G}$ decomposes as a tree-like concatenation of random encodings $F_{\ell_i, G_i}$ of small $[n_i, k_i]$ codes with generator matrix $G_i$. The output bit string of each $F_{\ell_i, G_i}$ is split into one or more substrings, and each such substring is passed along an edge to the next node.

2. $\text{SPSC}[P]$ factors into product channels $\text{SPSC}[P] = \text{SPSC}[P_1] \otimes \text{SPSC}[P_2] \otimes \dots$, with one term corresponding to each leaf of the tree representation of $F_{\ell,G}$.

We represent the tree-like decomposition of $F_{\ell,G}$ as a directed tree $\mathcal{G}$, which we call the *message-passing graph* (MPG). Our main result is an efficient algorithm to solve the subspace decoding problem using this MPG structure.

**Theorem 1.1** (informal, see Proposition 4.1 and Theorem 4.1). For any instance $\text{SDT}(n, k, \ell, G, P)$ admitting a tree-like decomposition as described above, we construct a quantum algorithm that solves it with optimal error probability and runtime $O(|\mathcal{G}|4^{N(\mathcal{G})})$, where $|\mathcal{G}|$ is the number of nodes in the MPG and $N(\mathcal{G}) := \max_i n_i$ is the largest blocklength among the local codes in the MPG.

The algorithm operates as a *message-passing procedure on* $\mathcal{G}$: Messages propagate from the leaves towards the root, with each internal node processing the messages from its successors to generate a new message for its predecessor. Conceptually, this realizes a divide-and-conquer strategy, since each node essentially solves a small instance of $\text{SDT}$ for its associated local code. The overall runtime is exponential only in the size of the largest local instance, making the algorithm efficient whenever $F_{\ell,G}$ decomposes into local encoding channels of constant or logarithmic size.

**Bit-optimal and block-optimal decoding with BPQM** Our main application of Theorem 1.1 is to efficiently and optimally solve the quantum decoding problem for certain families of codes. We begin with the comparatively simpler task of *bitwise decoding*, i.e., estimating a codeword bit $x_i$ from the channel output $W_\omega^{\otimes n}(x)$ for some given $i \in \{1, \dots, n\}$. We prove a key observation that chaining together bit-optimal decoders yields an optimal block decoder.

**Proposition 1.1** (informal, see Proposition 5.1). Consider an $[n, k]$ binary linear code $C$ that is transmitted over $W_\omega$. Suppose for each $i = 1, \dots, n$ there exists a two-outcome projective measurement $\Pi_0^{(i)}, \Pi_1^{(i)}$ achieving bit-optimal decoding of the $i$-th codeword bit. Then, the (sequential) measurement with Kraus operators $\{\tilde{\Pi}_y\}_{y \in \mathbb{F}_2^n}$, for $\tilde{\Pi}_y := \Pi_{y_n}^{(n)} \cdots \Pi_{y_1}^{(1)}$, realizes block-optimal decoding.
This result is especially remarkable, as the analogous statement does generally not hold in classical coding theory: It is possible to construct explicit examples where bitwise optimal decoding of a linear code transmitted over the binary symmetric channel does not result in block-optimal decoding.

Thus, block decoding reduces to constructing a quantum algorithm that achieves bit-optimal decoding with two-outcome projective measurements. Bit decoding is a special case of SDT(n, k, ℓ, G, P) with ℓ = 1, where G is a properly chosen generator matrix of C and P specifies the pure-state channels. Thus, Theorem 1.1 provides an efficient and optimal bit decoder whenever we have an efficient MPG representation of the channel

$$ \mathbb{F}_2 \ni z \mapsto \text{uniformly random element in } \{x \in C | x_i = z\} \qquad (5) $$

for each i = 1, ..., n. We call this channel the i-th bit-transmission channel of the code C.

**Proposition 1.2** (see Proposition 6.3). Let C be an [n, k] binary linear code that exhibits a trellis representation with maximal state space size S. Then, for any i = 1, ..., n, there exists an MPG representation G of the i-th bit-transmission channel of C with N(G) ≤ 2 log₂S and |G| = n.

Hence, any code with an efficient trellis admits an efficient and optimal bitwise decoder. To extend this to block decoding, the bit-decoder must implement a two-outcome projective measurement, which is not guaranteed in Theorem 1.1. We resolve this issue this via the deferred measurement principle, eliminating unnecessary intermediate measurements while preserving runtime complexity by shifting some classical computation into the quantum domain.

**Theorem 1.2** (informal, see Section 5.2). For any [n, k] binary linear code C that exhibits a trellis with state space size S, we construct a quantum algorithm that solves the quantum decoding task on C with optimal error probability and runtime O(nkS⁴).

This result assumes a computational model where quantum registers can store real numbers in [0, 1] with infinite precision at unit cost, analogous to the classical real RAM model. In practice, discretization is required. We prove in Theorem 5.1 that our algorithm remains robust under discretization: its runtime stays polynomial, and we pick up an additional polylog(1/ε) overhead, where ε is the error of the decoder directly caused by the discretization.

**BPQM-based decoding of turbo codes** One particularly important family of codes with efficient trellis representation are convolutional codes. As such, Theorem 1.2 provides an efficient and optimal quantum algorithm to decode convolutional codes transmitted over a pure-state channel.

We extend these insights to quantum decoding of turbo codes, which are interleaved combinations of two convolutional codes. In classical channel coding, turbo codes have demonstrated excellent performance as they can operate very close to the Shannon limit [18]. While turbo codes lack an efficient trellis representation, the convolutional quantum decoder can be adapted to this setting. Specifically, in the asymptotic limit of large block sizes, windowed decoding with a finite number of iterations yields a tree-like computation graph with probability one [19], which can be converted into an MPG to decode individual codeword bits.

Since the resulting MPG is not an entirely faithful representation of the bit-transmission channel, the optimality arguments from the previous paragraph do not apply here. Instead, the asymptotic error rate of BPQM-based bitwise decoding of turbo codes can be numerically characterized using the technique of density evolution. We numerically estimate these thresholds for the G = 5/7, G = 13/15 and G = 23/33 parallel concatenated turbo code families and depict them in Table 1. Remarkably, the three code families exhibit thresholds that clearly exceed the Shannon bound, and closely approach the Holevo bound.

## 1.3 Relation to prior work

We show in Section 6.1 that the BPQM algorithm considered in prior work [10–15] can be recovered a special case of our algorithm when the local codes in the MPG all correspond to either the [nᵢ, 1]
<table><caption>Table 1: BPQM bit decoding thresholds for various rate-1/3 parallel concatenated turbo code families transmitted over $W_\omega$. G denotes the generator polynomials of the constituent convolutional codes in standard octal notation, and m is their memory size (in bits). Thresholds are obtained from density evolution numerics (see Figure 23).</caption><thead><tr><th>G</th><th>m</th><th>Threshold (in &omega;)</th></tr></thead><tbody><tr><td>5/7</td><td>2</td><td>0.233</td></tr><tr><td>13/15</td><td>3</td><td>0.243</td></tr><tr><td>23/33</td><td>4</td><td>0.248</td></tr><tr><td>BSC<sub>&omega;</sub> Shannon limit</td><td></td><td>0.17395</td></tr><tr><td>W<sub>&omega;</sub> Holevo limit</td><td></td><td>0.25977</td></tr></tbody></table>

repetition code with generator matrix $G_i = (11 \cdots 1)$ or to the trivial $[n_i, n_i]$ code with generator matrix

$$ G_i = \begin{pmatrix} 1 & 0 & 0 & \cdots & 0 \\ 1 & 1 & 0 & \cdots & 0 \\ 1 & 0 & 1 & \cdots & 0 \\ \vdots & & \ddots & & \vdots \\ 1 & 0 & 0 & \cdots & 1 \end{pmatrix}. \qquad (6) $$

For this reason, we will also refer to our algorithm as “BPQM”. We note that previous incarnations of BPQM were fundamentally limited to work with codes that exhibit a tree Tanner graph, or at least, a locally tree-like Tanner graph.<fnref n="2" /> As such, it previously remained an open question how to decode codes with small cycles in their Tanner graph. Our new generalization of BPQM shows that a tree-like Tanner graph is not necessary, as long as another tree-like factor graph structure is provided, such as an efficient trellis.

We note that a special case of the result on block optimality from bit optimality (see Proposition 1.1) was already implicitly found in [12], but only for codes C which exhibit a tree Tanner graph. Our work generalizes that result to all linear codes C by using a more refined proof technique.

Our density evolution simulations for the turbo codes are a straightforward adaptation of the BPQM density evolution technique introduced in [13, 15] to our generalized framework. We note that in [13], density evolution simulations have demonstrated that BPQM can achieve performance surpassing the Shannon limit on regular LDPC codes.

We note that in literature, the name “BPQM” has been used interchangeably to refer to various related algorithms, which differ in some small but important details. The (inefficient) algorithm described in [10] corresponds to the “uniformly-controlled BPQM” algorithm which we discuss in Appendix C. The (inefficient) algorithm called “BPQM” in [12] also corresponds to uniformly-controlled BPQM. The algorithm called “message-passing BPQM” in [12] corresponds to the “coherent BPQM” algorithm discussed in Section 5.1.

# 2 Preliminaries

## 2.1 Notation

**Vectors** We denote by $\mathbb{F}_2$ the finite field with 2 elements. For two vectors $x \in \mathbb{F}_2^n$ and $y \in \mathbb{F}_2^m$, we denote their concatenation by $x \parallel y$, an element of $\mathbb{F}_2^{n+m}$. Unless stated otherwise, vectors $x \in \mathbb{F}_2^n$ are understood as column vectors, with $x^T$ denoting their transpose. The inner product of two vectors $x, y \in \mathbb{F}_2^n$ is defined as $x \cdot y := x^T y = \sum_{i=1}^n x_i y_i \mod 2$.

**Distributions** For two distributions $P(x), x \in \mathcal{X}$ and $Q(y), y \in \mathcal{Y}$ we denote by $P \times Q$ the product distribution $(P \times Q)(x, y) := P(x)Q(y)$.

<footnote n="2">²As an exception, we note that previous did consider adaptations of BPQM for polar codes [10, 15], which do not exhibit a tree Tanner graph. This was possible, because the decoding graph in successive cancellation decoding essentially simplifies to a tree Tanner-like graph.</footnote>
**Quantum states and operators** For an $n$-qubit system, the computational basis states are denoted by $|x\rangle$ for $x \in \mathbb{F}_2^n$. We denote the identity operator and the three Pauli matrices by

$$1 = \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix}, \quad X = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}, \quad Y = \begin{pmatrix} 0 & -i \\ i & 0 \end{pmatrix}, \quad Z = \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix}. \qquad (7)$$

For some $x \in \mathbb{F}_2^n$, we define the $n$-qubit operator $Z^x := -Z^{x_1} \otimes Z^{x_2} \otimes \dots Z^{x_n}$.

**Norms and metrics** For a real vector $x \in \mathbb{R}^n$, we denote its $\ell_p$-norm for $p \ge 1$ by $\|x\|_p := (\sum_{i=1}^n |x_i|^p)^{1/p}$. For a linear operator $A \in \mathbb{C}^{n \times n}$, we denote its Schatten $p$-norm by $\|T\|_p := \text{Tr}(|A|^p)^{1/p}$. Note that $\|A\|_\infty$ is the spectral norm. For a pure quantum state $|\psi\rangle \in \mathbb{C}^n$, we denote by $\|\psi\|$ the standard (Euclidean) Hilbert space norm.

For two positive semi-definite operators $\rho, \sigma \in \mathbb{C}^{n \times n}$, we denote their fidelity and trace distance by $F(\rho, \sigma) := \text{Tr}[\sqrt{\rho}\sigma\sqrt{\rho}]$ and $\delta(\rho, \sigma) := -\frac{1}{2}\|\rho - \sigma\|_1$. As a slight abuse of notation, we will write $F(|\psi\rangle, |\varphi\rangle) = F(|\psi\rangle\langle\psi|, |\varphi\rangle\langle\varphi|)$ and $\delta(|\psi\rangle, |\varphi\rangle) = \delta(|\psi\rangle\langle\psi|, |\varphi\rangle\langle\varphi|)$ for two pure quantum states $|\psi\rangle, |\varphi\rangle \in \mathbb{C}^n$.

**Logarithm** We denote by $\log$ the logarithm with base 2.

**Circuit complexity** The circuit complexity of a quantum circuit is defined as the number of single and two-qubit gates that it contains.

**Pure-state channels** Let $P$ be an $n$-bit distribution. The symmetric pure-state channel $\text{SPSC}[P]$ maps $n$ bits to $n$ qubits and is defined as

$$\text{SPSC}[P](x) := Z^x |\varphi\rangle\langle\varphi| Z^x, \quad |\varphi\rangle := \sum_{z \in \mathbb{F}_2^n} \sqrt{P(z)} |z\rangle. \qquad (8)$$

The state $|\varphi\rangle$ is sometimes referred to as the channel state. The specialization with binary input ($n=1$) will be of particular interest for us, and hence we define the binary-input pure-state channel $\text{BSPSC}[p]$ for the channel parameter $p \in [0, 1]$ as

$$\text{BSPSC}[p](x) := \text{SPSC}[(1-p, p)](x). \qquad (9)$$

## 2.2 Forney-style factor graphs

A factor graph is a graphical representation of how a function of several variables, e.g., a joint probability distribution, factorizes into a product of separate terms each involving only a subset of the variables. The standard variant of factor graphs [20] is a bipartite graph consisting of two types of nodes, called *variable nodes* and *factor nodes*. Variable nodes are usually represented with circles and factor nodes with rectangular boxes. Consider a factorizable function

$$f(x_1, \dots, x_n) = \prod_{j \in J} f_j(Z_j) \qquad (10)$$

where $J$ is some finite index set and the $f_j$ are functions taking some subset $Z_j$ of $\{x_1, \dots, x_n\}$ as arguments. The corresponding factor graph consists of $n$ variable nodes $X_1, \dots, X_n$ as well as a factor node $f_j$ for each $j \in J$. A variable node $X_i$ and a factor node $f_j$ are connected by an edge if and only if $x_i \in Z_j$. As an example, Figure 3a depicts the factor graph representing the factorization of the function

$$f(x_1, x_2, x_3, x_4) = f_1(x_1, x_2) f_2(x_1, x_2, x_3) f_3(x_2, x_3, x_4). \qquad (11)$$

For this work, it will prove advantageous to work with a different graphical representation of factorizable functions, namely the so-called *Forney-style factor graphs* [21, 22]. Here, variables are represented by the edges of the graph whereas the factor terms of the function are represented by the nodes of the graph. Similarly, an edge and a node of the graph are connected if and only if the corresponding variable is part of the corresponding factor term.

When translating a factor graph to the Forney-style representation, one might encounter the issue that some variables are involved in more than two factors, as depicted in the example in Figure 3b. In
<figure><img src="image_5.png" /><figcaption>Figure 3: Standard and Forney-style factor graph representation of the factorization of the function $f(x_1, x_2, x_3, x_4)$ defined in the main text.</figcaption></figure>

that case, equality factor nodes must be introduced in the Forney-style factor graph. Equality nodes are depicted as $=$ and represent the function that returns 1 if all connected variables have the same value and 0 otherwise. All edges connected to a common equality node essentially represent the same variable.

Consider a Forney-style factor graph representing the factorization of some function in $m + l$ variables $f(V_1, ..., V_m, H_1, ..., H_l)$ where one subset of the variables $V_1, ..., V_m$, called the “visible” variables, are represented by half-edges, i.e., they are each connected to exactly one factor node. The other variables $H_1, ..., H_l$ are ‘hidden’ inside the graph, i.e., they are each connected to exactly two factor nodes. We define the exterior function of the factor graph to be the joint marginal of the visible variables, i.e., the function

$$v_1, ..., v_m \to \sum_{h_1, ..., h_l} f(v_1, ..., v_m, h_1, ..., h_l). \qquad (12)$$

We now introduce the Tanner graph, a specific type of factor graph that will be of great importance for us. Consider an $[n, k]$ binary linear code $C$, i.e., a linear subspace of $\mathbb{F}_2^n$ of dimension $k$. Let $H \in \mathbb{F}_2^{(n-k)\times n}$ be a parity-check matrix associated to this code, i.e.,

$$C = \{x \in \mathbb{F}_2^n | Hx = 0\}. \qquad (13)$$

The Tanner graph associated to $H$ is a factor graph representation of the factorization of the code inclusion function

$$I_C : \mathbb{F}_2^n \to \{0, 1\}, \quad I_C(x) := \begin{cases} 1 & \text{if } x \in C \\ 0 & \text{else} \end{cases}. \qquad (14)$$

In standard factor graph notation, the Tanner graph contains $n$ variables nodes $X_1, ..., X_n$ and $m$ check nodes (denoted $+$) which represent the function that is equal to 1 if the involved variables sum up to 0 modulo 2, and 0 otherwise. The variable node $X_i$ is connected to the $j$-th check node if and only if $H_{ji} = 1$. Hence, each check node corresponds to a parity check encoded in one of the rows of $H$. Figure 4a depicts the Tanner graph for the Hamming code based on the parity check matrix

$$H = \begin{pmatrix} 1 & 1 & 0 & 1 & 1 & 0 & 0 \\ 1 & 0 & 1 & 1 & 0 & 1 & 0 \\ 0 & 1 & 1 & 1 & 0 & 0 & 1 \end{pmatrix}. \qquad (15)$$

In the Forney-style representation of the Tanner graph, we simply replace each variable node with an equality node. As an example, the Forney-style Tanner graph of the Hamming code is depicted in Figure 4b. As a convention, we will always choose the exterior function of a Forney-style Tanner graph to be the code inclusion function $I_C(x_1, ..., x_n)$. This is achieved by connecting a half-edge to every equality node.

## 2.3 Trellis representation of codes

Here, we briefly introduce the trellis representation of binary codes. Compared to the Tanner graph, the trellis representation can be viewed as an alternative technique to graphically represent a linear code. We refer interested readers to the excellent review in [23] for an exhaustive treatment. In the context of classical coding theory, trellis representations have been extensively studied as they form the basis for the Viterbi [2] and BCJR [3] decoding algorithms, which respectively realize the blockwise and
<figure><img src="image_6.png" /></figure>

<figure><img src="image_7.png" /><figcaption>Figure 4: Standard and Forney-style representation of the Tanner graph of the Hamming code.</figcaption></figure>

bitwise optimal decoders over a classical channel. The runtime of these algorithms scales with the size of the trellis, which implies that the classical decoding problem can be optimally and efficiently solved for any code that exhibits an efficient (i.e. small) trellis representation. Perhaps the most well-known family of codes with efficient trellises are the convolutional codes. By extension, trellis representations also play an important role in the decoding of turbo codes [18], which are built from convolutional codes. Turbo codes can operate very close to the Shannon limit of a classical channel.

We now formally define a trellis representation of a code. In Figure 5, we depict a trellis representation of the [7, 4] Hamming code with generator matrix

$$G = \begin{pmatrix} 1 & 0 & 0 & 0 & 1 & 1 & 0 \\ 0 & 1 & 0 & 0 & 1 & 0 & 1 \\ 0 & 0 & 1 & 0 & 0 & 1 & 1 \\ 0 & 0 & 0 & 1 & 1 & 1 & 1 \end{pmatrix}. \qquad (16)$$

A trellis $T$ is an acyclic directed graph $T = (V, E)$ where $V$ denotes the set of vertices and $E$ the set of edges. The vertices are partitioned into $m + 1$ disjoint subsets (called “state sets”)

$$V = V_0 \cup V_1 \cup \cdots \cup V_m \qquad (17)$$

such that the first and last state set contain only one element each $V_0 = \{v_0\}$, $V_m = \{v_*\}$. We refer to $v_0$ and $v_*$ as the “source” and the “sink” of the trellis. The edges connect neighboring state sets in increasing direction, i.e., every edge $e$ goes from some element in $V_{i-1}$ to some element in $V_i$ for some $i \in \{1, \dots, m\}$. Similar to the vertices, we can group the edges into disjoint layers

$$E = E_1 \cup E_2 \cup \cdots \cup E_m \qquad (18)$$

where $E_i$ contains all edges going from $V_{i-1}$ to $V_i$. To any edge $e \in E_i$, we associate some label $\lambda(e) \in \mathbb{F}_2^{\ell_i}$ where $\ell_i \in \mathbb{N}$ is some fixed number for every $i \in \{1, \dots, m\}$.

For any path $p = (e_1, \dots, e_m)$ from the source to the sink (which must fulfill $e_i \in E_i$ for all $i$), we define the path label to be the concatenation of the labels of the individual edges

$$\lambda(p) := \lambda(e_1) \| \lambda(e_2) \| \dots \| \lambda(e_m). \qquad (19)$$

We say that a trellis $T = (V, E)$ represents a binary linear code $C \subset \mathbb{F}_2^n$ if the path labels precisely correspond to the codewords, i.e.,

$$C = \{\lambda(p) | p \text{ is a path in } T \text{ from the source to the sink}\}. \qquad (20)$$

The maximal state space size $S(T)$ for some trellis $T$ is defined as

$$S(T) := \max_{i \in \{0, \dots, m\}} |V_i|. \qquad (21)$$

## 2.4 Pretty good measurement

Consider a quantum system whose state is described by an ensemble $\{P(x), \rho_x\}_{x}$, i.e., it is in the state $\rho_x$ where the random variable $X$ is randomly sampled according to the distribution $P(x)$. The task of
<figure><img src="image_8.png" /><figcaption>Figure 5: Trellis representation of the [7, 4] Hamming code. The codewords can be read off by considering paths from the leftmost node (source) to the rightmost node (sink).</figcaption></figure>

quantum hypothesis testing is to estimate $X$ given access to this quantum system. One strategy is to perform the so-called *pretty good measurement* (PGM) described by the POVM operators

$$ \Lambda_x := -P(x)\rho^{-1/2}\rho_x\rho^{-1/2}, \qquad (22) $$

where $\rho := -\sum_x P(x)\rho_x$. In case that $\sum_x \Lambda_x \le 1$, the POVM is completed with an additional operator $1 - \sum_x \Lambda_x$. In certain circumstances, the success probability of solving the quantum hypothesis testing task $\sum_x P(x)\text{Tr}[\rho_x\Lambda_x]$ can be shown to be maximal.

**Proposition 2.1** (Optimality of the PGM [24–26]). Consider a set of linearly independent pure states $S = \{|\phi(x)\rangle\}_x$ which form a geometrically uniform state set, i.e.,

$$ S = \{U |\phi\rangle | U \in \mathcal{G}\} \qquad (23) $$

for some state $|\phi\rangle$ and some finite Abelian group of unitary matrices $\mathcal{G}$. The PGM distinguishes the uniform mixture of $S$ with the optimal success probability.

When the PGM is applied to an ensemble of pure states $\{P(x), |\phi_x\rangle\}_x$, as for example in Proposition 2.1, then the associated POVM is realized by a projective measurement w.r.t. the orthonormal basis $\{|f_x\rangle\}_x$ defined as

$$ |f_x\rangle := \sqrt{P(x)} \rho^{-1/2} |\phi_x\rangle. \qquad (24) $$

**Lemma 2.1.** Let $|\varphi\rangle$ be an arbitrary $\ell$-qubit state. Given access to a quantum system in a uniformly randomly-chosen state $\{Z^x |\varphi\rangle\}_{x \in \mathbb{F}_2^\ell}$, the optimal measurement to determine $x \in \mathbb{F}_2^\ell$ is given by the POVM $\Lambda_x := H^{\otimes \ell} |x\rangle\langle x| H^{\otimes \ell}$.

*Proof.* We expand the state $|\varphi\rangle = \sum_{y \in \mathbb{F}_2^\ell} \sqrt{P_Y(y)} |y\rangle$ where $\{|y\rangle\}_y$ are the computational basis states, up to some complex phase. Due to the Abelian symmetry of our state ensemble, Proposition 2.1 ensures that the PGM achieves the optimal distinguishing probability. The PGM realizes a projective measurement w.r.t. the orthonormal basis $|f_x\rangle := \frac{1}{\sqrt{2^\ell}} \rho^{-1/2} Z^x |\varphi\rangle$, where $\rho := -\sum_{x \in \mathbb{F}_2^\ell} \frac{1}{2^\ell} Z^x |\varphi\rangle\langle\varphi| Z^x$. Evidently, $\rho = \sum_{y \in \mathbb{F}_2^\ell} P_Y(y) |y\rangle\langle y|$, since the sum completely dephases the state $|\varphi\rangle\langle\varphi|$. Hence,

$$ \frac{1}{\sqrt{2^\ell}} \rho^{-1/2} Z^x |\varphi\rangle = \frac{1}{\sqrt{2^\ell}} Z^x \rho^{-1/2} |\varphi\rangle = \frac{1}{\sqrt{2^\ell}} Z^x \sum_{y \in \mathbb{F}_2^\ell} |y\rangle. \qquad (25) $$

This is equal to $Z^x |+\rangle^{\otimes \ell}$ up to some complex phase. Therefore, $\Lambda_x = H^{\otimes \ell} |x\rangle\langle x| H^{\otimes \ell} = Z^x |+\rangle\langle +|^{\otimes \ell} Z^x$ is the optimal measurement. $\square$

## 3 Subspace decoding task

This section is devoted to a problem which we call the “subspace decoding task”. The goal is to extract certain classical information that has been encoded into the output of a symmetric pure state quantum channel.
**Problem 3.1** (Subspace decoding task SDT(n, k, ℓ, G, P)).

- **INSTANCE PARAMETERS:** Nonnegative integers $n \ge k \ge \ell$, full-rank matrix $G \in \mathbb{F}_2^{k \times n}$, probability distribution $P$ over $n$ bits.

- **INPUT:** An $n$-qubit system in the state $W(x)$ for $x \in \mathbb{F}_2^\ell$ sampled uniformly at random, where $W$ is the channel defined as

$$x \mapsto W(x) := \frac{1}{2^{k-\ell}} \sum_{r \in \mathbb{F}_2^{k-\ell}} \text{SPSC}[P]((x \| r)^T G). \quad (26)$$

- **GOAL:** Given the input quantum system, determine $x$.

As depicted in Figure 6, the channel $W$ defining this task can be seen as the concatenation of a classical channel $F_{\ell,G}$ and the CQ channel $\text{SPSC}[P]$, where $F_{\ell,G}$ is defined as follows.

**Definition 3.1.** For a full-rank matrix $G \in \mathbb{F}_2^{k \times n}$ and some positive integer $\ell \le k$, we define $F_{\ell,G}$ to be the channel which maps a bit string $x \in \mathbb{F}_2^\ell$ to $(x \| r)^T G$ where $r \in \mathbb{F}_2^{k-\ell}$ is chosen uniformly at random.

Intuitively, $F_{\ell,G}$ extends the input $x$ to a $k$-bit source bit string, and then encodes it through $G$. The subspaces in the SDT problem are precisely the images of $x$ under $F_{\ell,G}$, and the difficulty of determining $x$ is that one only has access to the image of the subspace under $\text{SPSC}[P]$.

<figure><img src="image_9.png" /><figcaption>Figure 6: The CQ channel in (26). Double edges represent quantum systems.</figcaption></figure>

In the following, we show that SDT(n, k, ℓ, G, P) can be optimally solved by first performing some specific $n$-qubit unitary followed by a measurement of a particular subset of $\ell$ qubits. This unitary operation will be a central ingredient for the BPQM algorithm later, so for convenience we denote it by PNO(n, k, ℓ, G, P). We call it a “primitive node operation”, since it will essentially constitute the node operation for the message-passing procedure of BPQM.

**Definition 3.2** (Primitive node operation PNO(n, k, ℓ, G, P)). Let $n, k, \ell, G, P$ be the parameters of some instance of the subspace decoding task. Then PNO(n, k, ℓ, G, P) is the $n$-qubit unitary PNO(n, k, ℓ, G, P) := $U_2U_1$, where the $n$-qubit unitaries $U_1, U_2$ are constructed as follows:

1. Let $M = (G)$ for some $K \in \mathbb{F}_2^{(n-k) \times n}$ such that $M$ is invertible.

2. Define $U_1 := \sum_{z \in \mathbb{F}_2^n} |Mz\rangle\langle z|$.

3. Let $Y, S$ and $A$ be $\ell$-bit, $(k-\ell)$-bit and $(n-k)$-bit random variables, respectively, with the joint distribution

$$P_{Y,S,A}(y,s,a) := P(M^{-1}(y \| s \| a)). \quad (27)$$

4. For any $s \in \mathbb{F}_2^{k-\ell}$ and $y \in \mathbb{F}_2^\ell$, define the $(n-k)$-qubit state

$$|\xi_{y,s}\rangle := \sum_{a \in \mathbb{F}_2^{n-k}} \sqrt{P_{A|Y=y,S=s}(a)} |a\rangle, \quad (28)$$

and let $V(y,s)$ be an $(n-k)$-qubit unitary which maps $|\xi_{y,s}\rangle$ to $|0\rangle^{\otimes(n-k)}$.

5. Define $U_2 := \sum_{y \in \mathbb{F}_2^\ell, s \in \mathbb{F}_2^{k-\ell}} |y\rangle\langle y| \otimes |s\rangle\langle s| \otimes V(y,s)$.

Note that the definition of PNO is not unique: there may exist many valid choices for the matrix $M$ and the unitaries $V(y,s)$. Unless otherwise specified, any such choice will suffice for our purposes. Thus, whenever we refer to the unitary PNO(n, k, ℓ, G, P), we are implicitly picking one valid choice.

Following the PNO by a measurement of the first $\ell$ qubits in the conjugate basis is optimal for solving SDT.

**Theorem 3.1.** Consider an instance $T = \text{SDT}(n, k, \ell, G, P)$ and let $U = \text{PNO}(n, k, \ell, G, P)$. Define the projective measurement with projectors $\Lambda_x$ for $x \in \mathbb{F}_2^\ell$ by

$$\Lambda_x := U^\dagger(H^{\otimes \ell} |x\rangle\langle x| H^{\otimes \ell} \otimes 1^{\otimes (n-\ell)}) U. \quad (29)$$

Then $\{\Lambda_x\}_{x \in \mathbb{F}_2^\ell}$ determines the channel input $x$ in $T$ with optimal (i.e., lowest possible) error probability.
The proof makes use of the fact that PNO(n, k, ℓ, G, P) effectively compresses the information about x contained in the n qubits into just ℓ qubits and k − ℓ classical bits. Moreover, the state of the ℓ qubits can be understood as the output of a heralded symmetric pure-state channel given input x. More formally, we have the following result.

**Lemma 3.1.** Consider an instance SDT(n, k, ℓ, G, P) and let U = PNO(n, k, ℓ, G, P). For all x ∈ Fℓ₂,

$$
UW(x)U^{\dagger} = \sum_{s \in \mathbb{F}_{2}^{k-l}} P_{S}(s) \text{SPSC}[P_{Y|S=s}](x) \otimes |s\rangle\langle s| \otimes |0\rangle\langle 0| \otimes^{(n-k)}, \quad (30)
$$

where $P_S$ and $P_{Y|S=s}$ are marginal and conditional marginal distributions defined from (27).

Proof. The proof proceeds by using $U_1$ to bring $W(x)$ into a CQ form and then $U_2$ to “decouple” the final $n-k$ qubits from the rest and leave them in the all-zero state.

First observe that $U_1 Z^{v^T M} = Z^v U_1$ for any vector $v \in \mathbb{F}_2^n$:

$$
\begin{align}
U_1 Z^{v^T M} U_1^\dagger &= \sum_{z, z' \in \mathbb{F}_2^n} |Mz\rangle\langle z| Z^{v^T M} |z'\rangle\langle Mz'| \nonumber \\
&= \sum_{z \in \mathbb{F}_2^n} |Mz\rangle\langle Mz| (-1)^{v^T Mz} = \sum_{z \in \mathbb{F}_2^n} |z\rangle\langle z| (-1)^{v^T z} = Z^v. \tag{31}
\end{align}
$$

Furthermore, $U_1$ acts on the channel state $|\varphi\rangle = \sum_{z} \sqrt{P(z)} |z\rangle$ as follows:

$$
\begin{align}
U_1 |\varphi\rangle &= \sum_{z \in \mathbb{F}_2^n} \sqrt{P(z)} |Mz\rangle = \sum_{z \in \mathbb{F}_2^n} \sqrt{P(M^{-1}z)} |z\rangle \nonumber \\
&= \sum_{y \in \mathbb{F}_2^\ell, s \in \mathbb{F}_2^{k-\ell}, a \in \mathbb{F}_2^{n-k}} \sqrt{P_{Y,S,A}(y,s,a)} |y\rangle \otimes |s\rangle \otimes |a\rangle \tag{32} \\
&= \sum_{y \in \mathbb{F}_2^\ell, s \in \mathbb{F}_2^{k-\ell}} \sqrt{P_{Y,S}(y,s)} |y\rangle \otimes |s\rangle \otimes |\xi_{y,s}\rangle . \nonumber
\end{align}
$$

Let us now consider the action of $U$ on the channel output for a fixed bit string $r \in \mathbb{F}_2^{k-l}$. By (31), we have

$$
U_1 Z^{(x \| r \| 0)^T M} |\varphi\rangle = \sum_{y \in \mathbb{F}_2^l, s \in \mathbb{F}_2^{k-l}} \sqrt{P_{Y,S}(y,s)} Z^x |y\rangle \otimes Z^r |s\rangle \otimes |\xi_{y,s}\rangle. \quad (33)
$$

Applying $U_2$ decouples the last subsystem, producing

$$
U_2 U_1 Z^{(x \| r \| 0)^T M} |\varphi\rangle = \sum_{s \in \mathbb{F}_2^{k-l}} \sqrt{P_S(s)} Z^x |\varphi'_s\rangle \otimes Z^r |s\rangle \otimes |0\rangle^{\otimes (n-k)}, \quad (34)
$$

where $|\varphi'_s\rangle = \sum_{y \in \mathbb{F}_2^l} \sqrt{P_{Y|S=s}(y)} |y\rangle$. Mixing these pure states uniformly over values of $r$ pinches the qubits in the second register, removing all off-diagonal elements. Hence $UW(x)U^\dagger$ has the form claimed in (30). $\square$

Observe that the purity of the output of W is crucial to the result. The case of mixed states can be easily described by having an additional purification register R such that $|\varphi\rangle \in (\mathbb{C}^2)^{\otimes n} \otimes \mathcal{H}_R$. The operation $U_1$ will work as before, but now $U_2$ will not generally be able to decouple $|\xi_{y,s}\rangle \in (\mathbb{C}^2)^{\otimes (n-k)} \otimes \mathcal{H}_R$ from the rest of the state without access to R.<fnref n="3" />

**Proof of Theorem 3.1.** It is equivalent to distinguish the states {$W(x)|x \in \mathbb{F}_2^\ell$} and {$UW(x)U^\dagger|x \in \mathbb{F}_2^\ell$}. Lemma 3.1 implies that by observing the classical bit $s$, this latter task reduces to the problem of distinguishing the states {$SPSC[P_{Y|S=s}](x)|x \in \mathbb{F}_2^\ell$}. By Lemma 2.1, this is optimally achieved by a measurement in the conjugate basis. Importantly, the same conjugate-basis measurement is optimal for every value of $s$. $\square$

<footnote n="3">³One case that does work is when all the $|\xi_{y,s}\rangle$ are different maximally-entangled states, or, more generally, when all the states have the same Schmidt coefficients.</footnote>
# 4 General description of BPQM

The prototypical node operation of the previous section performs optimal subspace decoding. However, the circuit complexity of realizing the associated unitary will generally grow exponentially with $n$. In this section, we will see how subspace decoding can still be solved efficiently when the code associated with $G$ has some additional structure that allows the problem to be split into a sequence of smaller instances with small $n$ each.

Recall that the channel $W$ in $\text{SDT}(n, k, \ell, G, P)$ can be written as $W = \text{SPSC}[P] \circ F_{\ell, G}$. There are two requirements for a given subspace decoding task to decompose into smaller instances, which are depicted in Figure 2:

1. The channel $F_{\ell, G}$ can be written as a tree-like concatenation of random encodings $F_{\ell_i, G_i}$ of smaller $[n_i, k_i]$ codes $G_i$. The output bit string of each $F_{\ell_i, G_i}$ is split into one or more substrings, and each such substring is passed along an edge to the next node.

2. SPSC[P] factors into product channels SPSC[P] = SPSC[P_1] ⊗ SPSC[P_2] ⊗ ..., with one term corresponding to each leaf of the tree representation of $F_{\ell, G}$.

The tree representation of $F_{\ell, G}$ will be central for us, so we give an explicit name and call it a *message-passing graph* (MPG) representation of $F_{\ell, G}$. In the remainder of this section, we first formally define MPGs and then introduce the incoherent BPQM algorithm, which can be considered a message-passing algorithm operating on the MPG (the reason for the adjective *incoherent* will become clear in Section 5). We then show that the algorithm achieves the optimal error probability. Finally, we show that incoherent BPQM is robust to discretization errors, which are inevitable in practical implementations of the algorithm.

## 4.1 Message-passing graphs

Formally, an MPG $G = (V, E)$ is a directed tree, where $V$ and $E$ denote the sets of nodes and edges respectively. The MPG has both normal edges, connecting two nodes, and half-edges, connected to only one node. There are at least 2 half-edges: one serves as the “root edge” and the rest serve as “leaf edges”. Each node has degree at least two and each edge is directed away from the root. Hence, each node $v \in V$ in an MPG has one incoming edge and $m_v \ge 1$ outgoing edges, which we denote by $e^{\text{in}}(v)$ and $e^{\text{out}}_1(v), \dots, e^{\text{out}}_{m_v}(v)$ respectively.

To each edge $e \in E$, we associate a positive integer $n_e$, which represents the number of bits associated to the represented intermediate step in the concatenated encoding procedure. We then define $n_v := \sum_{i=1}^{m_v} n_{e^{\text{out}}(v)}$ and $\ell_v := n_{e^{\text{in}}(v)}$. Additionally, to each node $v \in V$ we associate a full-rank generator matrix $G_v \in \mathbb{F}_2^{k_v \times n_v}$. Furthermore, it must hold that $n_v \ge k_v \ge \ell_v$.

As depicted in Figure 2, every MPG represents a certain classical channel, which we formalize as follows.

**Definition 4.1.** Consider an MPG $G$ with root edge $e^*$ and leaf edges $e_1, \dots, e_m$. Let $n_{\text{out}} := \sum_{i=1}^m n_{e_i}$. The channel induced by $G$, denoted $F[G]$, is an $n_e$-bit to $n_{\text{out}}$-bit channel. We define it by giving an explicit procedure to sample an output $F[G](x)$:

1. Assign the message $x$ to the root edge $e^*$.

2. Perform message-passing from the root towards the edges. Upon encountering node $v$, append a random string $r \in \mathbb{F}_2^{k_v - \ell_v}$ to the message $z \in \mathbb{F}_2^{\ell_v}$, and transform the result via $G_v$ to $(z \| r)^T G_v$. Then, partition the output bits and send them along the corresponding output edges to subsequent nodes. Repeat until messages have been generated for all leaf edges.

3. Output the concatenation of the messages over all leaf edges.

It can often be convenient to think of the MPG $G$ as a Forney-style factor graph, by having the node $v$ represent the channel $F_{\ell_v, G_v}$. More formally, the node $v$ represents the indicator function

$$x^{\text{in}}, x_1^{\text{out}}, \dots, x_{m_v}^{\text{out}} \to \begin{cases} 1 & \text{if } \exists r \in \mathbb{F}_2^{k_v - \ell_v} : (x^{\text{in}} \| r)^T G_v = x_1^{\text{out}} \| \dots \| x_{m_v}^{\text{out}} \\ 0 & \text{else} \end{cases}, \quad (35)$$
<figure><img src="image_10.png" /><figcaption>Figure 7: MPG representing the encoding channel $F_{1,R_5}$ of the 5-bit repetition code.</figcaption></figure>

where $x^{in}$ is the variable associated with the edge $e^{in}(v)$ and $x_i^{out}$ the variable associated to $e_i^{out}(v)$. If $G$ now represents the channel $F_{\ell,G}$, then the outer function of the factor graph exactly represents $F_{\ell,G}$ in the sense of (35). In Section 6, we will discuss concrete MPG constructions for interesting channels $F_{\ell,G}$.

Given an appropriate product distribution, we can now formalize the channel associated to the tree subspace decoding task, as depicted in Figure 2.

**Definition 4.2.** Consider an MPG $G$ with $m$ leaves $e_1, \dots, e_m$ and let $\mathcal{P} = (P_i)_{i=1,\dots,m}$ be a sequence of $n_{e_i}$-bit distributions. We define the channel induced by $G$ and $\mathcal{P}$ as

$$ \mathcal{W}[G, \mathcal{P}] := \left( \bigotimes_{i=1}^{m} \text{SPSC}[P_i] \right) \circ F[G], \qquad (36) $$

where the concatenation should be understood as passing the output of the leaf edge $e_i$ through the channel SPSC[$P_i$].

To end this section, we provide two illustrative examples.

**Example 4.1.** Consider the $[n, 1]$ repetition code given by the generator matrix $G = R_n := (1 \ 1 \ \dots \ 1) \in \mathbb{F}_2^{1 \times n}$. The $n$-bit repetition code can be seen as a repeated concatenation of 2-bit repetition codes. As depicted in Figure 7 for $n = 5$, this allows us to express $F_{1,R_n} = F[G]$ with an MPG $G$ containing $n-1$ nodes. For every edge $e$ in the MPG, we have $n_e = 1$, and for every node $v$ in the MPG, we have $n_v = 2$, $k_v = \ell_v = 1$ and $G_v = R_2$.

**Example 4.2.** Consider the encoding channel $F_{\ell,G}$ for $\ell = 1$ and the generator matrix

$$ G = \begin{pmatrix} 0 & 0 & 0 & 1 & 1 \\ 1 & 1 & 1 & 0 & 1 \\ 0 & 0 & 1 & 1 & 0 \end{pmatrix}. \qquad (37) $$

In Figure 8, we depict an MPG $G$ which represents $F_{\ell,G}$, i.e., $F_{\ell,G} = F[G]$. We now verify that this MPG is indeed a valid representation. Consider $x$ to be the input bit. The node $a$ maps this bit to the vector

$$ x \xrightarrow{a} x \begin{pmatrix} 0 \\ \frac{0}{1} \end{pmatrix} + r_1 \begin{pmatrix} \frac{1}{1} \\ 0 \end{pmatrix} + r_2 \begin{pmatrix} 0 \\ \frac{1}{1} \end{pmatrix} \qquad (38) $$

where $r_1, r_2$ are uniformly random bits. The horizontal line in the vectors depicts how the three bits get split up, i.e., the first bit is then sent to $b$ and the last two bits are sent to $c$. The nodes $b$ and $c$ act on the vector as follows

$$ \xrightarrow{b} x \begin{pmatrix} 0 \\ \frac{0}{1} \end{pmatrix} + r_1 \begin{pmatrix} \frac{1}{1} \\ 0 \end{pmatrix} + r_2 \begin{pmatrix} 0 \\ \frac{0}{1} \end{pmatrix} \xrightarrow{c} x \begin{pmatrix} 0 \\ \frac{0}{1} \end{pmatrix} + r_1 \begin{pmatrix} \frac{1}{1} \\ \frac{0}{1} \end{pmatrix} + r_2 \begin{pmatrix} 0 \\ \frac{0}{1} \end{pmatrix}. \qquad (39) $$

The three vectors in the last expression exactly correspond to the rows of $G$, so the combined action of $a$, $b$ and $c$ precisely corresponds to $F_{\ell,G}$.
<figure><img src="image_11.png" /></figure>

<table><caption>Figure 8: MPG representing the encoding channel $F_{\ell,G}$ introduced in Example 4.2. The green numbers depict the number of bits $n_e$ associated to each edge $e$.</caption><thead><tr><th>Node</th><th>n<sub>v</sub>, k<sub>v</sub>, l<sub>v</sub></th><th>G<sub>v</sub></th></tr></thead><tbody><tr><td>a</td><td>3, 3, 1</td><td>(0 0 1<br>1 1 0<br>0 1 1)</td></tr><tr><td>b</td><td>2, 1, 1</td><td>(1 1)</td></tr><tr><td>c</td><td>3, 2, 2</td><td>(1 0 1<br>0 1 1)</td></tr></tbody></table>

## 4.2 Incoherent BPQM algorithm

Incoherent BPQM is a quantum algorithm in which messages are passed along the edges of an MPG $G = (V, E)$. Messages travel from the leaves towards the root, i.e., against the direction of the edges. At each node, the outgoing edges correspond to input messages and the incoming edge corresponds to the output message. The message passed over the edge $e \in E$ consists of two parts: an $n_e$-qubit quantum system $Q_e$ and a (classical) description of an $n_e$-bit probability distribution $P_e$ (e.g. a vector of $2^{n_e}$ probabilities $P_e(x)$ for $x \in \mathbb{F}_2^{n_e}$). Each node processes its output message once all incoming messages have been received.

So to define incoherent BPQM, we first specify how each node $v \in V$ processes its input messages coming from the outgoing edges in order to generate a message that is sent over its incoming edge. This node operation essentially performs the primitive node operation from Definition 3.2 with the generator matrix $G = G_v$. Figure 9 depicts the steps of the node operation, including measurement and classical registers.

**Definition 4.3 (Node operation).** Consider a node $v$ of some MPG.

- **INPUT:** For each outgoing edge $e_i^{\text{out}}(v)$, $i = 1, \dots, m_v$: a message consisting of an $n_{e_i^{\text{out}}(v)}$-qubit system $Q_{e_i^{\text{out}}(v)}$ and an $n_{e_i^{\text{out}}(v)}$-bit distribution $P_{e_i^{\text{out}}(v)}$.

- **OUTPUT:** An $n_{e_i^{\text{in}}(v)}$-qubit system $Q_{e_i^{\text{in}}(v)}$ and an $n_{e_i^{\text{in}}(v)}$-bit distribution $P_{e_i^{\text{in}}(v)}$.

- **ALGORITHM:** Denote the joint $n_v$-qubit quantum system $\tilde{Q} := \bigotimes_{i=1}^{m_v} Q_{e_i^{\text{out}}(v)}$ and the joint $n_v$-bit distribution $\tilde{P} := P_{e_1^{\text{out}}(v)} \times P_{e_2^{\text{out}}(v)} \times \dots \times P_{e_{m_v}^{\text{out}}(v)}$

1. Set $U = \text{PNO}(n_v, k_v, l_v, G_v, \tilde{P})$ and apply $U$ to the quantum system $\tilde{Q}$. Partition the resulting quantum system into three parts $Q_1 \otimes Q_2 \otimes Q_3$ consisting of $l_v$, $(k_v - l_v)$, $(n_v - k_v)$ qubits each.

2. Measure $Q_2$ in the computational basis, obtaining the result $s \in \mathbb{F}_2^{k_v-l_v}$.

3. Set the output message to be the quantum system $Q_1$ together with the distribution $P_{Y|S=s}$, where $P_{Y,S,A}(y, s, a)$ is defined as in (27) using the $n_v \times n_v$ matrix $M$ from $U$.

The incoherent BPQM algorithm simply performs this node operation on each node of the MPG, followed by a measurement of the final quantum message.

**Definition 4.4 (Incoherent BPQM algorithm).** Consider an instance $\text{SDT}(n, k, l, G, P)$ where the associated channel $W$ can be written as $W = W[G, P]$ for some MPG $G$ and a sequence $P = (P_i)_{i=1,...,m}$ of probability distributions.

- **INPUT:** An $n$-qubit quantum system denoted by $Q$ in the state $W(x)$, where $x \in \mathbb{F}_2^l$.

- **OUTPUT:** An estimate $\hat{x} \in \mathbb{F}_2^l$ for $x$.

- **ALGORITHM:** Denote the root edge of $G$ by $e^*$. Partition the quantum system into subsystems $Q = \bigotimes_{i=1}^m Q_i$ where $Q_i$ corresponds to the output of SPSC[$P_i$]. Accordingly denote the leaf edges of $G$ by $e_1, \dots, e_m$.

1. For $i = 1, \dots, m$, fix the message associated with the edge $e_i$ to be the quantum system $Q_i$ together with the distribution $P_i$.

2. Proceeding from leaves to root, perform node operations according to Definition 4.3 until all edges have an associated message.
<figure><img src="image_12.png" /><figcaption>Figure 9: Quantum circuit representation of the incoherent BPQM node operation for some node $v$ which $m_v = 2$. Here, double-edged lines represent classical registers and single-edged lines quantum registers. The depicted node receives two input messages (with quantum part $A_i$ and classical part $D_i$ for $i = 1, 2$ respectively). The joint quantum parts are passed through the primitive node operation (the PNO unitary), which depends on the values of $D_1$ and $D_2$. The resulting quantum system $Q_3$ is always in the $|0\rangle$ state (see proof of Lemma 4.1) and the system $Q_2$ is measured in the computational basis. Given the measurement outcome, the classical part of the input messages is processed into a new distribution $D'$. The output message consists of the quantum system $A' = Q_1$ and the classical distribution $D'$.</figcaption></figure>

3. Apply the Hadamard transform $H^{\otimes n_e}$ on the quantum system $Q_e$, of the final message.

4. Measure $Q_e$ in the computational basis and set $\hat{x}$ to the resulting measurement outcome.

## 4.3 Efficiency and optimality of incoherent BPQM

The runtime of incoherent BPQM is governed by two factors: The number of nodes in the MPG as well as the following quantity.

**Definition 4.5 (Maximum variable dimension).** The maximum variable dimension of an MPG $\mathcal{G} = (V, E)$ is defined as $N(\mathcal{G}) := \max_{v \in V} n_v$.

**Proposition 4.1.** The incoherent BPQM algorithm operating on some MPG $\mathcal{G} = (V, E)$ has a time complexity of $O(|V| 4^{N(\mathcal{G})})$.

*Proof.* The number of performed node operations is $|V|$ and the complexity of the node operation associated with $v \in V$ is generally $O(4^{n_v})$, as this is the circuit complexity to implement a general $n_v$-qubit unitary [27]. The time complexity associated with the classical computation scales as $O(2^{n_v})$. $\square$

We note that if the MPG is well balanced, and node operations are allowed to be performed in parallel, then the $|V|$ term in the time complexity of the algorithm can potentially be reduced to a sub-linear term.

We can already appreciate the efficiency of incoherent BPQM by considering the $n$-bit repetition code we encountered in Example 4.1. Naively implementing the primitive node operation solving the entire subspace decoding task would entail a complexity of $O(4^n)$. By using incoherent BPQM on the proposed MPG, the complexity instead reduces to $O(n)$ since $|V| = n-1$ and $N(\mathcal{G}) = 2$.

Now we turn to our main result, the optimality of incoherent BPQM.

**Theorem 4.1.** Consider an instance $T = \text{SDT}(n, k, l, \mathcal{G}, P)$ where the associated channel $W$ can be written as $W = W[\mathcal{G}, P]$ for some MPG $\mathcal{G}$ with $m$ leaves and a sequence of probability distributions $P = (P_i)_{i=1,...,m}$. Incoherent BPQM determines the input $x$ in $T$ with optimal (i.e., the lowest possible) error probability.

To prove this theorem, we need to characterize the messages that are sent over the various edges of the MPG. Since the measurement of $Q_2$ makes the incoherent BPQM node operations inherently stochastic, the values of the messages are not deterministic and must instead be described by a distribution over their possible values. We need some technical groundwork before we can arrive to such a characterization, which will be stated in Lemma 4.1 below.
We define an $\ell$-bit distribution ensemble $\mathcal{E}$ to be a list of pairs $\mathcal{E} = (p_i, D_i)_{i=1,...,m}$ where $p_i \ge 0$ are probabilities, so that $\sum_{i=1}^m p_i = 1$, and $D_i$ are $\ell$-bit probability distributions. Next, we define the product $\mathcal{E}_1 \otimes \mathcal{E}_2$ of an $\ell_1$- and $\ell_2$-bit ensemble $\mathcal{E}_1 = (p_i^{(1)}, D_i^{(1)})_i, \mathcal{E}_2 = (p_j^{(2)}, D_j^{(2)})_j$ to be the $(\ell_1 + \ell_2)$-bit distribution ensemble $(p_i^{(1)} p_j^{(2)}, D_i^{(1)} \times D_j^{(2)})_{i,j}$. A distribution ensemble of particular importance is the one which describes the possible residual channels that occur in a primitive node operation.

**Definition 4.6 (Node message ensemble).** Consider a primitive node operation $U = \text{PNO}(n, k, \ell, G, P)$ and its associated $n \times n$ matrix $M$. We define the distribution ensemble

$$f_U(D) := (P_S(s), P_{Y|S=s})_{s \in \mathbb{F}_2^{k-\ell}}, \quad (40)$$

where $P_{Y,S,A}$ is defined as in Definition 3.2, i.e., $P_{Y,S,A}(y, s, a) := D(M^{-1}(y \| s \| a))$.

Combining the node message ensembles yields the message ensemble for the root edge of the BPQM algorithm.

**Definition 4.7 (BPQM message ensemble).** Consider an MPG $G = (V, E)$ with $m$ leaves $e_1, \dots, e_m$ and a sequence $\mathcal{P} = (P_i)_{i=1,...,m}$ of $n_{e_i}$-bit probability distributions. The message ensemble of $G$ w.r.t. $\mathcal{P}$, denoted by $\mathcal{E}_G^\mathcal{P}$, is the $(k-\ell)$-bit distribution ensemble defined inductively as follows.

* If $G$ has zero nodes (and thus $\mathcal{P} = (P_1)$), then $\mathcal{E}_G^\mathcal{P}$ is given by the list with only one element $(1, P_1)$.

* If $G$ has at least one node, then let $v$ be the node of $G$ connected to the root edge. Each outgoing edge $e_i^{\text{out}}(v)$ for $i = 1, \dots, m_v$ can be considered to be the root of a smaller MPG $G_i$ which only includes $e_i^{\text{out}}(v)$ and all of its successor nodes and edges in $G$. Define the ensemble $\mathcal{E}_i := \mathcal{E}_{G_i}^{\mathcal{P}_i}$ where $\mathcal{P}_i$ only contains the distributions associated to the leaves of $G_i$. Let us write the product ensemble as $\bigotimes_{i=1}^{m_v} \mathcal{E}_i = (\bar{p}_j, \bar{D}_j)_j$. For each $\bar{D}_j$, we write $f_U(\bar{D}_j) = (p'_{k|j}, D'_{k|j})_k$ where $U = \text{PNO}(n_v, k_v, \ell_v, G_v, \bar{D}_j)^4$. Then, define

$$\mathcal{E}_G^\mathcal{P} := (\bar{p}_j p'_{k|j}, D'_{k|j})_{j,k}. \quad (41)$$

**Lemma 4.1.** Consider the setup of Theorem 4.1. Denote the root of $G$ by $e^*$ and let $\mathcal{E}_G^\mathcal{P} = (p_s, D_s)_s$ be the BPQM message ensemble from Definition 4.7. Applying incoherent BPQM to $W(x)$ results in a final message sent over $e^*$ which is given by a quantum system in the state $\text{SPSC}[D_s](x)$ and the classical distribution $D_s$ with probability $p_s$.

*Proof.* The proof proceeds by induction over the number of nodes in the MPG $G$, as in the construction of $\mathcal{E}_G^\mathcal{P}$ from Definition 4.7. If $G$ has no nodes, then the statement is true by definition. For the induction step, consider an MPG $G$ with at least one node, and let $v$ denote the node connected to the root and $F_{\ell_v, G_v}$ the associated randomized encoding. For an input $x \in \mathbb{F}_2^{n_{e^*}}$, the output of $F_{\ell_v, G_v}$ is $(x \| r) G_v$ for a randomly-chosen $r \in \mathbb{F}_2^{k_v - \ell_v}$. Denote the portion of this string associated to outgoing edge $e_i^{\text{out}}(v)$ by $x_i$. Each outgoing edge $e_i^{\text{out}}(v)$ for $i = 1, \dots, m_v$ can be considered the root of a smaller MPG $G_i$ which includes only its successor nodes and child edges in the original MPG. The input to $G_i$ is $x_i$.

We apply the induction hypothesis on these smaller sub-MPGs. Define the ensemble $\mathcal{E}_i := \mathcal{E}_{G_i}^{\mathcal{P}_i}$ where $\mathcal{P}_i$ only contains the distributions associated to the leaves contained in $G_i$. By assumption, the message sent over the edge $e_i^{\text{out}}$ is precisely characterized by the ensemble $\mathcal{E}_i = (p_{\ell_i}, D_{\ell_i})_{\ell_i}$ in that the classical part of the message is $D_{\ell_i}$ and the quantum part $\text{SPSC}[D_{\ell_i}](x_i)$ with probability $p_{\ell_i}$. Let us write the product ensemble as $\bigotimes_{i=1}^{m_v} \mathcal{E}_i = (\bar{p}_j, \bar{D}_j)_j$. The combined quantum message going into the node is hence given by the state

$$\frac{1}{2^{k_v - \ell_v}} \sum_{r \in \mathbb{F}_2^{k_v - \ell_v}} \text{SPSC}[\bar{D}_j]((x \| r)^T G) \quad (42)$$

with probability $\bar{p}_j$.

The first step of the node operation is application of the unitary $U = \text{PNO}(n_v, k_v, \ell, G_v, \bar{D}_j)$ to this state. By Lemma 3.1, the resulting state is precisely given by

$$\sum_{k \in \mathbb{F}_2^{k_v - \ell_v}} p'_{k|j} \text{SPSC}[D'_{k|j}](x)_{Q_1} \otimes |k\rangle\langle k|_{Q_2} \otimes |0\rangle\langle 0|_{Q_3}^{\otimes n_v - k_v}, \quad (43)$$

<footnote n="4">⁴Note that technically speaking $f_U$ depends on the choice of the matrix $M$. The exact choice if of no further consequence, except that the same choice needs to be used for each $j$.</footnote>
where we write $f_U(\tilde{D}_j) = (p'_{j|lj}, D'_{k|j})_k$. In the next step, $Q_2$ is measured to obtain the value of $k$. As such, the output message is precisely given by $\text{SPSC}[D'_{k|j}](x)$ and $D'_{k|j}$ with probability $\bar{p}_j p'_{k|j}$. Thus the induction step is proven. $\square$

**Proof of Theorem 4.1.** From (43), we can observe that for each node operation, the state of the system $Q_1Q_2$ is given by a quantum-classical state. As such, the measurement of the system $Q_2$ in the standard basis is a reversible (i.e. it does not disturb the state) and no information is lost through its action.

Together with the statement of Lemma 2.1, we conclude that the sequence of all node operations reversibly maps $W(x)$ to the quantum-classical state

$$ \sum_{(p_s, D_s) \in \mathcal{E}_G^P} p_s \text{SPSC}[D_s](x) \otimes |s\rangle\langle s| \otimes |0\rangle\langle 0| \otimes^{n-k}. \quad (44) $$

Therefore we may just as well determine $x$ from this state as from $W(x)$. By Lemma 2.1 the optimal strategy to guess $x$ from this quantum-classical state is simply to perform a measurement of the first $k$ qubits in the conjugate basis.

We briefly note that the reversibility of the node operations generally only holds for input states of the form $W(x)$. However, we will see later in Section 5 that it is possible to modify BPQM so as to realize the node operations reversibly for any input state. $\square$

From the proof of Theorem 4.1, we can also directly find a closed-form expression for the success probability of incoherent BPQM.

**Corollary 4.1.** Consider an instance $\text{SDT}(n, k, \ell, G, P)$ where the associated channel $W$ can be written as $W = W[G, P]$ for some $\text{MPG } G$ and a sequence of probability distributions $P = (P_i)_{i=1,...,m}$. The optimal success probability of solving the subspace decoding task is given by

$$ p_{\text{succ}} = \sum_{(p, D) \in \mathcal{E}_G^P} p 2^{H_{1/2}(D) - \ell} \quad (45) $$

where $H_{1/2}(D) := 2\log \sum_{z \in \mathbb{F}_2^\ell} \sqrt{D(z)}$ is the Rényi entropy of order 1/2.

*Proof.* The probability of correctly obtaining $x$ from $\text{SPSC}[D](x)$ is given by

$$ \left| \langle + | \otimes^{\ell} \sum_{z \in \mathbb{F}_2^{\ell}} \sqrt{D(z)} | z \rangle \right|^2 = \frac{1}{2^{\ell}} \left( \sum_{z, z'} \sqrt{D(z)} \langle z' | z \rangle \right)^2 = 2^{H_{1/2}(D) - \ell}. \quad (46) $$

Averaging over the choice of $D$ in $\mathcal{E}_G^P$ gives the desired statement. $\square$

We briefly note that while incoherent BPQM is a quantum algorithm with quantum input, and thus requires an actual quantum device to execute, it is possible to efficiently evaluate its success probability on a classical machine. Since BPQM only operates on non-entangled quantum systems of size at most $N(G)$ qubits, the classical cost to evaluate BPQM's performance scales as $O(|V|2^{N(G)})$, which is essentially identical to the runtime of BPQM itself on a quantum computer.

## 4.4 Robustness to discretization

In the previous discussion of incoherent BPQM, we made the implicit assumption that the classical part of the computation, which involves real numbers, can be realized with infinite accuracy. Such assumptions are common in the study of message passing algorithms, though one must ensure that the algorithm remains robust when these real numbers are approximated with a discretized representation. It is especially important to formally define and analyze a properly discretized version of incoherent BPQM, since, as we will see later in Section 5, it can be useful to perform the classical computation coherently on a quantum register.

There are essentially two aspects of the incoherent BPQM algorithm which are idealized and need some discretization procedure to work in practice. Firstly, the classical part of the messages are real-valued, and would in principle require an infinite number of classical bits to represent. Secondly, as part
of every primitive node operation, a circuit for the unitary $U_2$ must be explicitly (classically) constructed, which, as opposed to $U_1$, generally also involves real numbers.

We address these issues by approximating the classical part of the message in a discretized fashion. We consider the arguably simplest discretization scheme to simplify the analysis: Store each number in the probability vector using a fixed-point representation that utilizes $B$ bits to represent a real number in $[0, 1]$. The $l_1$-norm error caused by the discretized representation of the distribution is at most $2^{N(G)/2^B}$, since $2^{N(G)}$ is the size of the largest probability vector that ever occurs in the incoherent BPQM algorithm and each entry is off by at most $2^{-B}$. Therefore, to achieve an $l_1$-norm error of $\Delta$ on all distributions, we require a discretized representation with a total number of $B = N(G) + \log(1/\Delta)$ bits for each probability.

The full details of the discretized incoherent BPQM algorithm are rather technical and not of particular importance for most considerations. We therefore refer the interested reader to Appendix A, and for now, the following informal definition will suffice.

**Definition 4.8 (discretized incoherent BPQM, informal).** The discretized incoherent BPQM algorithm is defined identically to Definition 4.4, except that any real number occurring in the classical computation is represented in a discretized fashion.

We now briefly discuss the impact that discretization errors have on the accuracy and runtime of BPQM. Roughly speaking, the analysis of the discretization errors has to consider two aspects. First, since we store the classical messages in a quantized fashion, they will accumulate more and more errors during the execution of the algorithm. In turn, these errors also affect the quantum part of the message, since each node operation applies a unitary $PNO(n, k, l, G, P)$ with an erroneous value of $P$. Fortunately, it can be shown that these errors can be efficiently suppressed by choosing $B$ to be large enough.

**Theorem 4.2.** Consider an instance $\text{SDT}(n, k, l, G, P)$ where the associated channel $W$ can be written as $W = W[G, P]$ for some MPG $G = (V, E)$ and a sequence of probability distributions $\mathcal{P} = (P_i)_{i=1,...,m}$. For any $\epsilon > 0$, discretized incoherent BPQM solves this problem with a success probability that is at most $\epsilon$ smaller than the optimal probability when choosing $B = \mathcal{O}(N(G)+\log(1/\epsilon)+|V|\log(N(G)))$. The runtime of the algorithm is $\mathcal{O}(4^{N(G)}N(G)^2|V|\text{poly}(B))$.

The proof is delegated to Appendix D. We briefly note that the exact polynomial in the complexity term depends on implementation details of the discretization scheme, such as the precise asymptotic cost of performing basic operations (addition, division, square root, arcsin) on discretized $B$-bit fixed-point numbers. By appropriately choosing the algorithms to realize these basic operations, the polynomial can be quadratic [28]. We also expect our estimate of the required number of bits $B$ to be overly pessimistic and that improved techniques and a more refined analysis could lower it.

# 5 Decoding the pure-state channel with BPQM

In this section, we will show how BPQM can be utilized to solve the following block decoding task. Recall that for $p \in [0, 1/2]$, we define $\text{BSPSC}[p] := \text{SPSC}[(1-p, p)]$.

**Problem 5.1 (Block decoding problem BLOCKDEC($C$, $p$)).**

- **INSTANCE PARAMETERS:** An $[n, k]$ binary linear code $C$ and a vector $p \in [0, 1/2]^n$.

- **INPUT:** A codeword $x \in C$ is chosen uniformly at random and then transmitted over a collection of independent binary-input pure-state channels, yielding the state

$$|\Psi_x\rangle := \text{BSPSC}[p_1](x_1) \otimes \text{BSPSC}[p_2](x_2) \otimes \dots \otimes \text{BSPSC}[p_n](x_n). \quad (47)$$

The input is an $n$-qubit quantum system in the state $|\Psi_x\rangle$.

- **GOAL:** Given the input quantum system, determine $x$.

Before solving `BLOCKDEC`, let us first discuss the comparatively simpler task of bit decoding.

**Problem 5.2 (Bit decoding problem `BITDEC`($C$, $p$, $i$)).**

- **INSTANCE PARAMETERS:** An $[n, k]$ binary linear code $C$, a vector $p \in [0, 1/2]^n$ and $i \in \{1, ..., n\}$.

- **INPUT:** identical to the input of Problem 5.1.
- **GOAL:** Given the input quantum system, determine $x_i$.

Clearly, `BITDEC(C, p, i)` is an instance of the subspace decoding problem `SDT(n, k, ℓ, G, P)` considered in Section 3 with $ℓ = 1$, $P = (1-p_1, p_1) \times \cdots \times (1-p_n, p_n)$ and with an appropriately chosen generator matrix $G$ of $C$ where only the first row has a non-zero entry at the $i$-th position.<fnref n="5" /> As such, we can optimally solve this problem with incoherent BPQM as long as we are given an MPG representation of the following channel.

**Definition 5.1 (Bit-transmission channel).** Let $C$ be an $[n, k]$ binary linear code and $i \in \{1, \dots, n\}$. We define the bit-transmission channel $\mathcal{F}_{C,i}$ as the 1-bit to $n$-bit channel, which maps the bit $z \in \{0, 1\}$ to a uniformly random element in $\{x \in C | x_i = z\}$.

**Corollary 5.1.** Consider an instance `BITDEC(C, p, i)`. If $\mathcal{G}$ is an MPG such that $F[\mathcal{G}] = \mathcal{F}_{C,i}$, then incoherent BPQM on $\mathcal{G}$ optimally solves the `BITDEC(C, p, i)` problem.

Recall that the runtime complexity of incoherent BPQM is $O(4^{N(\mathcal{G})}|V|)$ where $\mathcal{G} = (V, E)$. Hence, to efficiently and optimally solve the `BITDEC(C, p)` problem is also an instance of the subspace decoding task with $ℓ = k$, and could thus be solved by incoherent BPQM. However, since the maximum variable dimension of the involved MPG is necessarily at least $k$ (because the root edge $e^*$ of the MPG must have $n_e^* = k$), incoherent BPQM has an exponentially scaling runtime when $k = \Omega(n)$.

We now turn our attention back to block decoding. In principle, the `BLOCKDEC(C, p)` problem is also an instance of the subspace decoding task with $ℓ = k$, and could thus be solved by incoherent BPQM. However, since the maximum variable dimension of the involved MPG is necessarily at least $k$ (because the root edge $e^*$ of the MPG must have $n_e^* = k$), incoherent BPQM has an exponentially scaling runtime when $k = \Omega(n)$.

To decode codes with non-vanishing rate, we must therefore take another approach. Taking inspiration from classical BP, we instead decode each codeword bit separately. We will therefore assume that for every codeword bit $x_i$ (or at least for $k$ linearly independent codeword bits) we know an efficient MPG representation of the bit-transmission channel $\mathcal{F}_{C,i}$, such that we can efficiently decode said codeword bit.

For block decoding with BPQM, there are two important distinctions from classical BP that stem from the quantum nature of the problem. First, in contrast to classical BP, it is not possible to decode all codeword bits in parallel. That would require duplication of the channel outputs, which is forbidden by the no-cloning theorem. Instead we decode the individual codeword bits sequentially one at a time. Second, we cannot naively apply the incoherent BPQM algorithm sequentially. Measurements in the node operations of incoherent BPQM may significantly disturb the quantum state, potentially impeding the successful decoding of subsequent bits.

For this reason, we need to modify incoherent BPQM to be as minimally destructive as possible. We cannot eliminate the measurement of the final message, since we need to extract one classical bit out of the decoding procedure. But all node operations can be performed completely coherently by utilizing the deferred measurement principle. We call this modification of BPQM with reversible node operations *coherent BPQM* to highlight its difference with incoherent BPQM.

After decoding a single codeword bit with coherent BPQM, the node operations can be reversed in order to return to a state that is as close as possible to the original state. Remarkably, it turns out that sequentially decoding in this fashion is block-optimal, i.e., it allows us to estimate the codeword with the maximal success probability. This will be proven in Section 5.2.

## 5.1 Coherent BPQM algorithm

The incoherent BPQM algorithm described in Section 4.2 involves two types of measurements: The conjugate basis measurement on the final message as well as the measurements of the register $Q_2$ in each node operation. The measurements of $Q_2$ can be avoided by using the deferred measurement principle. To do so, we first need to upgrade the classical registers storing the distributions ($D_1, D_2$ and $D'$ in Figure 9) to quantum registers. Then, the primitive node operation (PNO in the Figure 9) must be coherently controlled on the values of $D_1$ and $D_2$. Furthermore, the classical computation (the “distribution processing” box in the Figure 9) needs to be translated from a classical circuit to a

<footnote n="5">⁵I.e., $G_{1i} = 1$ and $G_{ji} = 0$ for $j > 1$. This can be achieved by appropriately applying elementary row operations on any given generator matrix of $C$.</footnote>
quantum circuit. Finally, instead of measuring the $Q_2$ register coming out from PNO, the distribution processing step must be coherently controlled on $Q_2$.

We call the resulting algorithm coherent BPQM. Due to the deferred measurement principle, coherent BPQM solves the subspace decoding task with the same probability as incoherent BPQM. It can hence realize optimal bit-wise decoding. The drawback is that now we offload some of the classical computation to the quantum domain, so additional quantum memory and computation is required. However, the overall (classical and quantum) asymptotic complexity of the algorithm can be shown to remain unchanged.

In the discussion of incoherent BPQM, we distinguished between ideal incoherent BPQM and discretized incoherent BPQM, where in the latter the classical part of the message is stored in a discretized fashion using only a finite number of bits. It is important to note that, strictly speaking, coherent BPQM is only a well-defined algorithm when based on the discretized incoherent BPQM algorithm. Indeed, without discretization, the register containing the description of the distribution ($D_i$ in Figure 9) would need to be infinite dimensional to reliably represent the infinite number of admissible distributions<fnref n="6" />.

**Definition 5.2 (Coherent BPQM algorithm).** The coherent BPQM algorithm is identical to the discretized incoherent BPQM algorithm, except that all measurements, besides the final one, are avoided by using the deferred measurement principle.

For a more detailed step-by-step description of coherent BPQM, as well as a discussion of its circuit complexity, we refer the reader to Appendix B.

This situation is somewhat cumbersome, as it leaves us without a precise notion of an “idealized coherent BPQM” algorithm, of which the discretized version would be an approximation. We address this in Appendix C by introducing another algorithm, called uniformly-controlled BPQM (UC-BPQM). UC-BPQM is a generalization of the algorithm initially introduced in [10]. It is an inefficient algorithm, but does formalize the notion of what an ideal coherent BPQM computation (without discretization errors) would be. The main idea of UC-BPQM is to not keep track of the distribution information of the state on-the-fly, but instead simply condition the primitive node unitaries on all (classical) bits produced by preceding node operations.

## 5.2 Block-optimality of sequential BPQM decoding

Consider some instance BLOCKDEC($C, p$). To estimate $x$ from $|\Psi_x\rangle$, it suffices to correctly decode $k$ linearly independent codeword bits, which then fully determine $x$. For convenience of notation, we will assume that the first $k$ codeword bits $x_1, \dots, x_k$ are linearly independent, which can always be achieved by appropriate relabeling. We assume that for each $i = 1, \dots, k$ an MPG $G_i$ describing the bit-transmission channel $F_{C,i}$ is given.

Notice that coherent BPQM w.r.t. $G_i$ utilizes ancilla scratch registers in the zero state during its execution.<fnref n="7" /> Denote the total number of such ancilla qubits by $A_i$. Therefore, the action of the coherent BPQM algorithm w.r.t. $G_i$ on the system $Q$ in state $|\Psi_x\rangle$ can be written as a unitary evolution

$$|\Psi_x\rangle_Q \otimes |0^{A_i}\rangle_{E_i} \mapsto U_{cBPQM,i} (|\Psi_x\rangle_Q \otimes |0^{A_i}\rangle_{E_i}) \quad (48)$$

for some $A_i$-qubit ancilla system $E_i$, followed by some projective measurement $\{\Pi_i, 1-\Pi_i\}$ acting on $QE$. The $(n+A_i)$-qubit unitary $U_{cBPQM,i}$ captures all of the node operations performed by the algorithm, including initialization of the classical part of the message at the leaves into the ancilla. Correspondingly, the projection $\Pi_i$ captures the measurement of the final qubit in the conjugate basis.

To decode the complete codeword with BPQM, we sequentially apply the coherent BPQM algorithm for the codeword bits $1, \dots, k$. After each codeword bit $x_i$ has been decoded, the node operations are “undone” by reversing the quantum circuit in order to return to a state that is as close as possible to the original channel output.

**Definition 5.3 (BPQM block decoding).** Consider an instance BLOCKDEC($C, p$) for some $[n, k]$ binary linear code where $x_1, \dots, x_k$ are linearly independent codeword bits. Let $G_1, \dots, G_k$ be MPG representations of $F_{C,1}, \dots, F_{C,k}$.

<footnote n="6">⁶It could be argued that incoherent BPQM without discretization is also an ill-defined algorithm in the first place, as it requires infinite precision to represent the classical part of the message. However, making this assumption of a real RAM computation model is generally more common for classical algorithms.</footnote>

<footnote n="7">⁷For example, these ancilla qubits are used to store the distribution part of the messages.</footnote>
- INPUT: n-qubit quantum system Q in the state $|\Psi_x\rangle$ for some $x \in C$.

- OUTPUT: An estimate $\hat{x}$ of x.

- ALGORITHM: For $i = 1, \dots, k$ perform the following actions

1. Prepare $A_i$-qubit ancilla register $E_i$ in the all-zero state

2. Apply the coherent BPQM circuit $U_{CBPQM,i}$ to $QE_i$

3. Set $\hat{x}_i$ to the result of measuring $\{\Pi_i, \mathbb{1} - \Pi_i\}$ on $QE_i$

4. Apply the reversed coherent BPQM circuit $U_{CBPQM,i}^\dagger$ to $QE_i$

5. Discard the register $E_i$

Finally, complete $\hat{x}_1, \dots, \hat{x}_k$ to a valid codeword in $C$.

We observe that, somewhat surprisingly, BPQM not only realizes bit-optimal decoding, but also block-optimal decoding. This is remarkable, since classical BP on the binary symmetric channel does not necessarily realize block-optimal decoding, even on codes with a tree factor graph.

**Theorem 5.1.** Consider an instance BLOCKDEC($C$, $p$) for an $[n, k]$ binary linear code $C$. For $k$ linearly independent codeword bits $x_i$, let $G_i = (V_i, E_i)$ be an MPG representation of $F_{C,i}$. Define $N := -\max_i N(G_i)$, $M := -\max_i |V_i|$ and $\bar{p} := \min_{j=1,\dots,n} p_j$.

For any $\epsilon > 0$, the algorithm in Definition 5.3 with B-bit fixed point representation solves BLOCKDEC($C$, $p$) with a success probability that is at most $\epsilon$ smaller than the optimal probability when choosing $B = O(N + M \log N + \log k + \log(1/\epsilon) + n \log(1/\bar{p}))$. The circuit complexity of the algorithm is $O(4^N N^2 k M \text{ poly}(B))$.

We briefly note that the exact polynomial in the complexity term depends on implementation details of the discretization scheme, such as the precise asymptotic cost of performing basic operations (addition, division, square root, arcsin) on discretized B-bit fixed-point numbers. By appropriately choosing the algorithms to realize these basic operations, the polynomial can be quadratic [28]. We also expect our estimate of the required number of bits $B$ to be overly pessimistic and that improved techniques and a more refined analysis could lower it. In practice, it is likely sufficient for most applications to simply fix a number of discretization bits $B$ that is large enough, as is commonplace for most classical numerical computing. In that case, the considerations about the asymptotics simplify significantly, and the overhead reduces to $O(4^N Mk)$ (up to polynomial terms in $N$).

There are two main steps involved in the proof of this theorem. First, we will argue that in the absence of discretization errors, the algorithm would be block optimal. Second, we show that it is possible to efficiently approximate this ideal computation up to an error $\epsilon$. We briefly sketch out the proof for the first step here, since some of the involved ideas are interesting on their own. For the second step, we delegate the full details to Appendix D, since they are more technical and less insightful.

Due to the Abelian structure, the PGM realizes block-optimal decoding of binary linear codes sent over pure-state channels (recall Proposition 2.1). In this case, the PGM is given by an orthogonal measurement into the orthonormal basis $\{|f_x\rangle\}_{x \in C}$ where

$$|f_x\rangle := \frac{1}{\sqrt{2^k}} \rho^{-1/2} |\Psi_x\rangle \quad \text{and} \quad \rho := \frac{1}{2^k} \sum_{x \in C} |\Psi_x\rangle\langle\Psi_x|. \qquad (49)$$

To prove that a decoding scheme is block-optimal, it thus suffices to show that it acts equivalently to a projective measurement in the basis $\{|f_x\rangle\}_{x \in C}$ on the subspace $V := \text{span}\{|\Psi_x\rangle| x \in C\}$.

The following proposition shows that any optimal bit-wise decoding algorithm, which in some sense doesn't measure more than it actually needs to, can be chained into a block-wise optimal decoder which realizes the PGM.

**Proposition 5.1.** Consider an instance BLOCKDEC($C$, $p$) for some $[n, k]$ binary linear code $C$, and let $i \in \{1, \dots, n\}$. Define

$$\rho_0 := \frac{1}{2^{k-1}} \sum_{x \in C: x_i=0} |\Psi_x\rangle\langle\Psi_x|, \quad \rho_1 := \frac{1}{2^{k-1}} \sum_{x \in C: x_i=1} |\Psi_x\rangle\langle\Psi_x|. \qquad (50)$$

Consider an orthogonal two-outcome projective n-qubit measurement $\{\Pi, \mathbb{1} - \Pi\}$ that optimally decodes the i-th codeword bit, i.e., it maximizes $\text{Tr}[\Pi\rho_0] + \text{Tr}[(\mathbb{1} - \Pi)\rho_1]$. Then, for P the projection onto V,

$$\Pi P = \sum_{x \in C: x_i=0} |f_x\rangle\langle f_x|. \qquad (51)$$
Proof. First, we consider the spectral decomposition of $(\rho_0 - \rho_1)$. The orthogonal complement of $V$ is clearly an eigenspace with eigenvalue zero. The eigenvalues corresponding to eigenvectors in $V := \text{span}\{|\Psi_x\rangle| x \in C\}$ are all non-zero, because for all $|\phi\rangle \in V$

$$ (\rho_0 - \rho_1)|\phi\rangle = \frac{1}{2^{k-1}} \sum_{x \in C} (-1)^{x_i} \langle \Psi_x | \phi \rangle |\Psi_x\rangle \quad (52) $$

which can only be zero if $|\phi\rangle = 0$ (due to the linear independence of the $|\Psi_x\rangle$).

By [29, Equation 2.41] every optimal measurement has the form $\Pi = \{\rho_0 - \rho_1 > 0\} + \Lambda$, where $\{A > 0\}$ denotes the projection onto the subspace of strictly positive eigenvalues of $A$ and $\Lambda$ is an operator supported on the kernel of $\rho_0 - \rho_1$ such that $0 \le \Lambda \le 1$. Since the support of $\rho_0 - \rho_1$ is $V$, we have $\{\rho_0 - \rho_1 > 0\}P = \{\rho_0 - \rho_1 > 0\}$, and similarly, $\Lambda P = 0$. Hence, $\Pi P = \{\rho_0 - \rho_1 > 0\}$ for all optimal $\Pi$.

Therefore, to complete the proof, it suffices to show that $\Pi' = \{\rho_0 - \rho_1 > 0\}$ for $\Pi' := -\sum_{x \in C: x_i=0} |f_x\rangle\langle f_x|$. Let $G$ be a generator matrix for $C$ adapted to the $\text{BITDEC}(C, p, i)$ problem, as described above. Then define $U = \text{PNO}(n, k, 1, G, P)$ for $P$ the distribution corresponding to the $n$ independent binary pure-state channels with parameters $p_1, \dots, p_n$. We will verify the equality $\Pi' = \{\rho_0 - \rho_1 > 0\}$ under the basis transformation given by $U$.

By Lemma 3.1, the unitary $U$ transforms $\rho_i$ to the state

$$ U\rho_i U^\dagger = \sum_{s \in \mathbb{F}_2^{k-1}} P_S(s) \text{SPSC}[P_{Y|S=s}](i) \otimes |s\rangle\langle s| \otimes |0\rangle\langle 0|^{\otimes (n-k)}. \quad (53) $$

Therefore, we have

$$ U\{\rho_0 - \rho_1 > 0\}U^\dagger = \{U\rho_0 U^\dagger - U\rho_1 U^\dagger > 0\} = |+\rangle\langle +| \otimes \mathbb{1}^{\otimes (k-1)} \otimes |0\rangle\langle 0|^{\otimes (n-k)}. \quad (54) $$

Next, notice that we can write $\Pi'$ as follows

$$ \Pi' = \sum_{x \in C, x_i=0} |f_x\rangle\langle f_x| = \frac{1}{2^k} \rho^{-1/2} \left( \sum_{x \in C, x_i=0} |\Psi_x\rangle\langle \Psi_x| \right) \rho^{-1/2} = \frac{1}{2} \rho^{-1/2} \rho_0 \rho^{-1/2}. \quad (55) $$

Moreover, $U\rho U^\dagger = U(\frac{\rho_0+\rho_1}{2})U^\dagger$ is diagonal:

$$ U\rho U^\dagger = \sum_{s \in \mathbb{F}_2^{k-1}} \sum_{y \in \mathbb{F}_2} P_S(s) P_{Y|S=s}(y) |y\rangle\langle y| \otimes |s\rangle\langle s| \otimes |0\rangle\langle 0|^{\otimes (n-k)}. \quad (56) $$

Therefore, we observe

$$ U\Pi'U^\dagger = \frac{1}{2}(U\rho U^\dagger)^{-1/2}(U\rho_0 U^\dagger)(U\rho U^\dagger)^{-1/2} = |+\rangle\langle +| \otimes \mathbb{1}^{\otimes (k-1)} \otimes |0\rangle\langle 0|^{\otimes (n-k)}. \quad (57) $$

Comparing (54) with (57), we get the desired statement. $\square$

Therefore, if we have a sequence of bit-optimal decoders for the codeword bits $i = 1, \dots, k$, each described by the projective measurement $\{\Pi_i^0, \Pi_i^1\}$, then this proposition implies

$$ \Pi_i^0 P = \sum_{x \in C: x_i=0} |f_x\rangle\langle f_x| \quad \text{and} \quad \Pi_i^1 P = \sum_{x \in C: x_i=1} |f_x\rangle\langle f_x|. \quad (58) $$

and thus

$$ \forall \hat{x} \in C : \Pi_k^{\hat{x}_k} \cdots \Pi_2^{\hat{x}_2} \Pi_1^{\hat{x}_1} P = |f_{\hat{x}}\rangle\langle f_{\hat{x}}|. \quad (59) $$

because $P\Pi_i^{\hat{x}_i} P = \Pi_i^{\hat{x}_i} P$. Therefore, sequentially chaining the $k$ bit-wise decoders together provides a block-optimal decoder. We note that, instead of decoding $k$ linearly independent bits and then completing them to a codeword, it would also be possible to instead decode all $n$ bits bit-optimally. We also highlight that the bitwise projective measurements commute on $V$.

Ideally, we would like to apply Proposition 5.1 to the coherent BPQM algorithm to prove Theorem 5.1. Unfortunately, this is not possible for two reasons: Firstly, it is a priori unclear if coherent
BPQM realizes a projective measurement, since it acts on an extended space (i.e., it is described by an isometry and not a unitary). Secondly, coherent BPQM is only $\epsilon$-close to a bit-optimal decoder. These two problems can be solved by considering the UC-BPQM algorithm mentioned previously. It requires no ancilla qubits, and therefore Proposition 5.1 can be applied to UC-BPQM. We refer to Appendix C for a detailed discussion. So to prove Theorem 5.1, it suffices to show that coherent BPQM can efficiently approximate UC-BPQM. The details of this are technical and can be found in Appendix D. We also briefly highlight that coherent BPQM does indeed realize a projective measurement.

**Lemma 5.1.** For all $i = 1, \dots, k$, the five steps in Definition 5.3 act like a two-outcome projective measurement on the system Q.

The proof can also be found in Appendix D.

# 6 MPG construction for bit-transmission channel

In Section 5, we showed that BPQM can achieve optimal bitwise and blockwise decoding of a binary linear code $C$ under the condition that we are given an efficient MPG representation of the involved bit-transmission channels $\mathcal{F}_{C,i}$. In this section, we will show how such MPGs can be explicitly constructed for different classes of codes. The first construction, presented in Section 6.1, works for codes that exhibit a tree Tanner graph. This construction essentially recovers the BPQM description that was presented in previous works [10, 12], and we add it here for completeness. The subsequent constructions in Sections 6.2 and 6.3 are novel. They apply to certain families of codes that do not have a tree Tanner graph, but still exhibit some alternative tree factor graph representation.

We begin with a brief overview of the general strategy that underlies all the constructions before addressing each one in turn. As an illustrative example, we depict in Figure 10 how this general procedure constructs an MPG representation $\mathcal{F}_{C,i}$ for some 6-bit code $C$ and $i = 2$.

**Procedure 6.1** (Procedure to construct MPG representation of $\mathcal{F}_{C,i}$). Assume we know some tree Forney-style factor graph representation of the code inclusion function $I_C$ (recall (14)). More concretely, this Forney-style factor graph has $n$ external edges representing the variables $X_1, \dots, X_n$ and the exterior function of the factor graph is precisely $I_C$. Then, copy the external leg $X_i$ using an equality node, and call the copy $Z$. The resulting factor graph has the exterior function

$$x_1, \dots, x_n, z \mapsto I_C(x_1, \dots, x_n) \cdot \begin{cases} 1 & \text{if } x_i = z \\ 0 & \text{otherwise,} \end{cases} \qquad (60)$$

and therefore, can be understood as a representation of the bit-transmission channel $\mathcal{F}_{C,i}$ in the sense of (35). This new factor graph is still a tree, and we can induce an order on all its edges by choosing $Z$ to be the root and the $X_1, \dots, X_n$ to be leaves (and choosing the direction from root to leaves). In order for this graph to represent a valid MPG, we additionally need all internal edges to have an alphabet size that is a power of 2 and also each node $v$ to represent a channel of the form $F_{\ell_v, G_v}$ for some $\ell_v, G_v$.

We emphasize that this procedure is generally not applicable to any arbitrary tree factor graph representation of $I_C$, since the individual factor nodes may not necessarily represent a channel $F_{\ell_v, G_v}$. Furthermore, notice that the (logarithm of the) alphabet sizes of the factor graph edges directly translates to the variable dimensions $n_e$ in the MPG. Therefore, the main difficulty in this section will be to construct factor graph representations of the code inclusion function $I_C$ that

1. are trees,

2. have a small (polynomial in code size) number of nodes,

3. have small (polynomial in code size) alphabet sizes of the internal variables and

4. only contain nodes representing channels of the form $F_{\ell, G}$.
<figure><img src="image_13.png" /><figcaption>Figure 10: Illustration of Procedure 6.1 which constructs an MPG for the bit-transmission channel $\mathcal{F}_{C,i}$ from a tree Forney-style factor graph representation of the code inclusion function, here for some 6-bit code $C$ and $i = 2$. In the original factor graph (left), the external edge $X_i$ is copied using an equality node (center). We denote the copy by $Z$, depicted in red. The remaining external edges $X_1, \dots, X_n$ are depicted in blue. The desired MPG (right) is obtained by fixing the red edge to be the root.</figcaption></figure>

<figure><img src="image_14.png" /><figcaption>Figure 11: In a Forney-style factor graph, an equality or check node of degree $n > 3$ can be decomposed into smaller nodes of degree 3. The equality here should be understood as saying that the exterior function of both factor graphs are identical.</figcaption></figure>

## 6.1 Construction from tree Tanner graph

If a certain $[n, k]$ binary linear code $C$ exhibits a Tanner graph which is a tree, then Procedure 6.1 goes through quite directly. All nodes $v$ in the Forney representation of the Tanner graph are either equality nodes or check nodes, and in both cases, one can interpret the node as representing a channel $F_{1,G_v}$ for some code $C_v$ of blocksize $\deg(v) - 1$ and generator matrix $G_v$, where $\deg(v)$ denotes the degree of $v$. More concretely, for an equality node, $C_v$ is the $[\deg(v) - 1, 1]$ repetition code with generator matrix $G_v = (11 \dots 1)$, and for a check node, $C_v$ is the trivial $[\deg(v) - 1, \deg(v) - 1]$ code with generator matrix

$$ G_v = \begin{pmatrix} 1 & 0 & 0 & \cdots & 0 \\ 1 & 1 & 0 & \cdots & 0 \\ 1 & 0 & 1 & \cdots & 0 \\ \vdots & & \ddots & & \vdots \\ 1 & 0 & 0 & \cdots & 1 \end{pmatrix}. \qquad (61) $$

While this construction does provide us with a valid MPG $\mathcal{G}$ for the bit-transmission channel, the resulting maximal variable dimension $N(\mathcal{G})$ could potentially be large, as it is essentially given by the maximum node degree in the original Tanner graph. To avoid this issue, we can do a simple pre-processing step on the Tanner graph before converting it into an MPG. The crucial insight here is that any check or equality node of degree larger than 3 in the Forney-style representation of the Tanner graph can be split up into multiple smaller nodes of degree 3 by iteratively applying the identities in Figure 11. As such, the maximal degree of the pre-processed factor graph is at most 3, and hence, $N(\mathcal{G}) \le 2$.

In Figure 12, we exemplify the generation of the efficient MPG representation of $\mathcal{F}_{C,i}$ where $i = 4$ and $C$ is the 7-bit code with parity check matrix

$$ H = \begin{pmatrix} 1 & 1 & 1 & 1 & 0 & 0 & 0 \\ 0 & 0 & 0 & 1 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 & 0 & 1 & 1 \end{pmatrix}. \qquad (62) $$
<figure><img src="image_15.png" /><figcaption>Figure 12: Construction of MPG representation of bit-transmission channel $\mathcal{F}_{C,4}$ of some 7-bit code with tree Tanner graph (left). In the first step, the nodes with degree $> 3$ are split up and the bit $X_4$ is copied with an additional equality node (middle). Unrolling this graph around the root $Z$ provides us with the desired MPG (right). The nodes with degree 2 are removed from the MPG, since they correspond to the trivial trivial channel $F_{\ell,G}$ with $\ell = 1$ and $G = (1)$.</figcaption></figure>

While the pre-processing step guarantees a small constant alphabet size, it increases the number of nodes in the resulting MPG. More concretely, for each (equality or check) node of degree $d > 3$, it is split into $d-2$ nodes of degree 3 each. If we denote by $d_i^{(c)}$ and $d_j^{(v)}$ the degree of the i-th variable node and j-th check node in the original (Forney-style) Tanner graph, we see that the total number of nodes in the pre-processed factor graph is

$$ \sum_{i=1}^{n} \begin{cases} d_i^{(v)} - 2 & \text{if } d_i^{(v)} > 2 \\ 1 & \text{else} \end{cases} + \sum_{j=1}^{m} \begin{cases} d_j^{(c)} - 2 & \text{if } d_j^{(c)} > 2 \\ 1 & \text{else} \end{cases} \leq \sum_{i=1}^{n} d_i^{(v)} + \sum_{j=1}^{m} d_j^{(c)} = 3n + 2m - 2 \quad (63) $$

where $n$ is the code size, $m$ the number of parity checks in the Tanner graph and we used that the number of internal edges is precisely $n+m-1$. We summarize our discussion as follows.

**Proposition 6.1.** Let $C$ be an $[n, k]$ binary linear code with a tree Tanner graph. For any $i \in \{1, \dots, n\}$, there exists an MPG representation $G$ of the bit-transmission channel $\mathcal{F}_{C,i}$ that has maximum variable dimension $N(G) \le 2$ and $O(n)$ nodes.

## 6.2 Construction from Tanner graph with one cycle

In some situations, an efficient MPG can also be obtained from a Tanner graph that contains only a few cycles. We illustrate this procedure on the simplest case: A Tanner graph with a single cycle. The central idea is that the cycle can be effectively removed from the factor graph by merging certain groups of check and/or equality nodes into a larger node<fnref n="8" />. We depict the procedure in Figure 13. Two nodes (or three nodes at the bottom) are each merged into one single node, depicted in red.

More precisely, we turn the (non-tree) Tanner graph into a tree factor graph representation of the code inclusion function by performing following steps:

1. Every node of degree-2 in the factor graph can be removed and the two neighboring nodes merged using the identities

<figure><img src="image_16.png" /></figure>

Note that the remaining factor graph remains a bipartite graph of equality and check nodes.

<footnote n="8">⁸Merging two or more nodes $v_1, \dots, v_m$ is achieved by replacing them with one node $\bar{v}$ representing the exterior function of the sub-factor graph containing only $v_1, \dots, v_m$ and their connected edges. This merging operation is sometimes called “closing the box” in the Forney-style factor graph nomenclature [22]. It can also be understood as a tensor contraction by interpreting the factor graph as a tensor network. The exterior function of a Forney-style factor graph remains unchanged when some of its nodes are merged.</footnote>
<figure><img src="image_17.png" /><figcaption>Figure 13: Procedure to obtain an efficient MPG from a Tanner graph with one loop. The loopy tanner graph is depicted on the left (only the nodes involved in the loop are shown). With appropriate pre-processing, it can be assumed that all involved nodes have degree three. By pairing up the nodes and merging each pair into one node (see middle), we obtain nodes that are valid for an MPG (see right), i.e., they represent some channel of the form $F_{\ell,G}$.</figcaption></figure>

<figure><img src="image_18.png" /><figcaption>Figure 14: The four different types of merged nodes that can occur in Figure 13.</figcaption></figure>
2. Ensure that all remaining nodes in the graph are of degree 3, by splitting up high-degree nodes using the identity in Figure 11. For nodes that are involved in the cycle, this has to be done specifically in a way such that the cycle remains alternating between equality nodes and check nodes.

3. Merge the nodes involved in the cycle as depicted in Figure 13.

Steps 1 and 2 ensure that the cycle in the factor graph only contains degree-3 nodes, alternating between equality and check nodes. After the merging in step 3, the resulting factor graph now contains new node types (besides check and equality nodes). We exhaustively enumerate the types of possible nodes in Figure 14. To verify that the resulting tree graph is a valid MPG, we simply have to verify that each of these possible nodes does represent a channel of the form $F_{\ell,G}$ for some $\ell, G$.<fnref n="9" /> We show this for each node type separately. In the following, we choose the order of bits to be left-to-right according to Figure 14.

(A) This node encodes $\ell = 2$ bits $z_1, z_2$ into $(z_1 \| z_2)^T G_A$ where

$$G_A = \begin{pmatrix} 1 & 1 & 0 & 0 \\ 0 & 0 & 1 & 1 \end{pmatrix}. \qquad (64)$$

(B) This node encodes $\ell = 2$ bits $z_1, z_2$ into $(z_1 \| z_2 \| r)^T G_B$ where $r \in \mathbb{F}_2^2$ is uniformly random and

$$G_B = \begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 1 & 1 & 0 & 0 \\ 0 & 0 & 1 & 1 \end{pmatrix}. \qquad (65)$$

(C) This node encodes $\ell = 2$ bits $z_1, z_2$ into $(z_1 \| z_2)^T G_C$ where

$$G_C = \begin{pmatrix} 1 & 1 & 0 \\ 0 & 1 & 1 \end{pmatrix}. \qquad (66)$$

(D) This node encodes $\ell = 2$ bits $z_1, z_2$ into $(z_1 \| z_2 \| r)^T G_D$ where $r \in \mathbb{F}_2$ is uniformly random and

$$G_D = \begin{pmatrix} 1 & 0 & 0 \\ 0 & 0 & 1 \\ 1 & 1 & 1 \end{pmatrix}. \qquad (67)$$

Our result can be summarized as follows.

**Proposition 6.2.** Let $\mathcal{C}$ be an $[n, k]$ linear code with a Tanner graph containing one cycle. For any $i \in \{1, \dots, n\}$, there exists an MPG representation $\mathcal{G}$ of the bit-transmission channel $\mathcal{F}_{C,i}$ that has maximum variable dimension $N(\mathcal{G}) \le 4$ and $\mathcal{O}(n)$ nodes.

We note that for Tanner graphs with multiple cycles, the “cycle removal” procedure could in principle be repeated multiple times to obtain a tree factor graph representation of the code inclusion function. However, proving that the fused nodes remain valid MPG nodes while controlling the maximum variable dimension is more involved. Characterizing the cases where this remains possible is an interesting open research direction for future work.

## 6.3 Construction from trellis representation

We now discuss how to construct MPGs from classical linear codes that exhibit an efficient trellis representation. For now, we will restrict our attention to trellises that have only binary labels (i.e. either 0 or 1) on their edges, as opposed to possibly longer bit strings. In the notation of Section 2.3, this means $\ell_i = 1$ for all $i$. We will come back to the general case towards the end of this section.

<footnote n="9">⁹Note that all other nodes in the graph are equality and check nodes, and therefore already covered by the discussion in Section 6.1.</footnote>
<figure><img src="image_19.png" /><figcaption>Figure 15: Structure of a Forney-style factor graph which was derived from a trellis and which represents the code inclusion function $I_C$.</figcaption></figure>

Consider some trellis representation $T = (V, E)$ of some binary linear code $C \subset \mathbb{F}_2^n$ with binary labels. There exists a well-known procedure to generate a factor graph from $T$ of the form of Figure 15 that represents the code inclusion function $I_C$ [22]. Each external edge $X_i$ is connected to a distinct factor $f_i$ for $i = 1, \dots, n$. The factor graph also contains internal variables $S_j$ for $j = 1, \dots, n-1$ connecting the factors $f_j$ and $f_{j+1}$. The alphabet size of $S_j$ is given by state space size at the j-th level, i.e., $|V_j|$ in the notation of Section 2.3. The factor nodes are defined as

$$f_i(s_{i-1}, x_i, s_i) := \begin{cases} 1 & \text{if there exists an edge } e \in E \text{ connecting the } s_{i-1}\text{-th node} \\ 0 & \text{in } V_{i-1} \text{ to the } s_i\text{-th node in } V_i \text{ with label } \lambda(e) = x_i, \end{cases} \quad (68)$$

A detailed discussion of this construction, including a detailed explanation why the resulting factor graph describes the code inclusion function $I_C$, is not necessary for our purposes, and we refer interested readers to [22]. The Viterbi [2] and BCJR [3] algorithms, the standard trellis-based decoders in classical coding theory, can both be seen as some variation of belief propagation on this factor graph [22, 30]. Naturally, one may attempt to attempt to base the MPG for BPQM off of the same factor graph. Unfortunately, this is generally not possible, as the not every trellis-induced factor graph representing $I_C$ will be suitable for our procedure to generate MPGs, since the individual nodes generally do not represent channels of the form $F_{\ell,G}$.

However, similar to factor graph representations, any one code has a multitude of trellis representations, some being more efficient than others. It turns out that the construction of an MPG is always possible if we focus on one specific family of trellis representations, namely, trellises constructed from a “minimal-span generator matrix” (MSGM, also called “trellis-oriented generator matrix”). These MSGM-derived trellises have been extensively studied in literature [31–33], since they are optimal in a multitude of notions. For example, they minimize the state space size of the trellis at every position [33, Theorem 5.1] (in fact, they are the unique optimum up to isomorphism). It should also be noted that an MSGM of a code can always be found efficiently (see e.g. [32, Section IV.C] or [33, Section VI]).

In the following, we will now explain how a MPG for the bit-transmission channel can be constructed from an MSGM of a code. In order to simplify and shorten the exposition as much as possible, we will not explain the construction of the MSGM-derived trellis from the MSGM itself; instead we will directly show how the MPG can be obtained from the MSGM, skipping the intermediate trellis. We start by summarizing the definition and a few results about MSGMs.

**Definition 6.1 (Span).** Consider a nonzero vector $x \in \mathbb{F}_2^n$. The left index $L(x)$ is defined as the smallest index $i \in \{1, \dots, n\}$ such that $x_i \neq 0$, and similarly, the right index $R(x)$ is defined as the largest index $j \in \{1, \dots, n\}$ such that $x_j \neq 0$. The span of $x$ is the discrete interval $(L(x), L(x)+1, \dots, R(x))$. The span length of $x$ is the number of elements in its span.

**Definition 6.2 (Minimal-span generator matrix).** The span length of a generator matrix $G \in \mathbb{F}_2^{k \times n}$ for some $[n, k]$ binary linear code is defined as the sum of the span lengths of its rows. A generator matrix of a code that achieves the minimal spanlength is called a minimal-span generator matrix (MSGM).

**Lemma 6.1.** [33, Theorem 6.11] A generator matrix $G$ is an MSGM if and only if it fulfills the LR property, i.e., the i-th and j-th rows $g_i, g_j$ of $G$ fulfill $L(g_i) \neq L(g_j)$ and $R(g_i) \neq R(g_j)$ when $i \neq j$.

Given a generator matrix $G$ of some $[n, k]$ binary linear code $C$ fulfilling the LR property, we can construct a factor graph representation of $I_C$ using the following procedure below. As an example, the
<figure><img src="image_20.png" /><figcaption>Figure 16: Construction of Forney-style factor graph describing the code inclusion $I_C$ for the [7, 4] Hamming code. The color indicates to which row of the MSGM an equality node is associated to. The gray boxes show which nodes are combined into the factors $f_1, \dots, f_7$.</figcaption></figure>

procedure is illustrated in Figure 16 for the Hamming code with MSGM

$$G = \begin{pmatrix} 1 & 1 & 1 & 0 & 0 & 0 & 0 \\ 0 & 1 & 1 & 0 & 1 & 1 & 0 \\ 0 & 0 & 1 & 1 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 & 1 & 1 & 1 \end{pmatrix}. \qquad (69)$$

1. Introduce a parity check node for every bit, denoted by $c_1, \dots, c_n$. For each $i$, connect $c_i$ to an external edge corresponding to $X_i$.

2. For $j = 1, \dots, k$:

* Let $g_j$ be the $j$-th row of $G$.

* For $i = L(g_j), \dots, R(g_j)$: Introduce an equality node $e_{j,i}$. If $G_{j,i} = 1$, connect this node to $c_i$.

* For $i = L(g_j), \dots, R(g_j) - 1$: connect the nodes $e_{j,i}$ and $e_{j,i+1}$.

3. For every $j = 1, \dots, k$: Combine $c_j$ and all nodes $e_{j,i}$ for any $i$ into one single node.

It is easy to verify that this constructed factor graph has the exterior function

$$x_1, \dots, x_n \mapsto \sum_{u_1, \dots, u_k = 0, 1} I_{u^T G = x^T} \qquad (70)$$

where $I$ is the indicator function, as each row of connected equality nodes $(e_{j,i})_i$ represents a source bit $u_j$. This map is equal to the code inclusion function $I_C$.

To verify that our factor graph induces a valid MPG, we have to check that the individual factor nodes represent channels of the form $F_{\ell,G}$. To this end, the LR property of $G$ is very important: It implies that at every codeword bit check node, there may be at most one source bit from the left and at most one source bit from the right “terminating” at that node. Hence, we can categorize four different configurations (according to the number of “terminating bits”), which are depicted in Figure 17. There is also another difficulty to consider: Contrary to the Tanner graph-derived MPG, the factor nodes here are not symmetric under permutation of the edges. As such, we have to make sure that the nodes represent valid encoding channels for all relevant configurations of edge directions. Concretely, there are three possible configurations, which are depicted in Figure 18.

In total, there are thus $4 \cdot 3 = 12$ different cases, and for each one, we have to verify that the factor represents a valid channel $F_{\ell,G}$ for some $\ell$ and $G$. We now do this by enumerating all these possible cases. Note that situations A) and B) are symmetric to each other, so it will suffice to only consider A) and C). Furthermore, as in Figure 17, let $\alpha$ and $\beta$ denote the number of equality nodes that are involved in a factor nodes, which are not connected, respectively connected, to the check node. In the following, $I_n$ denotes the $n \times n$ identity matrix and $\vec{1}_n$ denotes the column vector of size $n$ containing only the entry
<figure><img src="image_21.png" /><figcaption>Figure 17: In an MSGM-derived trellis, we can categorize the factor nodes into four different categories, depending on whether there are zero or one “terminating” bits coming from the left and from the right. We denote these four cases i) ii) iii) and iv). Furthermore, we denote by $\alpha$ and $\beta$ the number of equality nodes in that are not connected, or respectively are connected, to the check node. In the depicted examples, $\alpha = \beta = 2$.</figcaption></figure>

<figure><img src="image_22.png" /><figcaption>Figure 18: When translating a trellis-induced factor graph, as depicted in Figure 15, into an MPG, the orientation of the edges connected to some factor node can only be one of three possible configurations, which we denote A), B) and C).</figcaption></figure>

1. Furthermore, in reference to Figure 17, the order of the bits is always chosen as follows: First, the bits corresponding to open edges on the left (top-to-bottom), then the bits corresponding to open edges on the right (top-to-bottom), and then the bit corresponding to the open edge at the bottom

Ai) This node encodes $l = \alpha + \beta$ bits $z \in \mathbb{F}_2^{\alpha+\beta}$ into $z^T G$ where

$$G = \begin{pmatrix} I_{\alpha} & 0 & 0 \\ 0 & I_{\beta} & \vec{1}_{\beta} \end{pmatrix}. \qquad (71)$$

Aii) This node encodes $l = \alpha + \beta$ bits $z \in \mathbb{F}_2^{\alpha+\beta}$ into $(z||r)^T G$ where $r \in \mathbb{F}_2$ is uniformly random and

$$G = \begin{pmatrix} I_{\alpha} & 0 & 0 \\ 0 & I_{\beta+1} & \vec{1}_{\beta+1} \end{pmatrix}. \qquad (72)$$

Aiii) This node encodes $l = \alpha + \beta + 1$ bits $z \in \mathbb{F}_2^{\alpha+\beta+1}$ into $z^T G$ where

$$G = \begin{pmatrix} I_{\alpha} & 0 & 0 \\ 0 & I_{\beta} & \vec{1}_{\beta} \\ 0 & 0 & 1 \end{pmatrix}. \qquad (73)$$

Aiv) This node encodes $l = \alpha + \beta + 1$ bits $z \in \mathbb{F}_2^{\alpha+\beta+1}$ into $(z||r)^T G$ where $r \in \mathbb{F}_2$ is uniformly random and

$$G = \begin{pmatrix} I_{\alpha} & 0 & 0 & 0 \\ 0 & I_{\beta} & 0 & \vec{1}_{\beta} \\ 0 & 0 & 0 & 1 \\ 0 & 0 & 1 & 1 \end{pmatrix}. \qquad (74)$$
Ci) This node encodes $l = 1$ bit $z$ into $(z\|r)^T G$ where $r \in \mathbb{F}_2^{\alpha+\beta-1}$ is uniformly random and

$$ G = \begin{pmatrix} 0 & 1 & 0 & 0 & 1 & 0 \\ 0 & \vec{1}_{\beta-1} & I_{\beta-1} & 0 & \vec{1}_{\beta-1} & I_{\beta-1} \\ I_{\alpha} & 0 & 0 & I_{\alpha} & 0 & 0 \end{pmatrix}. \qquad (75) $$

Cii) This node encodes $l = 1$ bit $z$ into $(z\|r)^T G$ where $r \in \mathbb{F}_2^{\alpha+\beta}$ is uniformly random and

$$ G = \begin{pmatrix} 0 & 1 & 0 & 0 & 1 & 0 & 0 \\ 0 & \vec{1}_{\beta-1} & I_{\beta-1} & 0 & \vec{1}_{\beta-1} & I_{\beta-1} & 0 \\ I_{\alpha} & 0 & 0 & I_{\alpha} & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 & 1 & 0 & 1 \end{pmatrix}. \qquad (76) $$

Ciii) This node encodes $l = 1$ bit $z$ into $(z\|r)^T G$ where $r \in \mathbb{F}_2^{\alpha+\beta}$ is uniformly random and

$$ G = \begin{pmatrix} 0 & 1 & 0 & 0 & 0 & 1 & 0 \\ 0 & \vec{1}_{\beta-1} & I_{\beta-1} & 0 & 0 & \vec{1}_{\beta-1} & I_{\beta-1} \\ I_{\alpha} & 0 & 0 & 0 & I_{\alpha} & 0 & 0 \\ 0 & 1 & 0 & 1 & 0 & 1 & 0 \end{pmatrix}. \qquad (77) $$

Civ) This node encodes $l = 1$ bit $z$ into $(z\|r)^T G$ where $r \in \mathbb{F}_2^{\alpha+\beta+1}$ is uniformly random and

$$ G = \begin{pmatrix} 0 & 1 & 0 & 0 & 0 & 1 & 0 & 0 \\ 0 & \vec{1}_{\beta-1} & I_{\beta-1} & 0 & 0 & \vec{1}_{\beta-1} & I_{\beta-1} & 0 \\ I_{\alpha} & 0 & 0 & 0 & I_{\alpha} & 0 & 0 & 0 \\ 0 & 1 & 0 & 1 & 0 & 1 & 0 & 0 \\ 0 & 1 & 0 & 0 & 0 & 1 & 0 & 1 \end{pmatrix}. \qquad (78) $$

We summarize the result of our construction as follows.

**Proposition 6.3.** Let $C$ be an $[n, k]$ binary linear code that exhibits a trellis representation $T$ with binary labels and maximal state space size$^{10}$ $S$. For any $i \in \{1, \dots, n\}$, there exists an MPG representation $G$ of the bit-transmission channel $F_{C,i}$ that has maximum variable dimension $N(G) \le 2 \log S$ and $n$ nodes.

*Proof.* Consider an MSGM $G'$ of some arbitrary binary linear $[n', k']$ code $C'$. Let's denote the rows of $G'$ by $g_1, \dots, g_{k'}$ and define $A_i(G') := \{j \in \{1, \dots, k'\} | i \in \text{span}(g_j)\}$ for $i = 1, \dots, n'$. Then, define $\beta_i(G)$ to be the cardinality of the set $A_i(G') \cap A_{i+1}(G')$. We use following two facts and refer to literature for the proofs:

* The trellis derived from $G'$ has state space $2^{\beta_i(G')}$ in the $i$-th layer of the trellis [33, Theorems 7.2 and 7.4].

* No trellis representation of $C'$ has a state space size at the $i$-th layer which is smaller than $2^{\beta_i(G')}$ [33, Theorem 5.1].

Now, let $G$ be an MSGM for the given code $C$. We can conclude that $\beta_i(G) \le \log S$ for all $i$.

Consider the factor graph constructed from $G$, as described by Figure 16. Notice that the resulting external edges have alphabet size 2, whereas the $i$-th internal edge has alphabet size $2^{\beta_i(G)}$. By the previous considerations, we can utilize this factor graph to construct an MPG by Procedure 6.1. The largest possible value of $n_v$ can be achieved by setting $C$ in Figure 18. We conclude that $N(G) \le 2 \max_i \beta_i(G)$. $\square$

Up to now, we have only considered trellises with binary labels on each edge, and therefore, each node in the factor graph (as in Figure 15) was connected to only one single external (binary) edge. However, it is sometimes possible to obtain more efficient trellises by allowing edge labels with multiple

<footnote>$^{10}$In the notation of Section 2.3, $S := \max_i |V_i|$.</footnote>
<figure><img src="image_23.png" /><figcaption>Figure 19: Encoding diagram for the $G = 13/15$ binary systematic recursive convolutional code. $x^s$ and $x^p$ denote the systematic bit and parity bit. The square boxes depict delay elements and correspond to the $m = 3$ bits of memory in the encoder.</figcaption></figure>

bits. This is nicely exemplified in Figure 5, where combining the fourth and fifth bits reduces the maximal state space from $S = 8$ to $S = 4$.

An optimal trellis (in terms of maximal state space size) with longer edge labels can always be obtained from the MSGM-derived trellis by merging subsequent trellis stages together.<fnref n="11" /> In terms of the factor graph picture in Figure 5, this corresponds to merging neighboring nodes in the factor graph. The resulting factor graph can therefore have more than one external edge connected to any node. It is easy to verify that the resulting factor graph still produces a valid MPG when processed with Procedure 6.1. Indeed, this follows from the fact that the concatenation of $F_{\ell_2,G_2} \circ F_{\ell_1,G_1}$, where $F_{\ell_2,G_2}$ acts on a subset of the output bits of $F_{\ell_1,G_1}$, is again a channel of the form $F_{\ell',G'}$ for some $\ell'$ and $G'$.

**Corollary 6.1.** Let $C$ be an $[n,k]$ binary linear code and $T$ a trellis representation of $C$ with maximum state space size $S$ and where the length of the label bit strings is $\le L$. For any $i \in \{1, \dots, n\}$ there exists an MPG representation $G$ of the bit-transmission channel $F_{C,i}$ that has maximum variable dimension $N(G) \le 2\log S + (L-1)$ and $n$ nodes.

To illustrate the trellis-based MPG construction, we now consider a simple convolutional codes as example.

**Example: $G = 13/15$ binary systematic recursive convolutional code** We illustrate the trellis-based MPG construction on the $G = 13/15$ binary systematic recursive convolutional code. For this example, it will prove a bit simpler and less verbose to not explicitly work out the MSGM of the code, and instead directly construct the MSGM-derived trellis as in Figure 16. The MSGM could then be inferred from that factor graph, if desired.

For this example, we will assume basic familiarity with the theory of convolutional codes. The 13 corresponds to the feedforward polynomial $p(D) = 1+D+D^3$ and 15 corresponds to the feedback polynomial $q(D) = 1+D^2+D^3$. The encoding diagram for this convolutional code is depicted in Figure 19. This convolutional code has $m = 3$ bits of memory, and therefore, it exhibits a trellis representation with a state space size of $2^3 = 8$. The convolutional encoder implicitly describes the state transition map $T$

$$ (x^s, s) \mapsto T(x^s, s) = (x^p, s') \qquad (79) $$

which describes how the input systematic bit $x^s$ at time $t$ and the state $s$ at time $t-1$ are mapped to the output parity bit $x^p$ at time $t$ and the state $s'$ at time $t$. Since we have three memory bits, we have $s, s' \in \mathbb{F}_2$. A circuit representation of the transition map $T$ is given in Figure 20a. In Figure 20b, we translate this circuit into a factor graph representation of this transition function, i.e., a Forney-style factor graph with exterior function

$$ x^s, s, x^p, s' \mapsto I_{T(x^s, s)}(x^p, s') = \begin{cases} 1 & \text{if } T(x^s, s) = (x^p, s') \\ 0 & \text{otherwise} \end{cases} \qquad (80) $$

The code inclusion function of the convolutional code $C$ can be written as

$$ I_C(x_1^s, x_1^p, x_2^s, x_2^p, x_3^s, x_3^p, \dots) = \sum_{s_1, s_2, s_3, \dots \in \mathbb{F}_2^3} I_{T(x_1^s, 0)}(x_1^p, s_1) I_{T(x_2^s, s_1)}(x_2^p, s_2) I_{T(x_3^s, s_2)}(x_3^p, s_3) \dots \qquad (81) $$

<footnote n="11">¹¹This follows from the fact that the optimal trellis state space size at any given layer only depends on the “past” and “future” codes at this point — see [31, Appendix A] for a detailed discussion.</footnote>
<figure><img src="image_24.png" /></figure>

<figure><img src="image_25.png" /><figcaption>Figure 20: Graphical representation of the state transition map $T$ of the $G = 13/15$ convolutional code, as a circuit diagram (a) and as a Forney-style factor graph (b).</figcaption></figure>

<figure><img src="image_26.png" /><figcaption>Figure 21: Forney-style factor graph representation of the $G = 13/15$ binary systematic recursive convolutional code. Here, $X_i^s$ and $X_i^p$ are the variables representing the $i$-th systematic bit and the $i$-th parity bit. Each color corresponds to a row of the MSGM. By grouping together the nodes of each gray box, one can obtain an MPG representation of the bit-transmission channels with maximum variable dimension of 3.</figcaption></figure>

which implies that by “gluing” together repeated copies of the factor graph in Figure 20b, we can obtain a factor graph representation of the code inclusion function $I_c$, which is depicted in Figure 21. If we pick the order of the codeword bits to be $x_1^s, x_1^p, x_2^s, x_2^p, x_3^s, x_3^p, \dots$ where $x_i^s, x_i^p$ are the $i$-th systematic and parity bit, this factor graph takes exactly the form of an MSGM-derived factor graph, i.e., at each check node there is at most one “terminating” edge coming from either side. By running the construction in reverse, one could also retrieve a valid MSGM from this factor graph. More importantly, because of the previous discussion in this section, we can turn this factor graph into an MPG for each bit-transmission channel using Procedure 6.1 such that the resulting MPG has a maximum variable dimension of 4. If we group the two neighboring factors corresponding to $x_i^s$ and $x_i^p$ together for each $i$, as depicted by the gray boxes in Figure 21, then the maximum variable dimension can be reduced to 3.

We note that Figure 21 only depicts the “bulk” of the factor graph which exhibits the depicted repeated pattern. Special care has to be taken when constructing the MPG nodes of the first few and the last few codeword bits, as the exact behavior of the MSGM will depend on the exact details of the initialization and termination procedure of the convolutional code.

# 7 BPQM decoding of turbo codes

Previously, in Section 5, we saw that BPQM achieves bit-optimal and block-optimal decoding for codes where an efficient MPG representation of the bit-transmission channels is available. Later, in Section 6, we saw that such efficient MPG representations can be constructed for various code families which exhibit some efficient tree factor graph representation, such as a tree Tanner graph or a trellis with small state space size. Unfortunately, many of the best performing classical codes do not exhibit such a tree-
<figure><img src="image_27.png" /><figcaption>Figure 22: Forney-style factor graph representation of the code inclusion function of a parallel concatenated rate-1/3 turbo code of blocksize $n$. Here $X_i^s$ denotes the $i$-th systematic bit and $X_i^{p_1}, X_i^{p_2}$ denote the $i$-th parity bits. The blue nodes at the top and at the bottom each correspond to the factor graph representation of the constituent convolutional code.</figcaption></figure>

like structure. Fortunately, this doesn't necessarily imply that BPQM cannot be effective in decoding these codes — some simple modifications to the decoding procedure can be sufficient in order to successfully apply BPQM. However, as a consequence of these modifications, the bit- and block-optimality arguments from Section 5 are not applicable in these settings and the performance of BPQM must be characterized on a case-by-case basis.

In previous works, such BPQM-based decoding beyond tree factor graphs was considered for polar codes [10] and LDPC codes [13]. The main trick to apply BPQM to polar codes is the realization that the factor graph induced by successive cancellation decoding is a tree, which can therefore be translated into an MPG. A quantum version of the polarization argument [34], together with the quantum union bound [35], then suffice to prove that BPQM-based decoding can achieve the Holevo capacity.

The BPQM-based decoding procedure for LDPC codes is more closely related to the techniques we will later consider in this section. While LDPC codes do not exhibit a tree-like structure, they can be seen as being *locally* tree-like. More formally, in the limit of large block sizes, the environment of a codeword bit in the Tanner graph is almost certainly a tree. As such, the computation graph associated to a message-passing decoder that is truncated to a finite number of steps will not encounter any loops in the asymptotic limit, which enables us to translate this computation graph to an MPG and run BPQM on it. The asymptotic performance of BPQM on regular LDPC codes was investigated using density evolution in [13].

In this section, we will extend the applicability of BPQM to another family of binary linear codes which do not exhibit a tree factor graph structure: turbo codes. These codes exhibit excellent performance for classical channel coding and they closely approach the Shannon limit [18]. In this section, we will show that they also approach the Holevo limit in classical-quantum channel coding when paired with BPQM. For simplicity, we will restrict our attention to parallel concatenated turbo codes without puncturing, i.e., with rate 1/3. We refer the reader to [19] for a precise definition of these codes, and from now on, we will assume basic familiarity with turbo codes. We depict the Forney-style factor graph structure of such a code in Figure 22. It essentially consists of two copies of the factor graph of the constituent convolutional code which are interleaved with a random permutation. Furthermore, we will only focus on the task of bit decoding on these turbo codes. To lift the results from bit error rates to block error rates, one can use the quantum union bound [35] (which is applicable because of Lemma 5.1), provided that the bit error rates are sufficiently small.

The general strategy for decoding turbo codes with BPQM is similar as for LDPC codes, namely, a truncated message-passing decoder is executed for a finite number of iterations. More concretely, we employ a *windowed* message passing schedule, parametrized by a window size $w \in \mathbb{N}$ and the number of steps $l \in \mathbb{N}$. The schedule operates as follows: To decode a given systematic bit, messages are required from both the upper and lower constituent convolutional codes. Each of these messages is computed by performing BPQM on the corresponding trellis within a symmetric window of size $w$, that is, by
restricting the message passing to the w trellis sections to the left as well as to the right of the target bit. The resulting messages for the neighboring 2w systematic bits are obtained in the same way, by running local windowed decoding on the opposite constituent code. This process is iterated l times, enabling information to propagate gradually between the two trellises through the interleaver while keeping the decoding complexity bounded. For a more detailed explanation of windowed decoding, we refer to [19, Sections 6.4]. We note that for each trellis section, we need to choose some initial message at the boundaries of the window. We choose the value of that message to be associated with the completely information-destroying channel spsc[P₀] where P₀ is the m-bit distribution with P₀(0^m) = 1 and m is the number of memory cells in the convolutional code. This mirrors the classical strategy, where these messages are typically initialized as the uniform distribution.

The computation tree resulting from such a windowed decoder is asymptotically tree-like, i.e., the probability that it contains a loop converges to zero as the block size of the code goes to infinity. As such, the computation tree can be converted to a MPG by the considerations in Section 2.3. One can characterize the asymptotic performance of BPQM by density evolution, i.e., by tracking the distribution of the classical part of the messages that are transmitted by incoherent BPQM over this MPG. For a more detailed explanation of density evolution on turbo codes, we refer to [19, Sections 6.4].

We numerically implement density evolution for various parallel concatenated rate-1/3 turbo codes with the constituent convolutional codes parametrized by the rational function G(D) = p(D)/q(D). More concretely, we consider the three code families G = 5/7, G = 13/15 and G = 23/33 where the polynomials p, q are denoted in standard octal notation. These codes have memory size m = 2, m = 3 and m = 4 respectively. We will assume that the codeword bits are transmitted over independent copies of the binary-input pure-state channel W_ω := spsc[1/2 - √ω(1-ω)] for some parameter ω ∈ [0, 1/2]. This parametrization is natural, because W_ω acts, up to a unitary basis change on its output, as

$$W_{\omega}(x) = \sqrt{1-\omega}|x\rangle + \sqrt{\omega}|1-x\rangle \quad (82)$$

for x ∈ F₂. Therefore, by performing the optimal distinguishing measurement on the output of W_ω(x), it degrades to the binary symmetric channel bsc_ω with error probability of ω. The amount of information that can be transmitted over W_ω using a classical decoding strategy is precisely characterized by the Shannon bound of bsc_ω, whereas a truly quantum decoder (such as BPQM) can surpass that Shannon bound and achieve rates up to the Holevo bound of W_ω.

To numerically perform density evolution, we utilize the Monte Carlo density evolution technique described in [13]. We fix the parameters l = 200 and w = 200 and utilize a population size of 10000. In Figure 23, we depict the expected bit error rate associated with the decoding of a systematic bit for each of our three chosen turbo code families. The points where the lines reach 0 indicate the location of the BPQM thresholds on the corresponding code families. We summarize the estimated thresholds in Table 1. Observe that all three code families exhibit a threshold that clearly exceeds the Shannon bound. Furthermore, the thresholds lie close to the Holevo bound.

## Acknowledgements

We thank André Chailloux, Anthony Leverrier, Avijit Mandal, Henry Pfister, and Jean-Pierre Tillich for insightful discussions. CP acknowledges financial support from the Swiss National Science Foundation (SNSF) Postdoc.Mobility fellowship P500PT_230724. JMR acknowledges support from the SNF under grant number 20QU-1_225224 as well as the ETH Quantum Center and the SNF NCCR SwissMAP.
<figure><img src="image_28.png" /><figcaption>Figure 23: Asymptotic bit error rates of BPQM for various rate-1/3 parallel concatenated turbo codes obtained from density evolution. The red vertical lines depict the Shannon and Holevo bounds which characterize the maximal tolerable noise rates $\omega$ at which reliable transmission is possible with rate 1/3 over BSC$_{\omega}$ and $W_{\omega}$ respectively.</figcaption></figure>

## A Formal definition of discretized incoherent BPQM

Here, we provide a formal version of Definition 4.8. In order to obtain a discretized BPQM algorithm valid in a model of computation without the capability to store arbitrary real numbers with infinite accuracy, we modify incoherent BPQM in two ways.

First, the classical part of the messages is replaced with an approximate discretized representation thereof, as described in the main text. For convenience, define the values that are representable with a B-bit fixed-point representation:

$$ \mathcal{Q}_B := \left\{ \frac{i}{2^B} \mid i = 0, \dots, 2^B - 1 \right\} \subset [0, 1). \qquad (83) $$

We will assume that basic operations (addition, multiplication, division, square root, arcsin) of elements in $\mathcal{Q}_B$ can be performed in poly($B$) complexity. Then, we denote the set of discretized $m$-bit distributions by

$$ \mathcal{D}_{B,m} := \left\{ p : \mathbb{F}_2^m \to \mathcal{Q}_B \mid \sum_{x \in \mathbb{F}_2^m} p(x) = 1 \right\}. \qquad (84) $$

Hence, an element $p \in \mathcal{D}_{B,m}$ can be represented using a $2^m B$-bit string. For convenience, we will often treat elements of $\mathcal{D}_{B,m}$ interchangeably as elements of $\mathbb{F}_2^{2^m B}$, e.g., $|p\rangle$ is understood as a computational basis state of a $2^m B$-qubit register. For convenience, we will also define a rounding function $r_{B,m}$ which maps an $m$-bit distribution $p$ to the (or one of the) closest element in $\mathcal{D}_{B,m}$. It generally holds that

$$ \|r_{B,m}(q) - q\|_1 \le 2^{m-B} \qquad (85) $$

for any $m$-bit distribution $q$ [36, Lemma 3].

Second, for the primitive node operation applied within each node operation, we need an efficient procedure to construct an efficient circuit that is a good approximation to the desired unitary. This is possible, as captured by the following lemma.

**Lemma A.1.** Consider some instance SDT($n, k, \ell, G, P$) and $B \in \mathbb{N}$. Let $Q$ be an $n$-qubit register and $E$ a $2^n B$-qubit register. We construct an explicit quantum circuit $C$ on $QE$ such that

* $C$ only contains unitary operations,

* $C$ implements the operation

$$ \sum_{\tilde{P} \in \mathcal{D}_{B,n}} \mathrm{PNO}(n, k, \ell, G, P'(\tilde{P}))_Q \otimes |\tilde{P}\rangle\langle\tilde{P}|_E, \qquad (86) $$
where for any $\tilde{P} \in \mathcal{D}_{B,n}$, $P'(\tilde{P})$ is some $n$-bit distribution such that $\|P'(\tilde{P}) - \tilde{P}\|_1 \le (\pi + 1)2^{n-B}$,

* $C$ has circuit complexity $\mathcal{O}(\text{poly}(B)4^n n^2)$.

Here, we perform the operations conditional on the classical distribution coherently. This will be useful in Appendix B. We note this statement is not entirely trivial, as a naive implementation of the gate $\sum_{\tilde{p}}$ PNO($n, k, \ell, G, \tilde{P}) \otimes |\tilde{P}\rangle\langle\tilde{P}|$ would have a complexity exponential in $2^n B$. The proof, including the explicit circuit construction, of this lemma is provided at the end of this section. We now formally define discretized incoherent BPQM in full analogy to Definition 4.3 and Definition 4.4.

**Definition A.1 (Discretized node operation).** Consider a node $v$ of some MPG and some fixed $B \in \mathbb{N}$.

- **INPUT:** For each outgoing edge $e_i^{\text{out}}(v)$, $i = 1, \dots, m_v$: a message consisting of an $n_{e_i^{\text{out}}(v)}$-qubit system $Q_{e_i^{\text{out}}(v)}$ and a discretized distribution $P_{e_i^{\text{out}}(v)} \in \mathcal{D}_{B,n_{e_i^{\text{out}}(v)}}$.

- **OUTPUT:** An $n_{\text{in}}(v)$-qubit system $Q_{\text{in}}$ and a discretized distribution $P_{\text{in}} \in \mathcal{D}_{B,n_{\text{in}}(v)}$.

- **ALGORITHM:** Denote the joint $n_v$-qubit quantum system $\tilde{Q} := \bigotimes_{i=1}^{m_v} Q_{e_i^{\text{out}}(v)}$.

1. Compute and store the joint distribution $\tilde{P} := r_{B,n_v}(P_{e_1^{\text{out}}(v)} \times P_{e_2^{\text{out}}(v)} \times \cdots \times P_{e_{m_v}^{\text{out}}(v)})$.

2. Prepare a $2^{n_v}$-B-qubit quantum register F in the state $|\tilde{P}\rangle_F$ and apply the quantum circuit from Lemma A.1 on $\tilde{Q}$ and F. Partition the resulting quantum system $\tilde{Q}$ into three parts $Q_1 \otimes Q_2 \otimes Q_3$ consisting of $\ell_v$, $(k_v - \ell_v)$, $(n_v - k_v)$ qubits each.

3. Measure $Q_2$ in the computational basis, obtaining the result $s$.

4. Define $P_{Y,S,A}(y, s, a) := \tilde{P}(M^{-1}(y \| s \| a))$ using the $n_v \times n_v$ matrix $M$ from the primitive node operation. Compute and store the distribution $P' := r_{B,\ell_v}(P_{Y|S=s})$.

5. Output the quantum system $Q_1$ and the distribution $P'$.

**Definition A.2 (Discretized incoherent BPQM algorithm).** Consider an instance SDT($n, k, \ell, G, P$) where the associated channel $W$ can be written as $W = W[G, P]$ for some MPG $G$ and a sequence of probability distributions $P = (P_i)_{i=1,...,m}$. Also, let $B \in \mathbb{N}$.

- **INPUT:** An $n$-qubit quantum system denoted $Q$ in the state $W(x)$, where $x \in \mathbb{F}_2^\ell$.

- **OUTPUT:** An estimate $\hat{x} \in \mathbb{F}_2^\ell$ for $x$.

- **ALGORITHM:** Let us denote the root edge of $G$ by $e^*$. Partition the quantum system into subsystems $Q = \bigotimes_{i=1}^m Q_i$ where $Q_i$ corresponds to the output of SPSC[$P_i$]. Accordingly denote the leaf edges of $G$ by $e_1, \dots, e_m$.

1. For $i = 1, \dots, m$, fix the message associated with the edge $e_i$ to be the quantum system $Q_i$ together with the discretized distribution $r_{B,n_{e_i}}(P_i)$.

2. Proceeding from leaves to root, perform node operations according to Definition A.1, with $B$, until all edges have an associated message.

3. Apply the Hadamard transform $H^{\otimes n_e}$ on the quantum system $Q_e$ of the final message.

4. Measure $Q_e$ in the computational basis and set $\hat{x}$ to the resulting measurement outcome.

The complexity of discretized incoherent BPQM is dominated by the node operations. All of the five steps in Definition A.1 each have complexity of $\mathcal{O}(\text{poly}(B)4^{n_v} n_v^2)^{12}$, and hence, the total complexity of discretized incoherent BPQM is $\mathcal{O}(\text{poly}(B)4^{N(G)}N(G)^2|V|)$.

For the rest of this section, our aim is to prove Lemma A.1. The proof uses the following two intermediate results.

**Lemma A.2.** Consider a family of $m$-qubit unitaries $(U_i)_{i \in \mathbb{F}_2^n}$, and assume that for each $i \in \mathbb{F}_2^n$ we are given a unitary circuit that realizes $U_i$ with complexity $\le C$. Then, there exists a circuit implementation of the unitary $\sum_{i \in \mathbb{F}_2^n} U_i \otimes |i\rangle\langle i|$ with complexity $\mathcal{O}(2^n n C)$.

<footnote n="12">¹²The complexity of computing $\tilde{P}$ is at most $2^{n_v} \cdot m_v \cdot \text{poly}(m_v B) = \mathcal{O}(4^{n_v} \text{poly}(B))$ since we are computing the product of $m_v$ $m_v$-B-bit numbers $2^{n_v}$ times. The vector $M^{-1}(y \| s \| a)$ can be computed (exactly) in time $n_v^2$ (respectively $n_v^3$ if the matrix inverse is not computed offline). Therefore, $P_{Y,S,A}$ can be exactly computed and stored in the time $n_v^2$. The computation and storage of $P_S(s)$ and the vector $P_{Y,S}(\cdot, s)$ (for the given $s$) can be done in time $2^{n_v} \text{poly}(B)$ (where the poly($B$) term comes from addition), and importantly, without any discretization errors, since $P_{Y,S} \in \mathcal{D}_{B,k_v}$ and $P_S \in \mathcal{D}_{B,k_v-\ell_v}$. To compute $P'$, it remains to perform $2^{\ell_v}$ divisions, which has complexity $\mathcal{O}(2^{n_v} \text{poly}(B))$.</footnote>
**Proof.** Apply the circuits for $U_1, \dots, U_{2n}$ sequentially, with each gate replaced by an $n$-controlled version of itself. $\square$

**Lemma A.3.** Fix some $B, n \in \mathbb{N}$. There exists a quantum circuit of complexity $\mathcal{O}(4^n n^2 \text{poly}(B))$ which acts as follows: For any $p \in \mathcal{D}_{B,n}$ it maps

$$|p\rangle \otimes |0^n\rangle \mapsto |p\rangle \otimes \left( \sum_{x \in \mathbb{F}_2^n} \sqrt{\tilde{p}(x)} |x\rangle \right) \qquad (87)$$

for some $n$-bit probability distribution $\tilde{p}$ with $\|p - \tilde{p}\|_1 \le \pi n 2^{-B}$.

**Proof.** Let's write the probability distribution as $p = p_{X_1, \dots, X_n}$ where $X_i$ are the $n$ involved bits. For a number $q \in [0, 1]$, let us denote by $r(q)$ the closest (or one of the closest) number in $\mathcal{D}_B$.

We begin by considering the somewhat simpler state preparation problem of realizing a circuit with the action $|0^n\rangle \mapsto \sum_x \sqrt{p(x)} |x\rangle$ for the given $n$-bit distribution $p$. Möttönen et al. proposed a method to perform this task in [37]. The idea is to work sequentially, rotating each subsequent qubit by the correct probability distribution conditioned on all previous qubit values. More precisely, the circuit proceeds by applying the sequence of gates $U_i = V_i \otimes 1^{\otimes n-i}$ for $i = 1, \dots, n$, where $V_i$ is the uniformly controlled rotation gate

$$V_i := - \sum_{z \in \mathbb{F}_2^{i-1}} |z\rangle\langle z| \otimes R_y(\alpha_{i|z_1, z_2, \dots, z_{i-1}}), \qquad (88)$$

with

$$R_y(\theta) := \begin{pmatrix} \cos \frac{\theta}{2} & -\sin \frac{\theta}{2} \\ \sin \frac{\theta}{2} & \cos \frac{\theta}{2} \end{pmatrix} \qquad (89)$$

and

$$\alpha_{i|z_1, \dots, z_{i-1}} := -2 \arcsin \left( \sqrt{p_{X_1|X_1=z_1, X_2=z_2, \dots, X_{i-1}=z_{i-1}}(1)} \right). \qquad (90)$$

Thus, applying $U_1$ yields the state

$$U_1 |0^n\rangle = \left( \sqrt{p_{X_1}(0)} |0\rangle + \sqrt{p_{X_1}(1)} |1\rangle \right) \otimes |0^{n-1}\rangle, \qquad (91)$$

and subsequently applying $U_2$ gives

$$U_2 U_1 |0^n\rangle = \sum_{x \in \mathbb{F}_2^n} \sqrt{p_{X_1, X_2}(x)} |x\rangle \otimes |0^{n-2}\rangle. \qquad (92)$$

A simple induction shows that the desired state is indeed produced after applying all $n$ uniformly-controlled gates $U_i$.

We can now simply adapt this procedure for the more general task in (87). Let us denote the two registers in (87) by A and C. The procedure makes use of an additional B-qubit scratch register E and proceeds as follows. For $i = 1, \dots, n$:

1. Coherently compute the angle $\theta = r(\frac{1}{\pi} \alpha_{i|z_1, \dots, z_{i-1}})$ from the register A, uniformly controlled on the values $z_1, \dots, z_{i-1}$ of the first $i-1$ qubits in C. Store the angle in E.

2. Apply the gate $\sum_{\theta \in \mathcal{D}_B} R_y(\pi \theta)_{C_i} \otimes |\theta\rangle\langle\theta|_E$.

3. Un-compute the register E by repeating the first step.

This procedure prepares the state $|p\rangle_A \otimes \sum_x \sqrt{\tilde{p}(x)} |x\rangle_C$, where $\tilde{p}$ is implicitly defined by

$$\frac{2}{\pi} \arcsin \left( \sqrt{\tilde{p}_{X_1|X_1=z_1, X_2=z_2, \dots, X_{i-1}=z_{i-1}}(1)} \right) = r \left( \frac{2}{\pi} \arcsin \left( \sqrt{p_{X_1|X_1=z_1, X_2=z_2, \dots, X_{i-1}=z_{i-1}}(1)} \right) \right) \qquad (93)$$

for $i = 1, \dots, n$. Since $f(x) = \sin(\frac{\pi}{2}x)^2$ is $(\pi/2)$-Lipschitz continuous, this directly implies that

$$|\tilde{p}_{X_1|X_1=z_1, X_2=z_2, \dots, X_{i-1}=z_{i-1}}(z) - p_{X_1|X_1=z_1, X_2=z_2, \dots, X_{i-1}=z_{i-1}}(z)| \le \frac{1}{2} \pi 2^{-B} \le \pi 2^{-B} \qquad (94)$$
for all $i=1, \dots, n$ and for all $z \in \mathbb{F}_2^n$. Therefore, by the triangle inequality,

$$ \|p - \tilde{p}\|_1 = \sum_{x \in \mathbb{F}_2^n} |p_{X_1, \dots, X_n}(x_1, \dots, x_n) - \tilde{p}_{X_1, \dots, X_n}(x_1, \dots, x_n)| \quad (95) $$

$$ = \sum_{x \in \mathbb{F}_2^n} |p_{X_1}(x_1)p_{X_2|X_1=x_1}(x_2) \cdots p_{X_n|X_1=x_1 \cdots x_{n-1}=x_{n-1}}(x_n) - \tilde{p}_{X_1}(x_1)\tilde{p}_{X_2|X_1=x_1}(x_2) \cdots \tilde{p}_{X_n|X_1=x_1 \cdots x_{n-1}=x_{n-1}}(x_n)| \quad (96) $$

$$ \le \sum_{x_1 \in \mathbb{F}_2} |p_{X_1}(x_1) - \tilde{p}_{X_1}(x_1)| + \sum_{x_1, x_2 \in \mathbb{F}_2} \tilde{p}_{X_1}(x_1) |p_{X_2|X_1=x_1}(x_2) - \tilde{p}_{X_2|X_1=x_1}(x_2)| + \cdots \quad (97) $$

$$ \le \pi n 2^{-B}. \quad (98) $$

It remains to discuss the complexity of realizing the entire operation. The computation of the conditional marginal $P_{X_1|X_1=z_1, \dots, X_{i-1}=z_{i-1}}$ takes $O(4^n \text{npoly}(B))$ time: The $2^n$ additions followed by the division lead to a $2^n \text{poly}(B)$ contribution, and the uniform control on the $i \le n$ qubits in C register contributes a factor of $2^n n$ (see Lemma A.2). Subsequently, the computation of the arcsin of the square root can be done in complexity $O(\text{poly}(B))$. Note that the intermediate step of computing the conditional marginal may require an increase in precision, but no more than a constant increase in working precision will be needed.

Hence, the complexity of Step 1 and Step 3 is $O(4^n \text{npoly}(B))$. Meanwhile, the operation in Step 2 can be realized through a sequence of B controlled-R_y rotations which are controlled on $E_j$ and target $C_i$ for $j = 1, \dots, B$. Its complexity is hence linear in B. The total cost is therefore $O(4^n n^2 \text{poly}(B))$. $\square$

**Proof of Lemma A.1.** As discussed in Definition 3.2, the unitary $PNO(n, k, l, G, P)$ can be decomposed into two parts: $U_1$ and $U_2$. The unitary $U_1$ is static (i.e., it does not depend on the input distribution), so its generation can be done fully offline. The complexity of the circuit of $U_1$ is $O(n^2)$ [38].

It remains to approximate the unitary

$$ \sum_{s, y, \tilde{P}} |y\rangle\langle y|_{Q_1} \otimes |s\rangle\langle s|_{Q_2} \otimes V(y, s, \tilde{P})_{Q_3} \otimes |\tilde{P}\rangle\langle \tilde{P}|_{B}, \quad (99) $$

where we denote by $V(y, s, \tilde{P})$ the unitary $V(y, s)$ from the definition of $U_2$ associated with the primitive node unitary with distribution $\tilde{P}$. We can approximate this unitary with the following steps:

1. Coherently compute $\tau_{B,n-k}(\tilde{P}_{A|Y=y,S=s})$, coherently conditioned on the system $Q_1$ and $Q_2$ being in the state $|y\rangle_{Q_1} \otimes |s\rangle_{Q_2}$, and store the result in an ancilla $2^{n-k}B$-qubit register $F$.

2. Apply the reversed circuit from Lemma A.3 to $FQ_3$.

3. Uncompute the ancilla register $F$ by repeating the first step.

The complexity of the first and third step scales as $O(4^n \text{npoly}(B))$, where the uniform control on $Q_1 Q_2$ contributes a factor $2^n n$ (see Lemma A.2) and the computation of the marginal distribution contributes a factor $2^n \text{poly}(B)$.

Note that for each $y, s$, the unitary $V(y, s, \tilde{P})$ only depends on the conditional distributions $\tilde{P}_{A|Y=y,S=s}$. Due to the discretized storage of the marginal in $F$, as well as the approximation involved in Lemma A.3, we do effectively apply the gate $V(y, s, \tilde{P})$ with an erroneous value of the conditional marginal, which we denote by $P'_{A|Y=y,S=s}$ and which fulfills

$$ \forall y, s: \left\| \tilde{P}_{A|Y=y,s=s} - P'_{A|Y=y,s=s} \right\|_1 \le n2^{-B}\pi + 2^{n-B} \le (\pi+1)2^{n-B} \quad (100) $$

due to a simple triangle inequality argument. We can complete these marginals $P'_{A|Y=y,S=s}$ to a complete joint distribution by defining it as $P'_{Y,S,A}(y, s, a) := \tilde{P}_{S,Y}(s, y)P'_{A|Y=y,S=s}(a)$. Correspondingly, let $P'$ be the $n$-bit distributions such that $P'_{Y,S,A}(y, s, a) = P'(M^{-1}(y||s||a))$. We write $P'(\tilde{P})$ to highlight that $P'$ depends on $\tilde{P}$. In summary, our circuit implements

$$ \sum_{s, y, \tilde{P}} |y\rangle\langle y|_{Q_1} \otimes |s\rangle\langle s|_{Q_2} \otimes V(y, s, P'(\tilde{P}))_{Q_3} \otimes |\tilde{P}\rangle\langle \tilde{P}|_{B}, \quad (101) $$
and it holds that

$$ \forall \tilde{P} : \|P'(\tilde{P}) - \tilde{P}\|_1 = \|P'_{Y,S,A} - \tilde{P}_{Y,S,A}\| = \sum_{y,s} \tilde{P}_{Y,S}(y,s) \|P'_{A|Y=y,s=s} - \tilde{P}_{A|Y=y,s=s}\|_1 \le (\pi + 1)2^{n-B}. \quad (102) $$

□

## B Detailed description of coherent BPQM

In Definition 5.2, we defined the coherent BPQM algorithm as the result of applying the deferred measurement principle to the discretized incoherent BPQM algorithm. To be more explicit, this appendix provides a detailed step-by-step description of the algorithm.

**Definition B.1 (Coherent BPQM node operation).** Consider a node v of some MPG and some fixed $B \in \mathbb{N}$. The node operation of coherent BPQM is identical to Definition A.1, except for the following changes:

* The classical registers storing the input distributions $P_{e_i^{\text{out}}(v)}$ and the output distribution $P_{e_i^{\text{in}}(v)}$ are replaced by $2^m$-qubit quantum registers

* The computation of $\tilde{P}$ in step 1 is done coherently, and the result is stored in a $2^m$-qubit quantum register F

* Step 2 is realized with the reversed circuit from Lemma A.1 applied to $\tilde{Q}F$.

* The measurement in step 3 is omitted.

* The computation of $P'$ is done coherently and uniformly conditioned on the system $Q_2$. Denote the $2^{n_{e_i^{\text{in}}(v)}}$-qubit system storing the result by $E'$.

* At the end of the node operation, the register F is uncomputed.

* The output of the node operation is given by $Q_1$ together with $E'$.

The coherent BPQM algorithm is then obtained by chaining together these node operations on the MPG.

**Definition B.2 (Coherent BPQM algorithm).** The coherent BPQM algorithm is identical to Definition A.2, except for the following changes:

* In step 1, the message associated with the edge $e_i$ is fixed to be the quantum system $Q_i$ together with a $2^{n_{e_i}}$-qubit register initialized in the computational state $|\tau_{B,n_{e_i}}(P_i)\rangle$

* In step 2, the node operation from Definition B.1 is used instead of the one from Definition A.1.

We now briefly discuss the complexity of coherent BPQM. When comparing Definition B.1 with Definition A.1, the only step where the asymptotic complexity changes is the computation of $P'$, due to the uniform control on $Q_2$. More precisely, the computation of $P_S(s)$ and the vector $P_{Y,S}(\cdot, s)$ from $\tilde{P}$ (which are needed to compute $P_{Y|S=s}$) must now be coherently controlled on the value s of $Q_2$. This increases the circuit complexity from $O(2^{n_{e_i}} \text{poly}(B))$ to $O(4^{n_{e_i}} n_{e_i} \text{poly}(B))$ (because of Lemma A.2).

This change is asymptotically irrelevant, as the overall complexity of the node operation remains as $O(\text{poly}(B)4^{n_{e_i}} n_{e_i}^2)$. Therefore, the total complexity of coherent BPQM is the same as that of discretized incoherent BPQM, i.e., it is $O(\text{poly}(B)4^{n_{e_i}} N(G)^2 |V|)$.

## C Uniformly-controlled BPQM algorithm

In Section 5.1, we introduced the notion of coherent BPQM by applying the deferred measurement principle to incoherent BPQM. As discussed in that section, this only provides us with a well-defined quantum algorithm if we consider the discretized version of incoherent BPQM, as otherwise, the quantum register storing the distributions would need to be infinite dimensional. This puts us in a slightly
uncomfortable situation that we do not have a precise notion of what an idealized version of coherent BPQM would even mean.

In this appendix, we address this problem by introducing yet another quantum algorithm, which we call uniformly-controlled BPQM (UC-BPQM). UC-BPQM is a well-defined quantum algorithm (i.e. acting only on finite-dimensional spaces) and can be viewed as a formalization of what computation an “idealized coherent BPQM algorithm” (i.e. without any sort of discretization errors) should perform. As we will see, it achieves both bit-optimal and block-optimal decoding, though it is not an efficient algorithm. Instead, it will purely serve as a theoretical tool, as we will show that UC-BPQM can be efficiently approximated using (discretized) coherent BPQM.

We start by defining an incoherent version of UC-BPQM.

**Definition C.1 (BPQM with lookup table).** Consider the incoherent BPQM algorithm as described in Definition 4.4 and the unitary $PNO(n_v, k_v, l_v, G_v, \tilde{P})$ that is performed as part of the node operation of some node $v$. Notice that all the parameters, except $\tilde{P}$, are fixed by the MPG, and are therefore identical for every execution of incoherent BPQM on every possible input. Furthermore, notice that for a given set of distributions input to the leaves of the MPG, the value of $\tilde{P}$ is entirely determined by the measurement outcomes (see step 2 in Definition 4.3) incurred in all the preceding node operations (i.e., from node operations of nodes $v'$ which succeed $v$ in the MPG). We jointly denote these measurement outcomes by $m \in \mathbb{F}_2^{P_v}$ where $p_v := \sum_{v' \text{ succeeds } v} (k_v - l_{v'})$.

As such, it is possible to remove the classical part of the messages in the incoherent BPQM algorithm, and instead, make all the primitive node unitaries classically controlled on all the preceding measurement outcomes. More precisely, for every node $v$, we pre-compute a lookup table of all possible primitive node operation unitaries $(U_m^{(v)})_m$ for every possible combination $m$ of preceding measurement outcomes. Instead of choosing a primitive node operation based on the incoming messages, we instead simply pick the appropriate unitary from this lookup table.

The resulting algorithm is called BPQM with lookup table and it also solves the subspace decoding task.

Clearly, BPQM with lookup table and incoherent BPQM perform the identical quantum computation on the quantum system that is fed as input into the algorithm. The difference purely lies in the fact that we now do not keep track of the distribution information on-the-fly. Hence, BPQM with lookup table can also optimally solve the subspace decoding task. The downside is that we now have to pre-compute exponentially many possible node unitaries in advance to fill up the lookup tables; this requires both exponential time and memory.

**Definition C.2 (Uniformly-controlled BPQM algorithm).** Consider BPQM with lookup table from Definition C.1. This algorithm contains two different types of measurements: some in the node operations, and one final measurement of the final message. We can remove the former using the deferred measurement principle, analogous to the definition of coherent BPQM in Definition 5.2. More precisely, for the node $v$, we replace the classically-controlled $U_m^{(v)}$ gate by the uniformly controlled quantum gate $\sum_m U_m^{(v)} \otimes |m\rangle\langle m|$.

The resulting algorithm is called uniformly-controlled BPQM (UC-BPQM) and it also solves the subspace decoding task.

Just as BPQM with lookup table, UC-BPQM is also an inefficient algorithm, as describing and applying the involved uniformly controlled gates is exponentially hard. However, UC-BPQM inherits its optimality in solving the subspace decoding task due to the deferred measurement principle. We briefly note that UC-BPQM corresponds to the description of BPQM in the original paper that introduced it [10].

Note that UC-BPQM does not require any additional ancilla qubits in its computation, and hence, the action of UC-BPQM can be described by an $n$-qubit unitary $U_{UC-BPQM}$ followed by the measurement of the first $\ell$ qubits in the conjugate basis, which provides the output of the algorithm. The action of $U_{UC-BPQM}$ is easy to describe.

**Lemma C.1.** Consider an instance SDT$(n, k, \ell, G, P)$ where the associated channel $W$ can be written as $W = W[G, P]$ for some MPG $G$ and a sequence of probability distributions $P = (P_i)_{i=1,...,m}$. Let us write the message ensemble as $\mathcal{E}_G^P = (p_s, D_s)_{s \in \mathbb{F}_2^{k-\ell}}$. The unitary $U_{UC-BPQM}$ acts as follows

$$ \text{SPSC}[P]((x \| r)^T G) \mapsto \sum_{s \in \mathbb{F}_2^{k-\ell}} \sqrt{p_s} (-1)^{s \cdot A_r} \text{SPSC}[D_s](x)_{Q_1} \otimes |s\rangle_{Q_2} \otimes |0^{n-k}\rangle_{Q_3}, \quad (103) $$
where $x \in \mathbb{F}_2^\ell, r \in \mathbb{F}_2^{k-\ell}, A \in \mathbb{F}_2^{(k-\ell) \times (k-\ell)}$ is some invertible matrix and $Q_1, Q_2, Q_3$ are $\ell$-qubit, $(k-\ell)$-qubit and $(n-k)$-qubit registers.

**Proof.** Consider the channel $F[G]$ which describes passing messages from the root to the leaves on the MPG $G$. Recall that at every node $v$, the input string is concatenated with some random string $r_v \in \mathbb{F}_2^{k_v-\ell_v}$ and then encoded according to $G_v$. Let us denote the concatenation of all the random strings by $\bar{r} := \|_{v \in V} r_v$, which is a $(k-\ell)$-bit string. So if we fix some particular value $\bar{r} \in \mathbb{F}_2^{k-\ell}$, the encoding map described by the MPG becomes deterministic. Put differently, $G$ induces a one-to-one mapping between pairs $(x, \bar{r}) \in \mathbb{F}_2^\ell \times \mathbb{F}_2^{k-\ell}$ and codewords $c \in C$. This map is linear, since all the “local” constituent encoders of $F[G]$ are linear. Therefore, there exists a matrix $G' \in \mathbb{F}_2^{k \times n}$ such that $F[G]$ describes the encoding $x \mapsto (x \| \bar{r}) G'$.

By iteratively applying (34) for each node operation, we see that $U_{\text{UC-BPQM}}$ maps

$$ \text{SPSC}[P]((x \| \bar{r})^T G') \to \sum_{s \in \mathbb{F}_2^{k-\ell}} \sqrt{p_s} (-1)^{\bar{r} \cdot s} \text{SPSC}[D_s](x)_{Q_1} \otimes |s\rangle_{Q_2} \otimes |0^{n-k}\rangle_{Q_3} \quad (104) $$

Clearly, $G'$ must be a generator matrix for the same code as $G$ since $F[G] = F_{\ell,G}$, and the first $\ell$ rows of the two generator matrices must be identical. As such, the remaining rows only differ by a basis change. Put differently, there exists an invertible matrix $A \in \mathbb{F}_2^{(k-\ell) \times (k-\ell)}$ such that $(x \| r)^T G = (x \| Ar)^T G'$. This directly implies the desired statement. $\square$

The fact that UC-BPQM requires no ancilla is particularly relevant for the task of block decoding, as discussed in Section 5.2. Consider the following algorithm to perform block decoding using UC-BPQM. It is identical to Definition 5.3, except that coherent BPQM is replaced by UC-BPQM.

**Definition C.3 (UC-BPQM block decoding).** Consider an instance $\text{BLOCKDEC}(C, p)$ for some $[n, k]$ binary linear code where $x_1, \dots, x_k$ are linearly independent codeword bits. Let $\mathcal{G}_1, \dots, \mathcal{G}_k$ be MPG representations of $\mathcal{F}_{C,1}, \dots, \mathcal{F}_{C,k}$.

- **INPUT:** n-qubit quantum system $Q$ in the state $|\Psi_x\rangle$ for some $x \in C$.

- **OUTPUT:** An estimate $\hat{x}$ of $x$.

- **ALGORITHM:** Denote the unitary associated to UC-BPQM w.r.t. $\mathcal{G}_i$ by $U_{\text{UC-BPQM},i}$. For $i = 1, \dots, k$ perform the following actions

1. Apply $U_{\text{UC-BPQM},i}$ to $Q$

2. Measure the first qubit of $Q$ in the conjugate basis, set $\hat{x}_i$ to the measurement result.

3. Apply $U_{\text{UC-BPQM},i}^\dagger$ to $Q$

Finally, extend $\hat{x}_1, \dots, \hat{x}_k$ to a valid codeword in $C$.

Due to the unitarity of BPQM, this algorithm implements a sequence of projective two-outcome measurements, which realize bit-optimal decoding. Therefore, we can apply Proposition 5.1, which states that UC-BPQM realizes block-optimal decoding.

**Corollary C.1.** The algorithm in Definition C.3 achieves block optimal decoding.

# D Resilience of BPQM under discretization errors

In this section, we will prove Theorem 4.2 and Theorem 5.1. We will assume that the reader has already familiarized themselves with Appendices A to C. The two proofs essentially amount to showing that the discretization errors in BPQM are well-behaved, i.e., we can efficiently approximate incoherent BPQM with discretized incoherent BPQM, and we can efficiently approximate UC-BPQM with coherent BPQM.

Before we get to the proofs themselves, we need to provide some additional insights. The basis for the BPQM with lookup table algorithm was the observation that in incoherent BPQM, the value of $\tilde{P}$ in the node operation depends only on the measurement outcomes $m$ of the preceding node operations. Hence, the primitive node operation for the node $v$ can only take a finite number of possible values $(U_m^{(v)})_m$.

The same insight also applies to the discretized incoherent BPQM algorithm, i.e., the applied node operation unitary also only depends on the preceding measurement outcomes. Here, we denote the list
of possible unitaries associated to the node v by $(\tilde{U}_m^{(v)})_m$. The two unitaries $U_m^{(v)}$ and $\tilde{U}_m^{(v)}$ differ because of discretization errors in the classical part of the messages and because of the error in Lemma A.1. As part of the analysis in this appendix, we will show that $\tilde{U}_m^{(v)}$ and $U_m^{(v)}$ are close to each other with high probability, provided that the number of discretization bits B is large enough.

**Definition D.1** (discretized BPQM with lookup table). We define discretized BPQM with lookup table to be the identical algorithm as Definition C.1, except that we use the unitaries $(\tilde{U}_m^{(v)})_m$ from discretized incoherent BPQM as a lookup table instead of the ideal unitaries $(U_m^{(v)})_m$.

In full analogy to the construction of UC-BPQM, we can also apply the deferred measurement principle here, and get a unitary version of this algorithm.

**Definition D.2** (Discretized uniformly-controlled BPQM). Consider discretized BPQM with lookup table from Definition D.1 and apply the deferred measurement principle to replace the classically conditioned unitaries with uniformly controlled quantum gates (analogous to Definition C.2). The resulting algorithm is called discretized uniformly-controlled BPQM (DUC-BPQM).

DUC-BPQM, analogously to UC-BPQM, is neither an efficient algorithm, nor a message-passing algorithm. Instead, it will purely serve as an analytical tool to prove Theorem 4.2 and Theorem 5.1. The performance of DUC-BPQM in solving the subspace decoding task is equal to that of discretized BPQM with lookup table, which is in turn equivalent to that of discretized incoherent BPQM. Hence, to prove Theorem 4.2, it suffices to characterize the success probability of DUC-BPQM.

Similarly, the action of DUC-BPQM and coherent BPQM on any given input state is equivalent, except that coherent BPQM involves ancilla systems to store the discretized distribution information. More formally, consider some instance $SDT(n, k, l, G, P)$ and an appropriate MPG $G$. The action of the DUC-BPQM on an $n$-qubit input system $Q$ is described by some $n$-qubit unitary $U_{\text{DUC-BPQM}}$ followed by a projective measurement $\{\Pi_j\}_{j \in E_2^l}$. If we separate the output $Q$ into the three systems $Q = Q_1Q_2Q_3$, as in Lemma C.1, then $\{\Pi_j\}_j$ is simply the conjugate basis measurement on $Q_1$. Meanwhile, the action of coherent BPQM is can be described by some $(n+A)$-qubit unitary $U_{\text{CBPQM}}$, acting on the input $Q$ and an $A$-qubit ancilla system $E$ in the all-zero state, followed by the same conjugate basis measurement $\{\Pi_j\}_j$ on $Q_1$. In fact, there exists an isometry $V_{Q_2 \to Q_2 E}$ from $Q_2$ to $Q_2 E$ such that

$$ U_{\text{CBPQM}}(|\varphi\rangle_Q \otimes |0^A\rangle_E) = V_{Q_2 \to Q_2 E} \cdot U_{\text{DUC-BPQM}} |\varphi\rangle_Q \quad (105) $$

for all $n$-qubit states $|\varphi\rangle$. The isometry $V$ coherently computes the discretized distribution information given the joint systems $Q_2$ produced by all the node operations. We formally prove this below in Lemma D.1.

Importantly, since $V$ and $\Pi_j$ act on different systems ($Q_2$ and $Q_1$ respectively), we can prove in the following that coherent BPQM and DUC-BPQM realize the identical projective measurement. More precisely, coherent BPQM maps any state $|\varphi\rangle_Q \otimes |0\rangle_E$ to the post-measurement state

$$ |\zeta_j\rangle := \frac{1}{\sqrt{p_j}} \Pi_j U_{\text{CBPQM}} |\varphi\rangle_Q \otimes |0\rangle_E \quad \text{with probability } p_j = \left\| \Pi_j U_{\text{CBPQM}} |\varphi\rangle_Q \otimes |0\rangle_E \right\|^2. \quad (106) $$

Moreover, observe that $|\zeta_j\rangle = V_{Q_2 \to Q_2 E} |\zeta'_j\rangle$ where $|\zeta'_j\rangle := \frac{1}{\sqrt{p'_j}} \Pi_j U_{\text{DUC-BPQM}} |\varphi\rangle$ is the post-measurement state of DUC-BPQM with probability $p'_j = \|\Pi_j U_{\text{DUC-BPQM}} |\varphi\rangle\|$. Notice that

$$ p_j = \|\Pi_j V_{Q_2 \to Q_2 E} U_{\text{DUC-BPQM}} |\varphi\rangle\|^2 = \|V_{Q_2 \to Q_2 E} \Pi_j U_{\text{DUC-BPQM}} |\varphi\rangle\|^2 = \|\Pi_j U_{\text{DUC-BPQM}} |\varphi\rangle\|^2 = p'_j. \quad (107) $$

Furthermore, after undoing the coherent BPQM node operations, we obtain the state

$$ U_{\text{CBPQM}}^{\dagger} |\zeta_j\rangle = U_{\text{CBPQM}}^{\dagger} V_{Q_2 \to Q_2 E} |\zeta'_j\rangle \quad (108) $$

$$ = U_{\text{CBPQM}}^{\dagger} V_{Q_2 \to Q_2 E} U_{\text{DUC-BPQM}} (U_{\text{DUC-BPQM}}^{\dagger} |\zeta'_j\rangle) \quad (109) $$

$$ = U_{\text{CBPQM}}^{\dagger} U_{\text{CBPQM}} (U_{\text{DUC-BPQM}}^{\dagger} |\zeta'_j\rangle) \otimes |0\rangle_E \quad (110) $$

$$ = (U_{\text{DUC-BPQM}}^{\dagger} |\zeta'_j\rangle) \otimes |0\rangle_E \quad (111) $$
which is identical to the state obtained after realizing DUC-BPQM and undoing $U_{DUC-BPQM}$.

In summary, in order to study the performance of coherent BPQM in block decoding, we can equivalently study the performance of DUC-BPQM in block decoding (i.e., Definition C.3 where we replace UC-BPQM with DUC-BPQM). We also briefly note that this argument proves Lemma 5.1.

**Lemma D.1.** Consider an instance $T = \text{SDT}(n, k, \ell, G, P)$ where the associated channel $W$ can be written as $W = W[G, P]$ for some MPG $G$ with $m$ leaves and a sequence of probability distributions $\mathcal{P} = (P_i)_{i=1,...,m}$. The action of coherent BPQM and DUC-BPQM are related by (105) for some isometry $V_{Q_2 \to Q_2 E}$.

*Proof.* Comparing the action of the coherent BPQM node operation and DUC-BPQM node operation, we observe that they are identical except that coherent BPQM produces additional ancilla registers containing ancilla information. More concretely, let us write the action of DUC-BPQM on some $n$-qubit state $|\varphi\rangle$ as follows

$$U_{\text{DUC-BPQM}} |\varphi\rangle = \sum_s |f_s\rangle_{Q_1 Q_3} \otimes |s\rangle_{Q_2}, \qquad (112)$$

where $Q_1$ is the final message, $Q_2$ is the collection of all $S$ registers produced by all node operations, and $Q_3$ is the collection of all $A$ registers produced by all the node operations. Here, $|f_s\rangle$ is a subnormalized quantum state. A simple (but verbose) induction argument shows that coherent BPQM produces the state

$$U_{\text{cBPQM}}(|\varphi\rangle_Q \otimes |0\rangle_E) = \sum_s |f_s\rangle_{Q_1 Q_3} \otimes |s\rangle_{Q_2} \otimes |q_s\rangle_E, \qquad (113)$$

where $E$ contains the distribution registers for all the edges in the graph. Moreover, $|q_s\rangle$ depends only on $s$. The desired isometry is therefore given by $V_{Q_2 \to Q_2 E} := \sum_s |s\rangle\langle s|_{Q_2} \otimes |q_s\rangle_E$. $\square$

## D.1 Characterizing the discretization error in the classical messages

In this subsection, we characterize the impact of discretization errors on the classical part of the messages in discretized incoherent BPQM. Let us consider some instance $\text{SDT}(n, k, \ell, G, P)$ and an appropriate corresponding MPG $G$. Let us denote the root of $G$ by $e^*$.

In the absence of discretization errors, we know from Lemma 4.1 that the classical part of the final message over $e^*$ is given by $D_m$ with probability $p_m$ where $(p_m, D_m)_m = \mathcal{E}_G^P$. Here, the index $m \in \mathbb{F}_2^{k-\ell}$ captures the measurement outcomes of the $Q_2$ systems of all node operations.

If we run discretized incoherent BPQM, the classical part of the message over the final edge is still fully determined by $m$, but now takes different values due to discretization errors. We denote the possible values by $(\tilde{D}_m)_m$. Naively, one might expect that $\tilde{D}_m$ is a very good approximation of $D_m$, provided that $B$ is chosen large enough. Unfortunately this is not true for all $m$. However, it remains possible to make an average-case statement, which will end up being sufficient for our purposes. The precise statement is formalized as follows.

**Lemma D.2.** Consider an instance $\text{SDT}(n, k, \ell, G, P)$ where the associated channel $W$ can be written as $W = W[G, P]$ for some MPG $G = (V, E)$ and a sequence of probability distributions $\mathcal{P} = (P_i)_{i=1,...,m}$. Denote the associated message ensemble $\mathcal{E}_G^P = (p_m, D_m)_{m \in \mathbb{F}_2^{k-\ell}}$. Consider the discretized incoherent BPQM algorithm with $B \in \mathbb{N}$ discretization bits, and denote the possible values of the classical part of the final message by $(\tilde{D}_m)_{m \in \mathbb{F}_2^{k-\ell}}$. For $\Delta := 2^{N(G)-B}$, it holds that

$$\sum_m p_m \|D_m - \tilde{D}_m\|_1 \le (2N(G) + 3)^{|V|} \Delta. \qquad (114)$$

The proof of this lemma proceeds by induction, by considering how the discretization errors accumulate at every node operation throughout the MPG. This accumulated error at each node is captured by the following result.

**Lemma D.3.** Consider a primitive node operation $U = \text{PNO}(n, k, \ell, G, D)$ and an $\ell$-bit probability distribution $\tilde{D}$. Let us write $f_U(D) = (p_s, D'_s)_s$ and $f_U(\tilde{D}) = (\tilde{p}_s, \tilde{D}'_s)_s$. Then,

$$\sum_s p_s \|D'_s - \tilde{D}'_s\|_1 \le 2 \|D - \tilde{D}\|_1. \qquad (115)$$
*Proof.* Let us denote $P_{Y,S,A}(s, y, a) := D(M^{-1}(s||y||a))$ and $\tilde{P}_{Y,S,A}(s, y, a) := \tilde{D}(M^{-1}(s||y||a))$ where M is the matrix associated to the primitive node unitary. Then,

$$ \sum_s p_s \|D'_s - \tilde{D}'_s\|_1 = \sum_s P_S(s) \|P_{Y|S=s} - \tilde{P}_{Y|S=s}\|_1 \quad (116) $$

$$ \le \|P_S - \tilde{P}_S\|_1 + \sum_s \|P_S(s)P_{Y|S=s} - \tilde{P}_S(s)\tilde{P}_{Y|S=s}\|_1 \quad (117) $$

$$ = \|P_S - \tilde{P}_S\|_1 + \|P_{S,Y} - \tilde{P}_{S,Y}\|_1 \quad (118) $$

$$ \le \|P_{Y,S,A} - \tilde{P}_{Y,S,A}\|_1 + \|P_{Y,S,A} - \tilde{P}_{Y,S,A}\|_1 \quad (119) $$

$$ = 2 \|D - \tilde{D}\|_1. \quad (120) $$

In the last step, we used that $P$ and $D$, respectively $\tilde{P}$ and $\tilde{D}$, only differ by some relabeling. $\square$

*Proof of Lemma D.2.* We prove our statement inductively over the size of the MPG. If the MPG has no nodes, then there is simply one element in the ensemble $\mathcal{E}_G^P = (1, D)$ and the discretization error $\|D - \tilde{D}\|_1$ is at most $\Delta$ by definition.

If the MPG has at least one node, consider the node $v$ connected to the root edge. For $i = 1, \dots, m_v$, denote the message ensembles associated to the incoming messages by $\mathcal{E}^{(i)} = (p_{s_i}^{(i)}, D_{s_i}^{(i)})_{s_i}$ (i.e. $\mathcal{E}^{(i)}$ is the message ensemble of the sub-MPG for which $e_i^{\text{out}}(v)$ is the root), and similarly, denote the associated distributions in incoherent BPQM by $\tilde{D}_{s_i}^{(i)}$. The joint message ensemble is $\otimes_{i=1}^{m_v} \mathcal{E}^{(i)} = (p_s, \tilde{D}_s)$. Let us denote the distribution ensemble $f_U(D_s) = (p_{t|s}, D'_{s,t})_t$ where $U$ is the primitive node unitary associated to $v$. Therefore, the output of non-discretized incoherent BPQM has classical part $D'_{s,t}$ with probability $p_s p_{t|s}$.

Now consider discretized incoherent BPQM. The incoming message over the $i$-th edge is given by $\tilde{D}_{s_i}$ with some probability $\tilde{p}_{s_i}$. From the induction hypothesis, we know that the joint message $\tilde{\mathcal{D}}_s := \times_i \tilde{D}_{s_i}$ fulfills

$$ \sum_s p_s \|\tilde{D}_s - \tilde{\mathcal{D}}_s\|_1 \le \sum_{i=1}^{m_v} \sum_{s_i} p_{s_i} \|D_{s_i} - \tilde{D}_{s_i}\|_1 \quad (121) $$

$$ \le \sum_{i=1}^{m_v} (2N(\mathcal{G}) + 3)^{|\mathcal{G}|-1} \Delta \quad (122) $$

$$ \le N(\mathcal{G})(2N(\mathcal{G}) + 3)^{|\mathcal{G}|-1} \Delta. \quad (123) $$

In the incoherent BPQM algorithm, $\tilde{\mathcal{D}}_s$ is computed and stored in its discretized form, which we denote $\tilde{P}_s := \tau_{B,n_v}(\tilde{D}_s)$ to mirror the notation in Step 1 from Definition A.1. This gives us

$$ \sum_s p_s \|\tilde{D}_s - \tilde{P}_s\|_1 \le N(\mathcal{G})(2N(\mathcal{G}) + 3)^{|\mathcal{G}|-1} \Delta + \Delta. \quad (124) $$

Let us denote $f_U(\tilde{P}_s) = (\tilde{p}_{t|s}, P'_{s,t})_t$. Next, we can apply Lemma D.3 to obtain

$$ \sum_{s,t} p_s p_{t|s} \|D'_{s,t} - P'_{s,t}\|_1 \le 2 \sum_s p_s \|\tilde{D}_s - \tilde{P}_s\|_1 \le 2N(\mathcal{G})(2N(\mathcal{G}) + 3)^{|\mathcal{G}|-1} \Delta + 2\Delta. \quad (125) $$

Finally, the resulting distribution $P'_{s,t}$ is again computed and stored in discretized fashion, so the output distribution of discretized incoherent BPQM is $P''_{s,t} := \tau_{B,\ell_v}(P'_{s,t})$ (see Step 4 in Definition A.1). We hence obtain

$$ \sum_{s,t} p_s p_{t|s} \|D'_{s,t} - P''_{s,t}\|_1 \le \Delta + \sum_{s,t} p_s p_{t|s} \|D'_{s,t} - P'_{s,t}\|_1 \quad (126) $$

$$ \le 2N(\mathcal{G})(2N(\mathcal{G}) + 3)^{|\mathcal{G}|-1} \Delta + 3\Delta \quad (127) $$

$$ \le 2N(\mathcal{G})(2N(\mathcal{G}) + 3)^{|\mathcal{G}|-1} \Delta + 3(2N(\mathcal{G}) + 3)^{|\mathcal{G}|-1} \Delta \quad (128) $$

$$ = (2N(\mathcal{G}) + 3)^{|\mathcal{G}|}, \quad (129) $$

which proves the induction step. $\square$
## D.2 Characterizing the fidelity of DUC-BPQM

The following lemma captures how imperfect knowledge of the incoming state impacts the action of the primitive node unitary.

**Lemma D.4.** Consider a full-rank matrix $G \in \mathbb{F}_2^{k \times n}$, $1 \le l \le k \le n$, and two probability distributions $D$ and $\tilde{D}$ over $n$ bits. Denote the two associated primitive node operations by $U = \text{PNO}(n, k, l, G, D)$ and $\tilde{U} = \text{PNO}(n, k, l, G, \tilde{D})$. Next, consider some $n$-qubit state $|\varphi_{x,r}\rangle := \text{SPSC}[D]((x\|r)^T G)$ for some $x \in \mathbb{F}_2^l, r \in \mathbb{F}_2^{k-l}$. Then,

$$ \langle \varphi_{x,r} | U^\dagger \tilde{U} | \varphi_{x,r} \rangle \ge 1 - \| D - \tilde{D} \|_1. \quad (130) $$

As a direct consequence, the trace distance between the output of the two node operations is bounded by

$$ \delta(U |\varphi_{x,r}\rangle, \tilde{U} |\varphi_{x,r}\rangle) \le \sqrt{2 \|D - \tilde{D}\|_1} \quad (131) $$

due to the Fuchs-van de Graaf inequality.

*Proof.* Following the notation in Definition 3.2, consider the $U_1, U_2, P_{Y,S,A}, V(y,s)$, and $|\xi_{y,s}\rangle$ induced by $D$ as well as the $\tilde{U}_1, \tilde{U}_2, \tilde{P}_{Y,S,A}, \tilde{V}(y,s), |\tilde{\xi}_{y,s}\rangle$ induced by $\tilde{D}$. Notice that $U_1 = \tilde{U}_1$, so only $U_2$ and $\tilde{U}_2$ differ. Recall from the proof of Lemma 3.1 that

$$ U_2 U_1 |\varphi_{x,r}\rangle = \sum_{y,s} \sqrt{P_{Y,S}(y,s) Z^x |y\rangle \otimes Z^r |s\rangle \otimes |0\rangle}. \quad (132) $$

Similarly, we have

$$ \tilde{U}_2 \tilde{U}_1 |\varphi_{x,r}\rangle = \sum_{y,s} \sqrt{P_{Y,S}(y,s) Z^x |y\rangle \otimes Z^r |s\rangle \otimes (\tilde{V}(y,s) |\xi_{y,s}\rangle)}. \quad (133) $$

The overlap between these states is therefore

$$ \langle \varphi_{x,r} | U^\dagger \tilde{U} | \varphi_{x,r} \rangle = \sum_{y,s} P_{Y,S}(y,s) \langle 0 | \tilde{V}(y,s) | \xi_{y,s} \rangle \quad (134) $$

$$ = \sum_{y,s} P_{Y,S}(y,s) \langle \tilde{\xi}_{y,s} | \tilde{V}(y,s)^\dagger \tilde{V}(y,s) | \xi_{y,s} \rangle \quad (135) $$

$$ = \sum_{y,s} P_{Y,S}(y,s) \langle \tilde{\xi}_{y,s} | \xi_{y,s} \rangle \quad (136) $$

$$ = \sum_{y,s} P_{Y,S}(y,s) F(P_{A|YS}, \tilde{P}_{A|YS}) \quad (137) $$

$$ \ge \sum_{y,s} P_{Y,S}(y,s) (1 - \frac{1}{2} \| P_{A|YS} - \tilde{P}_{A|YS} \|_1) \quad (138) $$

$$ = 1 - \frac{1}{2} \sum_{y,s} P_{Y,S}(y,s) \| P_{A|YS} - \tilde{P}_{A|YS} \|_1 \quad (139) $$

$$ \ge 1 - \frac{1}{2} (\| P_{Y,S} - \tilde{P}_{Y,S} \|_1 + \| P_{Y,S,A} - \tilde{P}_{Y,S,A} \|_1) \quad (140) $$

$$ \ge 1 - \| P_{Y,S,A} - \tilde{P}_{Y,S,A} \|_1 \quad (141) $$

$$ = 1 - \| D - \tilde{D} \|_1, \quad (142) $$

where $F$ denotes the quantum fidelity (respectively the Bhattacharyya coefficient) and we used Fuchs-van de Graaf. In the last step, we also used that $P_{Y,S,A}$ and $D$, respectively $\tilde{P}_{Y,S,A}$ and $\tilde{D}$, only differ by some relabeling. $\square$

By iteratively applying Lemma D.4, we can now characterize the how close the output of DUC-BPQM approximates the output of UC-BPQM.

**Lemma D.5.** Consider an instance SDT(n, k, l, G, P) where the associated channel W can be written as $W = W[G, P]$ for some MPG G = (V, E) and a sequence of probability distributions $P = (P_i)_{i=1,...,m}$. Let us additionally fix a number of discretization bits $B \in \mathbb{N}$. Denote by $U_{\text{UC-BPQM}}$ and $U_{\text{DUC-BPQM}}$ the unitaries
corresponding to the UC-BPQM and DUC-BPQM algorithms without the final measurement. For any $c \in \mathbb{C}$, where $C$ is the code induced by $G$, the actions on the state $|\varphi_c\rangle := \text{SPSC}[P](c)$ only differ by a trace distance error of

$$ \delta(U_{\text{UC-BPQM}} |\varphi_c\rangle, U_{\text{DUC-BPQM}} |\varphi_c\rangle) \le |V| \beta, \quad (143) $$

$$ \text{where } \beta := \sqrt{2((2N(\mathcal{G}) + 3)^{|V|} + \pi + 1)\Delta} \text{ and } \Delta := 2^{N(\mathcal{G})-B}. $$

*Proof.* Consider the channel $F[\mathcal{G}]$ described by the MPG. Recall that at every node $v$, the input string is concatenated with a random string $r_v \in \mathbb{F}_2^{k_v-\ell_v}$ and then encoded according to $G_v$. Denote the concatenation of all the random strings by $\tilde{r} := \|_{v \in V} r_v$, which is a $(k-\ell)$-bit string. For any particular value $\tilde{r}$, the encoding map described by the MPG is deterministic. Put differently, $\mathcal{G}$ induces a one-to-one mapping between pairs $(x, \tilde{r}) \in \mathbb{F}_2^{\ell \times k-\ell}$ and codewords $c \in \mathcal{C}$. From now on, let us denote by $x$ and $\tilde{r}$ the two bit strings associated to the codeword $c$ in the lemma.

We prove the desired statement inductively over the size $|V|$ of the MPG. If the MPG is trivial (i.e. it has zero nodes), then both $U_{\text{UC-BPQM}}$ and $U_{\text{DUC-BPQM}}$ are simply the identity operation. It remains to show the induction step.

So let us assume that the MPG is nontrivial and consider $v$ to be the node connected to the root edge. We can split $\tilde{r}$ into $\tilde{r} = r_1 \| r_2$ for $r_1 \in \mathbb{F}_2^{k_v-\ell_v}$ and $r_2 \in \mathbb{F}_2^{\ell-(v-(\ell_v-k_v))}$ where $r_1$ corresponds to the random bit string that is associated to the node $v$, and $r_2$ to the concatenation of all the other random bit strings.

Thanks to Lemma C.1, we know that in the UC-BPQM algorithm applied to $|\varphi_{x,r}\rangle$, the state of the $n$-qubit system going into the last node operation is given by

$$ |\phi\rangle := \sum_{s \in \mathbb{F}_2^{k-\ell-(k_v-\ell_v)}} \sqrt{P_s(-1)^{r_2 \cdot s}} \text{SPSC}[D_s]((x \| r_1)G_v)_{Q_1} \otimes |s\rangle_{Q_2} \otimes |0^{n-k-(n_v-k_v)}\rangle_{Q_3} \quad (144) $$

where $(p_s, D_s)_s$ is the tensor product of all the message ensembles of the sub-MPGs where the edge $e_i^{\text{out}}$ is the root edge, for $i = 1, \dots, m_v$. Similarly, in the DUC-BPQM algorithm, the state before the final node operation is given by some $|\tilde{\phi}\rangle$ which fulfills

$$ \delta(|\phi\rangle, |\tilde{\phi}\rangle) \le (|V| - 1)\beta \quad (145) $$

due to the induction hypothesis (because $|\tilde{\phi}\rangle$ is the tensor product of the DUC-BPQM output on smaller MPGs).

The action of the final UC-BPQM node operation is given by the unitary

$$ V = \sum_{s \in \mathbb{F}_2^{k-\ell-(k_v-\ell_v)}} \text{PNO}(n_v, k_v, \ell_v, G_v, D_s)_{Q_1} \otimes |s\rangle\langle s|_{Q_2} \otimes \mathbb{1}_{Q_3} \quad (146) $$

and similarly, the action of the final DUC-BPQM node operation is given by

$$ \tilde{V} = \sum_{s \in \mathbb{F}_2^{k-\ell-(k_v-\ell_v)}} \text{PNO}(n_v, k_v, \ell_v, G_v, \tilde{D}_s)_{Q_1} \otimes |s\rangle\langle s|_{Q_2} \otimes \mathbb{1}_{Q_3} \quad (147) $$

for some $\tilde{D}_s$ fulfilling

$$ \sum_s p_s \|D_s - \tilde{D}_s\|_1 \le (2N(\mathcal{G}) + 3)^{|V|} \Delta + (\pi + 1)\Delta = \frac{1}{2}\beta^2 \quad (148) $$

because of Lemmas A.1 and D.2.

By the triangle inequality, we have

$$ \delta(V|\phi\rangle, \tilde{V}|\tilde{\phi}\rangle) \le \delta(|\phi\rangle, |\tilde{\phi}\rangle) + \delta(V|\phi\rangle, \tilde{V}|\phi\rangle), \quad (149) $$

so it remains to characterize the trace distance between $V|\phi\rangle$ and $\tilde{V}|\phi\rangle$. We do this by considering the fidelity:

$$ \langle\phi|V^\dagger\tilde{V}|\phi\rangle = \sum_s p_s \langle\alpha_{s,x,r_1}|\text{PNO}(n_v, k_v, \ell_v, G_v, D_s)^\dagger\text{PNO}(n_v, k_v, \ell_v, G_v, \tilde{D}_s)|\alpha_{s,x,r_1}\rangle \quad (150) $$

$$ \ge 1 - \sum_s p_s \|D_s - \tilde{D}_s\|, \quad (151) $$
where $|\alpha_{s,x,r_1}\rangle := \text{SPSC}[D_s]((x\|r_1)^T G_v)$ and we applied Lemma D.4. From the Fuchs-van de Graaf inequality, we get

$$ \delta(V|\phi\rangle, \tilde{V}|\phi\rangle) \le \beta, \qquad (152) $$

which proves the induction step.

<figure><img src="image_29.png" /></figure>

## D.3 Putting it all together

*Proof of Theorem 4.2.* As discussed in the beginning of this section, the success probability of discretized incoherent BPQM and DUC-BPQM in solving the subspace decoding task are identical. We know that UC-BPQM optimally solves the subspace decoding task, so it remains to show that DUC-BPQM and UC-BPQM output the same result with high probability.

The difference in probability of obtaining the correct result with UC-BPQM and DUC-BPQM is upper bounded by the trace distance

$$ \delta(U_{\text{UC-BPQM}} W(x) U_{\text{UC-BPQM}}^{\dagger}, U_{\text{DUC-BPQM}} W(x) U_{\text{DUC-BPQM}}^{\dagger}) \qquad (153) $$

$$ \le \frac{1}{2^{k-\ell}} \sum_r \delta(U_{\text{UC-BPQM}} |\Psi_{x,r}\rangle\langle\Psi_{x,r}| U_{\text{UC-BPQM}}^{\dagger}, U_{\text{DUC-BPQM}} |\Psi_{x,r}\rangle\langle\Psi_{x,r}| U_{\text{DUC-BPQM}}^{\dagger}) \qquad (154) $$

$$ \le |V|\beta, \qquad (155) $$

where $|\Psi_{x,r}\rangle := \text{SPSC}[D]((x\|r)^T G)$ and we applied Lemma D.5. Hence, it suffices to choose $B = O(N(G) + \log(1/\epsilon) + |V|\log N(G))$. By the discussion in Appendix A, we know that the total circuit complexity of discretized incoherent BPQM is $O(\text{poly}(B)4^{N(G)}N(G)^2|V|)$. □

<figure><img src="image_30.png" /></figure>

*Proof of Theorem 5.1.* In the beginning of this section, we argued that DUC-BPQM realizes the identical projection as coherent BPQM. Furthermore, we know from Corollary C.1 that the projection from UC-BPQM realizes block optimal decoding. It hence suffices to show that sequential DUC-BPQM projections are likely to produce the same measurement result as UC-BPQM.

Following the notation in Section 5.2, let us denote by $|\Psi_x\rangle$ for $x \in C$ the states that we want to distinguish, and let $U_{\text{DUC-BPQM},i}$ and $U_{\text{UC-BPQM},i}$ be the unitaries describing the node operations of UC-BPQM and DUC-BPQM for decoding the $i$-th codeword bit for $i = 1, \dots, k$. Our first goal will be to expand the result in Lemma D.5 to show that the two unitaries $U_{\text{DUC-BPQM},i}$ and $U_{\text{UC-BPQM},i}$ do not only have a similar action on the states $|\Psi_x\rangle$, but in fact, they act similarly on the entire subspace $V$.

For this purpose, let us consider some vector (possibly unnormalized) $|\phi\rangle \in V$, which we can expand as $|\phi\rangle = \sum_x \alpha_x |\Psi_x\rangle$ for some expansion coefficients $\alpha_x \in C$. For any $i = 1, \dots, k$, we obtain

$$ \|(U_{\text{DUC-BPQM},i} - U_{\text{UC-BPQM},i}) |\phi\rangle\| \le \sum_x |\alpha_x| \|(U_{\text{DUC-BPQM},i} - U_{\text{UC-BPQM},i}) |\Psi_x\rangle\|, \le \sqrt{2M\beta} \sum_x |\alpha_x| \qquad (156) $$

where we used Lemma D.5, the fact that $\|f\rangle - |g\rangle\| \le \sqrt{2}\delta(|f\rangle, |g\rangle)$ for any two vectors $|f\rangle, |g\rangle$ with only real entries in the computationl basis, and we defined $\beta := -\sqrt{2((2N+3)^M + \pi + 1)2^{N-B}}$.

Next, let us define the $2^k \times 2^k$ Gram-matrix $G$ with entries $G_{x,y} := -\langle \Psi_x | \Psi_y \rangle$ for $x, y \in C$.<fnref n="13" /> The matrix $G$ has the identical spectrum as $2^k \rho$ on $V$.<fnref n="14" /> We can write

$$ \|\phi\|^2 = \sum_{x,y} \tilde{\alpha}_x \alpha_y \langle \Psi_x | \Psi_y \rangle = \tilde{\alpha}^\dagger G \tilde{\alpha} \ge \lambda_{\min}(G) \|\tilde{\alpha}\|_2^2, \qquad (157) $$

where $\tilde{\alpha}$ is the column vector with the entries given by $\alpha_x, x \in C$ and $\lambda_{\min}$ is the smallest non-zero

<footnote n="13">¹³As a slight abuse of notation, we index the rows and columns with elements of $C$.</footnote>

<footnote n="14">¹⁴Consider a collection of linearly independent states $|f_1\rangle, \dots, |f_n\rangle$ and $T := \sum_j |f_j\rangle\langle j|$. Then, the matrices $T^\dagger T = \sum_{j,k} (f_j|f_k\rangle\langle j|)$ and $T^\dagger T = \sum_j |f_j\rangle\langle f_j|$ have the same eigenvalues.</footnote>
eigenvalue. As such, we obtain

$$ \|(U_{\text{DUC-BPQM},i} - U_{\text{UC-BPQM},i}) |\phi\rangle\| \le \sqrt{2M\beta} \|\tilde{\alpha}\|_1 \quad (158) $$

$$ \le \sqrt{2M\beta} \sqrt{2^k} \|\tilde{\alpha}\|_2 \quad (159) $$

$$ \le \sqrt{2M\beta} \sqrt{\frac{2^k}{\lambda_{\min}(G)}} \|\phi\| \quad (160) $$

$$ = \sqrt{2M\beta} \frac{1}{\sqrt{\lambda_{\min}(\rho)}} \|\phi\| . \quad (161) $$

It remains to find a lower bound for the minimal non-zero eigenvalue of $\rho$. For this, we use $U = \text{PNO}(n, k, k, G, P)$ to diagonalize $\rho$ using Lemma 3.1.

$$ U\rho U^\dagger = \sum_{x \in \mathbb{F}_2^k} \text{SPSC}[P_Y](x) \otimes |0\rangle\langle 0|^{\otimes (n-k)} \quad (162) $$

$$ = \sum_{y \in \mathbb{F}_2^k} P_Y(y) |y\rangle\langle y| \otimes |0\rangle\langle 0|^{\otimes (n-k)}. \quad (163) $$

Hence $\lambda_{\min}(\rho) = \min_{y \in \mathbb{F}_2^k} P_Y(y)$. Recall that $P_{Y,S,A}(y,s,a) = P(M^{-1}(y||s||a))$ where $P = P_1 \times \cdots \times P_n$ where $P_i$ is a binary symmetric channel with error probability $p_i$. Since $P_Y(y) \ge \min_{s,a} P_{Y,S,A}(y,s,a)$, we thus have $P_Y(y) \ge \min_{z \in \mathbb{F}_2^k} P(z)$. Since the smallest $P(z)$ is at least $\bar{p}^n$, where $\bar{p} := \min_{i=1,\dots,n} p_i$, we have $P_Y(y) \ge \bar{p}^n$.

In summary, we have

$$ \|(U_{\text{DUC-BPQM},i} - U_{\text{UC-BPQM},i}) |\phi\rangle\| \le \sqrt{2M\beta} \bar{p}^{-n/2} \|\phi\| . \quad (164) $$

Let us now turn our attention to comparing the block decoding performance of UC-BPQM and DUC-BPQM. The probability that UC-BPQM outputs the estimate $\hat{x}$ of $x$ is given by the norm of the (unnormalized) statevector

$$ M_{\hat{x}_k}^{(k)} M_{\hat{x}_{k-1}}^{(k-1)} \cdots M_{\hat{x}_1}^{(1)} |\Psi_x\rangle \quad (165) $$

where the projective measurement $\{M_0^{(i)}, M_1^{(i)}\}$ is defined by

$$ M_j^{(i)} = U_{\text{UC-BPQM},i}^{\dagger} \Pi_j U_{\text{UC-BPQM},i}, \quad (166) $$

and $\{\Pi_0, \Pi_1\}$ is the projective measurement of the final qubit in the conjugate basis. Similarly, the probability that coherent BPQM outputs the estimate $\hat{x}$ of $x$ is given by the norm of

$$ \tilde{M}_{\hat{x}_k}^{(k)} \tilde{M}_{\hat{x}_{k-1}}^{(k-1)} \cdots \tilde{M}_{\hat{x}_1}^{(1)} |\Psi_x\rangle \quad (167) $$

where the projective measurement $\{\tilde{M}_0^{(i)}, \tilde{M}_1^{(i)}\}$ is defined by

$$ \tilde{M}_j^{(i)} = U_{\text{DUC-BPQM},i}^{\dagger} \Pi_j U_{\text{DUC-BPQM},i}. \quad (168) $$

Observe that for UC-BPQM, every intermediate state

$$ M_{\hat{x}_i}^{(i-1)} \cdots M_{\hat{x}_1}^{(1)} |\Psi_x\rangle \quad (169) $$

for $i = 1, \dots, k$ is also an element of $V$, because of Proposition 5.1. The same might not necessarily be true for DUC-BPQM.

Observe that for any (possibly unnormalized) vector $|\phi\rangle \in V$, we have

$$ \begin{aligned} \| M_j^{(i)} |\phi\rangle - \tilde{M}_j^{(i)} |\phi\rangle \| \le \| (U_{\text{DUC-BPQM},i}^{\dagger} - U_{\text{UC-BPQM},i}^{\dagger}) \Pi_j U_{\text{UC-BPQM},i} |\phi\rangle \| \\ + \| U_{\text{DUC-BPQM},i} |\phi\rangle - U_{\text{UC-BPQM},i} |\phi\rangle \| . \end{aligned} \quad (170) $$
For the first term, observe that $\Pi_j U_{UC-BPQM,i} |\phi\rangle = U_{UC-BPQM,i} |\varphi\rangle$ for some $|\varphi\rangle \in V$ with $\|\|\varphi\rangle\|$ ≤ $\|\|\phi\rangle\|$, because we know that $M_j^{(i)} |\phi\rangle \in V$. Hence, we get

$$ \left\| (U_{\text{DUC-BPQM},i}^{\dagger} - U_{\text{UC-BPQM},i}^{\dagger}) \Pi_j U_{\text{UC-BPQM},i} |\phi\rangle \right\| \le \left\| U_{\text{DUC-BPQM},i} |\varphi\rangle - U_{\text{UC-BPQM},i} |\varphi\rangle \right\|. \quad (171) $$

In summary, we have

$$ \left\| M_j^{(i)} |\phi\rangle - \tilde{M}_j^{(i)} |\phi\rangle \right\| \le 2\sqrt{2M\beta\bar{p}^{-n/2}} \|\|\phi\rangle\|. \quad (172) $$

Chaining together this result $k$ times using the triangle inequality, we see that the probability of obtaining the outcome $\hat{x}$ with UC-BPQM and DUC-BPQM differs by

$$ \begin{aligned} & \left\| M_{\hat{x}_k}^{(k)} M_{\hat{x}_{k-1}}^{(k-1)} \dots M_{\hat{x}_1}^{(1)} |\Psi_x\rangle \right\| - \left\| \tilde{M}_{\hat{x}_k}^{(k)} \tilde{M}_{\hat{x}_{k-1}}^{(k-1)} \dots \tilde{M}_{\hat{x}_1}^{(1)} |\Psi_x\rangle \right\| \\ & \le \left\| M_{\hat{x}_k}^{(k)} M_{\hat{x}_{k-1}}^{(k-1)} \dots M_{\hat{x}_1}^{(1)} |\Psi_x\rangle - \tilde{M}_{\hat{x}_k}^{(k)} \tilde{M}_{\hat{x}_{k-1}}^{(k-1)} \dots \tilde{M}_{\hat{x}_1}^{(1)} |\Psi_x\rangle \right\| \end{aligned} \quad (173) $$

$$ \le k2\sqrt{2M\beta\bar{p}^{-n/2}}. \quad (174) $$

Therefore, it suffices to choose $B = O(n \log(\frac{1}{\bar{p}}) + \log(1/\epsilon) + N + M \log(N) + \log(k))$. By the discussion in Appendix A, we know that the circuit complexity of discretized incoherent BPQM is $O(\text{poly}(B)4^N N^2 M)$, which is repeated $k$ times. □

## References

[1] A. Chailloux and J.-P. Tillich, “The Quantum Decoding Problem”, in 19th Conference on the Theory of Quantum Computation, Communication and Cryptography (TQC 2024), Vol. 310, edited by F. Magniez and A. B. Grilo, Leibniz International Proceedings in Informatics (LIPIcs) (2024), 6:1–6:14, arXiv:2310.20651 [quant-ph] (pages 1–3).

[2] G. Forney, “The Viterbi algorithm”, Proceedings of the IEEE 61, 268–278 (1973) (pages 1, 8, 29).

[3] L. Bahl, J. Cocke, F. Jelinek, and J. Raviv, “Optimal decoding of linear codes for minimizing symbol error rate (corresp.)”, IEEE Transactions on Information Theory 20, 284–287 (1974) (pages 1, 8, 29).

[4] T. Debris-Alazard, M. Remaud, and J.-P. Tillich, “Quantum Reduction of Finding Short Code Vectors to the Decoding Problem”, IEEE Transactions on Information Theory 70, 5323–5342 (2024), arXiv:2106.02747 [cs.CR] (pages 1, 3).

[5] Y. Chen, Q. Liu, and M. Zhandry, “Quantum Algorithms for Variants of Average-Case Lattice Problems via Filtering”, in Advances in Cryptology – EUROCRYPT 2022, edited by O. Dunkelman and S. Dziembowski (2022), pp. 372–401, arXiv:2108.11015 [quant-ph] (pages 1–3).

[6] T. Yamakawa and M. Zhandry, “Verifiable quantum advantage without structure”, Journal of the ACM 71, 1–50 (2024), arXiv:2204.02063 [quant-ph] (pages 1, 3).

[7] S. P. Jordan, N. Shutty, M. Wootters, A. Zalcman, A. Schmidhuber, R. King, S. V. Isakov, T. Khatar, and R. Babbush, Optimization by decoded quantum interferometry, 2025, arXiv:2408.08292 [quant-ph] (pages 1–3).

[8] A. Chailloux and J.-P. Tillich, “Quantum Advantage from Soft Decoders”, in Proceedings of the 57th Annual ACM Symposium on Theory of Computing, STOC ’25 (June 15, 2025), pp. 738–749, arXiv:2411.12553 [quant-ph] (pages 1, 3).

[9] P. Briaud, I. Dinur, R. Ghosal, A. Jain, P. Lou, and A. Sahai, Quantum advantage via solving multivariate polynomials, 2025, arXiv:2509.07276 [quant-ph] (pages 1, 3).

[10] J. M. Renes, “Belief propagation decoding of quantum channels by passing quantum messages”, New Journal of Physics 19, 072001 (2017), arXiv:1607.04833 [quant-ph] (pages 2, 5, 6, 21, 24, 35, 42).