Device-independent certification of tensor products of quantum states using single-copy self-testing protocols

Self-testing protocols are methods to determine the presence of shared entangled states in a device independent scenario, where no assumptions on the measurements involved in the protocol are made. A particular type of self-testing protocol, called parallel self-testing, can certify the presence of copies of a state, however such protocols typically suffer from the problem of requiring a number of measurements that increases with respect to the number of copies one aims to certify. Here we propose a procedure to transform single-copy self-testing protocols into a procedure that certifies the tensor product of an arbitrary number of (not necessarily equal) quantum states, without increasing the number of parties or measurement choices. Moreover, we prove that self-testing protocols that certify a state and rank-one measurements can always be parallelized to certify many copies of the state. Our results have immediate applications for unbounded randomness expansion.

Introduction -Bell nonlocality describes measurement correlations which are rigidly incompatible with the notion of local determinism [Bel64,BCP + 14].
Namely, all local deterministic theories satisfy bounds-called Bell inequalities-which limit the strength of the correlations between measurement outcomes of two spatially distant and non-communicating systems. Interestingly, it is possible to violate such Bell inequalities in quantum experiments [HBD + 15, SMSC + 15, GVW + 15]. Such violating correlations, called nonlocal, are closely re-lated to quantum resources such as entanglement and measurement incompatibility, essential for the development of modern day quantum technologies.
Bell nonlocality also plays a crucial role in socalled device-independent protocols. It turns out that the violation of a Bell inequality is a function of the observed correlations alone, regardless of the underlying physical realization. Thus, the sole observation of a Bell inequality violation witnesses the presence of both entanglement and incompatibility without having knowledge or making any assumptions about the underlying experimental implementation. Such an assumption-free verification is named device-independent and has a special significance in cryptographic scenarios [ABG + 07, PAM + 10].
The maximal violation of some Bell inequalities can even imply the precise form of the underlying state and measurements. This can be seen as a device-independent certification, and has received the name of self-testing [vB20, MY04]. The simplest example of such phenomenon is the maximal violation of the Clauser-Horn-Shimony-Holt (Bell) inequality [CHSH69], which can be used to self-test the maximally entangled pair of qubits and mutually unbiased local measurements [PR92, Tsi93, SW87]. There exist nonlocal correlations that self-test several copies of a quantum state, a process called parallel self-testing. These self-testing protocols have immediate applications in situations where high amounts of entanglement is needed, such as randomness expansion [CY14], parallel quantum key distribution [JMS20, Vid17], delegated quantum computing [RUV13, CGJV19], and universal entanglement certification [BŠCA18a]. One drawback of the first parallel self-testing proto-cols is that they require a number of local measurements that increases exponentially with the number of copies one wants to certify [WBMS16,Col17,CN16,McK17,BŠCA18b]. This fact increases the time-cost and the randomness consumption of the protocol (relevant for cryptographic applications). More recently, techniques to reduce the number of local measurements to poly(log(n)) and log(n) were found [NV17,NV18,CRSV18,OV16,BŠCA18b]. There exist protocols to self-test entangled states of arbitrary dimension with a constant number of three or four inputs per party [YN13,CGS17]. These protocols, when applied to copies of quantum states require making joint measurements between the local subsystems of each copy, making them challenging from an experimental perspective.
In this manuscript, we show a procedure to combine different self-testing protocols into a protocol that self tests tensor products of quantum states, without increasing the number of required measurements. The combined protocol has the advantage of not requiring joint measurements among the copies. As a key application, we show a way of self-testing n copies of the twoqubit maximally entangled state using only two measurements per party (see Figure 1 c). This is the first self-testing protocol using the minimum number of local measurements possible for certifying an unbounded amount of entanglement. This procedure can therefore be used to convert one random bit into an arbitrary number of private random bits.
Main idea of the method -For simplicity, we explain how our method can transform the selftesting based on the Clauser-Horn-Shimony-Holt (CHSH) game into a self-test for n copies of a two-qubit maximally entangled state. The scenario consists of two space-like separated parties, Alice and Bob, making local measurements on a shared quantum system. Alice and Bob apply one of two measurements each, labeled x = 0, 1 and y = 0, 1 respectively, and their goal is to obtain outputs a = 0, 1 and b = 0, 1 such that a ⊕ b = x · y where ⊕ is addition modulo 2. Their score is defined as ω = 1 4 x,y P (a⊕b = x·y|x, y), i.e. the probability of satisfying the winning condition averaged over a uniform choice of x, y. Alice and Bob can use quantum resources to increase their score. In that case the inputs denote the measurement choices, while the out-puts are simply measurement results. When they share quantum state ρ AB , Alice performs measurements {M a|x } a,x , and Bob {N b|y } b,y the probabilities p(a, b|x, y) satisfy the Born rule p(a, b|x, y) = tr M a|x ⊗ N b|y ρ AB . The measurement observables are defined as A x = M 0|x −M 1|x and B y = N 0|y − N 1|y . If Alice and Bob make use of classical resources (or separable states), the best score they can achieve is ω = 3 4 , which is equivalent to satisfying the CHSH Bell inequality where A x B y = ab (−1) a+b P (a, b|x, y). On the other hand, if they share a maximally entangled pair of qubits |φ + = 1 √ 2 [|00 + |11 ], Alice's measurements correspond to the Pauli observables A 0 = σ Z and A 1 = σ X and Bob's mea- they can achieve the score ω q ≈ 0.8536. This strategy violates the CHSH Bell inequality to a value of 2 √ 2, and is the largest violation possible in quantum theory. This maximum value is also known to selftest the state |φ + . Thus, up to a possible local change of basis and extra unused degrees of freedom, the state |φ + is the only state that achieves this value.
The CHSH inequality can also be used to selftest n copies of |φ + ⊗n via parallel self-testing [Col17,McK17]. For that purpose Alice and Bob in each round receive n-bit inputs x = (x 1 , x 2 , · · · , x n ) and y = (y 1 , y 2 , · · · , y n ), and return n-bit outputs a = (a 1 , a 2 , · · · , a n ) and b = (b 1 , b 2 , · · · , b n ). To self-test the state, Alice measures σ Z or σ X on her local qubit i depending on x i = 0, 1, and Bob does similarly, measuring σ + or σ − depending on y i = 0, 1 and returning outcome b i (see Fig. 1b). The resulting correlations maximally violate n CHSH inequalities in parallel and imply Alice and Bob share a tensor product of n maximally entangled pairs of qubits.
We consider, in turn, a scenario in which each party has only two choices of measurements x = 0, 1 and y = 0, 1 (Fig. 1c). If x = 0 Alice measures all of her qubits in the σ Z -basis, whereas if x = 1 she measures all of them in the σ Xbasis. In both cases she returns an output consisting of n bits a = (a 1 , a 2 , · · · , a n ) corresponding to the outcomes of each of the n measurements. Bob proceeds similarly, measuring all x 1 y 1 a 1 b 1 a 1 ,...,a n b 1 ,...,b n x 1 ,x 2 ,...,x n y 1 ,y 2 ,...,y n x 2 y 2 a 2 b 2 x n y n a n b n x y a 1 b 1 a 1 ,...,a n b 1 ,...,b n x y x y a 2 b 2 x y a n b n b) a b x y a) c) Figure 1: a) Standard Bell scenario, where local measurements labeled by x and y with outcomes a and b are performed on a shared state. b) Standard parallel self-testing protocol certifying n copies of a quantum states. The measurement choice corresponds to a string of n elements, each of them used to determine the measurement applied to each copy. Thus, the total number of local measurements increases exponentially with the number of copies one aims at certifying. c) The procedure we propose here (see Theorem 1) transforms a self-testing protocol for a single quantum state into a protocol for an arbitrary number of copies. Each party applies the same measurement to each copy and outputs each individual outcome.
his qubits in σ + and σ − bases and returning = ω q is satisfied, and one might naively think that this information alone is enough to conclude that the state is |φ + ⊗n . This would be a mistake however, as the following counter-example shows. Suppose Alice and Bob measure a single copy of |φ + , obtaining outputs a, b such that P (a ⊕ b = x · y) = ω q . Then, they set a i = a and b i = b for all i, leading to P (a i ⊕ b i = x · y) = ω q for all i. Thus, one can achieve P (a i ⊕ b i = x · y) = ω q for all i with only a single copy of |φ + .
One thus needs to consider more information than just the CHSH score of each copy. One possibility is to consider the marginal statistics, since in the parallel n-copy strategy one has p(a|x) = 1/2 n whereas in the single-copy strategy the local output bits a i are always perfectly correlated (with a similar situation for Bob). However this will not work, since by using n bits of pre-shared randomness (λ 1 , · · · , λ n ) and postprocessing their outputs according to a i = a + λ i and b i = b + λ i , the local output bits of the single-copy strategy can be decorrelated without affecting the CHSH scores. Notice however, that there is still a crucial difference between the two strategies that remains: in each round of the single-copy strategy, if the first pair satisfies a 1 + b 1 = x · y, then all other pairs also satisfy a i + b i = x · y. This is not the case for the n-copy strategy, where each pair has a probability ω q to satisfy the condition in each round, independent of the other pairs. It is precisely this difference that we use as an inspiration to design our selftesting protocol.
The probabilities of obtaining outputs a and b, when the inputs are x and y, respectively, are given by p(a, b|x, y) = ψ|M a|x ⊗ N b|y ⊗ 1 P |ψ , where {M a|x } and {N b|y } are Alice's and Bob's local measurement operators.
We say that the probabilities {p(a, b|x, y)} self-test the reference experiment {|ψ A B , M a|x , N b|y } if observing them in an experiment implies the existence of a local unitary transformation U = U AA ⊗ These equations state that, up to ancillary degrees of freedom and local basis transformations, the state |ψ is equivalent to |ψ , and the measurements M a|x and N b|y act on |ψ in the same way as M a|x and N b|y act on |ψ . The state |ξ is usually called the junk state and it can be seen as the state of additional degrees of freedom. Finally, let us define a Bell expression I, as a linear combination of experimental probabilities I = abxy b x,y a,b p(a, b|x, y), where b x,y a,b ∈ R. Now we can state our main result: The nonlinear Bell expressions J i in Theorem 1 are constructed as follows. Define I 1 = I({p(a 1 , b 1 |x, y)}) and the conditional Bell expressions for the pair i > 1 as where a i−1 = (a 1 , a 2 , · · · , a i−1 ) and b i−1 = (b 1 , b 2 , · · · , b i−1 ). I i a i−1 b i−1 gives the value of I for the pair i conditioned on observing the particular values a i−1 = (a 1 , a 2 , · · · , a i−1 ) and b i−1 = (b 1 , b 2 , · · · , b i−1 ). Note that in order for these conditional Bell expressions to be well defined we require that p(a i−1 , b i−1 |x, y) > 0 ∀ a i−1 , b i−1 for each combination (x, y) appearing in I. This is automatically the case for the reference experiment R n due to the properties of R given in the statement of the theorem. The Bell expression J i is defined as for i > 1 and J 1 = I 1 . The observation that J i = β ∀i = 1, · · · , n self tests R n . The proof is inductive (given a self-test of k copies, the value of J k+1 self-tests an additional copy) and is given in the Appendix A. Here we provide some intuition behind the proof. As shown on the example of the CHSH inequality two ingredients are necessary to make a self-testing statement with the minimal number of inputs. First, all sets of probabilities p(a i , b i |x, y) reach the maximum of I, and the pairs of outputs (a i , b i ) are mutually independent. If J i takes value β for all i, it means that all conditional Bell expressions I i a i−1 b i−1 are also equal to β. It can be shown that the maximal values of conditional Bell expressions imply that the outputs corresponding to different i-s are mutually independent. In other words, conditioning on a i−1 , b i−1 does not affect the values of a i and b i . Hence, for all i-s, which means that both conditions for making a self-testing statement are met.
A direct consequence of Theorem 1 is the possibility of self-testing n copies of the two-qubit maximally entangled state |φ + (itself a maximally entangled state of local dimension 2 n ) with only two measurement settings per party via the CHSH Bell inequality. More precisely, we have the following corollary: be the local measurements that lead to the maximal violation of the CHSH Bell inequality when applied to |φ + . Then the correlations obtained by performing the experiment R = {|φ + , M a|x , N b|y } in the parallel scheme of Fig. 1c self-test the reference experiment {|φ + ⊗n , M ⊗n a|x , N ⊗n b|y } In particular, this means that an unbounded amount of entanglement can be certified in a device-independent manner with the minimum number of local measurements possible. Although Theorem 1 holds only for the case of perfect statistics, one can investigate the robustness to noise of Corollary 1 for the case n = 2, via the technique propsed in [BNS + 15, YVB + 14]. The precise noise model we consider is one in which each copy of the state is subject to the same level of white noise. That is, the observed correlations are generated using the same measurement strategy on the state ρ ν ⊗ ρ ν where In [BNS + 15, YVB + 14] a semi-definite program is given that calculates a value f , such that for any state ρ AB leading to the observed correlations, there exists a local transformation mapping ρ AB to a state that has fidelity at least f with the reference state (in this case |φ + ⊗ |φ + ). Lower bounds to the self-tested fidelity with the state |φ + ⊗ |φ + obtained via the method proposed in Refs. [BNS + 15, YVB + 14], using correlations obtained from two copies of the isotropic state ν|φ + φ + | + (1 − ν)1/4. The blue curve is obtained using two inputs per party, using the parallel scheme of Fig. 1c. The red curve is data taken from [WBMS16] using the strategy of Fig. 1b with four inputs per party. The legend gives the size of the matrices used in the corresponding SDP optimization. The dashed line corresponds to the trivial fidelity between the target state and the separable state |00 of 0.25. (3), one has f = 1, which then decreases as a function of the noise parameter. Fig. 2 shows the values of f obtained as a function of ν for this noise model.

