Belief Propagation with Quantum Messages for Quantum-Enhanced Classical Communications

For space-based laser communications, when the mean photon number per received optical pulse is much smaller than one, there is a large gap between communications capacity achievable with a receiver that performs individual pulse-by-pulse detection, and the quantum-optimal"joint-detection receiver"that acts collectively on long codeword-blocks of modulated pulses; an effect often termed"superadditive capacity". In this paper, we consider the simplest scenario where a large superadditive capacity is known: a pure-loss channel with a coherent-state binary phase-shift keyed (BPSK) modulation. The two BPSK states can be mapped conceptually to two non-orthogonal states of a qubit, described by an inner product that is a function of the mean photon number per pulse. Using this map, we derive an explicit construction of the quantum circuit of a joint-detection receiver based on a recent idea of"belief-propagation with quantum messages"(BPQM) (arXiv:1607.04833). We quantify its performance improvement over the Dolinar receiver that performs optimal pulse-by-pulse detection, which represents the best"classical"approach. We analyze the scheme rigorously and show that it achieves the quantum limit of minimum average error probability in discriminating 8 (BPSK) codewords of a length-5 binary linear code with a tree factor graph. Our result suggests that a BPQM-receiver might attain the Holevo capacity of this BPSK-modulated pure-loss channel. Moreover, our receiver circuit provides an alternative proposal for a quantum supremacy experiment, targeted at a specific application that can potentially be implemented on a small, special-purpose, photonic quantum computer capable of performing cat-basis universal qubit logic.


