---
abstract: 'Establishing the security of continuous-variable quantum key distribution against general attacks in a *realistic* finite-size regime is an outstanding open problem in the field of theoretical quantum cryptography if we restrict our attention to protocols that rely on the exchange of coherent states. Indeed, techniques based on the uncertainty principle are not known to work for such protocols, and the usual tools based on de Finetti reductions only provide security for unrealistically large block lengths. We address this problem here by considering a new type of *Gaussian* de Finetti reduction, that exploits the invariance of some continuous-variable protocols under the action of the unitary group $U(n)$ (instead of the symmetric group $S_n$ as in usual de Finetti theorems), and by introducing generalized $SU(2,2)$ coherent states. Crucially, combined with an energy test, this allows us to truncate the Hilbert space globally instead as at the single-mode level as in previous approaches that failed to provide security in realistic conditions. Our reduction shows that it is sufficient to prove the security of these protocols against *Gaussian* collective attacks in order to obtain security against general attacks, thereby confirming rigorously the widely held belief that Gaussian attacks are indeed optimal against such protocols.'
author:
- Anthony Leverrier
title: 'Security of continuous-variable quantum key distribution via a Gaussian de Finetti reduction'
---

Quantum key distribution (QKD) is a cryptographic primitive aiming at distributing large secret keys to two distant parties, Alice and Bob, who have access to an authenticated classical channel. Mathematically, a QKD protocol ${\mathcal{E}}$ is described by a quantum channel, that is a completely positive trace-preserving (CPTP) map transforming an input state, typically a large bipartite entangled state shared by Alice and Bob, into two keys, ideally two identical bit strings unknown to any third party. Establishing the security of the protocol against arbitrary attacks means proving that the map ${\mathcal{E}}$ is approximately equal to an ideal protocol ${\mathcal{F}}$. An operational way of quantifying the security is by bounding the completely positive trace distance, or diamond distance between the two maps [@PR14]: the protocol is said to be ${\varepsilon}$-secure if $\|{\mathcal{E}}- {\mathcal{F}}\|_{\diamond} \leq {\varepsilon}$. If ${\mathcal{E}}$ and ${\mathcal{F}}$ act on some Hilbert space ${\mathcal{H}}$ and $\Delta = {\mathcal{E}}- {\mathcal{F}}$, then the diamond norm is defined as $$\begin{aligned}
\|\Delta\|_\diamond = \sup_{\rho \in {\mathfrak{S}}({\mathcal{H}}\otimes {\mathcal{H}}') } \|(\Delta \otimes {\mathbbm{1}}_{{\mathcal{H}}'}) (\rho) \|_1 \label{eqn:diamond1}\end{aligned}$$ where $\|\cdot\|_1$ is the trace norm and ${\mathfrak{S}}({\mathcal{H}}\otimes {\mathcal{H}}')$ is the set of normalized density matrices (positive operators of trace 1) on ${\mathcal{H}}\otimes {\mathcal{H}}'$ with ${\mathcal{H}}' \cong {\mathcal{H}}$ (see *e.g.* [@wat16]). Computing an upper bound of Eq.  is very challenging in general because the Hilbert space ${\mathcal{H}}= {\mathcal{H}}_1^{\otimes n}$ has a dimension scaling exponentially with the number $n$ of quantum systems shared by Alice and Bob. Typical values of $n$ range in the millions or billions.

In order to estimate the diamond norm, it is natural to exploit all the symmetries displayed by $\Delta$. For instance, if ${\mathcal{E}}$ is a QKD protocol involving many 2-qubit pairs, such as BB84 for instance [@BB84], then $\Delta$ might be covariant under any permutation of these pairs. For such maps, Christandl, König and Renner [@CKR09] showed that the optimization of Eq.  can be dramatically simplified provided that one is only interested in a polynomial approximation of $\|\Delta\|_\diamond$: indeed, it is then sufficient to consider a *single* state, called a “de Finetti state”, instead of optimizing over ${\mathcal{H}}\otimes {\mathcal{H}}' \cong ({\mathbb{C}}^4)^n \otimes ({\mathbb{C}}^4)^n$. More precisely, this de Finetti state is a purification of $ \tau_{{\mathcal{H}}} = \int \sigma_{{\mathcal{H}}_1}^{\otimes n} \mu(\sigma_{{\mathcal{H}}_1})$, where ${\mathcal{H}}_1 \cong {\mathbb{C}}^{4}$ is the single-system Hilbert space and $\mu(\cdot)$ is the measure on the space of density operators on a single system induced by the Hilbert-Schmidt metric.

This approach, called a *de Finetti reduction*, has been applied successfully to analyze the security of QKD protocol such as BB84 [@SLS10] or qudit protocols [@SS10]. Indeed, computing the value of $\|(\Delta \otimes {\mathbbm{1}}_{{\mathcal{H}}'}) \tau_{{\mathcal{H}}{\mathcal{H}}'}\|_1$ for some purification $\tau_{{\mathcal{H}}{\mathcal{H}}'}$ of $\tau_{{\mathcal{H}}}$ is usually tractable and is closely related to the task of establishing the security of the QKD protocol against *collective attacks*, corresponding to restricting the inputs of ${\mathcal{E}}$ to i.i.d. states of the form $\sigma_{{\mathcal{H}}_1}^{\otimes n}$. A full security proof then consists of two steps: proving the security against these restricted collective attacks, and applying the de Finetti reduction to obtain security (with a polynomially larger security parameter) against general attacks.

An outstanding problem in the theory of QKD is to address the security of protocols with continuous variables, that is protocols encoding the information in the continuous degrees of freedom of the quantified electro-magnetic field [@WPG12; @DL15]. From a practical point of view, the essential difference between continuous-variable (CV) protocols and discrete-variables ones lies in the detection method: CV protocols rely on coherent detection, either homodyne or heterodyne depending on whether one or two quadratures are measured for each mode, while discrete-variable protocols use photon counting. The main theoretical difference is the Hilbert space ${\mathcal{H}}$, which is *infinite-dimensional* for CV QKD, corresponding to a $2n$-mode Fock space: ${\mathcal{H}}= F({\mathbb{C}}^n \otimes {\mathbb{C}}^n)=\bigoplus_{k=0}^\infty \mathrm{Sym}^k({\mathbb{C}}^{n} \otimes {\mathbb{C}}^{n})$, where $\mathrm{Sym}^k(H)$ stands for the symmetric part of $H^{\otimes k}$. Note that the definition of Eq.  is formally restricted to finite-dimensional spaces, but we will ignore this issue here because one can always truncate ${\mathcal{H}}$ to make its dimension finite (arbitrary large) and will therefore assume that the supremum can still be taken on ${\mathcal{H}}\otimes {\mathcal{H}}'$ for ${\mathcal{H}}' \cong {\mathcal{H}}$. For later convenience, let us denote ${\mathcal{H}}$ by $F_{1,1,n}$ and ${\mathcal{H}}\otimes {\mathcal{H}}'$ by $F_{2,2,n} :=F({\mathbb{C}}^{2n} \otimes {\mathbb{C}}^{2n}) \cong F_{1,1,n}\otimes F_{1,1,n}$.

A possible strategy to prove the security of such CV protocols is to follow the same steps as for BB84: first establish the security against collective attacks, then prove that this implies security against general attacks (with a reasonable loss). For protocols involving a Gaussian modulation of coherent states and heterodyne detection [@WLB04], composable security against collective attacks was recently demonstrated in [@Lev15]. The second step is to apply the de Finetti reduction outlined above. The difficulty here comes from the infinite dimensionality of the Fock space ${\mathcal{H}}$. In order to apply the technique of [@CKR09], it is therefore needed to truncate the Fock space in a suitable manner. This can be achieved with the help of an energy test, but unfortunately, the local dimension of $\overline{{\mathcal{H}}}_1$, the truncated single-mode space, needs to grow like the logarithm of $n$, for the technique to apply [@LGRC13]. Indeed, the technique of [@CKR09] was developed for finite-dimensional systems, and the energy test needs to enforce that with high probability, *each the unmeasured modes* contains a number of photons below some given threshold. Such a guarantee can only be obtained for a threshold increasing logarithmically with $n$. The dimension of the total truncated Hilbert space is then super-exponential in $n$, on the order of $(\log n)^{Cn}$, for some constant $C>1$. Since the loss in the security parameter obtained with [@CKR09] is superpolynomial in the dimension of the total Hilbert space, this means that if the protocol is ${\varepsilon}$-secure against collective attacks, this approach only shows that the protocol is also ${\varepsilon}'$-secure against general attacks with ${\varepsilon}' = {\varepsilon}\times 2^{\mathrm{polylog}(n)}$. While this gives a proof that the protocol is asymptotically secure in the limit of infinitely large block lengths, it fails to provide any useful bound in practical regimes where $n \sim 10^6 - 10^9$. We note that a related strategy relies on the exponential de Finetti theorem but fails similarly to provide practical security bounds in the finite-size regime [@Ren08; @RC09].

Let us also mention that there exists a CV QKD protocol with proven security where Alice sends squeezed states to Bob instead of coherent states [@CLV01]. This protocol can be analyzed thanks to an entropic uncertainty relation [@FBB12], but this technique requires the exchange of squeezed states, which makes the protocol much less practical. Moreover, this approach does not recover the secret key rate corresponding to Gaussian attacks in the asymptotic limit of large $n$, even though these attacks are expected to be optimal. Here, in contrast, we are interested in the security of CV protocols based on the exchange of coherent states.

The idea that we exploit in this paper is that CV QKD protocols not only display the permutation invariance common to most QKD protocols, but also a specific symmetry with a continuous-variable flavor [@LKG09]. This new symmetry is linked to the unitary group $U(n)$ instead of the symmetric group $S_n$. More precisely, the protocols are covariant if Alice and Bob process their $n$ respective modes with linear-optical networks acting like the unitary $u \in U(n)$ on Alice’s annihilation operators and its complex conjugate $\overline{u}$ on Bob’s annihilation operators.

Our main technical result is an upper bound on $\|\Delta\|_{\diamond}$ for maps $\Delta$ covariant under a specific representation of the unitary group. For such maps, we show that is it sufficient to consider again a single state, which is the purification of a specific mixture of *Gaussian* i.i.d. states. This in turn will imply that it is sufficient to establish the security of the protocol against *Gaussian* collective attacks in order to prove the security of the protocol against general attacks. An important technicality is that we still need to truncate the total Hilbert space to replace it by a finite-dimensional one. Crucially, this truncation can now be done globally and not for single-mode Fock spaces as in [@LGRC13] and this is this very point that makes our approach so effective. Indeed, in our security proof, we argue that it is sufficient to consider states that are invariant under the action of $U(n)$ and such states live in a very small subspace of the ambient Fock space. More precisely, the dimension of the restriction of this subspace to states containing $K$ photons grows polynomially in $K$, instead of exponentially in the case of the total Fock space. This phenomenon is reminiscent of the fact that the dimension of the symmetric subspace of $({\mathbb{C}}^{\otimes d})^{\otimes n}$ only grows polynomially in $n$ if the local dimension $d$ is constant.

The consequence is that the security loss due to the reduction from general to collective attacks will not scale like $2^{\mathrm{polylog}(n))}$ anymore, but rather like $O(n^4)$, which behaves *much more nicely* for typical values of $n$, and yields the first practical security proof of a CV QKD protocol with coherent states against general attacks. Indeed, our security reduction performs even better than the original de Finetti reduction developed for BB84, where the security loss scales like $O(n^{15})$ [@CKR09].

Ideally, truncating the Fock space could be done by projecting the quantum state given as an input to $\Delta$ onto a finite dimensional subspace with say, less than $K$ photons (where the value of $K$ scales linearly with the total number of modes). Of course, such a projection ${\mathcal{P}}$ is unrealistic, and one will instead apply an energy test ${\mathcal{T}}$ that passes if the energy measured on a small number $k \ll n$ of modes is below some threshold and will abort the protocol otherwise. Such an idea was already considered in previous works dealing with the security of CV QKD [@RC09; @LGRC13; @fur14]. An application of the triangle inequality (see Lemma \[lem:sec-red\] in the appendix) yields: $$\begin{aligned}
\|\Delta \circ {\mathcal{T}}\|_\diamond \leq \|\Delta \circ {\mathcal{P}}\|_\diamond + 2 \|({\mathbbm{1}}-{\mathcal{P}})\circ {\mathcal{T}}\|_\diamond. \label{eqn:triangle}\end{aligned}$$ In other words, it is sufficient for our purposes to show the security of the protocol restricted to input states subject to a maximum photon number constraint, provided that we can bound the value of $\|({\mathbbm{1}}-{\mathcal{P}})\circ {\mathcal{T}}\|_\diamond$, which corresponds to the probability that the energy test passes but that the number of photons in the remaining modes is large.

[**Analysis of the energy test**]{}.—We show that $\|({\mathbbm{1}}-{\mathcal{P}})\circ {\mathcal{T}}\|_\diamond$ is indeed small for a maximal number of photons $K$ scaling linearly with $n$ (see Appendix \[sec:test\]). The energy test ${\mathcal{T}}(k, d_A, d_B)$ depends on 3 parameters: the number $k$ of additional modes that will be measured for the test and maximum allowed average energies $d_A$ and $d_B$ for Alice and Bob’s modes. The input of the state is a $2(n+k)$-mode state. Alice and Bob should symmetrize this state by processing them with random conjugate linear-optical networks and measure the last $k$ modes with heterodyne detection, corresponding to a projection of standard (Glauber) coherent states. If the average energy per mode is below $d_A$ for Alice and $d_B$ for Bob, the test passes and Alice and Bob apply the protocol ${\mathcal{E}}_0$ to their remaining modes. Otherwise the protocol simply aborts. These thresholds $d_A$, $d_B$ should be chosen large enough to ensure that the energy test passes with large probability. Note that the symmetrization of the state can be done on the classical data for the protocols of Refs [@WLB04; @POS15] since these protocols require both parties to measure all the modes with heterodyne detection, which itself commutes with the action of the linear-optical networks. For this, Alice and Bob need to multiply their measurement results (gathered as vectors for $\mathbbm{R}^{2n}$) by an identical random orthogonal matrix. There is also hope that this symmetrization can be further simplified, but we do not address this issue here.

[**An upper bound on $\|\Delta \circ {\mathcal{P}}\|_\diamond$ via de Finetti reduction**]{}.— This requires two main ingredients: first, a proof that any mixed state on $F_{1,1,n}$ that is invariant under the action of the unitary group admits a purification in the *symmetric subspace* $F_{2,2,n}^{U(n)}$, and second, that Gaussian states resolve the identity on the symmetric subspace. The symmetric subspace $F_{2,2,n}^{U(n)}$ was introduced and studied in Ref. [@lev16] and is defined as follows: $$\begin{aligned}
F_{2,2,n}^{U(n)} = \left\{|\psi\rangle \in F_{2,2,n} \: :\: W_u |\psi\rangle = |\psi\rangle, \forall u \in U(n) \right\},\end{aligned}$$ where $u \mapsto W_u$ is a representation of the unitary group $U(n)$ on the Fock space $F_{2,2,n}$ corresponding to mapping the $4n$ annihilation operators $\vec{a} = (a_1, \ldots, a_n), \vec{b} =(b_1, \ldots, b_n), \vec{a}' = (a'_1, \ldots, a'_n), \vec{b}'=(b'_1, \ldots, b'_n)$ of each of the $n$ modes of ${\mathcal{H}}_A, {\mathcal{H}}_B, {\mathcal{H}}_{A'}, {\mathcal{H}}_{B'}$ to $u \vec{a}, \overline{u} \vec{b}, \overline{u} \vec{a}', u \vec{b}'$. Here $\overline{u}$ denotes the complex conjugate of $u$ and $F_{2,2,n} = {\mathcal{H}}_A\otimes {\mathcal{H}}_B \otimes {\mathcal{H}}_{A'}\otimes {\mathcal{H}}_{B'}$.

In Ref. [@lev16], a full characterization of the symmetric subspace $F_{2,2,n}^{U(n)}$ is given. Let us introduce the four operators $Z_{11}, Z_{12}, Z_{21}, Z_{22}$ defined by: $$\begin{aligned}
Z_{11} &= \sum_{i=1}^n a_i^\dagger b_i^\dagger, \quad Z_{12} =\sum_{i=1}^n a_i^\dagger a'^\dagger_i,\\
Z_{21} &= \sum_{i=1}^n b_i^\dagger b'^\dagger_i, \quad Z_{22} =\sum_{i=1}^n a'^\dagger_i b'^\dagger_i.\end{aligned}$$ We now define the so-called $SU(2,2)$ *generalized coherent states* [@per72; @per86]: to any $2\times 2$ complex matrix $\Lambda = \left(\begin{smallmatrix} \lambda_{11} & \lambda_{12} \\ \lambda_{21} & \lambda_{22} \end{smallmatrix} \right)$ such that $\Lambda \Lambda^\dagger \prec {\mathbbm{1}}_2$ (that is, with a spectral norm strictly less than 1), we associate the $4n$-mode Gaussian state $|\Lambda, n\rangle = |\Lambda,1\rangle^{\otimes n}$ given by $$\begin{aligned}
|\Lambda,n\rangle = \mathrm{det} (1-\Lambda\Lambda^\dagger)^{n/2} \exp\left( \sum_{i,j=1}^2 \lambda_{ij} Z_{ij}\right) |\mathrm{vacuum}\rangle.\end{aligned}$$ Since the polynomial $\sum_{i,j=1}^2 \lambda_{ij} Z_{ij}$ is quadratic in the creation operators, the generalized coherent state is a Gaussian state. More specifically, it corresponds to $n$ copies of a centered 4-mode pure Gaussian state whose covariance matrix is a function of $\Lambda$ (see the discussion in Section 3 of Ref. [@lev16] for details).

These generalized coherent states span the symmetric subspace [@lev16], and moreover, for $n\geq 4$, they resolve the identity on the symmetric subspace [@lev16]: $$\begin{aligned}
\int_{{\mathcal{D}}} |\Lambda,n\rangle \langle \Lambda,n| \d \mu_n(\Lambda) = {\mathbbm{1}}_{F_{2,2,n}^{U(n)}} \label{eqn:maintext-id}\end{aligned}$$ where ${\mathcal{D}}$ is the set of $2\times 2$ matrices $\Lambda$ such that $\Lambda\Lambda^\dagger \prec {\mathbbm{1}}_2$ and $\mathrm{d}\mu_n(\Lambda)$ is the invariant measure on ${\mathcal{D}}$ given by $$\begin{aligned}
\mathrm{d}\mu_n (\Lambda) =  \frac{(n-1)(n-2)^2(n-3)}{\pi^{4}\det(\mathbbm{1}_2 - \Lambda \Lambda^\dagger)^4 } \d \lambda_{11} \d \lambda_{12}\d \lambda_{21} \d \lambda_{22}. \end{aligned}$$

Since the space $F_{2,2,n}^{U(n)}$ is infinite-dimensional, the integral of Eq.  is not normalizable. In order to obtain an operator with finite norm, we consider the finite-dimensional subspace $F_{2,2,n}^{U(n), \leq K}$ of $F_{2,2,n}^{U(n)}$ spanned by states with less than $K$ “excitations”: $$\begin{aligned}
\mathrm{Span}\left\{ (Z_{11})^i (Z_{12})^j (Z_{21})^k (Z_{22})^\ell |\mathrm{vac}\rangle \: : \: i+j+k+\ell \leq K \right\}.\end{aligned}$$ We show in Appendix \[sec:finite\] that an approximate resolution of the identity still holds for this space when restricting the coherent states $|\Lambda,n\rangle$ to $\Lambda \in {\mathcal{D}}_\eta$ for ${\mathcal{D}}_\eta = \left\{ \Lambda \in {\mathcal{D}}\: : \: \eta {\mathbbm{1}}_2 -\Lambda\Lambda^\dagger \succeq 0Ê\right\}$ for $\eta \in [0,1[$. Let us denote by $\Pi_{\leq K}$ the identity onto the subspace $F_{2,2,n}^{U(n), \leq K}$ and introduce the relative entropy $D(x||y) = x \log \frac{x}{y} + (1-x) \log \frac{1-x}{1-y}$.

\[thm:finite-version\] For $n\geq 5$ and $\eta \in [0,1[$, if $K \leq\frac{\eta N}{1-\eta}$ for $N=n-5$, then the operator inequality $$\begin{aligned}
\int_{\mathcal{D}_\eta} |\Lambda,n\rangle \langle \Lambda,n | \d \mu_n(\Lambda)\geq (1-{\varepsilon}) \Pi_{\leq K} \label{eqn:approximate-main}\end{aligned}$$ holds with ${\varepsilon}= 2 N^4 (1+K/N)^7 \exp\left(-N D\left(\frac{K}{K+N} \big\| \eta \right) \right)$.

This approximate resolution of the identity allows us to bound the diamond norm of maps which are covariant under the action $W_u$ of the unitary group $U(n)$, provided that the total photon number of the input state is upper bounded by some known value $K$. Let us define $\tau_{{\mathcal{H}}}^\eta$ to be the normalized state corresponding to the left-hand side of Eq. , and $\tau_{{\mathcal{H}}{\mathcal{N}}}^{\eta}$ a purification of $\tau_{{\mathcal{H}}}^\eta$.

\[thm:postselection\] Let $\Delta: \mathrm{End}(F_{1,1,n}^{\leq K}) \to  \mathrm{End}(\mathcal{H}')$ such that for all $u \in U(n)$, there exists a CPTP map $\mathcal{K}_u: \mathrm{End}(\mathcal{H}') \to \mathrm{End}(\mathcal{H}')$ such that $\Delta \circ W_u = \mathcal{K}_u \circ \Delta$, then $$\begin{aligned}
\|\Delta\|_\diamond \leq \frac{K^4}{50} \|(\Delta \otimes \mathrm{id}) \tau^\eta_{\mathcal{H}\mathcal{N}} \|_1,\end{aligned}$$ for $\eta = \frac{K-n+5}{K+n-5}$, provided that $n \geq N^*(K/(n-5))$.

The function $N^*$ is defined in Eq.  and its argument is an upper bound on the average number of photons per mode. One has for instance $N^*(21) \approx 10^4$, $N^*(60) \approx 10^5$.

Similarly as in [@CKR09] for the case of permutation invariance, Theorem \[thm:postselection\] shows that one can obtain a polynomial approximation of degree 4 (if the average number of photons per mode is constant) of the diamond norm by simply evaluating the trace norm of the map on a very simple state, namely a purification of a mixture of Gaussian i.i.d. states. We note that we restricted the analysis to $SU(2,2)$ coherent states here because they are the relevant ones for cryptographic applications, but our results can be extended to $SU(p,q)$ coherent states for arbitrary integers $p, q$. In that case, the prefactor of the diamond norm approximation would be a polynomial of degree $pq$.

[**Security reduction to Gaussian collective attacks**]{}.—We now explain how to obtain a bound on $\|(\Delta \otimes \mathrm{id}) \tau^\eta_{\mathcal{H}\mathcal{N}} \|_1$, if we already know that the initial protocol (without the energy test) is ${\varepsilon}$-secure against collective attacks. Let us therefore assume that we are given such a CV QKD protocol ${\mathcal{E}}_0$ acting on $2n$-mode states shared by Alice and Bob which is, in addition, covariant under the action of the unitary group (*i.e.* there exists $\mathcal{K}_u$ such that ${\mathcal{E}}_0 \circ W_u = {\mathcal{K}}_u \circ {\mathcal{E}}_0$). Examples of such protocols are the no-switching protocol [@WLB04] and the measurement-device-independent protocol of Ref. [@POS15], provided that they are suitably symmetrized. We define ${\mathcal{E}}:= {\mathcal{R}}\circ {\mathcal{E}}_0 \circ {\mathcal{T}}$, where ${\mathcal{R}}$ is an additional privacy amplification step that reduces the key by $\lceil 2 \log_2 \tbinom{K+4}{4} \rceil$ bits.

Recall that by definition, the QKD protocol ${\mathcal{E}}_0$ is ${\varepsilon}$-secure against Gaussian collective attacks if $$\begin{aligned}
\| (({\mathcal{E}}_0-{\mathcal{F}}_0)\otimes \mathrm{id})(|\Lambda,n\rangle \langle \Lambda,n|)\|_1\leq {\varepsilon}\end{aligned}$$ for all $\Lambda \in {\mathcal{D}}$. It means that the protocol is shown to be secure for input states of the form ${\mathrm{tr}}_{{\mathcal{H}}_{A'}{\mathcal{H}}_{B'}} (|\Lambda, n\rangle\langle \Lambda,n|)$, which are nothing but i.i.d. bipartite Gaussian states. By linearity, we immediately obtain that $\|(\Delta \otimes \mathrm{id}) \tau^\eta_{\mathcal{H}} \|_1 \leq {\varepsilon}$. To finish the proof, we need to take into account the extra system ${\mathcal{N}}$ given to Eve. This system can be chosen of dimension $\tbinom{K+4}{4}$ and the leftover hashing lemma of Renner [@Ren08] says that by shortening the final key of the protocol by $2 \log_2 (\mathrm{dim} \, {\mathcal{N}})$, one ensures that the protocol remains ${\varepsilon}$-secure. This is the role of the map ${\mathcal{R}}$. Overall, we find that $\|(({\mathcal{E}}-{\mathcal{F}}) \otimes \mathrm{id}) \tau^\eta_{\mathcal{H}\mathcal{N}} \|_1 \leq {\varepsilon}$.

[**Results**]{}.—Putting everything together, we show that if ${\mathcal{E}}_0$ is covariant under the action of the unitary group and ${\varepsilon}$-secure against Gaussian collective attacks, then the protocol ${\mathcal{E}}= {\mathcal{R}}\circ {\mathcal{E}}_0 \circ {\mathcal{T}}$ is ${\varepsilon}'$-secure against general attacks, with $$\begin{aligned}
{\varepsilon}' =\frac{K^4}{50} {\varepsilon}\label{eqn:final-result-main}\end{aligned}$$ for $K = \max \Big\{1, n(d_A + d_B)\Big(1 + 2 \sqrt{\frac{\ln (8/{\varepsilon})}{2n}} +  \frac{\ln (8/{\varepsilon})}{n}\Big)\Big(1-2{\sqrt{\frac{\ln (8/{\varepsilon})}{2k}}}\Big)^{-1}\Big\}$. The full proof is presented in Appendix \[sec:general-proof\]. The advantage of our approach compared to the previous results of [@LGRC13] is two-fold: first the improvement of the prefactor in Eq.  from $2^{\mathrm{polylog}(n)}$ to $O(n^4)$ yields security for practical settings; second, it is only required to establish the security of the protocol against Gaussian collective attacks in order to apply our security reduction, a task arguably much simpler than addressing the security against collective attacks in the case of CV QKD.

[**Discussion**]{}.—Despite their wide range of application, there is a regime where “standard” de Finetti theorems fail, namely when the local dimension is not negligible compared to the number $n$ of subsystems [@CKMR07]. In particular, these techniques do not apply directly to CV protocols where the local spaces are infinite-dimensional Fock spaces. In this work, we considered a natural symmetry displayed by some important CV QKD protocols, which are covariant under the action of beamsplitters and phase-shifts on their $n$ modes [@LKG09]. For such protocols, one legitimately expects that stronger versions of de Finetti theorems should hold. In particular, a widely held belief that it is enough to consider *Gaussian* i.i.d. input states instead of all i.i.d. states in order to analyze the security of the corresponding protocol.

We proved this statement rigorously here. Our main tool is a family of $SU(2,2)$ generalized coherent states that resolve the identity of the subspace spanned by states invariant under the action of $U(n)$. This implies that in some applications such as QKD, it is sufficient to consider the behaviour of the protocol on these states in order to obtain guarantees that hold for arbitrary input states.

Let us conclude by discussing the issue of active symmetrization. For the proof above to go through, it is required that the protocols are covariant under the action of the unitary group. Such an invariance can be enforced by symmetrizing the classical data held by Alice and Bob. However, this step is computationally costly and it would be beneficial to bypass it. We believe that this should be possible. Indeed, it is often argued that a similar step is unnecessary when proving the security of BB84 for instance, and there is no fundamental reason to think that the situation is different here. Moreover, we already know of security proofs based on the uncertainty principle [@TR11; @TLG12; @DFR16] where such a symmetrization is not required.

I gladly acknowledge inspiring discussions with Matthias Christandl and Tobias Fritz.

[30]{} natexlab\#1[\#1]{}bibnamefont \#1[\#1]{}bibfnamefont \#1[\#1]{}citenamefont \#1[\#1]{}url \#1[`#1`]{}urlprefix\[2\][\#2]{} \[2\]\[\][[\#2](#2)]{}

, ** (), .

, ** ().

, in ** (), vol. .

, , , ****, ().

, , , ****, ().

, ****, ().

, , , , , , , ****, ().

, ****, ().

, , , , , , ****, ().

, ****, ().

, , , , ****, ().

, ****, ().

, ****, ().

, , , ****, ().

, , , , , , , ****, ().

, , , , ****, ().

, ****, ().

, , , , , , , , , ****, ().

, ().

, ****, ().

, ** (, ).

, , , , ****, ().

, ****, ().

, , , , ****, ().

, , , ().

, ().

, **, vol.  (, ).

, **, Wiley series in probability and mathematical statistics. Probability and mathematical statistics (, , ), ISBN .

, ****, ().

, ****, ().

****

In Section \[sec:symm-sub\], we recall the main results from Ref. [@lev16] about the symmetric subspace $F_{2,2,n}^{U(n)}$ and the generalized $SU(2,2)$ coherent states. In Section \[sec:lemmas\], we present a series of technical lemmas and prove in Section \[sec:finite\] that bounded-energy generalized coherent states approximately resolve the identity on $F_{2,2,n}^{U(n), \leq K}$. In Section \[sec:general-proof\], we explain how to perform the security proof of the protocol and show that bounding the norm of $\Delta = {\mathcal{E}}- {\mathcal{F}}$ decomposes into separate tasks. In Section \[sec:generalization\], we derive our generalization of the de Finetti reduction of [@CKR09] to maps that are covariant under the action of the unitary group $U(n)$. In Section \[sec:collective\], we show how to reduce the security analysis against general attacks to a security analysis against Gaussian collective attacks, if the photon number of the input states is bounded. Finally, in Section \[sec:test\], we analyze the energy test and show how it provides the restriction on the input states required for the proof of Section \[sec:collective\] to go through.

The symmetric subspace $F_{2,2,n}^{U(n)}$ and generalized $SU(2,2)$ coherent states {#sec:symm-sub}
===================================================================================

In this section, we recall some results from Ref. [@lev16] where the symmetric subspace $F_{p,q,n}^{U(n)}$ is considered for arbitrary integers $p,q$ and specialize them to the case where $p=q=2$.

The symmetric subspace $F_{2,2,n}^{U(n)}$
-----------------------------------------

Let $H_A \cong H_B \cong H_{A'} \cong H_{B'} \cong {\mathbb{C}}^n$ and define the Fock space $F_{2,2,n}$ as $$\begin{aligned}
F_{2,2,n} := \bigoplus_{k=0}^\infty \mathrm{Sym}^k(H_A \otimes H_B \otimes H_{A'} \otimes H_{B'}),\end{aligned}$$ where $\mathrm{Sym}^k(H)$ is the symmetric part of $H^{\otimes k}$.

In this paper, we will use both the standard Hilbert representation and the Segal-Bargmann representation of $F_{2,2,n}$. Using the Segal-Bargmann representation, the Hilbert space $F_{2,2,n}$ is realized as a functional space of complex holomorphic functions square-integrable with respect to a Gaussian measure, $F_{2,2,n} \cong L^2_{\mathrm{hol}}({\mathbb{C}}^{4n}, \| \cdot\|)$, with a state $\psi \in F_{2,2,n}$ represented by a holomorphic function $\psi(z,z')$ with $z \in {\mathbb{C}}^{2n}, z' \in {\mathbb{C}}^{2n}$ satisfying $$\begin{aligned}
 \label{eqn:norm}
\|\psi\|^2 := \langle \psi, \psi\rangle = \frac{1}{\pi^{4n}}\int \exp(-|z|^2 -|z'|^2) |\psi(z,z')|^2 \d z \d z'< \infty\end{aligned}$$ where $\d z :=  \prod_{k=1}^n \prod_{i=1}^2 \mathrm{d}z_{k,i}$ and $\d z' := \prod_{k=1}^n \prod_{j=1}^2 \mathrm{d}z_{k,j}'$ denote the Lebesgue measures on ${\mathbb{C}}^{2n}$ and ${\mathbb{C}}^{2n}$, respectively, and $|z|^2 := \sum_{k=1}^n\sum_{i=1}^2 |z_{k,i}|^2, |z'|^2 := \sum_{k=1}^n \sum_{j=1}^2 |z_{k,j}'|^2$. A state $\psi$ is therefore described as a holomorphic function of $4n$ complex variables $(z_{1,1}, z_{n,1}; z_{1,2}, \ldots, z_{n,2};  z_{1,1}', \ldots, z_{n,1}'; z_{1,2}', \ldots, z_{n,2}')$. In the following, we denote by $z_i$ and $z_j'$ the vectors $(z_{1,i}, \ldots, z_{n,i})$ and $(z_{1,j}', \ldots, z_{n,j}')$, respectively, for $i,j \in \{1,2\}$. With these notations, the vector $z_1$ is associated to the space $H_A$, the vector $z_1'$ to $H_B$, the vector $z_2$ to $H_B'$ and the vector $z_2'$ to $H_A'$. These notations are chosen so that the unitary $u \in U(n)$ acts as $u$ on $z_1, z_2$, and $\overline{u}$ on $z'_1, z_2'$.

Let $\mathfrak{B}(F_{2,2,n})$ denote the set of bounded linear operators from $F_{2,2,n}$ to itself and let $\mathfrak{S}(F_{2,2,n})$ be the set of quantum states on $F_{2,2,n}$: positive semi-definite operators with unit trace.

Formally, one can switch from the Segal-Bargmann representation to the representation in terms of annihihation and creation operators by replacing the variables $z_{k,1}$ by $a_k^\dagger$, $z_{k,2}$ by $b'^\dagger_k$, $z'_{k,1}$ by $b_k^\dagger$ and $z'_{k,2}$ by $a'^\dagger_k$. The function $f(z,z')$ is therefore replaced by an operator $f(a^\dagger, b^\dagger, a'^\dagger, b'^\dagger)$ and the corresponding state in the Fock basis is obtained by applying this operator to the vacuum state.

The metaplectic representation of the unitary group $U(n) \subset Sp(2n,{\mathbb{R}})$ on $ F_{2,2,n}$ associates to $u \in U(n)$ the operator $W_u$ performing the change of variables $z \to uz$, $z' \to \overline{u} z'$: $$\begin{aligned}
U(n) & \to \mathfrak{B}(F_{2,2,n})\\
u & \mapsto W_u = \big[ \psi(z_1, z_2, z_1', z_2') \mapsto \psi(u z_1, u z_2, \overline{u} z_1',  \overline{u} z_2')\big]\end{aligned}$$ where $\overline{u}$ denotes the complex conjugate of the unitary matrix $u$. In other words, the unitary $u$ is applied to the modes of $F_A \otimes F_{B'}$ and its complex conjugate is applied to those of $F_B \otimes F_{A'}$.

The states that are left invariant under the action of the unitary group $U(n)$ are relevant for instance in the context of continuous-variable quantum key distribution, and we define the symmetric subspace as the space spanned by such invariant states.

For integer $n \geq 1$, the *symmetric subspace* $F_{2,2,n}^{U(n)}$ is the subspace of functions $\psi \in F_{2,2,n}$ such that $$\begin{aligned}
W_u \psi = \psi \quad \forall u \in U(n).\end{aligned}$$

The name *symmetric subspace* is inspired by the name given to the subspace $\mathrm{Sym}^n(\mathbbm{C}^d)$ of $(\mathbbm{C}^d)^{\otimes n}$ of states invariant under permutation of the subsystems: $$\begin{aligned}
\mathrm{Sym}^n(\mathbbm{C}^d) := \left\{|\psi\rangle \in(\mathbbm{C}^d)^{\otimes n} \: : \: P(\pi) |\psi\rangle = |\psi\rangle, \forall \pi \in S_n \right\}\end{aligned}$$ where $\pi \mapsto P(\pi)$ is a representation of the permutation group $S_n$ on $(\mathbbm{C}^d)^{\otimes n}$ and $P(\pi)$ is the operator that permutes the $n$ factors of the state according to $\pi \in S_n$. See for instance [@har13] for a recent exposition of the symmetric subspace from a quantum information perspective.

In [@lev16], a full characterization of the symmetric subspace $F_{2,2,n}^{U(n)}$ is given. It is helpful to introduce the four operators $Z_{11}, Z_{12}, Z_{21}, Z_{22}$ defined by: $$\begin{aligned}
Z_{11} =  \sum_{i=1}^n z_{i,1} z'_{i,1} \quad  & \leftrightarrow  \quad  \sum_{i=1}^n a_i^\dagger b_i^\dagger\\
Z_{12} =\sum_{i=1}^n z_{i,1} z'_{i,2} \quad  & \leftrightarrow  \quad   \sum_{i=1}^n a_i^\dagger a'^\dagger_i,\\
Z_{21} = \sum_{i=1}^n z_{i,2} z'_{i,1}  \quad  & \leftrightarrow  \quad   \sum_{i=1}^n b_i^\dagger b'^\dagger_i, \quad \\
Z_{22} =\sum_{i=1}^n z_{i,2} z'_{i,2}  \quad  & \leftrightarrow  \quad   \sum_{i=1}^n a'^\dagger_i b'^\dagger_i.\end{aligned}$$

For integer $n\geq 1$, let $E_{2,2,n}$ be the space of analytic functions $\psi$ of the $4$ variables $Z_{1,1}, \ldots, Z_{2,2}$, satisfying $\|\psi\|_E^2 < \infty$, that is $E_{2,2,n} = L^2_{\mathrm{hol}}({\mathbb{C}}^{pq}, \|\cdot\|_E)$.

In [@lev16], is was proven that $E_{2,2,n}$ coincides with the symmetric subspace $F_{2,2,n}^{U(n)}$.

\[thm:charact-symm\] For $n \geq 2$, the symmetric subspace $F_{2,2,n}^{U(n)}$ is isomorphic to $E_{2,2,n}$.

In other words, any state in the symmetric subspace can be written as $$\begin{aligned}
|\psi\rangle = f\big(\sum_{i=1}^n a_i^\dagger b_i^\dagger,  \sum_{i=1}^n a_i^\dagger a'^\dagger_i, \sum_{i=1}^n b_i^\dagger b'^\dagger_i, \sum_{i=1}^n a'^\dagger_i b'^\dagger_i \big) |\mathrm{vacuum}\rangle\end{aligned}$$ for some function $f$. Said otherwise, such a state is characterized by only 4 parameters instead of $4n$ for an arbitrary state in $F_{2,2,n}$; or else, the symmetric subspace is isomorphic to a 4-mode Fock space (with “creation” operators corresponding to $Z_{11}, Z_{12}, Z_{21}, Z_{22}$, instead of the ambient $4n$-mode Fock space.

Coherent states for $SU(2,2)/SU(2)\times SU(2) \times U(1)$ {#sec:CS}
-----------------------------------------------------------

In this section, we first review a construction due to Perelomov that associates a family of generalized coherent states to general Lie groups [@per72], [@per86]. In this language, the standard Glauber coherent states are associated with the Heisenberg-Weyl group, while the atomic spin coherent states are associated with $SU(2)$. The symmetric subspace $F_{2,2,n}^{U(n)}$ is spanned by $SU(2,2)$ coherent states, where $SU(2,2)$ is the special unitary group of signature $(2,2)$ over ${\mathbb{C}}$: $$\begin{aligned}
SU(2,2) := \left\{ A \in M_{4}({\mathbb{C}}) \: : \: A {\mathbbm{1}}_{2,2} A^\dagger ={\mathbbm{1}}_{2,2}Ê\right\}\end{aligned}$$ where $M_{4}({\mathbb{C}})$ is the set of $4\times 4$-complex matrices and ${\mathbbm{1}}_{2,2} = {\mathbbm{1}}_{2} \oplus (-{\mathbbm{1}}_2)$.

In Perelomov’s construction, a *system of coherent states of type* $(T, |\psi_0\rangle)$ where $T$ is the representation of some group $G$ acting on some Hilbert space $\mathcal{H} \ni |\psi_0\rangle$, is the set of states $\left\{|\psi_g\rangle \: : \: |\psi_g\rangle = T_g |\psi_0\rangle\right\}$ where $g$ runs over all the group $G$. One defines $H$, the *stationary subgroup* of $|\psi_0\rangle$ as $$\begin{aligned}
H := \left\{g \in G \: :Ê\: T_g |\psi_0\rangle = \alpha |\psi_0\rangle \, \text{for} \, |\alpha|=1Ê\right\},\end{aligned}$$ that is the group of $h \in G$ such that $|\psi_h\rangle $ and $|\psi_0\rangle$ differ only by a phase factor. When $G$ is a connected noncompact simple Lie group, $H$ is the maximal subgroup of $G$. In particular, for $G = SU(2,2)$, one has $H= SU(2,2) \cap U(4) = SU(2) \times SU(2)\times U(1)$ and the factor space $G/H$ corresponds to a Hermitian symmetric space of classical type (see *e.g.* Chapter X of [@hel79]). The generalized coherent states are parameterized by points in $G/H$. For $G/H = SU(2,2)/SU(2)\times SU(2) \times U(1)$, the factor space is the set ${\mathcal{D}}$ of $2\times 2$ matrices $\Lambda$ such that $\Lambda \Lambda^\dagger < {\mathbbm{1}}_{p}$, i.e. the singular values of $\Lambda$ are strictly less than 1. $$\begin{aligned}
{\mathcal{D}}= \left\{ \Lambda \in M_{2}({\mathbb{C}}) \: : \:\mathbbm{1}_2 - \Lambda\Lambda^\dagger >0 \right\},\end{aligned}$$ where $A>0$ for a Hermitian matrix $A$ means that $A$ is positive definite.

We are now ready to define our coherent states for the noncompact Lie group $SU(2,2)$.

\[defn:CS\] For $n \geq 1$, the coherent state $\psi_{\Lambda,n}$ associated with $\Lambda \in {\mathcal{D}}$ is given by $$\begin{aligned}
 \psi_{\Lambda,n}(Z_{1,1}, \ldots, Z_{2,2}) = \det (1-\Lambda \Lambda^\dagger)^{n/2} \det \exp (\Lambda^T Z)
 \end{aligned}$$ where $Z$ is the $2\times 2$ matrix $\left[ Z_{i,j}\right]_{i,j  \in \{1,2\}}$.

In the following, we will sometimes abuse notation and write $\psi_{\Lambda}$ instead of $\psi_{\Lambda,n}$, when the parameter $n$ is clear from context.

We note that the coherent states have a tensor product form in the sense that $$\begin{aligned}
\psi_{\Lambda,n}=\psi_{\Lambda,1}^{\otimes n}.\end{aligned}$$ We will also write $|\Lambda,n\rangle = |\Lambda,1\rangle^{\otimes n}$ for $\psi_{\Lambda,n}$. Such a state is called *identically and independently distributed* (i.i.d.) in the quantum information literature.

The main feature of a family of coherent states is that they resolve the identity. This is the case with the $SU(2,2)$ coherent states introduced above: see Ref. [@lev16].

\[thm:resol\] For $n \geq 4$, the coherent states resolve the identity over the symmetric subspace $F_{2,2,n}^{U(n)}$: $$\begin{aligned}
\int_{{\mathcal{D}}} |\Lambda,n\rangle \langle \Lambda,n| \mathrm{d}\mu_n(\Lambda) = \mathbbm{1}_{F_{2,2,n}^{U(n)}}, \end{aligned}$$ where $\mathrm{d}\mu_n(\Lambda)$ is the invariant measure on ${\mathcal{D}}$ given by $$\begin{aligned}
\label{eqn:mu}
\mathrm{d}\mu_n (\Lambda) =  \frac{(n-1)(n-2)^2(n-3)}{\pi^{4}\det(\mathbbm{1}_2 - \Lambda \Lambda^\dagger)^4 } \prod_{i=1}^2 \prod_{j=1}^{2} \mathrm{d} \mathfrak{R}(\Lambda_{i,j}) \mathrm{d} \mathfrak{I}(\Lambda_{i,j}), \end{aligned}$$ where $\mathfrak{R}(\Lambda_{i,j})$ and $\mathfrak{I}(\Lambda_{i,j})$ refer respectively to the real and imaginary parts of $\Lambda_{i,j}$. This operator equality is to be understood for the weak operator topology.

Technical lemmas {#sec:lemmas}
================

In this section, we prove or recall a number of technical results that will be useful for analyzing the finite energy version of the de Finetti theorem in \[sec:finite\].

Tail bounds
-----------

For positive integers $k,n >0$, the Beta and regularized (incomplete) Beta functions are given respectively by $$\begin{aligned}
B(k,n) = \int_0^1 t^{k-1} (1-t)^{n-1} \d t = \frac{(k-1)!(n-1)!}{(n+k-1)!}, \quad B(x;k,n) = \int_0^x t^{k-1}(1-t)^{n-1} \d t,\end{aligned}$$ for $x >0$. Finally, the regularized Beta function is defined as $$\begin{aligned}
I_{x}(k,n) = \frac{B(x; k,n)}{B(k,n)}.\end{aligned}$$

Let us recall the Chernoff bound for a sum of independent Bernoulli variables.

\[thm:chernoff\] Let $X_1, \ldots, X_n$ be independent random variables on $\{0,1\}$ with $\mathrm{Pr}[X_i=1]=p$, for $i=1, \ldots, n$. Set $X = \sum_{i=1}^n X_i$. Then for any $t \in [0,1-p]$, we have $$\begin{aligned}
\mathrm{Pr}[X \geq (p+t)n ] \leq \exp \left(-n D(p+t||p) \right),\end{aligned}$$ where the relative entropy is defined as $D(x||y) = x \log \frac{x}{y} + (1-x) \log \frac{1-x}{1-y}$.

Pinsker’s inequality gives a lower bound on $D(x||y)$ as a function of the total variation distance between the two probability distributions.

\[lem:pinsker\] For $0 < y < x <1$, it holds that $$\begin{aligned}
D(x \| y) \geq \frac{2}{\ln 2} (x-y)^2.\end{aligned}$$

We now prove a tail bound for the regularized Beta function.

\[lem:tail-bound\] For integers $k,n >0$, it holds that $$\begin{aligned}
1-I_{\eta}(k,n)  \leq \exp\left(-(n+k-1) D\left(\frac{k-2}{n+k-1} \| \eta \right) \right),\end{aligned}$$ provided that $\eta \geq (k-2)/(n+k-1)$.

The incomplete Beta function can be related to the tail of the binomial distribution as follows: $$\begin{aligned}
1- I_{\eta}(k,n) &= F(k-1,n+k-1,\eta) \label{eqn:injected}\end{aligned}$$ where $F(K,N,p)$ is the probability that there are at most $K$ successes when drawing $N$ times from a Bernoulli distribution with success probability $p$. Equivalently, if $X_i$ are $\{0,1\}$-random variables such that $\mathrm{Pr}[X_i=1] = 1-p$ for $i = 1, \ldots, n$, then $$\begin{aligned}
F(K,N,p) = \mathrm{Pr}[ X \geq N-K+1],\end{aligned}$$ where $X = \sum_{i=1}^{n} X_i$. The Chernoff bound of Theorem \[thm:chernoff\] yields $$\begin{aligned}
F(K,N,p) \leq \exp \left(-N D(1-p+t||1-p) \right)\end{aligned}$$ for $t = p - \frac{K-1}{N}$, provided that $N-K+1 \geq (1-p)N$, *i.e.* $p \geq (K-1)/N$ or $\eta \geq (K-1)/N$. Taking $K = k-1, N = n+k-1$ and $p=\eta$, and injecting into Eq. , gives $$\begin{aligned}
1- I_{\eta}(k,n) & \leq \exp \left(-(n+k-1) D\left(1-\frac{k-2}{n+k-1}||1- \eta \right) \right)\\
& \leq \exp \left(-(n+k-1) D\left(\frac{k-2}{n+k-1}||\eta \right) \right),\end{aligned}$$ which holds provided that $\eta \geq (k-2)/(n+k-1)$. This proves the claim.

Energy cutoff
-------------

The resolution of the identity of Theorem \[thm:resol\] involves operators which are not trace-class, as well as coherent states with arbitrary large energy. The natural solution to get operators with finite norm is to replace the domain $\mathcal{D}$ by a cut-off versions $\mathcal{D}_\eta$ defined by $$\begin{aligned}
\mathcal{D}_\eta := \left\{ \Lambda \in M_{p,q} ({\mathbb{C}}) \: : \: \eta {\mathbbm{1}}_p - \Lambda \Lambda^\dagger \geq 0\right\},\end{aligned}$$ for $\eta \in [0,1[$. Note that $$\begin{aligned}
\lim_{\eta \to 1} \mathcal{D}_\eta = \mathcal{D}.\end{aligned}$$ The integration over $\mathcal{D}_\eta$ can then be performed by first integrating the measure $\d \mu_n(\Lambda)$ on the “polar variables”, and only later on the “radial” variables corresponding to the singular values of $\Lambda$.

For a fixed pair of squared singular values $(x,y)$, let $V_{x,y}$ be the set of matrices $\Lambda \in \mathcal{D}$ with squared singular values $(x,y)$, *i.e.*, $$\begin{aligned}
V_{x,y} := \left\{u \big[\begin{smallmatrix} \sqrt{x} & 0 \\ 0 & \sqrt{y}\end{smallmatrix}\big] v^\dagger \: : \: u, v \in U(2)Ê\right\}.\end{aligned}$$ We further define the operator $P_{x,y}$ corresponding to the integral of $|\Lambda,n\rangle \langle \Lambda, n|$ over $V_{x,y}$: $$\begin{aligned}
P_{x,y} := \int_{V_{x,y}} |\Lambda,n\rangle\langle \Lambda,n| \d \mu_{x,y}(\Lambda) \geq 0 \label{eqn:Pxy}\end{aligned}$$ where $\mathrm{d}\mu_{x,y} (\Lambda)$ is the Haar measure on $V_{x,y}$ and the normalization is chosen so that ${\mathrm{tr}}\, P_{x,y} = 1$.

We have the following equivalent version of the resolution of the identity of Theorem \[thm:resol\].

\[thm:resol2\] For $n \geq 4$, it holds that: $$\begin{aligned}
\int_{0}^1 \int_0^1 q(x,y) P_{x,y} \d x \d y = \mathbbm{1}_{F_{2,2,n}^{U(n)}},\end{aligned}$$ where the distribution $q(x,y)$ is given by $$\begin{aligned}
q(x,y) := \frac{(n-1)(n-2)^2(n-3) (x-y)^2}{2(1-x)^4 (1-y)^4}. \label{eqn:Qxy}\end{aligned}$$

We wish to integrate $|\Lambda, n \rangle \langle \Lambda, n| \d\mu_n(\Lambda)$ over the “polar” variables. For this, we perform the singular value decomposition of $\Lambda$, which reads $\Lambda = u \Sigma v^\dagger$, where $u, v \in U(2)$ and $\Sigma = \mathrm{diag}(\sigma_1, \sigma_2)$, with $\sigma_1, \sigma_2 \in [0,1[$.

The Jacobian for the singular value decomposition is [@mui82]: $$\begin{aligned}
\mathrm{d}\Lambda = (\sigma_1^2-\sigma_1^2)^2 \sigma_1 \sigma_2 (u^\dagger \mathrm{d} u) \mathrm{d} \Sigma (v^\dagger \mathrm{d} v).\end{aligned}$$

Exploiting this Jacobian and performing the change of variables $x = \sigma_1^2$, $y=\sigma_2^2$, one obtains that the resolution of the identity of Theorem \[thm:resol\] can be written: $$\begin{aligned}
C \int_0^1 \d x \int_0^1 \d y \frac{(x-y)^2}{(1-x)^4(1-y)^4} P_{x,y} = \mathbbm{1}_{F_{2,2,n}^{U(n)}},\end{aligned}$$ for the appropriate constant $C$. Here, we have used that $\det(\mathbbm{1}_2 - \Lambda \Lambda^\dagger)^4 = (1-x)^4 (1-y)^4$ for any $\Lambda \in V_{x,y}$.

The constant $C$ can be determined by considering the overlap between ${\mathbbm{1}}_{F_{2,2,n}^{U(n)}}$ and the vacuum state: $$\begin{aligned}
1 & = \langle 0 | {\mathbbm{1}}_{F_{2,2,n}^{U(n)}}| 0\rangle\\
 &= C \int_0^1 \d x \int_0^1 \d y \int \frac{(x-y)^2}{(1-x)^4(1-y)^4} \big \langle 0 \big|u \big[\begin{smallmatrix} \sqrt{x} & 0 \\ 0 & \sqrt{y}\end{smallmatrix}\big] v^\dagger, n\big\rangle \big\langle u  \big[\begin{smallmatrix} \sqrt{x} & 0 \\ 0 & \sqrt{y}\end{smallmatrix}\big] v^\dagger, n\big|0 \big\rangle \d u \d v\\
 &= C \int_0^1 \d x \int_0^1 \d y\frac{(x-y)^2}{(1-x)^4(1-y)^4}(1-x)^n (1-y)^n \int  \d u \d v\\
 &= C \int_0^1 \d x \int_0^1 \d y\frac{(x-y)^2}{(1-x)^4(1-y)^4}(1-x)^n (1-y)^n\\
 &= C \frac{2}{(n-1)(n-2)^2(n-3)},
 \end{aligned}$$ where we used that $ \big \langle 0 \big|u \big[\begin{smallmatrix} \sqrt{x} & 0 \\ 0 & \sqrt{y}\end{smallmatrix}\big] v^\dagger, n\big\rangle = (1-x)^{n/2} (1-y)^{n/2}$ for any $u, v\in U(2)$ and that the measures $\d u$ and $\d v$ are normalized.

Let $K \geq 0$ be an integer. We define $V_{=K}$ as the subspace of $F_{2,2,n}^{U(n)}$ spanned by vectors with $K$ pairs of excitations: $$\begin{aligned}
V_K := \mathrm{Span}\{Z_{1,1}^i Z_{1,2}^j Z_{2,1}^k Z_{2,2}^\ell  |0\rangle \: : \: i + j + k+\ell = K; i, j,k, \ell \in {\mathbb{N}}\},\end{aligned}$$ and the projector $\Pi_{=K}$ to be the orthogonal projector onto $V_{=K}$. Physically, this is the subspace of the Fock space restricted to states containing $2K$ photons in total in the $4n$ optical modes.

Moreover, let us denote by $a_k^n := \tbinom{n+k-1}{k}$ the number of configurations of $k$ particles in $n$ modes.

\[lem:Piq\] For $K \in {\mathbb{N}}$ and $x, y \in [0,1[$, we have $$\begin{aligned}
{\mathrm{tr}}\left[\Pi_{=K} P_{x,y} \right] = \sum_{k_1+k_2=K} a_{k_1}^n a_{k_2}^n (1-x)^n (1-y)^n x^{k_1} y^{k_2}.\end{aligned}$$

The total photon number distribution of a state $|\Lambda, n\rangle$ is invariant under local unitaries $u, v \in U(2)$ applied on the creation operators of $F_A$ or $F_B$. This means that this distribution only depends on the squared singular values of the matrix $\Lambda$. In particular, denoting by $|(\sqrt{x},\sqrt{y}),n\rangle$ the coherent state corresponding to the matrix $\mathrm{diag}(\sqrt{x}, \sqrt{y})$, we obtain: $$\begin{aligned}
{\mathrm{tr}}\left[\Pi_{=K} P_{x,y} \right] = \langle (\sqrt{x},\sqrt{y}),n |  \Pi_{=K} | (\sqrt{x},\sqrt{y}),n\rangle.\end{aligned}$$ Since this coherent state is given by $$\begin{aligned}
| (\sqrt{x},\sqrt{y}),n\rangle := (1-x)^{n/2} (1-y)^{n/2} \exp(\sqrt{x} Z_{11}) \exp(\sqrt{y} Z_{22}),\end{aligned}$$ it implies that $$\begin{aligned}
{\mathrm{tr}}\left[\Pi_{=K} P_{x,y} \right] =\sum_{k_1+k_2=K} a_{k_1}^n a_{k_2}^n (1-x)^n (1-y)^n x^{k_1} y^{k_2}.\end{aligned}$$

Let us define the operator $\overline{P}_{\eta}$ as $$\begin{aligned}
\overline{P}_{\eta}  := \int_{\mathcal{D} \setminus \mathcal{D}_\eta} |\Lambda,n\rangle \langle \Lambda,n| \d \mu_n(\Lambda).\end{aligned}$$

\[eqn:crucial-step\] For $n \geq 38$, $K \in {\mathbb{N}}$ and $\eta \in [0,1[$ such that $K \leq \frac{\eta}{1-\eta}(n-5) $, it holds that $$\begin{aligned}
{\mathrm{tr}}(\Pi_{=K} \overline{P}_\eta) \leq   2 N^4 (1+\alpha)^7 \exp\left(-N D\left(\frac{\alpha}{\alpha+1} \big\|\eta \right) \right),\end{aligned}$$ where $N = n-5$ and $\alpha := K/N$.

For any non negative distribution $f(x,y) \geq 0$ symmetric in $x$ and $y$, *i.e.* such that $f(x,y) = f(y,x)$, it holds that $$\begin{aligned}
\int_{\overline{\mathcal{E}}_\eta} f(x,y) \d x  \d y &\leq  2\int_{\eta}^1 \d x \int_0^1 \d y f(x,y).\end{aligned}$$ Since $q(x,y) {\mathrm{tr}}\left[P_{=K} \Pi_{x,y} \right]$ is such a distribution, it holds that $$\begin{aligned}
{\mathrm{tr}}(\Pi_{=K} \overline{P}_\eta)\leq 2\int_{\eta}^1 \d x \int_0^1 \d y  q(x,y) \, {\mathrm{tr}}\left[P_{=K} \Pi_{x,y} \right].\end{aligned}$$ Lemma \[lem:Piq\] then yields $$\begin{aligned}
{\mathrm{tr}}(\Pi_{=K} \overline{P}_\eta) &\leq 2  \sum_{k_1+k_2=K} a_{k_1}^n a_{k_2}^n \int_{\eta}^1 \d x (1-x)^n x^{k_1} \int_0^1 \d y   q(x,y)  (1-y)^n  y^{k_2}\\
&\leq  (n-1)(n-2)^2(n-3)  \sum_{k_1+k_2=K} a_{k_1}^n a_{k_2}^n \int_{\eta}^1 \d x (1-x)^{n-4} x^{k_1} \int_0^1 \d y  (x-y)^2  (1-y)^{n-4}  y^{k_2}\\
&\leq  (n-1)(n-2)^2(n-3)  \sum_{k_1+k_2=K} a_{k_1}^n a_{k_2}^n \int_{\eta}^1 \d x (1-x)^{n-4} x^{k_1} \int_0^1 \d y   (1-y)^{n-4}  y^{k_2}\end{aligned}$$ where we used the trivial bound $ (x-y)^2 \leq 1$ for $0 \leq x,y \leq 1$ in the last inequality.

The normalization of the Beta function reads $$\begin{aligned}
\int_0^1  (1-y)^{n} y^k \d y =\frac{k! n!}{(n+k+1)!},\end{aligned}$$ which gives $$\begin{aligned}
\label{eqn:interm}
{\mathrm{tr}}(\Pi_{=K} \overline{P}_\eta) &\leq  (n-2)  \sum_{k_1+k_2=K} (n+k_2-1)(n+k_2-2)   \int_{\eta}^1 a_{k_1}^n (1-x)^{n-4} x^{k_1}  \d x\end{aligned}$$ Lemma \[lem:tail-bound\] allows us to bound the integral: $$\begin{aligned}
\int_{\eta}^1 a_{k_1}^{n-4} (1-x)^{n-4} x^{k_1}  \d x \leq\exp\left(-(n+k_1-5) D\left(\frac{n-3}{n+k_1-5} \big\| 1-\eta \right) \right),\end{aligned}$$ provided that $1-\eta \leq (n-3)/(n+k_1-5)$.

If $\frac{n-5}{n+K-5} \geq 1-\eta$, this term can be bounded uniformly as $$\begin{aligned}
\int_{\eta}^1 a_{k_1}^{n-4} (1-x)^{n-4} x^{k_1}  \d x \leq\exp\left(-N D\left(\frac{N}{N+K} \big\| 1-\eta \right) \right),\end{aligned}$$ where we defined $N := n-5$. Injecting this in Eq. , we obtain $$\begin{aligned}
{\mathrm{tr}}(\Pi_{=K} \overline{P}_\eta) &\leq  (N+3)  \sum_{k_1+k_2=K} (N+k_2+4)(N+k_2+3) \frac{(N+k_1+4)! N!}{(N+k_1)! (N+4)!}  \exp\left(-N D\left(\frac{N}{N+K} \big\| 1-\eta\right) \right) \nonumber\\
&\leq   \frac{(K+1) (N+K+4)^6}{(N+1)^3}  \exp\left(-N D\left(\frac{N}{N+K} \big\| 1-\eta \right) \right) \label{eqn:bound33}\end{aligned}$$ Imposing in addition that $N\geq 4$, *i.e.* $n\geq 9$, so that $N+K+4 \leq 2(N+K)$, one finally obtains the bound: $$\begin{aligned}
{\mathrm{tr}}(\Pi_{=K} \overline{P}_\eta) \leq   64 \frac{(N+K)^7}{N^3}  \exp\left(-N D\left(\frac{N}{N+K} \big\| 1-\eta \right) \right).\end{aligned}$$ One can get a better bound by choosing $N \geq 33$, *i.e.* $n\geq 38$: in that case, one can check that for any $K \geq 0$, it holds that $$\begin{aligned}
\left( 1 + \frac{4}{N+K}\right)^6 \leq 2,\end{aligned}$$ which gives $(N+K+4)^6 \leq 2(N+K)^6$. Injecting this into Eq.  yields $$\begin{aligned}
{\mathrm{tr}}(\Pi_{=K} \overline{P}_\eta) \leq   2 \frac{(N+K)^7}{N^3}  \exp\left(-N D\left(\frac{N}{N+K} \big\| 1-\eta \right) \right).\end{aligned}$$

\[lem:proj\] For any nonnnegative operator $A \geq 0$ and projector $\Pi$ with $\mathrm{rank}(\Pi) < \infty$, it holds that: $$\Pi A \Pi \leq {\mathrm{tr}}[\Pi A ] \Pi.$$

The support of $\Pi A \Pi$ is contained in that of ${\mathrm{tr}}[\Pi A ] \Pi$. Since both operators are positive semi-definite, the only thing we need to prove is that for any $\lambda \in \mathrm{spec}(\Pi A \Pi)$, it holds that $$\begin{aligned}
\lambda \leq {\mathrm{tr}}[\Pi A]\end{aligned}$$ since all the nonzero eigenvalues of ${\mathrm{tr}}[\Pi A ] \Pi$ are equal to ${\mathrm{tr}}[\Pi A ]$. The sum of the eingenvalues of an operator is equal to its trace, which gives $$\begin{aligned}
\sum_{\lambda \in \mathrm{spec}(\Pi A \Pi)}Ê\lambda = {\mathrm{tr}}(\Pi A \Pi).\end{aligned}$$ Moreover, since all these eigenvalues are nonnegative, we have that $\lambda_{\max} (\Pi A \Pi) \leq \sum_{\lambda \in \mathrm{spec}(\Pi A \Pi)}Ê\lambda$, which concludes the proof.

Finite energy version of de Finetti theorem {#sec:finite}
===========================================

In this section, we establish a *de Finetti reduction*, similar to the one obtained in [@CKR09] in the case of permutation invariance. Such a reduction uses as a main tool as statement analogous to the resolution of the identity $$\begin{aligned}
\mathbbm{1}_{\mathrm{Sym}} \leq C_{n,d} \int \left(|\phi\rangle \langle \phi|\right)^{\otimes n} \d \mu(\phi)\end{aligned}$$ where $C(n,d)$ is a polynomial in $n$ provided the local dimension $d$ is finite.

In the case of continuous-variable protocols, the local dimension is infinite and we need to find a better reduction. This is indeed possible provided we have bounds on the maximum energy (or total number of photons) of the states under consideration.

For $\eta \in [0,1[$, define the sets $\mathcal{E}_\eta = [0, \eta] \times [0,\eta]$ and $\overline{\mathcal{E}}_\eta = [0,1[^2 \setminus \mathcal{E}_\eta$.

We introduce the following positive operators $$\begin{aligned}
P_\eta &:=  \int_{\mathcal{E}_\eta} q(x,y) P_{x,y} \d x \d y =  \int_{\mathcal{D}_\eta} |\Lambda,n\rangle \langle \Lambda,n| \d \mu_n(\Lambda), \label{eqn:Peta} \\
\overline{P}_{\eta} &:= \int_{\overline{\mathcal{E}}_\eta} q(x,y) P_{x,y} \d x \d y =  \int_{\mathcal{D} \setminus \mathcal{D}_\eta} |\Lambda,n\rangle \langle \Lambda,n| \d \mu_n(\Lambda),\end{aligned}$$ where the equalities follow from the fact that one can integrate over $\mathcal{D}_\eta$ by first integrating over $V_{x,y}$ and then over $\mathcal{E}_\eta$. We recall that the operator $P_{xy}$ is defined in Eq.  and that the distribution $q(x,y)$ is defined in Eq. . The resolution of the identity over $F_{2,2,n}^{U(n)}$ (Theorem \[thm:resol\]) immediately implies that $$\begin{aligned}
P_\eta + \overline{P}_\eta = {\mathbbm{1}}_{F_{2,2,n}^{U(n)}}.\end{aligned}$$

Let $K \geq 0$ be an integer. We recall that $V_{=K}$ is the subspace of $F_{2,2,n}^{U(n)}$ spanned by vectors with $K$ pairs of excitations: $$\begin{aligned}
V_K := \mathrm{Span}\{Z_{1,1}^i Z_{1,2}^j Z_{2,1}^k Z_{2,2}^\ell  |0\rangle \: : \: i + j + k+\ell = K; i, j,k, \ell \in {\mathbb{N}}\}.\end{aligned}$$ The subspace $V_{\leq K}$ is defined as $V_{\leq K} := \bigoplus_{k=0}^K V_{=k}$. The projector $\Pi_{=K}$ is the orthogonal projector onto $V_{=K}$ and the projector $\Pi_{\leq K}$ is defined as $$\begin{aligned}
\Pi_{\leq K} : = \sum_{k=0}^K \Pi_{=k}.\end{aligned}$$

\[thm:finite-version\] For $n\geq 5$ and $\eta \in [0,1[$, if $K \leq\frac{\eta}{1-\eta} (n-5) $, then the following operator inequality holds $$\begin{aligned}
\int_{\mathcal{D}_\eta} |\Lambda,n\rangle \langle \Lambda,n | \d \mu_n(\Lambda)\geq (1-{\varepsilon}) \Pi_{\leq K}\end{aligned}$$ with $$\begin{aligned}
{\varepsilon}:= 2 N^4 (1+\alpha)^7 \exp\left(-N D\left(\frac{\alpha}{\alpha+1} \big\| \eta \right) \right).\end{aligned}$$ for $\alpha = K/N$ and $N=n-5$.

In particular, choosing $K$ such that $\alpha = \frac{1+\eta}{1-\eta} = \frac{K}{N}$ and using Pinsker’s inequality (Lemma \[lem:pinsker\]) yields $$\begin{aligned}
{\varepsilon}\leq  \frac{2 (N+K)^7}{N^3}\exp\left(- \frac{2N^3}{(N+K)^2 \ln 2} \right).\end{aligned}$$

The resolution of the identity reads $$\begin{aligned}
\int_{\overline{\mathcal{E}}_\eta}  P_{x,y}q(x,y) \d x \d y+\int_{{\mathcal{E}}_\eta} P_{x,y}q(x,y) \d x \d y = {\mathbbm{1}}_{F_{2,2,n}^{U(n)}} = \sum_{k=0}^\infty\Pi_{=k} .\end{aligned}$$ For all $k \leq K$, the projector $\Pi_{=k}$ can be written as: $$\begin{aligned}
\Pi_{=k} = \int_{\overline{\mathcal{E}}_\eta} \Pi_{=k}P_{x,y}\Pi_{=k} q(x,y) \d x \d y+\int_{{\mathcal{E}}_\eta} \Pi_{=k}  P_{x,y} \Pi_{=k} q(x,y) \d x \d y.\end{aligned}$$ In particular, since $k \leq K \leq \frac{\eta}{1-\eta} (n-5)$, we have $$\begin{aligned}
\int_{{\mathcal{E}}_\eta}  P_{x,y}q(x,y) \d x \d y &\geq \int_{{\mathcal{E}}_\eta}   \Pi_{=k}P_{x,y} \Pi_{=k} q(x,y) \d x \d y \nonumber\\
&\geq \Pi_{=k}   - \int_{\overline{\mathcal{E}}_\eta}  \Pi_{=k}P_{x,y} \Pi_{=k} q(x,y) \d x \d y \nonumber \\
&\geq  \Pi_{=k}  - \int_{\overline{\mathcal{E}}_\eta}  {\mathrm{tr}}[ \Pi_{=k}P_{x,y}]  \Pi_{=k} q(x,y) \d x \d y  \label{eqn640}\\
&\geq  (1-{\varepsilon})\Pi_{=k}     \label{eqn641}\end{aligned}$$ where we used Lemma \[lem:proj\] in Eq.  and the upper bound resulting from Lemma \[eqn:crucial-step\]: $$\begin{aligned}
\int_{\overline{\mathcal{E}}_\eta} {\mathrm{tr}}\left[ \Pi_{=k}P_{x,y}\right] q(x,y) \d x \d y \leq {\varepsilon}\end{aligned}$$ in Eq. . It follows that: $$\begin{aligned}
\int_{{\mathcal{E}}_\eta}  P_{x,y}q(x,y) \d x \d y \geq (1-{\varepsilon})  \Pi_{=k} \end{aligned}$$ for all $k \leq K$. This finally implies that $$\begin{aligned}
\int_{{\mathcal{E}}_\eta} P_{x,y}q(x,y) \d x \d y \geq(1-{\varepsilon})  \sum_{k \leq K} \Pi_{=k}   = (1-{\varepsilon})  \Pi_{\leq K}.\end{aligned}$$

The crucial property of Theorem \[thm:finite-version\] that will be important for application is that the volume of $\mathcal{D}_\eta$ is finite, and scales as a low degree polynomial in $n$ and $K$.

\[thm:volume\] For $n \geq 38$, $K \geq n-5$ and $\eta = \frac{K-n+5}{K+n-5}$, it holds that $$\begin{aligned}
T(n,\eta) := {\mathrm{tr}}\int_{\mathcal{D}_\eta} |\Lambda,n\rangle\langle \Lambda,n| \d \mu_n(\Lambda) \leq \frac{K^4}{100}.\end{aligned}$$

The volume of $\mathcal{D}_\eta$ is given by $$\begin{aligned}
{\mathrm{tr}}\int_{\mathcal{D}_\eta} |\Lambda,n\rangle\langle \Lambda,n| \d \mu_n(\Lambda) &= \int_0^{\eta}  \int_0^{\eta}  q(x,y)\d x \d y \\
&= \frac{(n-1)(n-2)^2(n-3)\eta^4}{12(1-\eta)^4} \\
&\leq \frac{n^4 \eta^4}{12 (1-\eta)^4}\\
& \leq \frac{n^4(1+\eta)^4}{192(1-\eta)^4}\end{aligned}$$ where we used that $\eta \leq (1+\eta)/2$ in the last equation.

In particular, choosing $K$ such that $\eta = \frac{K-n+5}{K+n-5}$ gives $\frac{1+\eta}{1-\eta} = \frac{K}{n-5}$, and therefore $$\begin{aligned}
{\mathrm{tr}}\int_{\mathcal{D}_\eta} |\Lambda,n\rangle\langle \Lambda,n| \d \mu_n(\Lambda) \leq \frac{n^4 K^4}{192(n-5)^4}.\end{aligned}$$

For $n \geq 38$, it holds that $\frac{1}{192} \left(\frac{n}{n-5}\right)^4 \leq \frac{1}{100}$, which finally gives $$\begin{aligned}
{\mathrm{tr}}\int_{\mathcal{D}_\eta} |\Lambda,n\rangle\langle \Lambda,n| \d \mu_n(\Lambda) \leq \frac{K^4}{100}.\end{aligned}$$

For future reference, let us not that that under the same assumptions as in the theorem, the following inequality also holds: $$\begin{aligned}
T(n,\eta) +1 \leq \frac{K^4}{100}. \label{eqn:tighter}\end{aligned}$$ This inequality will later be useful to analyze Eq.  at the end of Section \[sec:general-proof\] and obtain Eq. (5) in the main text.

In other words, the volume $T(n,\eta)$ of ${\mathcal{D}}_\eta$ is upper bounded by a polynomial of degree 4 in the number of modes (or equivalently in the total energy).

Let us define the function $N^* : [1,\infty[ \to {\mathbb{N}}$ such that $$\begin{aligned}
N^*(\alpha) = \max\left\{ 38,  \min \left\{N \in {\mathbb{N}}\: : \: 2(1+\alpha)^7 N^4 \exp\left(- \frac{2N}{(1+\alpha)^2 \ln 2} \right) \leq \frac{1}{2} \right\}\right\}. \label{eqn:N*}\end{aligned}$$ For instance, $N^*(21) \approx 10^4$, $N^*(60) \approx 10^5$.

We obtain:

\[corol16\] For $K \geq n-5$, if $n \geq N^*\big( \frac{K}{n-5} \big)-5$ then, for $\eta^* = \frac{K-n+5}{K+n-5}$, it holds that $$\begin{aligned}
&\int_{\mathcal{D}_{\eta^*}} |\Lambda,n\rangle \langle \Lambda,n | \d \mu_n(\Lambda)\geq \frac{1}{2} \Pi_{\leq K} \\
&{\mathrm{tr}}\int_{\mathcal{D}_{\eta^*}} |\Lambda,n\rangle\langle \Lambda,n| \d \mu_n(\Lambda) \leq \frac{K^4}{100}.\end{aligned}$$

Security proof for a modified CV QKD protocol {#sec:general-proof}
=============================================

In this section, we recall some facts about security proofs for QKD protocols and explain how to obtain a secure protocol from an initial protocol ${\mathcal{E}}_0$ known to be secure against Gaussian collective attacks, by prepending an energy test and adding an additional privacy amplification test. These various steps will then be detailed in the subsequent sections.

[**QKD protocols and their security**]{}.— A QKD protocol is a CP map from the infinite-dimensional Hilbert space $(\mathcal{H}_A\otimes \mathcal{H}_B)^{\otimes n}$, corresponding to the initially distributed entanglement, to the set of pairs $(S_A,S_B)$ of $\ell$-bit strings (Alice and Bob’s final keys, respectively) and $C$, a transcript of the classical communication. In order to assess the security of a given QKD protocol $\mathcal{E}$ in a composable framework, one compares it with an ideal protocol [@MKR09; @PR14]. The action of an ideal protocol $\mathcal{F}$ is defined by concatenating the protocol $\mathcal{E}$ with a map $\mathcal{S}$ taking $(S_A,S_B,C)$ as input and outputting the triplet $(S,S,C)$ where the string $S$ is a perfect secret key (uniformly distributed and unknown to Eve) with the same length as $S_A$, that is $\mathcal{F} = \mathcal{S}\circ\mathcal{E}$. Then, a protocol will be called *$\epsilon$-secure* if the advantage in distinguishing it from an ideal version is not larger than $\epsilon$. This advantage is quantified by (one half of) the diamond norm defined by $$||\mathcal{E} - \mathcal{F}||_\diamond := \sup_{\rho_{ABE} } \left\|(\mathcal{E}-\mathcal{F})\otimes \mathrm{id}_\mathcal{K} (\rho_{ABE})\right\|_1,$$ where the supremum is taken over density operators on $(\mathcal{H}_A\otimes \mathcal{H}_B)^{\otimes n} \otimes \mathcal{K}$ for any auxiliary system $\mathcal{K}$. The diamond norm is also known as the *completely bounded trace norm* and quantifies a notion of distinguishability for quantum maps [@wat16].

Our main technical result is a reduction of the security against general attacks to that against Gaussian collective attacks, for which security has already been proved in earlier work, for instance in [@Lev15]. Let us therefore suppose that our CV QKD protocol of interest, $\mathcal{E}_0$, is secure against Gaussian collective attacks. We will slightly modify it by prepending an initial test $\mathcal{T}$. More precisely, $\mathcal{T}$ is a CP map taking a state in a slightly larger Hilbert space, $(\mathcal{H}_A\otimes \mathcal{H}_B)^{\otimes (n+k)}$, applying a random unitary $u \in U(n+k)$ to it (corresponding to a network of beamsplitters and phaseshifters), measuring the last $k$ modes and comparing the measurement outcome to a threshold fixed in advance. The test succeeds if the measurement outcome (related to the energy) is small, meaning that the global state is compatible with a state containing only a low number of photons per mode. Such a state is well-described in a low dimensional Hilbert space, as we will discuss in Section \[sec:test\]. Depending on the outcome of the test, either the protocol aborts, or one applies the original protocol $\mathcal{E}_0$ on the $n$ remaining modes.

For the test to be practical, it is important that the legitimate parties do not have to physically implement the transformation $u \in U(n+k)$. Rather, they can both measure their $n+k$ modes with heterodyne detection, perform a random rotation of their respective classical vector in ${\mathbb{R}}^{2(n+k)}$ according to $u \in U(n+k) \cong O(2(n+k)) \cap Sp(2(n+k))$.

In this paper, we assume that this symmetrization step is performed, as it is anyway required for the security proof of the protocol against collective attacks [@Lev15]. We believe, however, that this step might not be required for establishing the security of the protocol and leave it as an important open question for future work. In particular, recent proof techniques in discrete-variable QKD have shown that the permutation need not be applied in practice [@TLG12].

In section \[sec:generalization\], we will prove a de Finetti reduction that allows to upper bound the diamond distance between two quantum channels, provided that they display the right invariance under the action of the unitary group $U(n)$ and that the input states have a maximum number of photons. We address this second issue by introducing another CP map $\mathcal{P}$ which projects a state acting on $F_{1,1,n} = (\mathcal{H}_A\otimes \mathcal{H}_B)^{\otimes n}$ onto a low-dimensional Hilbert space $F_{1,1,n}^{\leq K} $ with less than $K$ photons overall in the $2n$ modes shared by Alice and Bob. Here, the value of $K$ scales linearly with $n$.

Let us denote by ${\mathcal{E}}_0$ a CV QKD proven ${{\varepsilon}}$-secure against Gaussian collective attacks, for instance as in [@Lev15]. This means that (see Section \[sec:collective\] for details) $$\begin{aligned}
\|(({\mathcal{E}}_0 - {\mathcal{F}}_0)\otimes {\mathbbm{1}}) (|\Lambda,n\rangle \langle \Lambda, n|)\|_1 \leq {{\varepsilon}},\end{aligned}$$ for any generalized coherent state $|\Lambda,n\rangle$. Here ${\mathcal{F}}_0 := {\mathcal{S}}\circ {\mathcal{E}}_0$ and ${\mathcal{S}}$ is a map that replaces the output key of ${\mathcal{E}}_0$ by an independent and uniformly distributed string of length $\ell$ when ${\mathcal{E}}_0$ did not abort, and does nothing otherwise.

Here ${\mathcal{E}}_0$ maps an arbitrary density operator $\rho_{AB} \in \mathfrak{S}(F_{1,1,n})$ to a state $\rho_{S_A, S_B, C}$ where the registers are all classical and store respectively Alice’s final key, Bob’s final key and a transcript of the classical communication.

Let us define the following maps: $$\begin{aligned}
{\mathcal{T}}&: {\mathcal{B}}(F_{1,1,n+k}) \to {\mathcal{B}}(F_{1,1,n}) \otimes \{\mathrm{passes} / \mathrm{aborts}\},\\ 
{\mathcal{P}}&: {\mathcal{B}}(F_{1,1,n}) \to {\mathcal{B}}(F_{1,1,n}^{\leq K}),\\ 
{\mathcal{R}}&: \{0,1\}^{\ell} \times \{0,1\}^{\ell} \to \{0,1\}^{\ell'} \times \{0,1\}^{\ell'},\end{aligned}$$ where

-   ${\mathcal{T}}(k, d_A, d_B)$ takes as input an arbitrary state $\rho_{AB}$ on $F_{1,1,n+k}$, maps it to $V_u \rho_{AB} V_u^{\dagger}$ where the unitary $u$ is chosen from the Haar measure on $U(n+k)$, measures the last $k$ modes for $A$ and $B$ with heterodyne detection and check whether the measurement outputs pass the test if the $k$ outcomes $\alpha_1, \cdots, \alpha_k$ of Alice and $\beta_1, \cdots, \beta_k$ of Bob satisfy $$\begin{aligned}
    \sum_{i=1}^k |\alpha_i|^2 \leq k d_A \quad \text{and} \quad \sum_{i=1}^k |\beta_i|^2 \leq k d_B.\end{aligned}$$ If they pass the test, the map returns the state on the first $n$ modes (that were not measured) as well as the flag “passes”. Otherwise, it returns the vacuum state and the flag “aborts”.

-   ${\mathcal{P}}$ is the projector onto the finite-dimensional subspace $F_{1,1,n}^{\leq K}$ (corresponding to states with at most $K$ photons in the $2n$ modes): it maps any state $\rho \in {\mathcal{B}}(F_{1,1,n})$ to $\Pi_{\leq K} \rho \Pi_{\leq K} \in {\mathcal{B}}(F_{1,1,n}^{\leq K})$. This trace non-increasing map is introduced as a technical tool for the security analysis but need not be implemented in practice. It simply ensures that the states that are fed to the original QKD protocol ${\mathcal{E}}_0$ live in a finite-dimensional subspace. In the text, we will alternatively denote this projection by ${\mathcal{P}}^{\leq K}$ or ${\mathcal{P}}(n,K)$, depending on which parameters we wish to make explicit.

-   ${\mathcal{R}}$ takes two $\ell$-bit strings as input and returns $\ell'$-bit strings (for $\ell' < \ell$).

We finally define our CV QKD protocol ${\mathcal{E}}$ as $$\begin{aligned}
{\mathcal{E}}=  {\mathcal{R}}\circ {\mathcal{E}}_0 \circ {\mathcal{T}}\end{aligned}$$ and the ideal protocol as ${\mathcal{F}}= {\mathcal{S}}\circ {\mathcal{E}}$. Abusing notation slightly, the map ${\mathcal{S}}$ now acts on strings of length $\ell'$ instead of $\ell$.

\[lem:sec-red\] Let $\overline{{\mathcal{E}}}$ be the protocol ${\mathcal{R}}\circ {\mathcal{E}}_0$ where the inputs are restricted to the finite-dimensional subspace ${\mathcal{B}}(F_{1,1,n}^{\leq K})$, and $\overline{{\mathcal{F}}} = {\mathcal{S}}\circ \overline{{\mathcal{E}}}$. Then the security of $\overline{{\mathcal{E}}}$ implies the security of ${\mathcal{E}}$: $$\begin{aligned}
 \label{eqn:sec-red}
 ||\mathcal{E} - \mathcal{F}||_\diamond &\leq ||\overline{\mathcal{E}} - \overline{\mathcal{F}}||_\diamond  + 2 || ({\mathbbm{1}}- \mathcal{P}) \circ \mathcal{T}||_\diamond,\end{aligned}$$ provided that the quantity $|| ({\mathbbm{1}}- \mathcal{P}) \circ \mathcal{T}||_\diamond$ can be made arbitrarily small.

We define (virtual) protocols $\tilde{\mathcal{E}}:=  {\mathcal{R}}\circ  \mathcal{E}_0 \circ \mathcal{P} $ and $\tilde{\mathcal{F}}:=  \mathcal{S} \circ \tilde{\mathcal{E}}$. The security of the protocol $\mathcal{E}$ is then a consequence of the following derivation: $$\begin{aligned}
 ||\mathcal{E} - \mathcal{F}||_\diamond &\leq   ||\tilde{\mathcal{E}}\circ {\mathcal{T}}- \tilde{\mathcal{F}} \circ {\mathcal{T}}||_\diamond  +  ||\mathcal{E} - \tilde{\mathcal{E}} \circ {\mathcal{T}}||_\diamond+ ||\mathcal{F} - \tilde{\mathcal{F}} \circ {\mathcal{T}}||_\diamond \nonumber \\
&\leq   ||(\tilde{\mathcal{E}} - \tilde{\mathcal{F}}) \circ {\mathcal{T}}||_\diamond  +  ||{\mathcal{R}}\circ \mathcal{E}_0  \circ (\mathrm{id}- \mathcal{P}) \circ \mathcal{T}||_\diamond +||{\mathcal{S}}\circ {\mathcal{R}}\circ \mathcal{E}_0  \circ (\mathrm{id}- \mathcal{P}) \circ \mathcal{T}||_\diamond \nonumber\\
&\leq ||\tilde{\mathcal{E}} - \tilde{\mathcal{F}}||_\diamond  + 2 || ({\mathbbm{1}}- \mathcal{P}) \circ \mathcal{T}||_\diamond ,\end{aligned}$$ where we used the triangle inequality and the fact that the CP maps ${\mathcal{T}}$, ${\mathcal{R}}\circ \mathcal{E}_0$ and $\mathcal{S}$ cannot increase the diamond norm.

Since $\overline{E} \circ {\mathcal{P}}= \tilde{E}$ and ${\mathcal{P}}$ is trace non-increasing, we finally obtain that $$\begin{aligned}
 ||\mathcal{E} - \mathcal{F}||_\diamond &\leq ||\overline{\mathcal{E}} - \overline{\mathcal{F}}||_\diamond  + 2 || ({\mathbbm{1}}- \mathcal{P}) \circ \mathcal{T}||_\diamond.\end{aligned}$$

Bounding the two terms in the right hand side of Eq.  is done with the two following theorems, which will be proven in Sections \[sec:collective\] and \[sec:test\], respectively.

\[thm:diamond-protocol\] With the previous notations, if ${\mathcal{E}}_0$ is ${\varepsilon}$-secure against Gaussian collective attacks, then $$\begin{aligned}
 ||\overline{\mathcal{E}} - \overline{\mathcal{F}}||_\diamond  \leq 2 T(n,\eta)  {\varepsilon}\end{aligned}$$ where $T(n,\eta) =(n-1)(n-2)^2(n-3) \frac{\eta^4}{12(1-\eta)^4}$ and $\overline{{\mathcal{E}}} = {\mathcal{R}}\circ {\mathcal{E}}_0 \circ {\mathcal{P}}^{\leq K}$.

\[thm:test\] For integers $n,k \geq 1$, and $d_A, d_B >0$, define $K = n(d'_A + d'_B)$ for $d'_{A/B} = d_{A/B} g(n,k,{\varepsilon}/4)$ for the function $g$ defined in Eq. . Then $$\begin{aligned}
\big\| \big({\mathbbm{1}}- {\mathcal{P}}(n,K)\big) \circ {\mathcal{T}}(k, d_A, d_B)\big\|_{\diamond} \leq {\varepsilon}.\end{aligned}$$

Putting everything together yields our main result.

\[thm:main\] If the protocol ${\mathcal{E}}_0$ is ${\varepsilon}$-secure against Gaussian collective attacks, then the protocol ${\mathcal{E}}= {\mathcal{R}}\circ {\mathcal{E}}_0 \circ {\mathcal{P}}$ is ${\varepsilon}'$-secure against general attacks with $$\begin{aligned}
{\varepsilon}' \leq 2 T(n,\eta) {\varepsilon}+ {\varepsilon}.\end{aligned}$$

Putting everything together, we show that if ${\mathcal{E}}_0$ is covariant under the action of the unitary group and ${\varepsilon}$-secure against Gaussian collective attacks, then the protocol ${\mathcal{E}}= {\mathcal{R}}\circ {\mathcal{E}}_0 \circ {\mathcal{T}}$ is ${\varepsilon}'$-secure against general attacks, with $$\begin{aligned}
{\varepsilon}' = 2{\varepsilon}( T(n, \eta)+1) \label{eqn:final-result}\end{aligned}$$ for $T(n,\eta) \leq \frac{1}{12} \left(\frac{\eta n}{1-\eta}\right)^4$, $\eta = \frac{K-n+5}{K+n-5}$ and $K = n(d_A + d_B)\left(1 + 2 \sqrt{\frac{\ln (8/{\varepsilon})}{2n}} +  \frac{\ln (8/{\varepsilon})}{n}\right)\left(1-2{\sqrt{\frac{\ln (8/{\varepsilon})}{2k}}}\right)^{-1}$. The first term in Eq.  results from the de Finetti reduction and the second term results for the energy test failure probability.

In particular, for $n \geq 38$ and $K \geq n-5$, we obtain the bound $T(n,\eta) +1 \leq \frac{K^4}{100}$ from Eq. . This yields ${\varepsilon}' \leq \frac{K^4}{50} {\varepsilon}$, which corresponds to Eq. (5) in the main text.

Generalization of the postselection technique of Ref. [@CKR09] {#sec:generalization}
==============================================================

The goal of this section is to prove the following theorem (Theorem 2 in the main text).

\[thm:postselection\] Let $\Delta: \mathrm{End}(F_{1,1,n}^{\leq K}) \to  \mathrm{End}(\mathcal{H}')$ such that for all $u \in U(n)$, there exists a CPTP map $\mathcal{K}_u: \mathrm{End}(\mathcal{H}') \to \mathrm{End}(\mathcal{H}')$ such that $\Delta \circ u = \mathcal{K}_u: \circ \Delta$, then $$\begin{aligned}
\|\Delta\|_\diamond \leq 2 T(n,\eta) \|(\Delta \otimes \mathrm{id}) \tau^\eta_{\mathcal{H}\mathcal{N}} \|_1,\end{aligned}$$ for $\eta = \frac{K-n+5}{K+n-5}$, provided that $n \geq N^*(K/(n-5))$.

One way to make sure that the input of the map is indeed restricted to states with less than $K$ photons is to replace $\Delta$ by $\Delta  \circ {\mathcal{P}}^{\leq K}$.

In the following, for conciseness, we will denote by $\mathcal{H}$ the symmetric subspace: $$\begin{aligned}
{\mathcal{H}}:= F_{2,2,n}^{U(n)}.\end{aligned}$$

Let $\tau^\eta_{\mathcal{H}}$ be the normalized state corresponding to the projector $P_\eta$ defined in Eq. : $$\begin{aligned}
 \tau^\eta_{\mathcal{H}} = T(n,\eta)^{-1} \int_{ \mathcal{D}_\eta} |\Lambda,n\rangle \langle \Lambda,n| \d \mu_n(\Lambda)\end{aligned}$$ where $$\begin{aligned}
T(n,\eta) := {\mathrm{tr}}(P_\eta) = \frac{(n-1)(n-2)^2(n-3)\eta^4}{12(1-\eta)^4}. \label{eqn:defT}\end{aligned}$$

Consider an orthonormal basis $\left\{Ê|\nu_i\rangle \right\}$ of $F_{2,2,n}^{U(n)}$ and define the non normalizable operator $$\begin{aligned}
|\Phi\rangle_{{\mathcal{H}}{\mathcal{N}}} := \sum_{i} |\nu_i\rangle_{{\mathcal{H}}} |\nu_i\rangle_{{\mathcal{N}}}.\end{aligned}$$

A conjecture for an explicit such orthonormal basis was given in [@lev16], but we do not need to have such an explicit basis for our present purpose.

Let us further define the state $|\Phi^\eta\rangle \in F_{2,2,n}^{U(n)} \otimes F_{2,2,n}^{U(n)}$: $$\begin{aligned}
|\Phi^\eta\rangle = \left(\sqrt{ \tau^\eta} \otimes {\mathbbm{1}}\right) |\Phi\rangle.\end{aligned}$$ It is well-known that $|\Phi^\eta\rangle$ is a purification of $\tau_{\mathcal{H}}^{\eta}$: $$\begin{aligned}
{\mathrm{tr}}_{\mathcal{N}} \left(|\Phi^\eta\rangle\langle \Phi^\eta|_{\mathcal{H}\mathcal{N}} \right)=\tau_{\mathcal{H}}^{\eta}.\end{aligned}$$

Recall that $F_{2,2,n}^{U(n), \leq K}$ denotes the finite-dimensional subspace of $F_{2,2,n}^{U(n)}$ with less than $K$ excitations.

\[lem:measurement\] Let $\rho$ be an arbitrary density operator on $F_{2,2,n}^{U(n), \leq K}$. Then there exists a binary measurement $\mathcal{M} = \{M_{\mathcal{N}}, {\mathbbm{1}}_{\mathcal{N}}-M_{\mathcal{N}}\}$ on ${\mathcal{N}}$ applied to $|\Phi^\eta\rangle \in {\mathcal{H}}\otimes {\mathcal{N}}$ that successfully prepares the state $\rho$ with probability at least $\frac{1}{2T(n,\eta)}$.

To avoid cluttering up the notations, let us write $\tau$ instead of $\tau^\eta_{{\mathcal{H}}}$. Recall that $\tau \geq p {\mathbbm{1}}_{F_{2,2,n}^{U(n), \leq K}}$ with $p = \frac{1}{2T(n,\eta)}$, as a consequence of Corollary \[corol16\].

Let us define the non negative operator $M := p \tau^{-1/2} \rho \tau^{-1/2}$. Since $p^{-1} \tau \geq {\mathbbm{1}}$ on the support of $\rho \leq {\mathbbm{1}}$, the operator $M$ satisfies $$\begin{aligned}
0 \leq M \leq {\mathbbm{1}}.\end{aligned}$$ Let us define the measurement $\mathcal{M} = \{ M, {\mathbbm{1}}-M\}$. Performing this measurement on state $|\Phi^\eta\rangle$ prepares the state $$\begin{aligned}
{\mathrm{tr}}_{{\mathcal{N}}} \left( (1 \otimes M^{1/2}) |\Phi^\eta\rangle \langle \Phi^\eta | (1 \otimes M^{1/2}) \right)\end{aligned}$$ with probability $ \langle  \Phi^\eta | (1 \otimes M) |\Phi^\eta\rangle$. This state can be written: $$\begin{aligned}
{\mathrm{tr}}_{{\mathcal{N}}} \left( (1 \otimes M^{1/2}) |\Phi^\eta\rangle \langle \Phi^\eta | (1 \otimes M^{1/2})\right) &= {\mathrm{tr}}_{{\mathcal{N}}} \left( (1 \otimes M^{1/2})\left(\sqrt{ \tau} \otimes {\mathbbm{1}}\right) |\Phi\rangle \langle \Phi |   \left(\sqrt{ \tau} \otimes {\mathbbm{1}}\right) (1 \otimes M^{1/2}) \right)  \nonumber \\
&= {\mathrm{tr}}_{{\mathcal{N}}} \left( (\tau^{1/2} \otimes M^{1/2}) \sum_{i,j} |\nu_i \rangle \langle \nu_j| \otimes  |\nu_i \rangle \langle \nu_j| (\tau^{1/2} \otimes M^{1/2}) \right) \nonumber \\
&= \sum_{i,j} \tau^{1/2}  |\nu_i \rangle \langle \nu_j| \tau^{1/2}   \langle \nu_j| M^{1/2} M^{1/2}  |\nu_i \rangle  \nonumber\\
&= \sum_{i,j} \tau^{1/2}  |\nu_i \rangle \langle \nu_j| \tau^{1/2}   \langle \nu_i| M^{1/2} M^{1/2}  |\nu_j \rangle \label{eqn:inv} \\
&= \sum_{i,j} \tau^{1/2}  |\nu_i \rangle  \langle \nu_i| M^{1/2} M^{1/2}  |\nu_j \rangle  \langle \nu_j| \tau^{1/2}  \nonumber \\
&=  \tau^{1/2}  M^{1/2} M^{1/2}  \tau^{1/2} \nonumber \\
&=  \tau^{1/2}  p \tau^{-1/2} \rho \tau^{-1/2}  \tau^{1/2} \nonumber \\
&= p \rho, \nonumber\end{aligned}$$ and it is obtained with probability $p$. In Eq. , we used that $M$ is symmetric, that is $\langle \lambda_i |M |\lambda_j\rangle = \langle \lambda_j |M |\lambda_i\rangle$.

\[lem:dim\] For $k\geq 0$ and $n\geq 4$, the dimensions of $V_{=K}$ and $V_{\leq K} = F_{2,2,n}^{U(n), \leq K}$ are given by $$\begin{aligned}
\mathrm{dim} \, V_{=K} = \tbinom{K+3}{3} \quad \text{and} \quad \mathrm{dim} \, V_{\leq K} = \tbinom{K+4}{4}.\end{aligned}$$

It was proven in [@lev16] that the vectors $(Z_{1,1})^i (Z_{1,2})^j (Z_{2,1})^k (Z_{2,2})^{\ell}$ are independent (provided than $n\geq 4$), which means that the dimension of $V_{=K}$ is the cardinality of the sets of quadruples $\{(i,j,k,\ell) \in {\mathbb{N}}^4 \: : \: i+j+k+\ell =K\}$. This number is $\tbinom{K+3}{3}$. More generally, the number of $t$-uples of nonnegative integers that sum to $K$ is $\tbinom{n+K-1}{n-1}$. Since the subspaces $V_{=K}$ are orthogonal, it follows that $\mathrm{dim} \,  V_{\leq K} = \sum_{k=0}^K \mathrm{dim} \, V_{=k}$, which can be computed explicitly. Alternatively, one can see that the space $V_{\leq K}$ of quadruples $(i,j,k,\ell)$ summing to $K-m$ for some integer $m \leq K$ corresponds to the space of $5$-uples $(i,j,k,\ell, m)$ that sum to $K$.

\[lem:design\] For any $K$ and $n$ integers, there exists a finite subset $\mathcal{U} \subset U(n)$, such that for any state $\rho$ with support on $F_{1,1,n}^{\leq K}$, the subspace of $F_{1,1,n}$ restricted to states with less than $K$ photons, the following holds: $$\begin{aligned}
\frac{1}{|\mathcal{U}|} \sum_{u \in \mathcal{U}} V_u \rho V_u^\dagger =  \int V_u \rho V_u^\dagger \d u,\end{aligned}$$ where $\d u$ is the normalized Haar measure on $U(n)$.

Note that by definition of the Haar measure, the state $ \int V_u \rho V_u^\dagger \d u$ is invariant under the application of any unitary $u' \in U(n)$: $V_{u'}  \int V_u \rho V_u^\dagger \d u V_{u'}^\dagger =  \int V_u \rho V_u^\dagger \d u$, which means that it has support on $F_{1,1,n}^{U(n), \leq K}$.

By linearity, it is sufficient to establish the lemma for pure states $|\psi\rangle \in F_{1,1,n}^{\leq K}$. Such a state can be written as $$\begin{aligned}
|\psi\rangle = \sum_{\substack{k_1, \ldots, k_n, \ell_1, \ldots \ell_n\\ \sum k_i + \ell_i \leq K}} \lambda_{k_1 \ldots k_n, \ell_1 \ldots \ell_n} \prod_{i=1}^n \left(a_i^\dagger\right)^{k_i} \left(b_i^\dagger\right)^{\ell_i} |0\rangle.\end{aligned}$$

Applying $V_u$ maps $a_i^\dagger$ to $\sum_{j=1}^n u_{i,j} a_j^\dagger$ and $b_i^\dagger$ to $\sum_{j=1}^n \overline{u}_{i,j} b_j^\dagger$. In other words, the function $f: u \mapsto V_u |\psi\rangle \langle \psi | V_u^\dagger$ is a polynomial of degree at most $K$ in $u$ and $\overline{u}$. Taking $\mathcal{U}$ to be a $K$-design of $U(n)$, we obtain that $$\begin{aligned}
\frac{1}{|\mathcal{U}|} \sum_{u \in \mathcal{U}} f(u) = \int f(u) \d u,\end{aligned}$$ which proves the result.

We recall the following theorem that was established in [@lev16].

\[theo:purification\] Any density operator $\rho \in \mathfrak{S}(F_{1,1,n})$ invariant under $U(n)$ admits a purification in $F_{2,2,n}^{U(n)}$.

\[lem:symmetrization\] It is sufficient to consider states $\rho_{{\mathcal{H}}\mathcal{N}} $ with support on $F_{2,2,n}^{U(n),\leq K}$ when computing the diamond norm of Theorem \[thm:postselection\].

Consider a state $\rho_{{\mathcal{H}}{\mathcal{N}}}$ with support on $F_{2,2,n}^{\leq K}$. Let $\mathcal{U}$ be a finite set of unitaries as promised by Lemma \[lem:design\]. Let $\{ |u\rangle_{\mathcal{C}}\}_{u \in \mathcal{U}}$ be an orthogonal basis for some classical register $\mathcal{C}$. The following sequence of equalities holds: $$\begin{aligned}
\|(\Delta \otimes {\mathbbm{1}}) \rho_{{\mathcal{H}}{\mathcal{N}}}\|_1 &= \frac{1}{|\mathcal{U}|} \sum_{u \in \mathcal{U}} \|( \Delta \otimes {\mathbbm{1}}) (\rho_{{\mathcal{H}}{\mathcal{N}}} \otimes |u\rangle \langle u|_{\mathcal{C}}) \|_1 \nonumber \\
&=  \left\|\frac{1}{|\mathcal{U}|} \sum_{u \in \mathcal{U}} ( \Delta \otimes {\mathbbm{1}}) (\rho_{{\mathcal{H}}{\mathcal{N}}} \otimes |u\rangle \langle u|_{\mathcal{C}}) \right\|_1  \label{eqn00} \\
&=  \left\|\frac{1}{|\mathcal{U}|} \sum_{u \in \mathcal{U}} ( \mathcal{K}_u \circ \Delta \otimes {\mathbbm{1}}) (\rho_{{\mathcal{H}}{\mathcal{N}}} \otimes |u\rangle \langle u|_{\mathcal{C}}) \right\|_1 \label{eqn01} \\
&= \left\|\frac{1}{|\mathcal{U}|} \sum_{u \in \mathcal{U}} (  \Delta \circ u \otimes {\mathbbm{1}}) (\rho_{{\mathcal{H}}{\mathcal{N}}} \otimes |u\rangle \langle u|_{\mathcal{C}}) \right\|_1 \label{eqn02} \\
&= \left\| (  \Delta \otimes {\mathbbm{1}}) \left(\frac{1}{|\mathcal{U}|} \sum_{u \in \mathcal{U}}  ((u \circ {\mathbbm{1}}) \rho_{{\mathcal{H}}{\mathcal{N}}} \otimes |u\rangle \langle u|_{\mathcal{C}})\right) \right\|_1 \nonumber \end{aligned}$$ where we used that the classical states $|u\rangle$ are all pairwise orthogonal in Eq. , that ${\mathcal{K}}_u$ is trace preserving in Eq. , that ${\mathcal{K}}_u \circ \Delta = \Delta \circ u$ in Eq. . Consider now the reduced state $\tilde{\rho}_{{\mathcal{H}}}$: $$\begin{aligned}
\tilde{\rho}_{{\mathcal{H}}} = {\mathrm{tr}}_{{\mathcal{N}}{\mathcal{C}}}\left(\frac{1}{|\mathcal{U}|} \sum_{u \in \mathcal{U}}  ((u \circ {\mathbbm{1}}) \rho_{{\mathcal{H}}{\mathcal{N}}} \otimes |u\rangle \langle u|_{\mathcal{C}})\right) =\frac{1}{|{\mathcal{U}}|} \sum_{u \in \mathcal{U}} V_u \rho_{{\mathcal{H}}} V_u^\dagger = \int V_u \rho_{{\mathcal{H}}} V_u^{\dagger} \d u\end{aligned}$$ where the last equality follows from Lemma \[lem:design\]. Theorem \[theo:purification\] now assures the existence of some purification $\tilde{\rho}_{{\mathcal{H}}{\mathcal{N}}}$ of $\tilde{\rho}_{{\mathcal{H}}}$ in $F_{2,2,n}^{U(n), \leq K}\cong {\mathcal{H}}\otimes {\mathcal{N}}$. In particular, there exists a CPTP map $g: \mathrm{End}({\mathcal{N}}) \to \mathrm{End}({\mathcal{N}}\otimes {\mathcal{C}})$ such that $$\begin{aligned}
\frac{1}{|\mathcal{U}|} \sum_{u \in \mathcal{U}}  ((u \circ {\mathbbm{1}}) \rho_{{\mathcal{H}}{\mathcal{N}}} \otimes |u\rangle \langle u|_{\mathcal{C}}) = ({\mathbbm{1}}_{\mathcal{H}}\otimes g) \tilde{\rho}_{{\mathcal{H}}{\mathcal{N}}}.\end{aligned}$$ Since $g$ is trace preserving, it further implies that $$\begin{aligned}
\|(\Delta \otimes {\mathbbm{1}}) \rho_{{\mathcal{H}}{\mathcal{N}}}\|_1 =\|(\Delta \otimes {\mathbbm{1}}) ({\mathbbm{1}}_{\mathcal{H}}\otimes g) \overline{\rho}_{{\mathcal{H}}{\mathcal{N}}}\|_1  =\|(\Delta \otimes {\mathbbm{1}}) \tilde{\rho}_{{\mathcal{H}}{\mathcal{N}}}\|_1,\end{aligned}$$ which concludes the proof

We are now in position to prove Theorem \[thm:postselection\].

[thm:postselection]{} Let $\Delta: \mathrm{End}(F_{1,1,n}^{\leq K}) \to  \mathrm{End}(\mathcal{H}')$ such that for all $u \in U(n)$, there exists a CPTP map $\mathcal{K}_u: \mathrm{End}(\mathcal{H}') \to \mathrm{End}(\mathcal{H}')$ such that $\Delta \circ u = \mathcal{K}_u: \circ \Delta$, then $$\begin{aligned}
\|\Delta\|_\diamond \leq 2 T(n,\eta) \|(\Delta \otimes \mathrm{id}) \tau^\eta_{\mathcal{H}\mathcal{N}} \|_1,\end{aligned}$$ for $\eta = \frac{K-n+5}{K+n-5}$, provided that $n \geq N^*(K/(n-5))$.

According to Lemma \[lem:symmetrization\], it is sufficient to prove the theorem for a state $\rho_{{\mathcal{H}}{\mathcal{N}}}$ on $F_{2,2,n}^{U(n), \leq K}$. Lemma \[lem:measurement\] guarantees the existence of a trace-non-increasing map $\mathcal{T}$ from a copy of $F_{2,2,n}^{U(n), \leq K}$ to ${\mathbb{C}}$ such that $$\begin{aligned}
\rho_{{\mathcal{H}}{\mathcal{N}}} = {2T(n,\eta)}({\mathbbm{1}}\otimes \mathcal{T}) (|\Phi^\eta\rangle \langle \Phi^\eta |).\end{aligned}$$ This gives $$\begin{aligned}
(\Delta \otimes {\mathbbm{1}}) \rho_{{\mathcal{H}}{\mathcal{N}}} = {2T(n,\eta)}(\Delta \otimes \mathcal{T}) (|\Phi^\eta\rangle \langle \Phi^\eta |)\end{aligned}$$ and finally that $$\begin{aligned}
\|(\Delta \otimes {\mathbbm{1}}) \rho_{{\mathcal{H}}{\mathcal{N}}}\|_1 ={2T(n,\eta)} \|(\Delta \otimes \mathcal{T}) (|\Phi^\eta\rangle \langle \Phi^\eta |)\|_1.\end{aligned}$$

Security against collective attacks provides a bound on $\| {\mathcal{R}}\circ \Delta \circ {\mathcal{P}}\|_{\diamond}$ {#sec:collective}
=======================================================================================================================

In order to exploit Theorem \[thm:postselection\], one needs an upper bound on $\|(({\mathcal{R}}\circ \Delta \circ {\mathcal{P}}^{\leq K})\otimes \mathrm{id}) \tau^\eta_{\mathcal{H}\mathcal{N}} \|_1$. We will see that such a bound can be obtained if the protocol is known to be secure against Gaussian collective attacks. For this, we follow the same strategy as in [@CKR09]. Let us first recall the definition of being secure against Gaussian collective attacks.

The QKD protocol ${\mathcal{E}}_0$ is ${\varepsilon}$-secure against Gaussian collective attacks if $$\begin{aligned}
\| (({\mathcal{E}}_0-{\mathcal{F}}_0)\otimes \mathrm{id})(|\Lambda,n\rangle \langle \Lambda,n|)\|_1\leq {\varepsilon}\label{eqn:sec-coll}\end{aligned}$$ for all $\Lambda \in {\mathcal{D}}$.

We show the following result.

With the previous notations, if ${\mathcal{E}}_0$ is ${\varepsilon}$-secure against Gaussian collective attacks, then $$\begin{aligned}
 \|({\mathcal{R}}\circ \Delta \circ {\mathcal{P}}^{\leq K}  \otimes \mathrm{id}) \tau^\eta_{\mathcal{H}\mathcal{N}} \|_1 \leq {\varepsilon},\end{aligned}$$ where $\tau^\eta_{\mathcal{H}\mathcal{N}}$ is a purification of $\tau^\eta_{\mathcal{H}}$. Here ${\mathcal{R}}$ is an additional privacy amplification step that reduces the key by $\lceil 2 \log_2 \tbinom{K+4}{4} \rceil$ bits and ${\mathcal{P}}^{\leq K}$ is the projection onto $F_{1,1,n}^{\leq K}$.

Recall that $$\begin{aligned}
 \tau^\eta_{\mathcal{H}} = T(n,\eta)^{-1} \int_{\mathcal{D}_\eta} |\Lambda,n\rangle \langle \Lambda,n| \d \mu_n(\Lambda)\end{aligned}$$ where $$\begin{aligned}
T(n,\eta) := {\mathrm{tr}}(P_\eta) = \frac{(n-1)(n-2)^2(n-3)\eta^4}{12(1-\eta)^4}.\end{aligned}$$ By linearity, it holds that $$\begin{aligned}
\| (({\mathcal{E}}-{\mathcal{F}})\otimes \mathrm{id})( \tau^\eta_{\mathcal{H}})\|_1  &= 
 \| (({\mathcal{E}}-{\mathcal{F}})\otimes \mathrm{id})( T(n,\eta)^{-1} \int_{\Lambda \in \mathcal{D}_\eta} |\Lambda,n\rangle \langle \Lambda,n| \d \mu_n(\Lambda) )\|_1     \\
  &\leq  {\varepsilon}T(n,\eta)^{-1}\left\| \int_{\Lambda \in  \mathcal{D}_\eta}  \d \mu_n(\Lambda) \right\|_1     \\  &= {\varepsilon}\end{aligned}$$ In order to obtain the theorem, we need to consider a purification of $\tau_{{\mathcal{H}}{\mathcal{N}}}^{\eta}$. Since ${\mathcal{P}}^{\leq K}$ restricts the states to live in a space of dimension at most $\mathrm{dim} \, F_{2,2,n}^{U(n), \leq K} = \tbinom{K+4}{4}$ (according to Lemma \[lem:dim\]), it implies that the purifying system ${\mathcal{N}}$ can be chosen of this dimension. Giving this extra system to Eve can at most provide her with a limited amount of information. Applying an additional privacy amplification step ${\mathcal{R}}$ ensures that the protocol remains ${\varepsilon}$-secure for the state $\tau_{{\mathcal{H}}{\mathcal{N}}}^\eta$ thanks to the leftover hashing lemma (Theorem 5.1.1 of [@Ren08]): $$\begin{aligned}
 \|({\mathcal{R}}\circ \Delta \circ {\mathcal{P}}^{\leq K}  \otimes \mathrm{id}) \tau^\eta_{\mathcal{H}\mathcal{N}} \|_1 \leq  \|( \Delta \circ {\mathcal{P}}^{\leq K}  \otimes \mathrm{id}) \tau^\eta_{\mathcal{H}} \|_1.\end{aligned}$$

Combining this result with Theorem \[thm:postselection\] yields Theorem \[thm:diamond-protocol\].

[thm:diamond-protocol]{} With the previous notations, if ${\mathcal{E}}_0$ is ${\varepsilon}$-secure against Gaussian collective attacks, then $$\begin{aligned}
 \|{\mathcal{R}}\circ ({\mathcal{E}}_0-{\mathcal{F}}_0) \circ {\mathcal{P}}^{\leq K}  \|_{\diamond} \leq 2 T(n,\eta)  {\varepsilon}.\end{aligned}$$

Energy test {#sec:test}
===========

The goal of this section is to prove the following result.

[thm:test]{} For integers $n,k \geq 1$, and $d_A, d_B >0$, define $K = n(d'_A + d'_B)$ for $d'_{A/B} = d_{A/B} g(n,k,{\varepsilon}/4)$ for the function $g$ defined in Eq. . Then $$\begin{aligned}
\big\| \big({\mathbbm{1}}- {\mathcal{P}}(n,K)\big) \circ {\mathcal{T}}(k, d_A, d_B)\big\|_{\diamond} \leq {\varepsilon}.\end{aligned}$$

For $d >0$, let us introduce the following operators on ${\mathcal{H}}^{\otimes n}$ for a single-mode Fock space ${\mathcal{H}}$: $$\begin{aligned}
T_n^{d} &:= \frac{1}{\pi^n} \int_{\sum_{i=1}^n  |\alpha_i|^2 \geq n d} |\alpha_1\rangle\langle \alpha_1| \otimes \ldots \otimes |\alpha_n\rangle \langle \alpha_n| \d \alpha_1 \ldots \alpha_n\\
U_n^{d} &:= \sum_{m = n d+1}^\infty \Pi_{m}^n,\end{aligned}$$ where $\Pi_m^n$ is the projector onto the subspace of ${\mathcal{H}}^{\otimes n}$ spanned by Fock states containing $m$ photons: $$\begin{aligned}
\Pi_m^n = \sum_{m_1+\ldots+m_n=m} |m_1, \ldots, m_n\rangle \langle m_1, \ldots, m_n|.\end{aligned}$$ In words, $T_n^{d}$ is the sum of the projectors onto products of coherent states such that the total squared amplitude is greater than $n d$ and $U_n^{d}$ is the projector onto Fock states containing more that $n d$ photons. Intuitively, both operators should be “close” to each other. This is formalized with the following lemma that was proven in [@LGRC13].

\[lem:LGRC\] For any integer $n$ and any $d\geq0$, it holds that $$\begin{aligned}
U_n^{d} \leq 2 T_n^{d}.\end{aligned}$$

The following lemma results from the definitions of $U_n^d$ and ${\mathcal{P}}^{\leq K}$, the projector onto $F_{1,1,n}^{\leq K}$.

\[lem:obs\] For any $d_A, d_B \geq 0$ and integer $K$ such that $K \leq n(d_A+d_B)$, it holds that $$\begin{aligned}
{\mathbbm{1}}_{{\mathcal{H}}_A^{\otimes n} \otimes {\mathcal{H}}_B^{\otimes n}} - {\mathcal{P}}^{\leq K} \leq U_n^{d_A}\otimes  {\mathbbm{1}}_{{\mathcal{H}}_B^{\otimes n}} + {\mathbbm{1}}_{{\mathcal{H}}_A^{\otimes n}} \otimes U_n^{d_B}.\end{aligned}$$

The left hand side is the projector onto the states of ${\mathcal{H}}_A^{\otimes n} \otimes {\mathcal{H}}_B^{\otimes n}$ containing strictly more than $K$ photons. Any such state must contain either at least $n d_A$ photons in ${\mathcal{H}}_A^{\otimes n}$ or at least $K - n d_A$ photons in ${\mathcal{H}}_B^{\otimes n}$, for any possible value of $d_A$. This proves the claim.

Combining Lemmas \[lem:LGRC\] and \[lem:obs\], we obtain the immediate corollary.

\[cor:proj\] For any $d_A, d_B \geq 0$ and integer $K$ such that $K \leq n(d_A+d_B)$, it holds that $$\begin{aligned}
{\mathbbm{1}}_{{\mathcal{H}}_A^{\otimes n} \otimes {\mathcal{H}}_B^{\otimes n}} - {\mathcal{P}}^{\leq K} \leq 2 T_n^{d_A}\otimes  {\mathbbm{1}}_{{\mathcal{H}}_B^{\otimes n}} + 2{\mathbbm{1}}_{{\mathcal{H}}_A^{\otimes n}} \otimes T_n^{d_B}.\end{aligned}$$

Recall that the heterodyne measurement corresponds to a projection onto (Glauber) coherent states, and is described by the resolution of the identity: $$\begin{aligned}
{\mathbbm{1}}_{{\mathcal{H}}^{\otimes k}} = \frac{1}{\pi^k} \int_{{\mathbb{C}}^k} |\alpha_1\rangle \langle \alpha_1| \otimes \ldots \otimes |\alpha_k\rangle \langle \alpha_k| \d\alpha_1 \ldots \d \alpha_k.\end{aligned}$$ In other words, measuring a state $\rho$ on ${\mathcal{H}}^{\otimes k}$ with heterodyne detection outputs the result $(\alpha_1, \ldots, \alpha_k) \in {\mathbb{C}}^k$ with probability $$\begin{aligned}
\mathrm{Pr}_\rho(\alpha_1, \ldots, \alpha_k) =\frac{1}{\pi^k} {\mathrm{tr}}( \rho  |\alpha_1\rangle \langle \alpha_1| \otimes \ldots \otimes |\alpha_k\rangle \langle \alpha_k|).\end{aligned}$$

Laurent and Massart [@LM00] established the following tail bounds for $\chi^2(D)$ distributions.

\[lem:LM\] Let $U$ be a $\chi^2$ statistic with $D$ degrees of freedom. For any $x >0$, $$\begin{aligned}
\mathrm{Pr}[U-D \geq 2\sqrt{D x} + 2 Dx] \leq \exp(-x) \quad \text{and} \quad \mathrm{Pr}[D-U \geq 2\sqrt{Dx}] \leq \exp(-x). \end{aligned}$$

A state $\rho$ on ${\mathcal{H}}^{\otimes n} = F({\mathbb{C}}^n)$ is said *rotationally invariant* is $V_u \rho V_u^\dagger = \rho$ for all $u \in U(n)$.

In particular, the state $\int V_u \rho V_U^\dagger \d u$ is invariant if $\d u$ is the Haar measure on $U(n)$.

\[lem:36\] Let $\rho$ be an rotationally invariant state on ${\mathcal{H}}^{\otimes (n+k)}$. Then, for any $d >0$, $$\begin{aligned}
{\mathrm{tr}}\left[ ( T_n^{d'} \otimes ({\mathbbm{1}}-T_k^d)) \rho \right] \leq {\varepsilon},\end{aligned}$$ for $d' = g(n,k,{\varepsilon}) d$ and $$\begin{aligned}
 g(n,k,{\varepsilon}) = \frac{1 + 2 \sqrt{\frac{\ln (2/{\varepsilon})}{2n}} +  \frac{\ln (2/{\varepsilon})}{n}}{1-2{\sqrt{\frac{\ln (2/{\varepsilon})}{2k}}}}. \label{eqn:g}\end{aligned}$$

By definition, ${\mathrm{tr}}[T_k^d \rho]$ is the probability that the outcome $(\alpha_1, \ldots, \alpha_k)\in {\mathbb{C}}^k$ obtained by measuring the last $k$ modes of the state $\rho$ with heterodyne detection satisfies $\sum_{i=1}^k |\alpha_i|^2 \geq k d$. Similarly, ${\mathrm{tr}}\left[ ((T_n^{d'} \otimes ({\mathbbm{1}}-T_k^d)) \rho \right]$ is the probability that the outcome of measuring the $n+k$ modes of $\rho$ with heterodyne detection yields a vector $(\alpha_1, \ldots, \alpha_{n+k})$ such that $$\begin{aligned}
Y_n := \sum_{i=1}^n |\alpha_i|^2 \geq  n d' \quad \text{and} \quad Y_k :=\sum_{i=1}^k |\alpha_{n+i}|^2 \leq k d.\end{aligned}$$ Since the state is rotationally invariant, it means that the random vector $(\alpha_1, \ldots, \alpha_{n+k})$ is uniformly distributed on the sphere of radius $M$ in ${\mathbb{C}}^{n+k}$, conditioned on the fact that the modulus is $\sqrt{\sum_{i=1}^{n+k} |\alpha_i|^2}=M$. Equivalently, one can consider the $2(n+k)$-dimensional real vector $({\mathfrak{R}}(\alpha_1), {\mathfrak{I}}(\alpha_1), \ldots, {\mathfrak{R}}(\alpha_1), {\mathfrak{I}}(\alpha_1))$ which is uniformly distributed over the sphere in ${\mathbb{R}}^{2(n+k)}$. Here ${\mathfrak{R}}(\alpha_1)$ and ${\mathfrak{I}}(\alpha)$ refer respectively to the real and imaginary part of $\alpha$. We obtain $$\begin{aligned}
{\mathrm{tr}}\left[ ( T_n^{d'} \otimes ({\mathbbm{1}}-T_k^d)) \rho \right] &= \mathrm{Pr}[(Y_n \geq  nd' ) \wedge (Y_k \leq kd)]\\
& \leq \mathrm{Pr}[kd Y_n \geq nd' Y_k]\end{aligned}$$ where the inequality is a simple consequence of the fact that the rectangle $[nd',\infty] \times [0, kd]$ is a subset of the triangle $\{ (x,y) \in [0,\infty]^2 \: : \: kd x \geq nd' y\}$.

It is well-known that the uniform distribution over the unit sphere of ${\mathbb{R}}^{2(n+k)}$ can be generated by sampling $2(n+k)$ normal variables with 0 mean and unit variance. In that case, the squared norm $\sum_{i=1}^n |\alpha_i|^2$ is simply a $\chi^2$ variable with $2n$ degrees of freedom while $\sum_{i=1}^k |\alpha_{n+i}|^2$ corresponds to an independent $\chi^2$ variable with $2k$ degrees of freedom. Let us denote by $Z_n$ and $Z_k$ the corresponding random variables: $Z_n \sim \chi^2(2n)$, $Z_k \sim \chi^2(2k)$. Since $(Y_n, Y_k)$ and $(Z_n, Z_k)$ follow the same distribution, up to rescaling, we obtain that $$\begin{aligned}
\mathrm{Pr}[kd Y_n \geq nd' Y_k] = \mathrm{Pr}[kd Z_n \geq nd' Z_k].\end{aligned}$$ This is particularly useful because it means that there is no need to enforce normalization explicitly. Finally, using now that the triangle $\{ (x,y) \in [0,\infty]^2 \: : \: kd x \geq dd' y\}$ is a subset of the union of the rectangles $[\alpha nd',\infty]\times [0,\infty]$ and $[0,\infty] \times [0,\alpha kd]$ for any $\alpha >0$, it follows that $$\begin{aligned}
\mathrm{Pr}[kd Z_n \geq nd' Z_k] \leq  \mathrm{Pr}[ Z_n \geq  \alpha n d'] + \mathrm{Pr}[ Z_k \leq \alpha k d].\end{aligned}$$ Choosing $\alpha$ such that $$\begin{aligned}
\alpha k d = 2k \left(1 - 2 \sqrt{\frac{\ln({\varepsilon}/2)}{2k}}\right)\end{aligned}$$ and applying the lower bounds on the tails of the $\chi^2$ distribution given in Lemma \[lem:LM\] gives $$\begin{aligned}
\mathrm{Pr}[ Z_n \geq  \alpha n d'] \leq \frac{{\varepsilon}}{2}, \quad \mathrm{Pr}[ Z_k \leq \alpha k d] \leq \frac{{\varepsilon}}{2}.\end{aligned}$$ This establishes that $$\begin{aligned}
{\mathrm{tr}}\left[ ( T_n^{d'} \otimes ({\mathbbm{1}}-T_k^d)) \rho \right] \leq {\varepsilon}, \end{aligned}$$ which concludes the proof.

We are now ready to define and analyze the energy test. Alice and Bob perform a random rotation of their data according to a unitary $u \in U(n)$ chosen from the Haar measure on $U(n)$, and measure the last $k$ modes of their respective state with heterodyne detection. They compute the squared norm of their respective vectors and obtain two values $Y_A$ for Alice and $Y_B$ for Bob. The test depends on three parameters: the number $k$ of modes which are measured, a maximum value for Alice $d_A$ and a maximum value for Bob, $d_B$. The test $\mathcal{T}(k, d_A, d_B)$ passes if $$\begin{aligned}
Y_A \leq k d_A \quad \text{and} \quad Y_B \leq k d_B.\end{aligned}$$

We are interested in the probability of passing the test and failing for the remaining modes to contain less than $K$ photons, more precisely in the quantity $$\begin{aligned}
\|({\mathbbm{1}}- {\mathcal{P}}) \circ {\mathcal{T}}\|_{\diamond}.\end{aligned}$$

Let us denote by $\mathrm{Inv}( {\mathfrak{S}}({\mathcal{H}}^{\otimes (n+k)}))$ the set of density matrices which are invariant under the action of $U(n+k)$.

[thm:test]{} For integers $n,k \geq 1$, and $d_A, d_B >0$, define $K = n(d'_A + d'_B)$ for $d'_{A/B} = d_{A/B} g(n,k,{\varepsilon}/4)$ for the function $g$ defined in Eq. . Then $$\begin{aligned}
\big\| \big({\mathbbm{1}}- {\mathcal{P}}(n,K)\big) \circ {\mathcal{T}}(k, d_A, d_B)\big\|_{\diamond} \leq {\varepsilon}.\end{aligned}$$

Writing ${\mathcal{P}}$ and ${\mathcal{T}}$ for conciseness, the definition of the diamond norm yields: $$\begin{aligned}
\|({\mathbbm{1}}- {\mathcal{P}}) \circ {\mathcal{T}}\|_{\diamond} &= \max_{\rho \in {\mathcal{H}}_{AB}^{\otimes (n+k)} \otimes  {\mathcal{H}}_{AB}^{\otimes (n+k)}} \big\| \big(({\mathbbm{1}}- {\mathcal{P}}) \circ {\mathcal{T}})\otimes {\mathbbm{1}}_{{\mathcal{H}}_{AB}^{\otimes (n+k)}}\big) (\rho)\big\|_{1} \nonumber\\
&= \max_{\rho \in {\mathfrak{S}}({\mathcal{H}}_{AB}^{\otimes (n+k)})} \|({\mathbbm{1}}- {\mathcal{P}}) \circ {\mathcal{T}}(\rho)\|_{1} \label{eqn:nonneg}\\
& \leq \max_{\rho \in \mathrm{Inv}\left( {\mathfrak{S}}({\mathcal{H}}_{AB}^{\otimes (n+k)}\right)} \|({\mathbbm{1}}- {\mathcal{P}}) \circ {\mathcal{T}}(\rho)\|_{1} \label{eqn:invar}\\
& \leq \max_{\rho \in \mathrm{Inv}\left( {\mathfrak{S}}({\mathcal{H}}_{AB}^{\otimes (n+k)}\right)} \| (U_n^{d'_A} \otimes {\mathbbm{1}}+{\mathbbm{1}}\otimes U_n^{d'_B}) \circ \big( ({\mathbbm{1}}- T_k^{d_A} )\otimes ({\mathbbm{1}}-T_k^{d_B}) \big)(\rho)\|_{1} \label{eqn:sum} \\
& = \max_{\rho \in \mathrm{Inv}\left( {\mathfrak{S}}({\mathcal{H}}_{AB}^{\otimes (n+k)}\right)} \| (U_n^{d'_A} \circ ({\mathbbm{1}}-T_k^{d_A}) + U_n^{d'_B} \circ ({\mathbbm{1}}- T_k^{d_B})) (\rho)\|_{1} \nonumber \\
& \leq \max_{\rho \in \mathrm{Inv}\left( {\mathfrak{S}}({\mathcal{H}}_{A}^{\otimes (n+k)}\right)} \| (U_n^{d'_A}  \circ ({\mathbbm{1}}-T_k^{d_A} )) (\rho)\|_{1}  + \max_{\rho \in \mathrm{Inv}\left( {\mathfrak{S}}({\mathcal{H}}_{B}^{\otimes (n+k)}\right)} \| ( U_n^{d'_B} \circ  ({\mathbbm{1}}-T_k^{d_B})) (\rho)\|_{1} \label{eqn:triang}\\
& \leq 2 \max_{\rho \in \mathrm{Inv}\left( {\mathfrak{S}}({\mathcal{H}}_{A}^{\otimes (n+k)}\right)} \| (T_n^{d'_A}  \circ ({\mathbbm{1}}-T_k^{d_A}) ) (\rho)\|_{1}   +2 \max_{\rho \in \mathrm{Inv}\left( {\mathfrak{S}}({\mathcal{H}}_{B}^{\otimes (n+k)}\right)} \| ( T_n^{d'_B} \circ  ({\mathbbm{1}}-T_k^{d_B})) (\rho)\|_{1}\\
&\leq  {\varepsilon}\label{eqn:final}\end{aligned}$$ where we used that $\big(({\mathbbm{1}}- {\mathcal{P}}) \circ {\mathcal{T}})\otimes {\mathbbm{1}}_{{\mathcal{H}}_{AB}^{\otimes (n+k)}}\big) (\rho)$ is a nonnegative operator in Eq. , the fact that both ${\mathcal{P}}$ and ${\mathcal{T}}$ are rotationally invariant in Eq. , Lemma \[lem:obs\] in Eq. , the triangle inequality in Eq. , Lemma \[lem:36\] in Eq. .