In the case of perfect self-testing
Extensions -Theorem 1 is defined for bipartite Bell inequalities that feature an equal number of inputs per party. Here we present some more general extensions to this result that either do not require the knowledge of a specific Bell inequality, or allow one to self-test tensor products of different bipartite states.
Parallel self-testing protocols from full statistics-While Theorem 1 refers to self-tests based on the maximal violation of some Bell inequality, it is worth noting that similar claims can be made for self-testing protocols based on the observation of a particular set of correlations. More precisely, we have the following result.
Theorem 2. Assume that the correlations {p(a, b|x, y)} self-test the reference state |ψ , such that p(a, b|x, y) > 0 for all a, b, x, y. Then the correlations {p(a, b|x, y)} obtained by performing the reference experiment n times in the parallel scheme of Fig. 1c self-test the corresponding tensor product |ψ ⊗n .
In Appendix B we give an example of this technique that self-tests tensor products of the maximally entangled two-qubit state based on the correlations presented in [WWS16].
Combining self-testing protocols-The previous results show how it is possible to self-test a tensor product |ψ ⊗n of the same state |ψ , starting from a given protocol to self-test the state |ψ . In fact, the following describes how our construction can also be used to generate selftesting protocols for a tensor product of different states i |ψ i . The proof of this is almost identical to the proof of Theorem 1, instead now in (4) the Bell expressions I i are different for each i; see Appendix C for more details. One implication of this is the possibility to self-test a tensor product of different partially entangled pairs of qubits with two inputs for each party, which can be achieved through the use of different tilted CHSH inequalities [BP15].
All self-testing protocols can be paralellized -Here we discuss conditions for parallel self-testing without aiming to keep the number of inputs constant. As mentioned in the introduction, a number of schemes to parallel self-test certain classes of states are known (see [Col17, McK17, CN16, KM18, BKM19]), where the number of inputs scales exponentially with the number of copies to be self-tested. Given these examples, one interesting question is thus whether any self-testing protocol for a state |ψ can be 'parallelized' to self-test the tensor product |ψ ⊗n , at the expense of having exponentially many inputs. We give a positive answer to this question, answering an even a more general question of self-testing a tensor product i |ψ i of different states, given that there are self-tests for the individual states |ψ i . Note that unlike the previous results, no restrictions are needed on the reference correlations (i.e. some probabilities can be zero).
Then, the correlations obtained by performing the R i 's in parallel as in Fig.  1b The result is proven by constructing a single Bell expression whose maximal value self-tests R n . For each pair i define the Bell value conditioned on particular choice of other inputs x j , y j , j = i: where a (i) = {a 1 , · · · a i−1 , a i+1 , · · · , a n } and similarly for b (i) , x (i) and y (i) . The Bell expression I i averaged over all other inputs x (i) and y (i) is If J i achieves its maximal value, it means that for for every x i and y i I i x i y i also achieves the maximal value, which is enough to prove self-testing of the reference experiment R n . The proof of the theorem is given in Appendix D.
Application: unbounded randomness expansion.-Self-testing is intrinsically related to device-independent randomness expansion [CY14, CK11, LLR + 21]. This is because, once we certify that the system is in the state |ψ , we can also conclude that any external system is uncorrelated to it. Thus, an external observer can not predict the outcomes of the measurements applied to the system of interest, i.e. the outcomes are random. In particular, if the state is maximally entangled of local dimension d, and the measurements applied to it are rank-one projective, the amount of random bits obtained per round is log 2 (d). Notice, however, that in a Bell test some initial amount of randomness must be consumed in the choice of inputs. Thus, the efficiency of the randomness generation protocol is typically given by the the trade-off between the initial randomness consumed and the final randomness obtained. Our Theorem 1 applied to the CHSH inequality and self-testing n copies of a maximally entangled state shows that the best trade-off can be achieved from the noiseless correlations, where only one bit of randomness is used to generate log 2 (d) bits or randomness per round. We thus suspect that our results could improve extraction rates of practical device-independent randomness expansion protocols, although this would require a closer look at issues of noise robustness.
Discussion-In this manuscript we introduced a new procedure useful in parallel self-testing. It allows to self-test highly entangled quantum states with a constant number of measurements. Such schemes are important in protocols for randomness expansion: a small amount of randomness can be expanded to a string of unbounded length. At the heart of our construction lies an interesting insight: independent Bell violations can be used to ensure independence of sources even when the measurements are perfectly correlated. There are several directions for future research on the topic. It would be interesting to explore noise robustness of our scheme. Furthermore, the condition for self-testing can be seen as the maximal violation of a non-linear Bell inequality. One might try to understand if this can be achieved using a single linear Bell inequality.
Note-While working on this project we became aware of the work [SSKA19] exploring selftesting of quantum systems of arbitrary local dimension with minimal number of measurements.
Acknowledgements-We thank Jean-Daniel Bancal for sharing numerical data, to Jed Kaniewski and Yeong-Cherng Liang for useful comments and suggestions and to the anonymous referee for many useful comments. We acknowledge funding from SNSF (grant DIAQ), Ramon y Cajal fellowship, the Government of Spain (FIS2020-TRANQI, Retos Quspin and Severo Ochoa CEX2019-000910-S), Fundació Cellex, Fundació Mir-Puig, Generalitat de Catalunya (CERCA, AGAUR SGR 1381),ERC AdG CERQUTE and the AXA Chair in Quantum Information Science. Before starting the proofs let us introduce some useful notation. The probabilities to observe outcomes a = (a 1 , · · · , a n ) and b = (b 1 , · · · , b n ) when the inputs are x and y are given by the Born rule:

References
Let us introduce further auxilliary measurement operators With M a|x we simply denote the reference single qudit measurements. Since we extract the tensor product of the reference state into the ancillary Hilbert space, to ease keeping track of the number of the extracted reference states we denote the Hilbert spaces of ancillary systems with A j and B j (instead of A and B in the main text). In order to relax the notation when writing measurement operators we omit the Hilbert space notation. Thus, we employ the following notation: M b|y for reference measurements.
We prove the theorem by using mathematical induction. In the first step we prove the base case, i.e. that the theorem holds when n = 1. In the second step we prove the so-called inductive step, saying that if the theorem holds for some natural number i it also holds for i + 1. The whole theorem is proven by demonstrating the correctness of the base and the inductive step. The validity of the base step holds trivially since the theorem assumes that the Bell inequality under consideration is self-testing. The condition I 1 = β implies the existence of the local unitary U To start the inductive step assume that the theorem holds for i, i.e. that a i−1 By summing (A6) over b i and using the completeness relation b i N b i |y = 1 we obtain which can be rewritten as By comparing (A7) and (A5) we obtain where S a i |x |ξ i = |ξ i for all a i and x. Note that A8 is correct in case tr B 1 ···B i |ψ ψ | is full rank. We make assumption that this is indeed the case, which is a standard assumption in the self-testing scenarios. Since U AA 1 ···A i preserves the identity the condition must be satisfied. Since a i M a i |x = 1, the condition is satisfied if and only if S a i |x = 1 for all a i and x. This can be seen through the simple reasoning. U i,A ≡ U AA 1 ···A i is unitary and thus Hence, for arbitrary quantum states ρ A and τ A 1 ···A i it holds tr(S A a i |x ρ) = α i and tr(M a i |x τ ) = β i where 0 ≤ α i , β i ≤ 1. Eq. (A9) implies i α i β i = 1 and the completeness of M a i |x implies i β i = 1. Thus, it also holds i (1 − α i )β i = 0. The sum of nonnegative numbers is equal to zero if and only if each of them is equal to zero. Since the argumentation must hold for all states it implies S a i |x = 1 for all a i and x. Eq. (A8) reduces to for all a i and x. Analogous conclusion can be obtained for Bob's operators for all b i and y. Note now that M a i |x = a i+1 M a i ,a i+1 |x , where a i , a i+1 is just a different way to write a i+1 , where (i + 1)-th output is separately written, as to be able to keep track of it. Similar eq. holds for Bob and thus eqs. (A10) and (A11) imply: where operators K a i ,a i+1 |x and We prove that the operators on the r.h.s. of equalities (A12) and (A13) have the tensor product structure by reductio ab absurdum. Assume are entangled across the bipartition A|A 1 · · · A i . Then the following equation holds: is positive for all a i+1 , we have that k a i+1 ≥ 0 for all a i+1 . By tracing out the Hilbert space A in eq. (A15) we obtain where D is the dimension of Hilbert space is, by assumption, a tensor product of rank-one projectors, eq.
for all a i . Henceforth, we have is a rank-one projector, there cannot be entangle- across the bipartition A|A 1 · · · A i , which justifies the form of eq. (A12). Similar argument holds for (A13).
Let us now write down the expression for the conditional Bell value where b xy a i+1 b i+1 are the coefficients from the original Bell inequality corresponding to the probability p(a i+1 b i+1 |xy). Given the self-testing statements (A5),(A12),(A13) it can be rewritten in the following way I i+1 The expression can be further simplified The equalities come from the property of trace tr(A ⊗ B) = tr(A) tr(B) and observing that Let us now sum different conditional Bell values where we introduced new operators Note that K b i+1 |y = 1 (see eq. (A14) ). Hence they represent valid quantum measurements. The condition for self-testing is J i = β for all i, which through the definition of J i given in eq. (5) implies Since the Bell inequality is self-testing the reference experiment the eq. (A23) implies the existence of Combining eqs (A24)-(A25) with (A5)-(A6) leads to the parallel self-testing of i+1 j=1 |ψ : Now the aim is to self-test the action of measurements M a i+1 |x and N b i+1 |y . Let us verify how the isometry U i+1 • U i acts on these measurements. By using eqs. (A5), (A6),(A12) and (A13) we obtain: a i+1 |x , similarly to the derivation of eq. (A10).
Following the procedure used to prove eq. (A12), this implies b i+1 |y , whereK a i+1 |x andL b i+1 |y are positive operators. The eq. (A27) can be rewritten as The second equality is the consequence of eqs. (A5), (A12) and (A13), while the third equality a i+1 |x and analogously for L b i+1 |y . The final This can be proven by using the same argumentation used after eq. (A9) With this we have proved the inductive step, and with it completed the theorem proof.