I. INTRODUCTION
"Message-passing" algorithms are used to efficiently evaluate quantities of interest in problems defined on graphs. They work by passing messages between nodes of the graph. For example, these algorithms have been successfully used for statistical inference, optimization, constraint-satisfaction problems and the graph isomorphism problem among several other applications [1][2][3][4][5][6][7][8]. In particular, "belief-propagation" (BP) is a message-passing algorithm for efficiently marginalizing joint probability density functions in statistical inference problems. The algorithm derives its name from the fact that the messages used in BP are "local" probabilities or "beliefs" (e.g., of the value of the final quantity of interest). An important application of BP lies in the decoding of linear codes using the posterior bit-wise marginals given the outputs of a classical channel [9]. It is well-known that BP exactly performs the task of optimal bit-wise maximum-a-posteriori (bit-MAP) decoding when the code's factor graph is a tree. However, since codes with tree factor graphs have poor minimum distance [9], BP is also applied to codes whose factor graphs have cycles, e.g, low-density parity-check (LDPC) codes. Although BP does not compute the exact marginals in this case, it is computationally more efficient than MAP, and usually performs quite well. In fact, it has been proven that, for large blocks, BP achieves the optimal MAP performance for spatially-coupled LDPC codes over the binary erasure channel [10] and binary memoryless symmetric channels [11,12]. From a more practical perspective, BP-based decoders are routinely deployed in modern communications and data storage.
Given the success of BP decoding for classical channels, it is natural to ask if it can be generalized to the quantum setting. For example, can one decode classical codes for communications over a classical-quantum channel or, more generally, perform efficient inference on graphically-represented classical data encoded in qubits? Consider laser communications based on binary-phase-shift-keying (BPSK) modulation for sending classical data over a pure-loss bosonic channel of transmissivity η ∈ (0, 1] [13]. During each "use" of the quantum channel, the transmitter modulates each optical pulse, or mode, into one of the two coherent states |α or |−α , where α ∈ R and the mean photon number per mode equals N S = |α| 2 . Each channel output symbol is an optical pulse that is in one of the two coherent states |±β , where β = √ ηα and mean photon number N = ηN S . These two states are non-orthogonal with an inner product β| − β = e −2N ≡ σ. In this case, the coherent states |±β = ∞ n=0 e −|β| 2 /2 (±β) n √ n! |n live in an infinite-dimensional Hilbert space spanned by the complete orthonormal number basis {|n , n ∈ N}. However, since each channel output is always in one |±β , for the purposes of designing a receiver, we can embed the subspace spanned by |±β in a two-dimensional (qubit) Hilbert space via the inner-product-preserving map: with σ = cosθ. The resulting channel from a classical encoding variable x to a conditional quantum state, i.e., [x = 0] → |θ , [x = 1] → |−θ , is often called a (pure-state) "classical-quantum" (CQ) channel in the quantum information theory literature. When the channel output symbols are detected one at a time, the best possible detection error probability is given by the Helstrom bound [14,15] on the minimum average error probability of discriminating the alphabet states |±β , which is p : . A structured optical design of a receiver that achieves this performance was invented by Dolinar in 1973 [16]. This receiver induces a binary symmetric channel (BSC) between the quantum channel outputs |±β and the receiver's guess " ± β", with crossover probability p, thereby enabling the communicating parties to achieve a reliable communication rate given by C 1 = 1 − h 2 (p) bits per mode, the Shannon capacity of the BSC. To achieve communication at a rate close to this capacity, one would need to use a code that achieves the Shannon capacity of the BSC, e.g., Arikan's polar code [17], and a suitable decoder. If the receiver detects, i.e., converts from the quantum (optical) to the electrical domain, each quantum channel output one at a time, no amount of classical post-processing, including feedforward between channel uses, and soft-information processing, can achieve a rate higher than C 1 . Thus, a capacity-approaching LDPC code for the BSC and a BP decoder can approach but not surpass the rate C 1 .
However, if one employs a quantum joint-detection receiver that collectively measures the entire block of n channel outputs, then the rate may increase to the Holevo limit, ) bits per mode, where S(·) denotes the von Neumann entropy. In the limit as N → 0 (or equivalently σ → 1), where the mean photon number per mode vanishes, one can show that C ∞ /C 1 → ∞ and collective measurement is preferable. This regime of operation is especially important for long-haul free-space terrestrial and deep-space laser communications. In order to fully exploit this large capacity gain, one can use a CQ polar code [13] with a decoder based on collective measurement of the received quantum state. Alternatively, one can use a codebook comprising M = 2 nR random length-n codewords with R < C ∞ , where each symbol of each codeword chosen from an equal prior over the two BPSK symbols. If the receiver employs a joint measurement that discriminates between the codewords sufficiently well, then the probability of decoding error will converge to 0 as n → ∞. Both the optimal measurement and the square-root measurement (SRM) are known to faithfully discriminate between roughly 2 nC∞ codewords [18], as opposed to only 2 nC1 codewords if symbol-by-symbol detection is combined with classical decoding. Given the quantum states of the M codewords, the optimal measurement can be computed by applying the Yuen-Kennedy-Lax (YKL) conditions [19] applied to the Gram matrix of the codebook-the M -by-M matrix of pairwise inner products of the codewords' quantum states. This calculation is simpler for linear codes [20], especially codes that have certain group symmetries [21]. Even when it is possible to compute the optimal measurement for the codebook, it may be hard to translate the mathematical description into a physical receiver design [22], unless we have a general-purpose photonic quantum computer [23]. Therefore, an efficient and physically-realizable receiver is of significant practical interest if it can outperform the optimal receiver based on optimal symbol-by-symbol measurement.
Renes [24] recently proposed a quantum generalization of BP for a binary-output pure-state CQ channel. Renes' algorithm is well-defined on a tree factor graph and works by passing quantum messages (encoded in qubits) and classical messages (bits) between nodes of the code's factor graph. Unlike earlier algorithms termed "quantum beliefpropagation" [25,26], Renes' algorithm does not measure the n channel outputs, followed by classical BP on the (classical) syndrome measurements, and hence is not limited to achieving a rate of C 1 . In order to avoid any confusion with previous quantum belief-propagation algorithms, we will refer to Renes' algorithm as "belief-propagation with quantum messages" (BPQM).
In [24], the first step in developing BPQM was to interpret the message-combining operations in classical BP as "channel combining" rules that execute a local inference procedure. This step has close connections with the channel combining operation defined by Arikan for polar codes [17]. The second step was a generalization of these channel combining rules to allow for quantum messages, as in CQ polar codes [18], i.e., messages that are qubit density matrices which capture the node's belief about a message bit. The above rules define a CQ channel that gets induced at each Factor graph and parity-check matrix for the 5-bit linear code in the running example.
node when (quantum) messages arrive at it. Finally, the third step was to define appropriate unitary operations at the nodes, which process the outputs of the aforesaid induced CQ channels and produce messages to be passed on to subsequent nodes. While [24] is a breakthrough paper that provides a phenomenological description of BPQM, it does not assess its performance on an example code or make comparisons with optimal symbol-by-symbol measurements. Also, it does not present a proof of decoding optimality, even for CQ codes with a tree factor graph. Finally, it does not prescribe an explicit quantum circuit for BPQM. This paper addresses all of the above open questions and resolves many of them for the chosen example code.

A. BPQM-based Receiver Design and Block Error Rates
We construct an explicit quantum circuit for a BPQM-based joint-detection receiver (blueprint shown under Methods, see Fig. 8), and prove that it achieves the Helstrom limit for discriminating between the 8 codewords in our exemplary n = 5 linear BPSK code with a tree factor graph, as shown in Fig. 1. Hence, it outperforms the best achievable performance by the optimal symbol-by-symbol receiver measurement followed by a MAP decision. Based on our analysis of BPQM, we introduce a coherent rotation to be performed after decoding bit 1 as part of our receiver design, which is not part of Renes' original BPQM scheme. This might be important for generalizing BPQM beyond the specific example considered here (see Remark 2). We explicitly compute the density matrices of quantum messages that are passed, and evaluate the performance of BPQM for this example code. For decoding bit 1, we also derive an analytical expression for the BPQM success probability. The ultimate benchmark for decoding a bit is the performance of the Helstrom measurement that optimally distinguishes the density matrices corresponding to the two values of the bit. We show that BPQM is optimal for deciding the value of each of the 5 bits. In Fig. 2, we plot performance curves that show the "global" performance of BPQM for the 5-bit code in terms of block (codeword) error rate for the following strategies: (a) collective (optimal) Helstrom measurement on all n = 5 channel outputs of the received codeword, (b) BPQM on all channel outputs of the received codeword, (c) symbol-by-symbol (optimal) Helstrom measurement followed by classical (optimal) block-MAP decoding, and (d) symbol-by-symbol (optimal) Helstrom measurement followed by classical BP decoding.
For the last two schemes, classical decoding is performed for the BSC, with crossover probability p = 1 , that is induced by measuring each channel output with the Helstrom measurement to discriminate between |±θ .
As expected, the block error probabilities are in increasing order from (a) through (d). The plot shows that BPQM is strictly better than the quantum-optimal symbol-by-symbol detection followed by a block-MAP decision at all values of mean photon number per mode, and that it meets the optimal joint Helstrom measurement on the modulated codeword. We confirm this optimality analytically by using the fact that the square root measurement  (SRM), also called the pretty good measurement (PGM), is optimal for transmitting binary linear codes on the pure-state channel [20] (discussed under Methods). More precisely, we calculate the closed-form expression for the SRM block error probability [27], in terms of the classical code and associated cosets, and the density-matrix based expression for the BPQM block error probability for this example code. Then, for a range of channel parameters we compute the values from these expressions and confirm that they agree up to even 15 decimal places. Therefore, while decomposing the SRM itself into an explicit circuit might be challenging, BPQM provides a circuit that still achieves the optimal block error probability for this code. This is an important result because, it demonstrates that, if we can construct a BPQM receiver, then it will outperform any known physically realizable receiver for this channel. We provide more detailed observations on Fig. 2 shortly.