B Example: parallel self-testing beyond Bell inequalities
In this section we give example of lifting the self-testing protocol which is based not on the maximal violation of a Bell inequality but reproduction of the whole set of correlations. For the sake of simplicity we chose the self-testing protocol in the simplest scenario with two parties, each performing two binary measurements ((2,2,2) scenario). The self-testing correlations are for γ = δ and γ, δ ∈ (0, π/4]. A i and B j are observables defined as In [WWS16] it is proven that this set of correlations self-tests the maximally entangled pair of qubits.
The reference measurement observables are We omit the self-testing proof here and direct reader's attention to [WWS16]. The isometry used in the proof is the Swap isometry U and physical experiment reproducing correlations (B30)-(B31) satisfies the following equations Note that one might show that correlations (B30)-(B31) maximally violate some Bell inequality and the procedure corresponding to the Theorem 1 can be applied to build a self-testing protocol for a tensor product of n maximally entangled qubit pairs. However, we still find it useful to show how to deal with a self-testing protocol based on the reproduction of the whole set of correlations. In (2, 2, 2) case one can use standard methods to find the Bell inequality maximally violated by some extremal point of the set of quantum correlations (for example NPA hierarchy methods [NPA07, NPA08]), but in more complicated scenarios this might not be an easy task. Furthermore, most of the known self-testing protocols for multipartite states are not based on the maximal Bell inequality violation.
In what follows we show how to use the above given self-test to build another self-test, using the same number of measurement choices, certifying |φ + ⊗ |φ + . Let us introduce the following notation The condition for self-testing in this case is reproduction of the following correlations: In terms just of the observed probabilities the set of conditions (B35)-(B40) can be written as The proof goes along the same line as the proof of Theorem 1. Equations (B35)-(B36) imply the existence of the isometry U 1 = U AA 1 ⊗ U BB 1 ⊗ 1 P such that These two equations imply the following set of equations where the operators K a 1 ,a 2 |x , L b 1 ,b 2 |y are positive semidefinite and satisfy Given all these equations the first expression from (B37) can be rewritten as This equation holds for all a, b ∈ 0, 1. Analogous equations can be obtain starting from the other three relations from (B37)-(B39): Let us now introduce new operators which are valid measurements observables (cf. (B51)). Since eqs. (B53), (B54), (B55) and (B56) hold for all values of a and b by summing over all the different values we obtain These relations are exactly self-testing ones and they imply the existence of a local unitary U 2 = U AA 2 ⊗ U BB 2 ⊗ 1 P such that U 2 |ξ 1 ABP ⊗ |00 A 2 B 2 = |ξ ABP ⊗ |φ + A 2 B 2 (B60) Combining this equation with (B47) we obtain The proof for self-testing of measurements can be done in the same way as it is done in the proof of Theorem 1.
C Combining self-testing protocols to test a tensor product of different quantum states Let us introduce the notion of compatible self-testing protocols, as those using the same number of inputs to self-tests the corresponding reference states. Here we outline how one can build a self-testing protocol certifying a tensor product of n different states, which can be independently self-tested by using compatible self-testing protocols. Namely, the aim is to self-test a state of the form i |ψ i , knowing that every |ψ i can be self-tested through observing the maximal violation β i of the inequality Let us introduce the generalized conditional Bell value: The conditions for self-testing i |ψ i by using only m different inputs per party are the following The self-testing proof goes along the same lines as the proof for Theorem 1. The only difference is that for every i the second condition corresponds to the maximal violation of I i by the junk state appearing in the self-testing statement for i − 1.