B. Photon Information Efficiency
Besides the block error rates, we also compare the mutual information-per-photon-per-channel-use, also referred to as the photon information efficiency (PIE) [28,29], for BPQM, with the Holevo capacity of the pure-state channel and the capacity induced by symbol-by-symbol Helstrom measurements. In order to do this, we consider a composite channel whose input is k = 3 bits and output is also k = 3 bits, where the channel consists of encoding into the 5-bit code, transmitting over the pure-state channel, applying the BPQM receiver and identifying the transmitted codeword (equivalently the k-bit message). Determining the PIE for the BPQM analytically involves calculating closed form expressions for the transition probabilities of the 2 k -ary channel (where k = 3 for the considered 5bit code), which involves cumbersome calculations of the relevant density matrices. Instead, we calculate the PIE numerically by performing a Monte Carlo simulation. Fig. 3 shows a plot of the PIE of the BPQM receiver along with those corresponding to the Holevo capacity and the symbol-by-symbol Helstrom induced BSC capacity. We also compute the PIE for the square root measurement (SRM). The transition probability of decoding a transmitted message t ∈ {0, 1} k as g ∈ {0, 1} k using the SRM is given by [27] whereŝ(h) is as defined in (77) (under Methods, where the block success rate with the SRM given by (76) is evaluated). Therefore, the transition probability only depends on the sum g ⊕ t and hence the channel is symmetric. Using this closed form expression, we compute the mutual information for this k-bit channel, normalized by n = 5 (to obtain mutual information per channel use), then normalized by N to obtain the PIE, and also plot it in Fig. 3. We see that both BPQM and SRM produce identical curves, just as they do in block error rates. Finally, we observe that there exists a regime of N , where this explicit small code along with BPQM or SRM demonstrates superadditive capacity that beats the largest PIE obtained from symbol-by-symbol Helstrom measurements. The PIE with the BPQM (or SRM) receiver is found to be maximized at N = 6.2 × 10 −3 , the maximum PIE being 3.021, whereas the corresponding PIE attained by symbol-by-symbol Helstrom measurements is 2.862, the ratio of the two numbers being 1.056. (Interestingly, this is higher than the PIE ratio of 1.031 that has been reported for a different 5-bit code with 16 codewords and the corresponding SRM in Ref. [30].) The superadditive PIE hence makes the case stronger for performing the optimal collective measurement at the channel output using the systematic scheme of BPQM. In Fig. 2, we had plotted the block error probabilities as a function of the mean photon number per mode for the different measurement strategies. In Fig. 4, we plot both the bit and block error probabilities (and success probabilities, i.e., one minus error probability) for these measurement strategies. For strategy (a), the performance of the collective Helstrom measurement is plotted using the Yuen-Kennedy-Lax (YKL) conditions [19] as discussed, for example, in [21]. For strategies (c) and (d), classical processing is performed essentially for the BSC induced by measuring each qubit output by the pure-state channel. The mean photon number per mode, N , relates to the pure-state channel parameter θ as cos θ = e −2N (e.g., see [13] for more information on this quantity). We make the following observations from these performance curves.
1. The block error rates are in increasing order from strategy (a) to (d), as we might expect. Even though classical BP is performed on a tree FG here, it only implements bit-MAP decoding and not block-MAP decoding. This is why it performs worse than block-ML (i.e., block-MAP with uniform prior on codewords) in this case.
2. BPQM performs strictly better than symbol-by-symbol optimal detection followed by classical MAP decoding. This gives a clear demonstration that if one physically constructs a receiver for BPQM, then it will be the best known physically realizable receiver for the pure-state channel. For example, the Dolinar receiver [13,16] realizes only strategy (c). One can use our circuits to make such a physical realization.
3. BPQM performs as well as the quantum optimal collective Helstrom measurement on the outputs of the channel. This lends evidence to the conclusion that by passing quantum messages, BPQM is able to behave like a collective measurement while still making only single-qubit Pauli measurements during the process. However, more careful analysis is required to characterize this in general for, say, the family of codes with tree FGs.   success probabilities for decoding each bit and its overall performance for the 5-bit code, the theoretical BPQM/Helstrom success rate for bit 1, the initial theoretical prediction of 0.5(1 + sin θ ) for BPQM for bits 2-5, the performance of BP and block-ML when applied to the directly measured channel outputs, and the joint Helstrom limit (76). (b) The same curves on the left plotted against the mean photon number per mode N (cos θ = e −2N ), where the codeword Helstrom limit was calculated from the YKL limit as in [21]. It can be seen that the YKL limit also matches the theoretical calculation from (76). 4. As a first self-consistency check, we observe that the block-ML curve asymptotes at roughly 0.875 for low mean photon numbers per mode. This is because, in this regime, the BSC induced by the symbol-by-symbol measurement essentially has a bit-flip rate of 0.5. Therefore, block-ML computes a posterior that is almost uniform on all codewords, and thus the block success probability is 1/|C| = 1/8 = 0.125.

5.
As another self-consistency check, we note that the BP curve asymptotes at roughly (1 − 1/32) = 0.9688 for low mean photon numbers per mode. Since BP performs bit-MAP on this FG, and the induced BSC in this regime flips bits at a rate of almost 0.5, BP essentially picks each bit uniformly at random, thereby returning a vector that is uniformly at random out of all the possible 2 5 = 32 vectors of length 5.
6. The bit error probability plots show that even though BPQM is optimal for bits x 2 through x 5 , it still performs slightly poorly when compared to the performance for x 1 . This might be attributed to the fact that in the chosen parity-check matrix, bit x 1 is involved in both checks whereas the other bits are involved in exactly one of the two checks.
CQ polar codes are known to achieve capacity on CQ channels when paired with a quantum successive cancellation decoder [13,31]. It remains to be seen if the same is also true for a BPQM-based decoder. Though this is mentioned in [24], we think this requires more details in the form of an explicit proof. The quantum optimality of BPQM shown in this paper for the example 5-bit code bodes well for BPQM in this regard. It also remains open as to how BPQM can be generalized to FGs with cycles and also for decoding over general CQ channels. We have shown that the coherent rotation we introduced after measuring the first bit plays an important role in BPQM's optimality (see Remark 2). Hence, one needs to refine Renes' definition of the BPQM algorithm in more general settings. BPQM also has close connections with the recently introduced notion of channel duality [32]. The resulting entropic relations could help characterize the performance of a code over a channel using the performance of its dual code over the dual channel. Since the dual of the pure-state channel is the classical BSC, we believe it may be possible to extend classical techniques for analyzing BP (on BSC), such as density evolution, to analyze BPQM as well.
Leveraging optical realizations of "cat basis" quantum logic, i.e., single-and two-qubit quantum gates in the span of coherent states |β and |−β [33,34], our BPQM quantum circuit can be translated into the first fully-structured optical receiver that would attain the quantum limit of minimum-error discrimination of more than two coherent states. Since there is a proven classical-quantum performance gap as discussed above, implementing our receiver on an optical quantum processor provides an alternative proposal for a quantum supremacy experiment that is distinct from the conventional proposals based on random circuits [35].

III. METHODS
In this section, we will analyze the BPQM algorithm on the example 5-bit code shown in Fig. 1. See Supplementary Note 1 for a review of decoding classical linear codes using the belief propagation (BP) algorithm. It is very useful to interpret the node operations in BP as performing local statistical inference over certain induced channels, and this perspective is explained in Supplementary Note 2. This interpretation is also extended to classical-quantum channels as first described by Renes in [24]. Then Supplementary Note 3 introduces the pure-state channel and describes the BPQM algorithm via its node operations. The relevant node convolution operations are performed in detail in Supplementary Note 6 for completeness.
We assume that all the codewords are equally likely to be transmitted, just as in classical BP. Then the task of decoding the value of the first bit x 1 involves distinguishing between the density matrices ρ 1 , which are uniform mixtures of the states corresponding to the codewords that have x 1 = 0 and x 1 = 1, respectively, i.e., These density matrices can be written in terms of the FN channel convolution in (19) of the Supplementary material as ρ x1 , where we use the notation ± ≡ (−1) x1 , x 1 ∈ {0, 1}. The BPQM circuit for decoding x 1 is shown in Fig. 5 along with the density matrix in each stage of the circuit denoted by (a) through (e).
We emphasize that at each stage, the density matrix is the expectation over all pure states obtained there that correspond to transmitted codewords with the first bit taking value  Fig. 1. All circuits are drawn using the "Quantikz" package [36].
effectively two-qubit unitary operations, albeit controlled ones, and this phenomenon extends to any factor graph.
Evidently, BPQM compresses all the quantum information into system 1 and the problem reduces to distinguishing between Ψ (1) ± = j,k∈{0,1} 2 p j p k ±ϕ jk ±ϕ jk 1 , since the other systems are either trivial or completely classical and independent of x 1 . Finally, system 1 is measured by projecting onto the Pauli X basis, which we know from the discussion in Supplementary Note 3.2 after (31) to be the Helstrom measurement to optimally distinguish between the states Ψ (1) ± . It is pertinent that the optimal success probability of distinguishing between the density matrices ρ The action of BPQM until the final measurement is unitary and the trace norm · 1 is invariant under unitaries. Thus, BPQM does not lose optimality until the final measurement. Since the final measurement is also optimal for distinguishing the two possible states at that stage (e), BPQM is indeed optimal in decoding the value of x 1 . Thus, despite not performing a collective measurement, but rather only a single-qubit measurement at the end of a sequence of unitaries motivated by the FG structure and induced channels in classical BP, BPQM is still optimal to determine whether x 1 = 0 or 1. The performance curves plotted in Fig. 6 demonstrate this optimality.
Remark 1. Observe that in this quantum scenario, ρ (x) 1 behave like a "posterior" for bit x 1 . However, these can be written down even before transmitting over the channel since they do not depend on the output of the channel. Hence, it is unclear if there is a better notion of a true posterior which we can then show to be "marginalized" by BPQM.
We now analyze the performance of the receiver in decoding bit 1. The probability to decode it asx 1 = 0 is Therefore, since there are 4 codewords each that have x 1 = 0 and x 1 = 1, the prior for bit x 1 is 1/2 and the probability of success for BPQM in decoding the bit x 1 is  represents P Hel succ,1 and "Direct" represents the success probability when directly implementing the Helstrom measurement at the channel output on system 1. The curve "Sim: BPQM" corresponds to a simulation that averaged each data point over 10 5 codewords.
where we have used the fact that since all channels are identically W , we have cos θ 1 = 0. We can calculate cos ϕ 00 = cos θ cos θ 00 = cos θ cos 2 θ 0 = cos θ 4 cos 2 θ (1 + cos 2 θ) 2 ⇒ sin ϕ 00 = 1 − 16 cos 6 θ (1 + cos 2 θ) 4 Substituting back, we get the BPQM probability of success for bit x 1 to be which is the curve plotted as "Theory: BPQM P BPQM succ,1 " in Fig. 6. Before measuring system 1, the state of system 1 is essentially Ψ (1) ± = p 2 0 ±ϕ 00 ±ϕ 00 + (1 − p 2 0 ) |± ±|, since cos ϕ jk = 0 whenever either j or k equals 1 (or both) and hence ±ϕ jk ±ϕ jk = |± ±|. So, p 2 0 is the probability that the system "confuses" the decoder, and projection onto the X basis essentially replaces the system with |m 1 m 1 |, where m 1 = (−1)x 1 ∈ {+, −}. The full post-measurement state is given by quantum mechanics to be Note that in Fig. 5, we need to apply a Hadamard after the Z-basis measurement in order to ensure that the effective projector is H |x 1 x 1 | H = |m 1 m 1 |. Let us denote the overall unitary operation performed in Fig. 5 until stage (e) as B BPQM 1 . As mentioned earlier, the Helstrom measurement to optimally distinguish between ρ Thus, we can express the eigenvectors for (ρ |j . This further implies that Π Hel Hence, in order to identically apply the Helstrom measurement Π Hel 1 , BPQM needs to first apply B BPQM 1 , then measure the first qubit in the X-basis, and finally invert B BPQM 1 on the post-measurement state Φ m1 above. Although this is optimal for bit 1, next we will see that it is beneficial to coherently rotate Φ m1 before inverting B BPQM 1 , which sets up a better state discrimination problem for decoding bit 2.

B. Decoding Bits 2 and 3 (or 4 and 5)
Next, in order to execute BPQM to decode bit x 2 , we would ideally hope to change the state Φ m1 back to the channel outputs. However, this is impossible after having performed the measurement. In the original BPQM algorithm [24], the procedure to be performed at this stage is ambiguous, so we describe a strategy that treads closely along the path of performing the Helstrom measurement for bit 2 as well, i.e., optimally distinguishing ρ In order to be able to run BPQM for bit x 1 in reverse to get "as close" to the channel outputs as possible, we need to make sure that the state Φ m1 is modified to be compatible with the (angles used to define the) unitaries V and U in Fig. 5. Since we can keep track of the intermediate angles deterministically, we can conditionally rotate subsystem 1 to be m 1 ϕ 00 m 1 ϕ 00 1 for |jk jk| 45 = |00 00| 45 . Note again that in Ψ ± , when either of j or k is 1 (or both), ϕ jk = π/2 and hence ±ϕ jk ±ϕ jk = |± ±|. Therefore, ifx 1 is the wrong estimate for x 1 , then m 1 |± = 0 and the superposition in Φ m1 collapses to a single term with j = k = 0.
More precisely, we can implement the unitary operation (see Supplementary Note 5 for a decomposition of K m1 ) where K + and K − are unitaries chosen to satisfy K + |+ = ϕ 00 and K − |− = −ϕ 00 , respectively. We can easily complete these partially defined unitaries with the conditions K + |− = sin Now the BPQM circuit for bit x 1 , shown in Fig. 5, can be run in reverse from before the final measurement, i.e., from stage (e) back to stage (a). Hence, the overall operation on the input state in Fig. 5 is Then we expect the state to be almost the same as the channel outputs, except that system 1 will deterministically be in state |m 1 θ m 1 θ| 1 . However, a simple calculation shows that this is not completely true since the additional factor prevents the density matrix to decompose into a tensor product of two 2-qubit density matrices at stage (b) of Fig. 5. Specifically, when we takeΨ m1 at stage (e) back to stage (b) by inverting the BPQM operations, we arrive at the statẽ ρ (m1) Lemma 1. Let C := (I 2 ) 1 ⊗ CNOT 2→3 ⊗ CNOT 4→5 and |Γx 1 := cos Proof. We know from the definition of the factor node convolution operation of BPQM that This in turn implies that Ignoring the first qubit and the constant factor for simplicity, observe that We have used the fact that except when j = k = 0, assumingx 1 = x 1 , m 1 | ± ϕ jk = m 1 |m 1 ϕ jk = m 1 |m 1 = 1.
At this point, we have decodedx 1 = 0 if m 1 = + andx 1 = 1 if m 1 = −. We can absorb the value ofx 1 in the FG by updating the parity checks c 1 and c 2 to impose x 2 ⊕ x 3 =x 1 and x 4 ⊕ x 5 =x 1 , respectively. Now we have two disjoint FGs as shown in Fig. 7. It suffices to decode x 2 and x 4 sincex 3 =x 2 ⊕x 1 andx 5 =x 4 ⊕x 1 . Also, due to symmetry, it suffices to analyze the success probability of decoding x 2 (resp. x 4 ) and x 3 (resp. x 5 ). For this reduced FG, we need to splitρ m1,a into two density matrices corresponding to the hypotheses x 2 = 0 and x 2 = 1. If we revisit the density matrices ρ 1 , we observe that the 5-qubit system at the channel output is exactly 1 2 1 . Hence, for x 2 , we accordingly split [W W ](x 1 ) 23 inρ m1,a and arrive at the two hypotheses states In Supplementary Note 4 we discuss how these hypotheses must be processed, which makes the next steps of BPQM intuitively clear (see Supplementary Figure 3). However, the success probability derived from this analysis for bits 2-5 turns out to be significantly higher than the quantum optimal scheme for each bit at the channel output (see Supplementary Figure 4). This indicates that the state discrimination problem for bit 2 discussed above is more ideal than the actual problem in hand. Hence, next we analyze the true state discrimination problem for bit 2 (or 4) and clarify the observed performance in Supplementary Figure 4.

C. Analysis of BPQM Optimality for Decoding Bit 2 (or 4)
At the channel output, it is clear that the optimal strategy to decode bit 2 is to perform the Helstrom measurement that distinguishes between ρ (0) 2 and ρ (1) 2 . However, since we performed BPQM operations to decode bit 1 first, these two density matrices would have evolved through that process. Therefore, the correct analysis is to derive the resulting states and then subject them to the BPQM strategy for decoding bit 2 that was discussed above. For simplicity, we only track the density matrix ρ (0) 2 through the different stages in Fig. 8. In Fig. 11 we provide the full expanded BPQM circuit for decoding all bits, and this can be turned into a circuit composed of standard quantum operations by using the decompositions in Figs. 9 and 10. The corresponding states for ρ (1) 2 can easily be ascertained from these. It will be convenient to express For brevity, we will use the notation CX ij := CNOT i→j and Swap 34 := CX 34 CX 43 CX 34 . Then we can write The open-circled controls indicate that K m1 is coherently controlled by the last two qubits being in the state |00 45 . The solid line before K m1 indicates that the controlled unitary is applied to the post-measurement state. See Fig. 11 for the full decomposition of this circuit.
Next we make an X-basis measurement on the first qubit, and for convenience we assume that the measurement result is m 1 = +. The analysis for m 1 = − is very similar and follows by symmetry. We verified numerically that Tr |+ +| 1 · ρ 2,e = 0.5, which we might intuitively expect since ρ 2,e is the density matrix for x 2 = 0 and x 2 is independent from x 1 . Since m 1 = +, we follow the measurement with the conditional rotation M + in (21) to obtain FIG. 11: Full decomposition of the BPQM circuit in Fig. 8. The variable node unitaries U (θ, θ ) are decomposed in Fig. 9. The two-qubit-controlled coherent versions of these unitaries as well as the single-qubit rotation K m1 , which is a function of the measurement result m This is the state at stage (f) in Fig. 8. Hence, for x 2 = 0, the density matrix we have whenx 1 = 0 and we reverse the BPQM operations on Φ This is the state at stage (g) in Fig. 8. So, this is the actual density matrix that BPQM encounters for x 2 = 0 after having estimatedx 1 = 0. When compared with the earlier analysis, we observe numerically that this is close tõ Φ x2=x1 (x 1 ) but is not exactly the same. For example, when θ = 0.1π we find that ρ where "Fro" denotes the Frobenius norm, and only two of the distinct entries differ (slightly). Similarly, However, most importantly, we observe that 1 2ρ (0) 2,m1=+ = 1 2Φ x2=0 (0) + 1 2Φ x2=1 (0). This explains that while the full density matrixρ m1,a was correct, we had split it incorrectly to arrive at the two hypothesesΦ x2=x1 (x 1 ) andΦ x2 =x1 (x 1 ). Now, the Helstrom measurement that optimally distinguishes betweenρ (0) 2,m1=+ andρ (1) 2,m1=+ only depends onρ By symmetry of m 1 = + and m 1 = −, the optimal success probability to decide bit 2 is given by Since L is not unitary, we cannot directly apply the unitary invariance of the trace norm to conclude that there is no degradation in performance when compared to optimally distinguishing ρ at the channel output. However, we observe numerically (even up to 12 significant digits) that the operations in L indeed ensure that . Moreover, we also observe that the BPQM operations for bit 2 given in Supplementary Figure 3 achieve the same success probability, i.e., using the notation ± ≡ (−1) x2 we have P BPQM succ,2 = Tr U (m 1 θ, θ)ρ 2,m1 U (m 1 θ, θ) † · |± ±| 2 (50) = P Hel succ,2 .
Finally, the simulation results in Fig. 4 clearly show that the overall block error rate of BPQM coincides with that of the quantum optimal joint Helstrom limit. It remains open to rigorously prove all of these observations.

D. Overall Performance of BPQM
We can calculate the probability that the full codeword x is decoded correctly as = P BPQM succ,1 · P BPQM succ,2 x1=x1=0 The first term in (55) is clearly P BPQM succ,1 = P Hel succ,1 . The second term, however, is different from P BPQM succ,2 = P Hel succ,2 because of the conditioning on x 1 being estimated correctly, whereas in the above analysis we had implicitly averaged overx 1 = x 1 andx 1 = x 1 . Nevertheless, we can use a similar strategy as above to derive an expression for the second term. Here, we want to condition on x 1 being estimated correctly, i.e.,x 1 = x 1 , and derive the hypothesis states for x 2 under this scenario. Similarly, for the third term, the additional conditioning onx 2 = x 2 makes it not equal to the second term, although x 2 and x 4 are placed symmetrically in the factor graph of the code. But it still holds that . We perform these two analyses next and then combine them to calculate the full block success probability of BPQM. We will first analyze the decoding of bit 2 conditioned on bit 1. Let (ρ ) be two pairs of hypothesis states for x 2 , at the channel output, where the first pair is conditioned on x 1 = 0 and the second on x 1 = 1, and this information is known to the receiver. It is clear, for example, that ρ This is the state at stage (g) in Fig. 8. So, this is the actual density matrix that BPQM encounters for x 2 = 0 after having estimated correctly thatx 1 = x 1 = 0 (and reversed the first set of operations). Similarly, σ We verified numerically that the final processing of BPQM, after (g) in Fig. 8, also achieves the same success probability, i.e., .
Using a similar procedure as above, we can verify the analogous result for x 2 conditioned on x 1 = 1 andx 1 = x 1 = 1.
Next, we will analyze the decoding of bit 4 conditioned on bits 1 and 2. For convenience, let us assume that x 1 = x 2 = 0 in the transmitted codeword. Note that, due to symmetry, this choice will not affect the analysis and the final probability of success for x 4 conditioned on correct estimation of x 1 and x 2 will be independent of this fixed choice. Then, at the channel output, the candidate states for x 4 are given by ρ (00x4) 4 = |θ θ| 1 ⊗ |θ θ| 2 ⊗ |θ θ| 3 ⊗ |(−1) x4 θ (−1) x4 θ| 4 ⊗ |(−1) x4 θ (−1) x4 θ| 5 . is the probability of measuring x 1 = 0, then conditioned on this correct measurement we arrive at the following candidate states after the next set of BPQM operations: is the probability of measuring x 2 = 0, conditioned onx 1 = x 1 , then conditioned on this correct measurement we arrive at the following candidate states after the x 2 measurement: Therefore, any measurement that optimally distinguishes between x 4 = 0 and x 4 = 1 conditioned onx 1 = x 1 and x 2 = x 2 must satisfy the same probability of success as the Helstrom measurement on (ρ (000) 4,3 , ρ 4,3 ). We verified that measuring the 4th qubit in the X basis on ρ (00x4) 4,3 indeed satisfies this and hence BPQM is optimal in estimating x 4 conditioned on estimating x 1 and x 2 correctly, i.e., However, we also observe that Remark 3. The above analyses demonstrate that even though the measurement for each bit is irreversible, BPQM still decides each bit optimally in this 5-bit example code. In particular, the order in which the bits are decoded does not seem to affect the performance. This needs to be studied further and we need to analyze if BPQM always achieves the codeword Helstrom limit for all codes with tree factor graphs. We emphasize that, while in classical BP there is no question of ordering and one makes hard decisions on all the bits simultaneously after several BP iterations, it appears that quantum BP always has a sequential nature due to the unitarity of operations and the no-cloning theorem. This resembles "successive-cancellation" type decoders more than BP. Due to these facts, we expect that extending classical ideas for analyzing BP, such as density evolution [9], will require some caveats in the quantum setting.
In connection to this, Renes has recently developed a precise notion of duality between channels, and shown that classical channels need to be embedded in CQ channels in order to define their duals [32]. An interesting fact that follows from this framework is that the dual of the pure-state channel is the classical binary symmetric channel (BSC). Since we know that density evolution is a well-defined analysis technique for BP on BSCs, albeit sophisticated, it will be interesting to see if duality allows one to borrow from this literature and analyze BPQM on pure-state channels.

DATA AVAILABILITY
No specific public/private dataset was used in this research.

CODE AVAILABILITY
The computer programs to generate the data produced in our simulations are made available at https://github. com/nrenga/bpqm.