D Proof of Theorem 4
In this section we give a proof of Theorem 4 which deals with combining two or more incompatible self-tests, i.e. self-tests corresponding to the scenarios with different inputs and/or output size. The general scenario is as follows: the protocol S i can be used to self-test the state |ψ i in the scenario where each party has m i inputs denoted with x i , y i and o i outputs denoted as a i , b i . If the correlations p i (a i b i |x i y i ) satisfy the self-testing conditions given by the protocol S i for each i then there is isometry mapping the physical state to the i |ψ i . This can be seen as a generalization of parallel self-testing, where usually the reference state is an n-fold tensor product of some state. According to the theorem conditions the state |ψ i , for i ∈ {1, · · · , n}, is self-tested through achieving the maximal violation of the Bell inequality I i , evaluated as The self-testing scenario is as follows: in every round Alice and Bob receive n classical inputs each, denoted with x = {x 1 , · · · , x n }, y = {y 1 , · · · , y n }, where x i , y i ∈ {0, 1, · · · , m i −1}. They return strings a = {a 1 , · · · , a n }, b = {b 1 , · · · , b n }, where a i , b i ∈ {0, 1, · · · , o i − 1}. The measurement operators are denoted by M a|x for Alice and N b|y for Bob. Let us introduce the following notation Since numbers p 1 (a 1 b 1 |x 1 y 1 )/m 2 1 are positive and sum to one, and all K a 1 ,a 2 |x 1 ,x 2 and L b 1 ,b 2 |y 1 ,y 2 are valid measurement operators the observation J 2 = β 2 implies that a 2 ,b 2 ,x 2 ,y 2 b x 2 y 2 2,a 2 b 2 ξ 1 |K a 1 ,a 2 |x 1 ,x 2 ⊗ L b 1 ,b 2 |y 1 ,y 2 |ξ 1 = β 2 (D79) for all a 1 , b 1 , x 1 , y 1 . Let us define operators K (2) a 2 |x 2 = 1 m 1 a 1 ,x 1 K a 1 ,a 2 |x 1 ,x 2 , L b 2 |y 2 = 1 m 1 b 1 ,y 1 L b 1 ,b 2 |y 1 ,y 2 (D80) These operators are valid measurement operators, and they satisfy a 2 ,b 2 ,x 2 ,y 2 b x 2 y 2 2,a 2 b 2 ξ 1 |K (2) a 2 |x 2 ⊗ L (2) b 2 |y 2 |ξ 1 = β 2 .