# Self-testing multipartite entangled states through projections onto two systems

I Šupić, A Coladangelo, R Augusiak, A Acín

► To cite this version:

I Šupić, A Coladangelo, R Augusiak, A Acín. Self-testing multipartite entangled states through projections onto two systems. New Journal of Physics, 2018, 20 (8), pp.083041. 10.1088/1367-2630/aad89b. hal-05346103

HAL Id: hal-05346103

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

Submitted on 4 Nov 2025

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

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

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

Distributed under a Creative Commons Attribution 4.0 International License
PAPER • OPEN ACCESS

# Self-testing multipartite entangled states through projections onto two systems

To cite this article: I Šupić et al 2018 *New J. Phys.* 20 083041

View the [article online](#) for updates and enhancements.

You may also like

- *Self-testing through EPR-steering*
  Ivan Šupić and Matty J Hoban

- *Towards minimal self-testing of qubit states and measurements in prepare-and-measure scenarios*
  Gábor Drótos, Károly F Pál, Abdelmalek Taoutioui et al.

- *Self-testing and certification using trusted quantum inputs*
  Ivan Šupić, Matty J Hoban, Laia Domingo Colomer et al.
**New Journal of Physics**

The open access journal at the forefront of physics

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

IOP Institute of Physics

Published in partnership
with: Deutsche Physikalische
Gesellschaft and the Institute
of Physics

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

CrossMark

OPEN ACCESS

RECEIVED
9 April 2018

REVISED
27 July 2018

ACCEPTED FOR PUBLICATION
7 August 2018

PUBLISHED
28 August 2018

Original content from this
work may be used under
the terms of the [Creative
Commons Attribution 3.0
licence](https://creativecommons.org/licenses/by/3.0/).

Any further distribution of
this work must maintain
attribution to the
author(s) and the title of
the work, journal citation
and DOI.

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

PAPER

# Self-testing multipartite entangled states through projections onto two systems

I Šupić<fnref n="1" />, A Coladangelo<fnref n="2" />, R Augusiak<fnref n="3" /> and A Acín<fnref n="1" />,<fnref n="4" />

E-mail: ivan.supic@icfo.es

Keywords: self-testing, device-independence, multipartite entanglement, nonlocality

Abstract

Finding ways to test the behaviour of quantum devices is a timely enterprise, especially in light of the rapid development of quantum technologies. Device-independent self-testing is one desirable approach, as it makes minimal assumptions on the devices being tested. In this work, we address the question of which states can be self-tested. This has been answered recently in the bipartite case (Coladangelo et al 2017 *Nat. Commun.* 8 15485), while it is largely unexplored in the multipartite case, with only a few scattered results, using a variety of different methods: maximal violation of a Bell inequality, numerical SWAP method, stabiliser self-testing etc. In this work, we investigate a simple, and potentially unifying, approach: combining projections onto two-qubit spaces (projecting parties or degrees of freedom) and then using maximal violation of the tilted CHSH inequalities. This allows one to obtain self-testing of Dicke states and partially entangled GHZ states with two measurements per party, and also to recover self-testing of graph states (previously known only through stabiliser methods). Finally, we give the first self-test of a class of multipartite qudit states: we generalise the self-testing of partially entangled GHZ states by adapting techniques from (Coladangelo et al 2017 *Nat. Commun.* 8 15485), and show that all multipartite states which admit a Schmidt decomposition can be self-tested with few measurements.

**1. Introduction**

The rapid development of quantum technologies in recent years creates an urgent need for certification tools. Quantum computing and quantum simulation are state of the art tasks which require verifiable realisations. One way to certify the correct functioning of a quantum computer would be to ask it to solve a problem that is thought to be hard for a classical computer, like factoring large numbers and simply checking the correctness of the solution. However, it is conjectured that the class of problems that can be solved efficiently on a quantum computer (BQP) has elements outside the class of problems whose solution can be checked classically (NP) [1], which makes this type of verification incomplete. Thus, efforts have been made towards building reliable certification protocols for quantum systems performing universal quantum computing or quantum simulations [2–4]. In this work, we investigate one of the basic building blocks for such verifications tasks, namely certification of a particular quantum state.

A canonical way to approach the problem of certification of quantum states is to exploit tomographic protocols [5]. Unfortunately, quantum devices performing tasks such as quantum computation typically involve multipartite quantum states and the complexity of tomographic techniques scales exponentially with the number of particles involved. Moreover, they demand a set of trusted measurements, which in certain scenarios is not an available resource.

<footnote n="1">¹ ICFO-Institut de Ciencies Fotoniques, The Barcelona Institute of Science and Technology, E-08860 Castelldefels (Barcelona), Spain</footnote>

<footnote n="2">² Department of Computing and Mathematical Sciences, California Institute of Technology, 1200 E California Blvd, Pasadena, CA 91125, United States of America</footnote>

<footnote n="3">³ Center for Theoretical Physics, Polish Academy of Sciences, Aleja Lotników 32/46, 02-668 Warsaw, Poland</footnote>

<footnote n="4">⁴ ICRAE-Institucio Catalana de Recerca i Estudis Avançats, Lluis Companys 23, E-08010 Barcelona, Spain</footnote>
An alternative technique able to positively address these problems is self-testing [6]. Contrary to quantum state and process tomography, self-testing is a completely device-independent task. It aims to verify that a given quantum device operates on a certain quantum state, and performs certain measurements on it, solely from the correlations it generates. The building block for this, as well as for all other device-independent protocols is Bell's theorem [7], which says that correlations violating Bell inequalities do not admit local hidden-variable models. Thus, correlations useful for self-testing must be non-local. Self-testing was formally introduced by Mayers and Yao [6]. Since then, there has been growing interest in designing self-testing methods [8–12], and studying their robustness [8, 13, 14]. An important recent development shows that all pure entangled bipartite states can be self-tested [15]. As for applications, self-testing methods have successfully been employed in protocols for quantum key distribution [16, 17], randomness expansion [17], and verification of quantum computations [4, 18–20].

Most of the currently known self-testing protocols, however, are tailored to bipartite states, leaving the multipartite scenario rather unexplored. The known examples cover only the tripartite W state, a class of partially entangled tripartite states [21, 22] and graph states [23]. The aim of this paper is to extend the class of multipartite states that can be self-tested, by investigating a simple approach that exploits the well-understood self-testing of two-qubit states. At a high level, this is done by combining projections to two-qubit spaces and then exploiting maximal violation of tilted CHSH inequalities. Using this potentially unifying approach, we show self-testing of all Dicke states and partially entangled GHZ states with only two measurements per party. We also show that our method efficiently applies also to self-testing of graph states, previously known only through stabiliser state methods, with a slight improvement in the number of measurement settings per party. Finally, using techniques from [15] as a building block, we provide the first self-testing result for a class of multipartite qudit states, by showing that all multipartite qudit states which possess a Schmidt decomposition can be self-tested, with at most four measurements per party<fnref n="5" />.

## 2. Preliminaries

Self-testing is a device-independent task [24] whose aim is to characterise the form of the quantum state and measurements solely from the correlations that they generate. To introduce it formally, consider N non-communicating parties sharing some N-partite state $|\psi\rangle$. On its share of this state, party i can perform one of several projective measurements {$M_{x_i, i}^{a_i}$} $a_i$, labelled by $x_i \in \mathcal{X}_i$, with possible outcomes $a_i \in \mathcal{A}_i$. Here $\mathcal{X}_i$ and $\mathcal{A}_i$ stand for finite alphabets of possible questions and answers for party i. The experiment is characterised by a collection of conditional probabilities {$p(a_1, ..., a_N|x_1, ..., x_N)$: $a_i \in \mathcal{A}_i$}$_{x_i \in \mathcal{X}_i}$, where

$$p(a_1, ..., a_N|x_1, ..., x_N) = \langle\psi|M_{x_1,1}^{a_1} \otimes \dots \otimes M_{x_N,N}^{a_N}|\psi\rangle \quad (1)$$

is the probability of obtaining outputs $a_1, ..., a_N$ upon performing the measurements $x_1, ..., x_N$<fnref n="6" />. We refer to this as a correlation. It is sometimes convenient to describe correlations with the aid of standard correlators, where instead of measurement operators $M_{x_i}^{a_i}$ one uses Hermitian observables with eigenvalues $\pm 1$. Now, we can formally define self-testing in the following way.

**Definition 1 (Self-testing).** We say that a correlation {$p(a_1, ..., a_N|x_1, ..., x_N)$: $a_i \in \mathcal{A}_i$}$_{x_i \in \mathcal{X}_i}$ self-tests the state $|\psi\rangle$ and measurements {$\tilde{M}_{x_i, i}^{a_i}$} $a_i$, $i = 1, ..., N$, if for any state and measurements $|\psi\rangle$ and {$M_{x_i, i}^{a_i}$} $a_i$, $i = 1, ..., N$, reproducing the correlation, there exists a local isometry $\Phi = \Phi_1 \otimes \dots \otimes \Phi_N$ such that

$$\Phi(M_{x_1,1}^{a_1} \otimes \dots \otimes M_{x_N,N}^{a_N}|\psi\rangle) = |\text{aux}\rangle \otimes (\tilde{M}_{x_1,1}^{a_1} \otimes \dots \otimes \tilde{M}_{x_N,N}^{a_N}|\psi'\rangle), \quad (2)$$

where $|\text{aux}\rangle$ is an auxiliary state.

Intuitively, we can think of the self-testing correlations as characterising the state and measurements that achieve them, up to a local isometry. Indeed, this is the best possible characterisation that one can hope for. In fact, one can never characterise the state and measurements exactly by the observed correlation: this is because correlations are invariant under local unitary transformations or embeddings in Hilbert spaces of higher dimension. Moreover, we point out that it is not possible to self-test mixed states: this is because for all correlations that can be obtained by measuring a mixed state, there exists a pure state of the same dimension that can be measured to obtain the same correlations [25].

<footnote n="5">⁵ By 'n measurements per party' we mean that each party has n different measurement settings, not that the total number of measurement rounds performed in the experiment by each party is equal to n.</footnote>

<footnote n="6">⁶ We take the parties' measurements to be projective, invoking Naimark's dilation theorem. We take the joint state to be pure for ease of exposition, but we emphasise that all of our proofs hold analogously starting from a joint mixed state.</footnote>
<figure><img src="image_5.png" /><figcaption>Figure 1. Example of a circuit that takes as input a state $|\psi\rangle$ satisfying (4) and (5), adds two ancillas, each in $|0\rangle$, and outputs the state $|\psi_\theta\rangle$ in tensor product with an auxiliary state $|\text{aux}\rangle$. Here $H$ is the usual Hadamard gate.</figcaption></figure>

In some cases the existence of the required isometry can be proven solely from the maximal violation of some Bell inequality. For instance, all two-qubit pure entangled states can be self-tested with a one-parameter class of tilted CHSH Bell inequalities [10] given by

$$ \alpha \langle A_0 \rangle + \langle A_0 B_0 \rangle + \langle A_0 B_1 \rangle + \langle A_1 B_0 \rangle - \langle A_1 B_1 \rangle \le 2 + \alpha, \quad (3) $$

where $\alpha \ge 0$ and $A_i$ and $B_i$ are observables with outcomes $\pm 1$ measured by the parties. Note that for $\alpha = 0$, (3) reproduces the well-known CHSH Bell inequality [26]. For further purposes let us briefly recall this result. Here $\sigma_z$ and $\sigma_x$ are the standard Pauli matrices.

**Lemma 1 (Reference [10]).** Suppose a bipartite state $|\psi\rangle$ and dichotomic observables $A_i$ and $B_i$ achieve the maximal quantum violation of the tilted CHSH inequality (3) $\sqrt{8 + 2\alpha^2}$, for some $\alpha$. Let $\theta$, $\mu \in (0, \pi/2)$ be such that $\sin 2\theta = [(4 - \alpha^2)/(4 + \alpha^2)]^{1/2}$ and $\mu = \arctan\sin 2\theta$. Let $Z_A = A_0$, $X_A = A_1$. Let $Z_B^*$ and $X_B^*$ be, respectively, $(B_0 + B_1)/2 \cos \mu$ and $(B_0 - B_1)/2 \sin \mu$, but with all zero eigenvalues replaced by one, and define $Z_B = Z_B^*|Z_B^*|^-$ and $X_B = X_B^*|X_B^*|^-$.

$$ Z_A |\psi\rangle = Z_B |\psi\rangle, \quad (4) $$

$$ \begin{gathered} \cos \theta X_A (1 - Z_A) |\psi\rangle = \sin \theta X_B (1 + Z_A) |\psi\rangle, \\ \{Z_A, X_A\} |\psi\rangle = 0, \quad \{Z_B, X_B\} |\psi\rangle = 0. \end{gathered} \quad (5) $$

Moreover, there exists a local isometry $\Phi$ such that $\Phi(A_i \otimes B_j |\psi\rangle) = |\text{aux}\rangle \otimes (\tilde{A}_i \otimes \tilde{B}_j) |\psi_\theta\rangle$, where $|\psi_\theta\rangle = \cos \theta |00\rangle + \sin \theta |11\rangle$, and $\tilde{A}_0 = \sigma_z$, $\tilde{A}_1 = \sigma_x$, and $\tilde{B}_{0/1} = \cos \mu\sigma_z \pm \sin \mu\sigma_x$.

A typical construction of the isometry $\Phi$ is the one encoding the SWAP gate, as illustrated in figure 1.

Our aim in this paper is to exploit the above result to develop methods for self-testing multipartite entangled quantum states. Given an $N$-partite entangled state $|\psi\rangle$, the idea is that $N - 2$ chosen parties perform local measurements on their shares of $|\psi\rangle$ and the remaining two parties check whether the projected state they share violates maximally (3) for the appropriate $\alpha$ (we can think of this as a sub-test). This procedure is repeated for various subsets of $N - 2$ parties until the correlations imposed are sufficient to characterise the state $|\psi\rangle$. Our approach is inspired by [21], which shows that any state in the class $\{|100\rangle + |101\rangle + \alpha|001\rangle|\sqrt{2 + \alpha^2}$, containing the three-qubit $W$ state, can be self-tested in this way. We will show that this approach can be generalised in order to self-test new (and old) classes of multipartite states. The main challenge is to show that all the sub-tests of different pairs of parties are compatible. To be more precise, for a generic state there will always be a party which will be involved in several different sub-tests and, in principle, will be required to use different measurements to pass the different tests. Consequently, isometries (figure 1) corresponding to different sub-tests are in principle constructed from different observables. However, a single isometry is required in order to self-test the global state. Overcoming the problem of building a single isometry from several different ones is the key step to achieve a valid self-test for multipartite states. For states that exhibit certain symmetries, this can be done efficiently with few measurements. We leave for future work the exploration for states that do not have any particular symmetry.

In the $N$-partite scenario, parties will be denoted by numbers from 1 to $N$ and measurement observables by capital letters with a superscript denoting the party. For a two-outcome observable $W$, we denote by $W^{(\pm)} = (\mathbb{I} \pm W)/2$ the projectors onto the $\pm 1$ eigenspaces. We use the notation $|a\rangle$ to denote the biggest integer $n$ such that $n \le a$, while $[a]$ is the smallest $n$ such that $n \ge a$.
## 3. Results

In this work, we expand the class of self-testable multipartite states. More precisely, in section 3.1 we show that all multipartite partially entangled GHZ (qubit) states can be self-tested with two measurements per party. Then, we make use of this result as a building block to extend self-testing to all multipartite entangled Schmidt-decomposable qudit states, of any local dimension $d$, with only three measurements per party (except one party has four). To the best of our knowledge, this is the first self-test for multipartite states of qudits, for $d > 2$. Finally, in sections 3.2 and 3.3 we apply the approach used for multipartite partially entangled GHZ (qubit) states to the self-test the classes of Dicke states and graph states (previously known to be self-testable through stabiliser methods [23]).

### 3.1. All multipartite entangled qudit Schmidt states

While in the bipartite setting all states admit a Schmidt decomposition, in the general multipartite setting this is not the case. We refer to those multipartite states that admit a Schmidt decomposition as Schmidt states. By a Schmidt state we consider a multipartite state $|\Psi\rangle$ acting on $C^{d_1} \otimes C^{d_2} \cdots \otimes C^{d_N}$ that by local unitary transformations can be brought to the following form

$$|\Psi\rangle = \sum_{j=0}^{d-1} c_j |j\rangle^{\otimes N}, \qquad (6)$$

where $d = \min_i d_i$, $0 < c_j < 1$ for all $i$ and $\sum_{j=0}^{d-1} c_j^2 = 1$. Typicality of multipartite states that are equivalent to some Schmidt state up to a local unitary is discussed in [27, 28].

Our proof that all multipartite entangled Schmidt states can be self-tested follows closely the ideas from [15], while leveraging as a building block our novel self-testing result for partially entangled GHZ states. Thus, we proceed by first proving a self-testing theorem for multipartite partially entangled qubit GHZ states.

#### 3.1.1. Multipartite partially entangled GHZ states

Multipartite qubit Schmidt states, also known as partially entangled GHZ states, are of the form

$$|\text{GHZ}_N(\theta)\rangle = \cos \theta |0\rangle^{\otimes N} + \sin \theta |1\rangle^{\otimes N}, \qquad (7)$$

where $\theta \in (0, \pi/4]$ and $|\text{GHZ}_N(\pi/4)\rangle = |\text{GHZ}_N\rangle$ is the standard N-qubit GHZ state. The form of this state is such that if any subset of $N-2$ parties performs a $\sigma_X$ measurement, the collapsed state shared by the remaining two parties is $\cos\theta|00\rangle \pm \sin\theta|11\rangle$, depending on the parity of the measurement outcomes. As already mentioned, these states can be self-tested with the aid of inequality (3), which is the main ingredient of our self-test of $|\text{GHZ}_N(\theta)\rangle$.

**Theorem 1.** Let $|\psi\rangle$ be an N-partite state, and let $A_{0,i}$, $A_{1,i}$ be a pair of binary observables for the ith party, for $i = 1, \dots, N$. Suppose the following correlations are satisfied:

$$\langle\psi| A_{0,i}^{(+)} |\psi\rangle = \langle\psi| A_{0,i}^{(+)} A_{0,j}^{(+)} |\psi\rangle = \cos^2 \theta, \quad \forall i, j \in \{1, \dots, N-1\}, \qquad (8)$$

$$\langle\psi| \prod_{i=1}^{N-2} A_{1,i}^{(a_i)} |\psi\rangle = \frac{1}{2^{N-2}}, \quad \forall a \in \{+, -\}^{N-2}, \qquad (9)$$

$$\langle\psi| \prod_{i=1}^{N-2} A_{1,i}^{(a_i)} (\alpha A_{0,N-1} + A_{0,N-1}A_{0,N} + A_{0,N-1}A_{1,N} + (-1)^{h(a)} A_{1,N-1}A_{0,N}) \qquad (10)$$

$$(-1)^{h(a)} A_{1,N-2} A_{1,N-1} |\psi\rangle = \frac{\sqrt{8+2\alpha^2}}{2^{N-2}}, \quad \forall a \in \{+, -\}^{N-2}, \qquad (11)$$

where $h(a)$ denotes the parity of the number of ‘-’ in a, and $\alpha = 2 \cos 2\theta / \sqrt{1 + \sin^2 2\theta}$. Let $\mu$ be such that $\tan \mu = \sin 2\theta$. Define $Z_i = A_{0,i}$ and $X_i = A_{1,i}$, for $i = 1, \dots, N-1$. Then, let $Z'_N = (A_{0,N} + A_{1,N})/2 \cos \mu$, and let $Z_N^*$ be $Z'_N$ with zero eigenvalues replaced by 1. Define $Z_N = Z_N^*|Z_N^*|^{-1}$. Define $X_N$ similarly starting from $X'_N = (A_{0,N} - A_{1,N})/2 \sin \mu$. Then

$$Z_i |\psi\rangle = \dots = Z_N |\psi\rangle, \qquad (12)$$

$$X_1 \cdots X_D (I - Z_1) |\psi\rangle = \tan \theta (I + Z_1) |\psi\rangle. \qquad (13)$$

**Proof.** We refer the reader to appendix A for the formal proof of this theorem, while providing here an intuitive understanding of the correlations given above. The first equation (8) defines the existence of one measurement observable, whose marginal carries the information of angle $\theta$. The straightforward consequence of it is (12), which is analogue to (4). On the other hand, (9) involves a different measurement observable with zero marginal, while (10) shows that when the first $N-2$ parties perform this zero marginal measurement the remaining two
parties maximally violate the corresponding tilted CHSH inequality, i.e. the reduced state is self-tested to be the partially entangled pair of qubits. Note that (13) is analogue to (5).

As a corollary, these correlations self-test the state $|GHZ_N(\theta)\rangle$.

**Corollary 1.** Let $|\psi\rangle$ be an N-partite state, and let $A_{0,i}$, $A_{1,i}$ be a pair of binary observables for the ith party, for $i = 1, ..., N$. Suppose they satisfy the correlations of theorem 1. Then, there exists a local isometry $\Phi$ such that

$$ \Phi(|\psi\rangle) = |\text{aux}\rangle|\text{GHZ}_N(\theta)\rangle. \qquad (14) $$

**Proof.** This follows as a special case ($d = 2$) of lemma 2 stated below, upon defining $P_i^{(k)} = [I + (-1)^k Z_i]/2$, for $k \in \{0, 1\}$.

As one can expect, the ideal measurements achieving these correlations are: $A_{0,i} = \sigma_z$, $A_{1,i} = \sigma_x$, for $i = 1, ..., N - 1$, and $A_{0,N} = \cos \theta \sigma_z + \sin \theta \sigma_x$, $A_{1,N} = \cos \theta \sigma_z - \sin \theta \sigma_x$. We refer to the correlations achieved by these ideal measurements as the ideal correlations for multipartite entangled GHZ states.

### 3.1.2. All multipartite entangled qudit Schmidt states

The generalisation of theorem 1 to all multipartite qudit Schmidt states is then an adaptation of the proof in [15] for the bipartite case, with the difference that it uses as a building block the $|GHZ_N(\theta)\rangle$ self-test that we just developed, instead of the tilted CHSH inequality.

We begin by stating a straightforward generalisation to the multipartite setting of the criterion from [29] which gives sufficient conditions for self-testing a Schmidt state. Then, our proof that all multipartite entangled qudit Schmidt states can be self-tested goes through showing the existence of operators satisfying the conditions of such criterion.

**Lemma 2 (Generalisation of criterion from [29]).** Let $|\Psi\rangle$ be a state of the form (6). Suppose there exist sets of unitaries $\{X_l^{(k)}\}_{k=0}^{d-1}$, where the subscript $l \in \{1, ..., N\}$ indicates that the operator acts on the system of the lth party, and sets of projections $\{P_l^{(k)}\}_{k=0}^{d-1}$, that are complete and orthogonal for $l = 1, ..., N - 1$ and need not be such for $l = N$, and they satisfy:

$$ P_1^{(k)} |\psi\rangle = \dots = P_N^{(k)} |\psi\rangle, \qquad (15) $$

$$ X_1^{(k)} \dots X_N^{(k)} P_1^{(k)} |\psi\rangle = \frac{c_k}{c_0} P_1^{(0)} |\psi\rangle \qquad (16) $$

for all $k = 1, ..., N$. Then, there exists a local isometry $\Phi$ such that $\Phi(|\psi\rangle) = |\text{aux}\rangle \otimes |\Psi\rangle$.

**Proof.** The proof of lemma 2 is a straightforward generalisation of the proof of the criterion from [29], and is included in the appendix for completeness.

We now describe the self-testing correlations for $|\Psi\rangle = \sum_{j=0}^{d-1} c_j |j\rangle^{\otimes n}$. Their structure is inspired by the self-testing correlations from [15] for the bipartite case, and they consist of three d-outcome measurements for all but the last party, which has four. We describe them by first presenting the ideal measurements that achieve them, as we believe this aids understanding. Subsequently, we extract their essential properties that guarantee self-testing. For a single-qubit observable A, denote by $[A]_m$ the observable defined with respect to the basis $\{|2m\text{mod } d\rangle, \|(2m + 1) \text{ mod } d\rangle\}$. For example, $[\sigma_Z]_m = |2m\rangle\langle 2m| - |2m + 1\rangle\langle 2m + 1|$. Similarly, we denote by $[A]'_m$ the observable defined with respect to the basis $\{|(2m + 1) \text{ mod } d\rangle, \|(2m + 2) \text{ mod } d\rangle\}$. We use the notation $\oplus A_i$ to denote the direct sum of observables $A_i$.

Let $\mathcal{X}_i$ denote the question alphabet of the ith party, and let $\mathcal{X}'_i = \{0, 1, 2\}$ for $i = 1, ..., N - 1$, and $\mathcal{X}_N = \{0, 1, 2, 3\}$. Let $x_i \in \mathcal{X}_i$ denote a question to the ith party. The answer alphabets are $\mathcal{A}_i = \{0, 1, ..., d - 1\}$, for $i = 1, ..., N$.

**Definition 2 (Ideal measurements for multipartite entangled Schmidt states).** The N parties make the following measurements on the joint state $|\Psi\rangle = \sum_{j=0}^{d-1} c_j |j\rangle^{\otimes n}$.

For $i = 1, ..., N - 1$:

* For question $x_i = 0$, the ith party measures in the computational basis $\{|0\rangle, |1\rangle, \dots, |d - 1\rangle\}$ of its system.

* For $x_i = 1$ and $x_i = 2$: for d even, in the eigenbases of observables $\bigoplus_{m=0}^{d-1}[\sigma_X]_m$ and $\bigoplus_{m=0}^{d-1}[\sigma_X]'_m$, respectively, with the natural assignments of d measurement outcomes; for d odd, in the eigenbases of observables $\bigoplus_{m=0}^{d-2} [\sigma_X]_m \oplus |d - 1\rangle\langle d - 1|$ and $|0\rangle\langle 0| \oplus \bigoplus_{m=0}^{d-2} [\sigma_X]'_m$, respectively.
For $i = N$:

* For $x_N = 0$ and $x_N = 1$, the party $N$ measures in the eigenbases of $\bigoplus_{m=0}^{d-1}[\cos(\mu_m)\sigma_Z + \sin(\mu_m)\sigma_X]_m$ and $\bigoplus_{m=0}^{d-1}[\cos(\mu_m)\sigma_Z - \sin(\mu_m)\sigma_X]_m$, respectively, with the natural assignments of $d$ measurement outcomes, where $\mu_m = \arctan[\sin(2\theta_m)]$ and $\theta_m = \arctan(c_{2m+1}/c_{2m})$; for $d$ odd, he measures in the eigenbases of $\bigoplus_{m=0}^{d-1}[\cos(\mu_m)\sigma_Z + \sin(\mu_m)\sigma_X]_m \oplus |d-1\rangle\langle d-1|$ and $\bigoplus_{m=0}^{d-1}[\cos(\mu_m)\sigma_Z - \sin(\mu_m)\sigma_X]_m \oplus |d-1\rangle\langle d-1|$, respectively.

* For $x_N = 2$ and $x_N = 3$: for $d$ even, the $N$th party measures in the eigenbases of $\bigoplus_{m=0}^{d-1}[\cos(\mu'_m)\sigma_Z + \sin(\mu'_m)\sigma_X]'_m$ and $\bigoplus_{m=0}^{d-1}[\cos(\mu'_m)\sigma_Z - \sin(\mu'_m)\sigma_X]'_m$, respectively, where $\mu'_m = \arctan[\sin(2\theta'_m)]$ and $\theta'_m = \arctan(c_{2m+2}/c_{2m+1})$; for $d$ odd, in the eigenbases of $|0\rangle\langle 0| \oplus \bigoplus_{m=0}^{d-1}[\cos(\mu'_m)\sigma_Z + \sin(\mu'_m)\sigma_X]'_m$ and $|0\rangle\langle 0| \oplus \bigoplus_{m=0}^{d-1}[\cos(\mu'_m)\sigma_Z - \sin(\mu'_m)\sigma_X]'_m$, respectively.

We refer to the correlation specified by the ideal measurements above as the ideal correlation for multipartite entangled Schmidt states.

Next, we will highlight a set of properties of the ideal correlation that are enough to characterise it, in the sense that any quantum correlation that satisfies these properties has to be the ideal one. This also aids understanding of the self-testing proof (proof of theorem 2). In what follows, we will employ the language of correlation tables, which gives a convenient way to describe correlations. In general, let $\mathcal{X}_i$ be the question alphabets and $\mathcal{A}_i$ the answer alphabets. A correlation specifies, for each possible question $x \in \mathcal{X}_1 \times \cdots \times \mathcal{X}_N$, a table $T_x$ with entries $T_x(a) = p(a|x)$ for $a \in \mathcal{A}_1 \times \cdots \times \mathcal{A}_N$. For example, we denote the correlation tables for the ideal correlations for multipartite entangled GHZ states from theorem 1 as $T_x^{\text{ghz}_N(\theta_m)}$, where $x \in \{0, 1\}^N$ denotes the question.

**Definition 3 (Self-testing properties of the ideal correlations for multipartite entangled Schmidt states).**

Recall that $\mathcal{X}_i = \{0, 1, 2\}$ for $i = 1, \dots, N-1$, and $\mathcal{X}_N = \{0, 1, 2, 3\}$. $\mathcal{A}_i = \{0, 1, \dots, d-1\}$, for $i = 1, \dots, N$.

The self-testing properties of the ideal correlations are:

* For questions $x \in \{0, 1\}^N$, we require $T_x$ to be block-diagonal with $2^N$ blocks $C_{x,m} := (c_{2m}^2 + c_{2m+1}^2) \cdot T_x^{\text{ghz}_N(\theta_m)}$ corresponding to outcomes in $\{2m, 2m+1\}^N$, where the multiplication by the weight is intended entry-wise, and $\theta_m := \arctan(c_{2m+1}/c_{2m})$.

* For questions with $x_i \in \{0, 2\}$, for $i = 1, \dots, N-1$ and $x_N \in \{2, 3\}$ we require $T_x$ to be block-diagonal with the $2^N$ blocks 'shifted down' by one measurement outcome. These should be $D_{x,m} := (c_{2m+1}^2 + c_{2m+2}^2) \cdot T_x^{\text{ghz}_N(\theta'_m)}$ corresponding to measurement outcomes in $\{2m+1, 2m+2\}^N$, where $\theta'_m := \arctan(c_{2m+2}/c_{2m+1})$ and $f(0) = 0, f(2) = 1, g(2) = 0, g(3) = 1$.

We are now ready to state the main theorem of this section.

**Theorem 2.** Let $|\Psi\rangle = \sum_{j=0}^{d-1} c_j |j\rangle^{\otimes N}$, where $0 < c_j < 1$ for all $i$ and $\sum_{j=0}^{d-1} c_j^2 = 1$. Suppose $N$ parties exhibit the ideal correlations for multipartite entangled Schmidt states from definition 2 by making local measurements on a joint state $|\psi\rangle$. Then there exists a local isometry $\Phi$ such that $\Phi(|\psi\rangle) = |\text{aux}\rangle \otimes |\Psi\rangle$.

As we mentioned, the proof of theorem 2 follows closely the method of [15], and uses as a building block our self-testing of the $n$-partite partially entangled GHZ state. For the details, we refer the reader to appendix C.

## 3.2. Symmetric Dicke states

Let us now consider the symmetric Dicke states. These are simultaneous eigenstates of the square of the total angular momentum operator $J^2$ of $N$ qubits and its projection onto the $z$-axis $J_z$. In a concise way they can be stated as

$$|D_N^k\rangle = \left(\binom{N}{k}\right)^{-\frac{1}{2}} \sum_i P_i (|1\rangle^{\otimes k} |0\rangle^{\otimes (N-k)}), \quad (17)$$

where the sum goes over all permutations of the parties and $k$ is the number of excitations. For instance, for $k = 1$ they reproduce the $N$-qubit $W$ state:
$$|W_N\rangle = \frac{1}{\sqrt{N}} (|0 \dots 01\rangle + |0 \dots 10\rangle + \dots + |10 \dots 0\rangle). \quad (18)$$

Interestingly, Dicke states have been generated experimentally [30] and have important role in metrology tasks [31] and quantum networking protocols [32].

We now show how to self-test Dicke states. For convenience, we consider the unitarily equivalent state $|xD_N^k\rangle = \sigma_N^N |D_N^k\rangle$ with $\sigma_N^N$ denoting $\sigma_N$ applied to party N. Our self-test exploits the fact that every Dicke state can be written as

$$|xD_N^k\rangle = \frac{1}{\sqrt{N}} (\sqrt{N-m} |0\rangle |xD_{N-1}^k\rangle + \sqrt{m} |1\rangle |xD_{N-1}^{k-1}\rangle) \quad (19)$$

which, after recursive application, allows one to express it in terms of the $(k+1)$-partite W state, that is

$$|xD_N^k\rangle = \sum_{i_1, \dots, i_{N-k-1}=0}^{1} \frac{\binom{k+1}{k-\Omega}^{\frac{1}{2}}}{\binom{N}{k}^{\frac{1}{2}}} |i_1, \dots, i_{N-k-1}\rangle |xD_{k+1}^{k-\Omega}\rangle, \quad (20)$$

where the first ket is shared by the parties 1, ..., $N-k-1$ and $\Omega = i_1 + \dots + i_{N-k-1}$. Now, for $i_1 = \dots = i_{N-k-1} = 0$, the corresponding state $|xD_{k+1}^k\rangle$ is simply a rotated $(k+1)$-partite W state $\sigma_N^{\otimes(k+1)}|xW_{k+1}\rangle$. Moreover, due to the fact that the Dicke states are symmetric, the above decomposition holds for any choice of $N-k-1$ parties among the first $N-1$ parties. Thus, if we had a self-test for the N-partite W state $|xW_N\rangle$, we could use the above formula to generalise it to any Dicke state. Let us then show how to self-test any W state.

**Theorem 3.** Let the state $|\psi\rangle$ and measurements $Z_i, X_i$ for parties $i=1, \dots, N-1$ and $D_N$ and $E_N$ for the last party, satisfy the following conditions:

$$\left\langle \bigotimes_{l=1, l \neq i}^{N-1} Z_l^{(+)} \right\rangle = \frac{2}{N}, \qquad \left\langle \bigotimes_{l=1, l \neq i}^{N-1} Z_l^{(+)} \otimes B_{i, N}^{(+)} \right\rangle = \frac{4\sqrt{2}}{N}, \quad (21)$$

with $i=1, \dots, N-1$, where, as before, $B_{i,N}^{(+)} = Z_i \otimes D_N + Z_i \otimes E_N + X_i \otimes D_N - X_i \otimes E_N$ is the Bell operator between the parties i and N. Moreover, we assume that

$$\langle Z_i^{(-)} \rangle = \frac{1}{N}, \qquad \left\langle \bigotimes_{l=1, l \neq i}^{N-1} Z_i^{(+)} \otimes Z_i^{(-)} \right\rangle = \frac{1}{N} \quad (22)$$

with $i=1, \dots, N-1$. Then, for the isometry $\Phi_N$ one has $\Phi_N(|\psi\rangle) = |\text{aux}\rangle|xW_N\rangle$.

We defer the detailed proof to appendix D, presenting here only a sketch. The proof makes use of the fact that $|xW_N\rangle$ can be written as $[|0\rangle^{\otimes N-2}(|00\rangle + |11\rangle)_{i,N} + |\text{rest}_i\rangle]/\sqrt{N}$, where $(|00\rangle + |11\rangle)_{i,N}$ is the maximally entangled state between the parties i and N, and the state $|\text{rest}_i\rangle$ collects all the remaining kets. We thus impose in (21) that if $(N-2)$-partite subset of the first $N-1$ parties obtains +1 when measuring $Z_i$ on $|\psi\rangle$, the state held by the parties i and N violates maximally the CHSH Bell inequality. Conditions in (22) are needed to characterise $|\text{rest}_i\rangle$, which completes the proof.

Let us now demonstrate how the above result can be applied to self-test any Dicke state. First, let us simplify our considerations by noting that a Dicke state with $k \le [N/2]$ is unitarily equivalent to a Dicke state with $m \ge [N/2]$, i.e., $|D_N^k\rangle = \sigma_N^{\otimes N}|D_N^{N-k}\rangle$ for $k=0, \dots, [N/2]$. Thus, it is enough to consider the Dicke states with $k \ge [N/2]$. Second, due to the fact that theorem 3 is formulated for $|xW_N\rangle$, while in the decomposition (20) we have $\sigma_N^{\otimes(k+1)}|xW_N\rangle$, one has to modify the conditions in (21) and (22) as $Z_i^{(+)} \leftrightarrow Z_i^{(-)}$ for $i=1, \dots, N-1$, and $D_N \rightarrow -E_N$ and $E_N \rightarrow -D_N$.

Then, to self-test the Dicke states one proceeds in the following way:

(i) Project any $(N-k-1)$-element subset $S_i$ of the first $N-1$ parties of $|\psi\rangle$ (there are $\binom{N-1}{N-1-k}$ such subsets) onto $\otimes_{j \in S_i} Z_j^{(+)}$ and check whether the state corresponding to the remaining parties satisfies the conditions for $|xD_{k+1}^k\rangle = \sigma_N^{\otimes(k+1)}|xW_{k+1}\rangle$.

(ii) For every sequence $(i_1, \dots, i_N)$ consisting of $k+1$ ones on the first $N-1$ positions, check that the state $|\psi\rangle$ obeys the following correlations

$$\langle \psi | Z_1^{(i_1)} \otimes \dots \otimes Z_N^{(i_N)} | \psi \rangle = 0, \quad (23)$$

where $Z_i^{(\pi)} = [1 + (-1)^{\pi} Z_i]/2$.

The detailed proof that the above procedure allows to self-test the Dicke states is presented in appendix E.
Notice that our self-test exploits two observables per site and the total number of correlators one has to determine for every Dicke state in this procedure again scales linearly with N, in contrast with the exponential scaling of quantum state tomography.

### 3.3. Graph states

We finally demonstrate that our method applies also to the graph states. These are N-qubit quantum states that have been widely exploited in quantum information processing, in particular in quantum computing, error correction, and secret sharing (see e.g. [33]). It is thus an interesting question to design efficient methods of their certification, in particular self-testing. Such a method was proposed in [23] however, in general it needs three measurements for at least one party. Below we show that the approach based on violation of the CHSH Bell inequality provides a small improvement, as it requires only two measurements at each site.

Before stating our result, we introduce some notation. Consider a graph G = (V, E) with V and E denoting, respectively, the N-element set of vertices of G and the set of edges connecting elements of V. A graph state corresponding to G is an N-qubit state given by $|\psi_G\rangle = \prod_{(a,b)\in E} U_{a,b} | + \rangle^{\otimes N}$, where $U_{a,b}$ is the controlled-Z interaction between qubits a and b, the product goes over all edges of G, and $|+\rangle = (|0\rangle + |1\rangle)/\sqrt{2}$. Notice that $|\psi_G\rangle$ can also be written as

$$|\psi_G\rangle = \frac{1}{\sqrt{2^N}} \sum_{i \in \{0,1\}^n} (-1)^{\mu(i)} |i\rangle, \qquad (24)$$

where the sum is over all sequences $i = (i_1, ..., i_N)$ with each $i_j \in \{0, 1\}$, and $\mu(i)$ is the number of edges connecting qubits being in the state $|1\rangle$ for a given ket $|i\rangle$.

The main property of the graph states underlying our self-test is that by measuring all the neighbours of a pair of connected qubits i, j in the $\sigma_z$-basis, the two qubits i and j are left in one of the Bell states (see [34]):

$$\frac{1}{\sqrt{2}} (\sigma_z^{m_i} \otimes \sigma_z^{m_j}) (|0+\rangle + |1-\rangle), \qquad (25)$$

where $m_i$ is the number of parties from $\nu_{i,j} \setminus \{j\}$ whose result of the measurement in the $\sigma_z$-basis was $-1$. In (25) we neglect an unimportant $-1$ factor that might appear.

Having all this, we can now state formally our result. Given a graph G and the corresponding graph state $|\psi_G\rangle$, let $\nu_i$ denote the set of all neighbours of the qubit i (all qubits connected to i by an edge). Likewise, we denote by $\nu_{i,j}$ the set of neighbours of qubits i and j. Let then $|\nu_i|$ and $|\nu_{i,j}|$ be the numbers of elements of $\nu_i$ and $\nu_{i,j}$, respectively. Also, for simplicity, we label the qubits of $|\psi_G\rangle$ in such a way that the qubits N - 1 and N are connected and the qubit N is the one with the smallest number of neighbours. Denoting $Z_{\nu_{i,j}}^{(\tau)} = \otimes_{l \in \nu_{i,j}} Z_l^{(\tau)}$, where $\tau$ is an $|\nu_{i,j}|$-element sequence with each $\tau_l \in \{0, 1\}$ (the operator $Z_{\nu_{i,j}}^{(\tau)}$ acts only on the parties belonging to $\nu_{i,j}$), we can state our result.

**Theorem 4.** Let $|\psi\rangle$ and measurements $Z_i, X_i$ with $i = 1, ..., N - 1$ and $D_N, E_N, Z_N \equiv (D_N - E_N)/\sqrt{2}, N \equiv (D_N + E_N)/\sqrt{2}$, satisfy $\langle Z_{\nu_{N-1,N}}^{(\tau)} \rangle = 1/2^{|\nu_{N-1,N}|}$, and

$$\langle Z_{\nu_{N-1,N}}^{(\tau)} \otimes B_{N-1,N}^{(m_{N-1}, m_N)} \rangle = \frac{2\sqrt{2}}{2^{|\nu_{N-1,N}|}} \qquad (26)$$

for every choice of the $|\nu_{i,j}|$-element sequence $\tau$. The Bell operators $B_{N-1,N}^{(m_{N-1}, m_N)}$ are defined as

$$B_{N-1,N}^{(m_{N-1}, m_N)} = (-1)^{m_N} X_{N-1} \otimes (D_N + E_N) + (-1)^{m_{N-1}} Z_{N-1} \otimes (D_N - E_N). \text{ Additionally, we assume that}$$

$$\langle Z_{\nu_{i,j}}^{(\tau)} \rangle = \frac{1}{2^{|\nu_{i,j}|}}, \quad \langle Z_{\nu_{i,j}}^{(\tau)} \otimes Z_i \otimes X_j \rangle = \frac{(-1)^{m_j}}{2^{|\nu_{i,j}|}} \qquad (27)$$

for all connected pairs of indices $i \neq j$ except for $(N - 1, N)$. Then $\Phi_N(|\psi\rangle) = |\psi_G\rangle$.

The proof of this statement may be found in appendix F. It is worth noting that the above approach exploits violations of the CHSH Bell inequality between a single pair of parties (see (26)), and not between every pair of neighbours.

## 4. Conclusion and discussion

We investigated a simple, but potentially general, approach to self-testing multipartite states, inspired by [21], which relies on the well understood method of self-testing bipartite qubit states based on the maximal violation of the tilted CHSH Bell inequality. This approach allows one to self-test, with few measurement choices per party, all permutationally-invariant Dicke states, all partially entangled GHZ qubit states, and to recover self-testing of graph states (which was previously known through stabiliser-state methods). In our work, we also
generalise self-testing of partially entangled GHZ qubit states to the qudit case, using techniques from [15]. We obtain the first self-testing result for a class of multipartite qudit states, by showing that all multipartite qudit states that admit a Schmidt decomposition can be self-tested. Importantly, our self-tests have a low complexity in terms of resources as they require up to four measurement choices per party, and the total number of correlators that one needs to determine scales linearly with the number of parties. This is because, in contrast with tomographic methods, one does not need to check correlators between all possible measurements of each party, but a smaller number of correlators already imposes a rigid structure on the state.

As a direction for future work, we are particularly interested in extending this approach to self-test any generic multipartite entangled state of qubits (which is local-unitary equivalent to its complex conjugate in any basis). The main challenge here is to provide a general recipe to construct a single isometry that self-tests the global state from the different ones derived from various subtests (i.e. from projecting various subsets of parties and looking at the correlations of the remaining ones). This appears to be challenging for states that do not have any particular symmetry.

In this paper we have not made any estimations regarding robustness of the presented self-testing protocols. The standard methods based on norm inequalities (see [8, 10, 11, 23]) can be applied to obtain robustness bounds. However, calculating them is a tedious task which for states of many particles generally does not lead to practically useful bounds. Methods for finding better bounds, such as those presented in [13, 14], are not easily applicable to multipartite states. In general, finding methods to estimate robustness of self-testing of multipartite states remains as one of the open questions.

Finally, notice that all presented self-tests which rely on the maximal violation of the CHSH Bell inequality can be restated and proved in terms of the other available self-tests. In particular, any self-test discussed in [9] would work in case of two measurements per site, and self-tests in [11] would work for higher number of inputs.

## Acknowledgments

The authors thank Flavio Baccari, Marc Roda, Alexia Salavrakos and Thomas Vidick for useful discussions. This work was supported by Spanish MINECO (QIBEQI FIS2016-80773-P and Severo Ochoa SEV-2015-0522), the AXA Chair in Quantum Information Science, Generalitat de Catalunya (CERCA Programme), Fundació Privada Cellex and ERC CoG QITBOX. This project has received funding from the European Union's Horizon 2020 research and innovation programme under the Marie Skłodowska-Curie grant agreement No 705109. IŠ acknowledges the support of 'Obra Social La Caixa 2016' and COST project CA16218, NANOCOHYBRI. AC is supported by AFOSR YIP award number FA9550-16-1-0495. RA acknowledges the support from the Foundation for Polish Science through the First Team project No First TEAM/2017-4/31 co-financed by the European Union under the European Regional Development Fund.

*Note added.* After finishing this work, we learned about works [35, 36], where the authors obtain self-testing of N-partite W-states and Dicke states, respectively.

## Appendix A. Proof of theorem 1

For ease of exposition, we prove the theorem in the case $N = 4$, with the extension to general N being immediate.

Let $A_0, A_1, B_0, B_1, C_0, C_1, D_0, D_1$, be the pairs of observables for the four parties. For an observable $D$, let $P_D^a = [1 + (-1)^a D]/2$, and for brevity let $c_\theta$ and $s_\theta$ denote, respectively, $\cos \theta$ and $\sin \theta$. For clarity, we recall the correlations from theorem 1, for the case $N = 4$:

$$ \langle \psi | P_{A_0}^0 | \psi \rangle = \langle \psi | P_{B_0}^0 | \psi \rangle = \langle \psi | P_{C_0}^0 | \psi \rangle = \langle \psi | P_{A_0}^0 P_{C_0}^0 | \psi \rangle = \langle \psi | P_{B_0}^0 P_{C_0}^0 | \psi \rangle = c_{\theta}^2, \quad (A.1) $$

$$ \langle \psi | P_{A_1}^a P_{B_1}^b | \psi \rangle = \frac{1}{4}, \quad \text{for } a, b \in 0, 1, \quad (A.2) $$

$$ \langle \psi | P_{A_1}^a P_{B_1}^b (\alpha C_0 + C_0 D_0 + C_0 D_1 + (-1)^{a+b}(C_1 D_0 - C_1 D_1)) | \psi \rangle = \frac{\sqrt{8 + 2\alpha^2}}{4}, \quad \text{for } a, b \in 0, 1, \quad (A.3) $$

where $\tan 2\theta = (\frac{2}{\alpha^2} - \frac{1}{2})^{\frac{1}{2}}$. Equations (A.1) imply, by Cauchy-Schwartz inequality, that

$$ P_{A_0}^0 |\psi\rangle = P_{B_0}^0 |\psi\rangle = P_{C_0}^0 |\psi\rangle \quad (A.4) $$
and consequently

$$P_{A_0}^1 |\psi\rangle = P_{B_0}^1 |\psi\rangle = P_{C_0}^1 |\psi\rangle. \qquad (A.5)$$

Notice that equation (A.2) implies $||P_{A_1}^a P_{B_1}^b |\psi\rangle|| = 1/2$, for $a, b \in \{0, 1\}$, and that the equations in (A.3) describe maximal violations of tilted CHSH inequalities by the normalised state $2P_{A_1}^a P_{B_1}^b |\psi\rangle$, for $a, b \in \{0, 1\}$ (the ones for $a \oplus b = 1$ are tilted CHSH inequalities upon relabelling $D_1 \to -D_1$).

Let $\mu$ be such that $\tan \mu = s_{2\theta}$. Define $X_A := A_1$, $X_B := B_1$ and $X_C := C_1$. Then, let $Z_D' = (D_0 + D_1)/2 \cos \mu$, and let $Z_D^*$ be $Z_D'$ where we have replaced the zero eigenvalues with 1. Define $Z_D = Z_D^*|Z_D^*|^{-1}$. Define $X_D$ similarly starting from $X_D' = (D_0 - D_1)/2 \cos \mu$. Let $P_{Z_D}^a = [1 + (-1)^a Z_D]/2$. The maximal violations of tilted CHSH from (A.3) imply, thanks to lemma 1, that

$$P_{C_0}^a = P_{Z_D}^a, \quad \text{for } a \in \{0, 1\}, \qquad (A.6)$$

$$s_{\theta} P_{A_1}^a P_{B_1}^b X_C X_D P_{C_0}^0 |\psi\rangle = (-1)^{a+b} c_{\theta} P_{A_1}^a P_{B_1}^b P_{C_0}^1 |\psi\rangle, \quad \text{for } a, b \in \{0, 1\}. \qquad (A.7)$$

If we introduce notation $X_A = A_1$, $X_B = B_1$ and $X_C = C_1$, then

$$\begin{aligned} X_A X_B X_C X_D P_{A_0}^1 |\psi\rangle &= (P_{A_1}^0 - P_{A_1}^1)(P_{B_1}^0 - P_{B_1}^1)X_C X_D P_{C_0}^1 |\psi\rangle \\ &= P_{A_1}^0 P_{B_1}^0 X_C X_D P_{C_0}^1 |\psi\rangle - P_{A_1}^0 P_{B_1}^1 X_C X_D P_{C_0}^1 |\psi\rangle - P_{A_1}^1 P_{B_1}^0 X_C X_D P_{C_0}^1 |\psi\rangle \\ &\quad + P_{A_1}^1 P_{B_1}^1 X_C X_D P_{C_0}^1 |\psi\rangle \end{aligned} \qquad (A.8)$$

$$\begin{aligned} &= \frac{s_{\theta}}{c_{\theta}} P_{A_1}^0 P_{B_1}^0 P_{A_0}^0 |\psi\rangle + \frac{s_{\theta}}{c_{\theta}} P_{A_1}^0 P_{B_1}^1 P_{A_0}^0 |\psi\rangle + \frac{s_{\theta}}{c_{\theta}} P_{A_1}^0 P_{B_1}^1 P_{A_0}^0 |\psi\rangle + \frac{s_{\theta}}{c_{\theta}} P_{A_1}^1 P_{B_1}^1 P_{A_0}^0 |\psi\rangle \\ &= \frac{s_{\theta}}{c_{\theta}} P_{A_0}^0 |\psi\rangle, \end{aligned} \qquad (A.9)$$

where we used equation (A.7) to obtain the third line, and $\sum_{a,b \in \{0,1\}} P_{A_1}^a P_{B_1}^b = 1$ to obtain the last. Conditions (12) and (13) of theorem 1 follow immediately from the above. Note that we omitted the proof that $Z_D$ and $X_D$ act on $|\psi\rangle$ in the same way as $Z_D'$ and $X_D'$, respectively. The proof relies on the standard self-testing procedure named regularisation. For a detailed proof see [10, 11].

## Appendix B. Proof of lemma 2

In this section, we provide a proof of lemma 2. We explicitly construct a local isometry $\Phi$ such that $\Phi(|\psi\rangle) = |\text{aux}\rangle \otimes |\Psi\rangle$ for any Schmidt state $|\Psi\rangle = \sum_{j=0}^{d-1} c_j |j\rangle^{\otimes N}$, where $0 < c_j < 1$ for all $j$ and $\sum_{j=0}^{d-1} c_j^2 = 1$, and $|\text{aux}\rangle$ is some auxiliary state.

**Proof.** Recall that $\{P_l^{(k)}\}_{k=0}^{d-1}$ are complete sets of orthogonal projections for $l = 1, \dots, N-1$ by hypothesis. Then, notice that for $i \neq j$ we have, using condition (15), $P_N^{(i)} P_N^{(j)} |\psi\rangle = P_N^{(i)} P_1^{(j)} |\psi\rangle = P_1^{(j)} P_1^{(i)} |\psi\rangle = 0$, i.e., the $P_N^{(k)}$ are ‘orthogonal when acting on $|\psi\rangle$’.

Let $\mathcal{A}$ be the unital algebra generated by $\{P_1^{(k)}\}$. Let $\mathcal{H}' = \mathcal{A}|\psi\rangle$, where $\mathcal{A}|\psi\rangle = \{Q|\psi\rangle: Q \in \mathcal{A}\}$. Let $\tilde{P}_N^{(k)} = P_N^{(k)}|\mathcal{H}'$ be the restriction of $P_N^{(k)}$ to $\mathcal{H}'$. Then, $\{\tilde{P}_N^{(k)}\}_{k=0}^{d-1}$ is a set of orthogonal projections. This is because, thanks to (15), one can always move the relevant operators to be in front of $|\psi\rangle$, as in the simple example

$$\tilde{P}_N^{(i)} \tilde{P}_N^{(j)} (P_1^{(k)} |\psi\rangle') = P_1^{(k)} \tilde{P}_N^{(i)} \tilde{P}_N^{(j)} |\psi\rangle = 0. \qquad (B.1)$$

Thus, the set $\{\tilde{P}_B^{(k)}, I - P_B'\}$, where $P_B'$ is the sum of all other projections, is a complete set of orthogonal projections.

Now, define $Z_l := \sum_{k=0}^{d-1} \omega^k P_l^{(k)}$, for $l = 1, \dots, N-1$, and $Z_N := \sum_{k=0}^{d-1} \omega^k \tilde{P}_N^{(k)} + 1 - \sum_{k=0}^{d-1} \tilde{P}_N^{(k)}$. In particular, the $Z_l$ are all unitary. Notice, moreover, that $(1 - \sum_k \tilde{P}_N^{(k)}) |\psi\rangle = 0$, by using (15) and the fact that the $\{P_l^{(k)}\}$ are complete.

Define the local isometry

$$\Phi := \bigotimes_{l=1}^{N} R_{ll'} \tilde{F}_{l'} S_{ll'} F_{l'} \text{App}_l, \qquad (B.2)$$

where App$_l$: $\mathcal{H}_l \to \mathcal{H}_l \otimes \mathcal{H}_{l'}$ is the isometry that simply appends $|0\rangle_{l'}$, $F$ is the quantum Fourier transform, $\tilde{F}$ is the inverse quantum Fourier transform, $R_{ll'}$ is defined so that $|\phi\rangle_l |k\rangle_{l'} \mapsto X_l^{(k)} |\phi\rangle_l |k\rangle_{l'} \forall |\phi\rangle$, and $S_{ll'}$ is defined so that $|\phi\rangle_l |k\rangle_{l'} \mapsto Z_l^k |\phi\rangle_l |k\rangle_{l'} \forall |\phi\rangle$. We compute the action of $\Phi$ on $|\psi\rangle$. For ease of notation with drop the tilde from the $\tilde{P}_N^{(k)}$, while still referring to the new orthogonal projections.
$$
\begin{align}
& |\psi\rangle \otimes |0\rangle^{\otimes N} \xrightarrow{\otimes l} \frac{1}{d^{N/2}} \sum_{k_1, \dots, k_N} |\psi\rangle \otimes \otimes_l |k_l\rangle' \nonumber \\
& \xrightarrow{\otimes l} \frac{1}{d^{N/2}} \sum_{k_1, \dots, k_N} \left[ \prod_{i=1}^{N-1} \left( \sum_j \omega^{j_i} P_i^{(j_i)} \right)^{k_i} \right] \left[ \sum_{j_N} \omega^{j_N} P_N^{(j_N)} + 1 - \sum_k P_N^{(j_k)} \right] |\psi\rangle \otimes \otimes_l |k_l\rangle' \nonumber \\
& = \frac{1}{d^{N/2}} \sum_{k_1, \dots, k_N} \sum_{j_1, \dots, j_N} \prod_{i=1}^{N} \omega^{j_i k_i} P_i^{(j_i)} |\psi\rangle \otimes \otimes_l |k_l\rangle' \nonumber \\
& = \frac{1}{d^{N/2}} \sum_{k_1, \dots, k_N} \sum_{j_1, \dots, j_N} \prod_{i=1}^{N} \omega^{j_i k_i} P_i^{(j_i)} |\psi\rangle \otimes \otimes_l |k_l\rangle' \nonumber \\
& = \frac{1}{d^{N/2}} \sum_{k_1, \dots, k_N} \sum_j \omega^{j(\sum_i k_i)} P_1^{(j)} |\psi\rangle \otimes \otimes_l |k_l\rangle' \nonumber \\
& \xrightarrow{\otimes l} \frac{1}{d^N} \sum_{k_1, \dots, k_N} \sum_j \sum_{m_1, \dots, m_N} \omega^{j(\sum_i k_i)} \prod_r \omega^{-m_r k_r} P_1^{(j)} |\psi\rangle \otimes \otimes_l |m_l\rangle' \nonumber \\
& = \frac{1}{d^N} \sum_{k_1, \dots, k_N} \sum_j \sum_{m_1, \dots, m_N} \prod_i \omega^{k_i (j-m_i)} P_1^{(j)} |\psi\rangle \otimes \otimes_l |m_l\rangle' \nonumber \\
& = \sum_j P_1^{(j)} |\psi\rangle \otimes |j\rangle^{\otimes N} \tag{B.3}
\end{align}
$$

$$
\begin{align}
& \xrightarrow{\otimes l} \sum_j \left( \prod_i X_i^{(j)} \right) P_1^{(j)} |\psi\rangle \otimes |j\rangle^{\otimes N} \nonumber \\
& = \sum_j \frac{c_j}{c_0} P_1^{(0)} |\psi\rangle \otimes |j\rangle^{\otimes N} \nonumber \\
& = \frac{1}{c_0} P_1^{(0)} |\psi\rangle \otimes \sum_j c_j |j\rangle^{\otimes N} \nonumber \\
& = |\text{aux}\rangle \otimes |\Psi\rangle, \tag{B.4}
\end{align}
$$

where to get (B.4) we used condition (15). It is an easy check to see that the whole proof above can be repeated by starting from a mixed joint state, yielding a corresponding version of the lemma that holds for a general mixed state. $\square$

## Appendix C. Proof of theorem 2

As mentioned, we work in the tripartite case, as the general *n*-partite case follows analogously. The measurements of Alice, Bob and Charlie can be assumed to be projective, since we make no assumption on the dimension of the system. For ease of notation, the proof assumes that the joint state is pure, but one easily realises that the proof goes through in the same way by rephrasing everything in terms of density matrices (see [15] for a slightly more detailed discussion).

Let $|\psi\rangle$ be the unknown joint state, and let $P_{A_x}^a$ be the projection on Alice side corresponding obtaining outcome *a* on question *x*. Define $P_{B_y}^b$ and $P_{C_z}^c$ similarly on Bob and Charlie's side. The proof structure follows closely that of [15], and goes through explicitly constructing projectors and unitary operators satisfying the sufficient conditions of lemma 2.

Define $\hat{A}_{x,m} = P_{A_x}^{2m} - P_{A_x}^{2m+1}$, $\hat{B}_{y,m} = P_{B_y}^{2m} - P_{B_y}^{2m+1}$ and $\hat{C}_{z,m} = P_{C_z}^{2m} - P_{C_z}^{2m+1}$, for $x, y, z \in \{0, 1\}$. Let $1_{A_x}^m = P_{A_x}^{2m} + P_{A_x}^{2m+1}$ and similarly define $1_{B_y}^m$ and $1_{C_z}^m$ for $x, y, z \in \{0, 1\}$. Now

$$
\begin{align}
\| P_{A_0}^{2m} \| &= \langle \psi | P_{A_0}^{2m} | \psi \rangle^{\frac{1}{2}} \nonumber \\
&= \left( \left\langle \psi | P_{A_0}^{2m} \sum_{i=0}^{d-1} P_{B_0}^i \sum_{j=0}^{d-1} P_{C_0}^j | \psi \right\rangle \right)^{\frac{1}{2}} \nonumber \\
&= c_{2m}, \tag{C.1}
\end{align}
$$

and $\|P_{A_0}^{2m+1}\| = c_{2m+1}$. Similarly, we derive $\|1_{A_x}^m|\psi\rangle\| = \|1_{B_y}^m|\psi\rangle\| = \|1_{C_z}^m|\psi\rangle\| = (c_{2m}^2 + c_{2m+1}^2)^{1/2}$ for any $m$ and $x, y, z \in \{0, 1\}$. Notice then that
$$ \begin{aligned} \langle \psi | \mathbf{1}_{A_x}^m \mathbf{1}_{B_y}^m | \psi \rangle &= \langle \psi | \mathbf{1}_{A_x}^m \mathbf{1}_{B_y}^m \sum_{i=0}^{d-1} P_{C_0}^i | \psi \rangle \\ &= \langle \psi | \mathbf{1}_{A_x}^m \mathbf{1}_{B_y}^m \mathbf{1}_{C_0}^m | \psi \rangle \\ &= c_{2m}^2 + c_{2m+1}^2, \end{aligned} \quad (C.2) $$

where the second last equality is from the block-diagonal structure of the correlations. Since $||\mathbf{1}_{A_x}^m|\psi\rangle|| = ||\mathbf{1}_{B_y}^m|\psi\rangle|| = (c_{2m}^2 + c_{2m+1}^2)^{1/2}$, then Cauchy-Schwartz inequality implies $\mathbf{1}_{A_x}^m|\psi\rangle = \mathbf{1}_{B_y}^m|\psi\rangle$. So, we have

$$ \mathbf{1}_{A_x}^m |\psi\rangle = \mathbf{1}_{B_y}^m |\psi\rangle = \mathbf{1}_{C_z}^m |\psi\rangle \quad (C.3) $$

for all $x, y, z \in \{0, 1\}$. The correlations are, by design, such that $\hat{A}_{0,m}, \hat{A}_{1,m}, \hat{B}_{0,m}, \hat{B}_{1,m}, \hat{C}_{0,m}, \hat{C}_{0,m}$, the associated projections $P_{A_i}^j, P_{B_i}^j, P_{C_i}^j, j \in \{2m, 2m+1\}$ and $|\psi\rangle$ reproduce the correlations

$(c_{2m}^2 + c_{2m+1}^2) \cdot C_{x,y,z}^{ghz_{3,2,\theta_m}}$. In order to apply theorem 1, we need to define the normalised state $|\psi'_m\rangle := (\mathbf{1}_{A_0}^m|\psi\rangle)/(c_{2m}^2 + c_{2m+1}^2)^{1/2}$ and the ‘unitarized’ versions of the operators above, namely

$\hat{D}_{i,m} := 1 - \mathbf{1}_m^D + \hat{D}_{i,m}$, for $D \in \{A, B, C\}$. It is easy to check that then $\hat{A}_{i,m}, \hat{B}_{i,m}$ and $\hat{C}_{i,m}$ satisfy the conditions of theorem 1 (for $N=3$) on state $|\psi'_m\rangle$. Thus, we have

$$ Z_{A,m} |\psi'_m\rangle = Z_{B,m} |\psi'_m\rangle = Z_{C,m} |\psi'_m\rangle \quad (C.4) $$

$$ X_{A,m} X_{B,m} X_{C,m} (1 - Z_{A,m}) |\psi'_m\rangle = \tan(\theta_m) (1 + Z_{A,m}) |\psi'_m\rangle \quad (C.5) $$

Define the subspace $C_m = \text{range}(\mathbf{1}_m^{C_0}) + \text{range}(\mathbf{1}_m^{C_1})$, and the projection $1_{C_m}$ onto subspace $C_m$. Then, notice from the way $Z_{C,m}$ is defined, that it can be written as $Z_{C,m} = 1 - \mathbf{1}_{C_m} + \tilde{Z}_{C,m}$, where $\tilde{Z}_{C,m}$ is some operator living entirely on subspace $C_m$. This implies that $Z_{C,m}|\psi_m\rangle = \tilde{Z}_{C,m}|\psi_m\rangle = \tilde{Z}_{C,m}|\psi\rangle$, where we have used (C.3) and the fact that

$$ \mathbf{1}_{m}^{C_0} |\psi\rangle = \mathbf{1}_{m}^{C_1} |\psi\rangle \implies 1_{C_m} |\psi\rangle = \mathbf{1}_{m}^{C_1} |\psi\rangle. \quad (C.6) $$

Hence, from (C.4) it is not difficult to deduce that $\hat{A}_{0,m}|\psi\rangle = \hat{B}_{0,m}|\psi\rangle = \tilde{Z}_{C,m}|\psi\rangle$.

**Constructing the projections of lemma 2.** Define projections $P_A^{(2m)} := (\mathbf{1}_m^{A_0} + \hat{A}_{0,m})/2 = P_{A_0}^{2m}$, $P_A^{(2m+1)} := (\mathbf{1}_m^{A_0} - \hat{A}_{0,m})/2 = P_{A_0}^{2m+1}$, $P_B^{(2m)} := (\mathbf{1}_m^{B_0} + \hat{B}_{0,m})/2 = P_{B_0}^{2m}$, $P_B^{(2m+1)} := (\mathbf{1}_m^{B_0} - \hat{B}_{0,m})/2 = P_{B_0}^{2m+1}$, $P_C^{(2m)} := (1_{C_m} + \tilde{Z}_{C,m})/2$ and $P_C^{(2m+1)} := (1_{C_m} - \tilde{Z}_{C,m})/2$.

Note that $P_A^{(2m)}$, $P_C^{(2m+1)}$ are indeed projections, since $\tilde{Z}_{C,m}$ has all $\pm 1$ eigenvalues corresponding to subspace $C_m$, and is zero outside. We also have, for all $m$ and $k = 2m, 2m+1$,

$$ \begin{aligned} P_B^{(k)} |\psi\rangle &= P_A^{(k)} |\psi\rangle = \frac{1}{2} [\mathbf{1}_m^{A_0} + (-1)^k \hat{A}_{0,m}] |\psi\rangle = \frac{1}{2} [\mathbf{1}_m^{B_0} + (-1)^k \hat{A}_{0,m}] |\psi\rangle \\ &= \frac{1}{2} [1_{B_m} + (-1)^k \tilde{Z}_{B,m}] |\psi\rangle = P_C^{(k)} |\psi\rangle. \end{aligned} \quad (C.7) $$

Further, notice that $[1 + (-1)^k Z_{A,m}] |\psi'_m\rangle = [\mathbf{1}_m^{A_0} + (-1)^k \hat{A}_{0,m}] |\psi'_m\rangle = [\mathbf{1}_m^{A_0} + (-1)^k \hat{A}_{0,m}] |\psi\rangle = P_A^{(k)} |\psi\rangle$. Substituting this into (C.5), gives

$$ X_{A,m} X_{B,m} X_{C,m} P_A^{(2m+1)} |\psi\rangle = \tan(\theta_m) P_A^{(2m)} |\psi\rangle = \frac{c_{2m+1}}{c_{2m}} P_A^{(2m)} |\psi\rangle. \quad (C.8) $$

Now, for the ‘shifted’ blocks, we can similarly define $\hat{A}'_{x,m}, \hat{B}'_{x,m}$ and $\hat{C}'_{x,m}$ as $\hat{A}_{x,m} = P_{A_x}^{2m+1} - P_{A_x}^{2m+2}$ and similar. Then, analogously, we deduce the existence of hermitian and unitary operators $Y'_{A,m}, Y'_{B,m}$ and $Y'_{C,m}$ such that

$$ Y_{A,m} Y_{B,m} Y_{C,m} P_A^{(2m+2)} |\psi\rangle = \frac{c_{2m+2}}{c_{2m+1}} P_A^{(2m+1)} |\psi\rangle. \quad (C.9) $$

**Constructing the unitary operators of lemma 2.** We will now directly construct unitary operators satisfying conditions (15) and (16) of lemma 2. Define $X_{A/B/C}^{(k)}$ as follows:

$$ X_A^{(k)} = \begin{cases} 1, & \text{if } k = 0, \\ X_{A,0} Y_{A,0} X_{A,1} Y_{A,1} \dots X_{A,m-1} Y_{A,m-1} X_{A,m}, & \text{if } k = 2m + 1, \\ X_{A,0} Y_{A,0} X_{A,1} Y_{A,1} \dots X_{A,m-1} Y_{A,m-1}, & \text{if } k = 2m, \end{cases} \quad (C.10) $$

and analogously for $X_B^{(k)}$ and $X_C^{(k)}$. Note that $X_A^{(k)}$ and $X_B^{(k)}$ are unitary since they are product of unitaries. Finally, we are left to check that

$$ X_A^{(k)} X_B^{(k)} X_C^{(k)} P_A^{(k)} |\psi\rangle = \frac{c_k}{c_0} P_A^{(0)} |\psi\rangle. \quad (C.11) $$
The case $k = 0$ holds trivially. For $k = 2m + 1$, For $k = 2m + 1$,

$$
\begin{align*}
& X_A^{(k)} X_B^{(k)} X_C^{(k)} P_A^{(k)} |\psi\rangle \\
&= X_{A,0} Y_{A,0} X_{B,0} Y_{B,0} X_{C,0} Y_{C,0} \dots X_{A,m-1} Y_{A,m-1} X_{B,m-1} Y_{B,m-1} X_{C,m-1} Y_{C,m-1} \\
&\quad \times X_{A,m} X_{B,m} X_{C,m} P_A^{(2m+1)} |\psi\rangle \\
&\stackrel{\text{C.8}}{=} \frac{c_{2m+1}}{c_{2m}} X_{A,0} Y_{A,0} X_{B,0} Y_{B,0} X_{C,0} Y_{C,0} \dots X_{A,m-1} Y_{A,m-1} X_{B,m-1} Y_{B,m-1} X_{C,m-1} Y_{C,m-1} P_A^{(2m)} |\psi\rangle \\
&\stackrel{\text{C.9}}{=} \frac{c_{2m+1}}{c_{2m}} \cdot \frac{c_{2m}}{c_{2m-1}} X_{A,0} Y_{A,0} X_{B,0} Y_{B,0} X_{C,0} Y_{C,0} \dots X_{A,m-2} Y_{A,m-2} X_{B,m-2} Y_{B,m-2} \\
&\quad \times X_{C,m-2} Y_{C,m-2} P_A^{(2m-1)} |\psi\rangle \\
&= \dots \\
&= \frac{c_{2m+1}}{c_{2m}} \cdot \frac{c_{2m}}{c_{2m-1}} \dots \frac{c_2}{c_1} \cdot \frac{c_1}{c_0} P_A^{(0)} |\psi\rangle \\
&= \frac{c_{2m+1}}{c_0} P_A^{(0)} |\psi\rangle \tag{C.12}
\end{align*}
$$

which is indeed (C.11) as $2m + 1 = k$. The case $k = 2m$ is similar. This concludes the proof of theorem 2.

## Appendix D. Self-testing of the W states

In this section we provide a detailed proof of self-testing of the $|W_N\rangle$ state

$$ |W_N\rangle = \frac{1}{\sqrt{N}} (|0 \dots 01\rangle + |0 \dots 010\rangle + \dots + |10 \dots 0\rangle). \qquad (D.1) $$

For our convenience we show how to self-test the following unitarily equivalent state

$$ |xW_N\rangle = \frac{1}{\sqrt{N}} (|0 \dots 0\rangle + |0 \dots 011\rangle + \dots + |10 \dots 01\rangle), \qquad (D.2) $$

which is obtained from $|W_N\rangle$ by applying $\sigma_x$ to the last qubit of $|W_N\rangle$. This is because $|xW_N\rangle$ can be written as

$$ |xW_N\rangle = \frac{1}{\sqrt{N}} [|0\rangle^{\otimes N-2} (|00\rangle + |11\rangle)_{i,N} + |\text{rest}_i\rangle], \qquad (D.3) $$

where $(|00\rangle + |11\rangle)_{i,N}$ stands for the two-qubit maximally entangled state distributed between the parties $i$ and $N$ with $i = 1, \dots, N-1$, and the vectors $|\text{rest}_i\rangle$ contain the remaining kets. This decomposition explains the conditions we impose below.

Let us now prove the following theorem.

**Theorem 5.** Assume that for a given state $|\psi\rangle$ and measurements $Z_i$, $X_i$ for parties $i = 1, \dots, N-1$ and $D_N$ and $E_N$ for the last party, the following conditions are satisfied

$$ \left\langle \bigotimes_{l=1, l \neq i}^{N-1} Z_l^{(+)} \right\rangle = \frac{2}{N}, \qquad \left\langle \bigotimes_{l=1, l \neq i}^{N-1} Z_l^{(+)} \otimes B_{i,N}^{(+)} \right\rangle = \frac{4\sqrt{2}}{N}, \qquad (D.4) $$

with $i = 1, \dots, N-1$, where, as before, $B_{i,N}^{(+)}$ is the Bell operator between the parties $i$ and $N$ corresponding to the CHSH Bell inequality

$$ B_{i,N}^{(+)} = Z_i \otimes D_N + Z_i \otimes E_N + X_i \otimes D_N - X_i \otimes E_N. \qquad (D.5) $$

Moreover, we assume that

$$ \langle Z_i^{(-)} \rangle = \frac{1}{N}, \qquad \left\langle \bigotimes_{l=1, l \neq i}^{N-1} Z_i^{(+)} \otimes Z_i^{(-)} \right\rangle = \frac{1}{N} \qquad (D.6) $$

with $i = 1, \dots, N-1$. Then, for the isometry $\Phi_N$ one has

$$ \Phi_N(|\psi\rangle |0\rangle^{\otimes N}) = |\text{aux}\rangle |xW_N\rangle. \qquad (D.7) $$

**Proof.** Denoting $Z_N = (D_N + E_N)/\sqrt{2}$ and $X_N = (D_N - E_N)/\sqrt{2}$, the action of the isometry can be explicitly written as

$$ \Phi_N(|\psi\rangle |0\rangle^{\otimes N}) = \sum_{\tau \in \{0,1\}^N} X_1^{\tau_1} \dots X_N^{\tau_N} Z_1^{(\tau_1)} \dots Z_N^{(\tau_N)} |\psi\rangle |\tau_1 \dots \tau_N\rangle, \qquad (D.8) $$

where $\tau = (\tau_1, \dots, \tau_N)$ with each $\tau_i \in \{0, 1\}$ and $Z_i^{(\tau_i)} = [1 + (-1)^i Z_i]/2$.
It should be noticed that in general the operators $Z_N$ and $D_N$ might not be unitary, and one should consider $\tilde{X}_N$ and $\tilde{Z}_N$, which by constructions are unitary. However, as already explained in appendix A, their action on $|\psi\rangle$ is the same as the action of $X_N$ and $Z_N$, thus, for simplicity, we use these operators.

The first bunch of conditions (D.4) implies that the norm of

$$|\psi_i\rangle = Z_1^{(+)} \dots Z_{i-1}^{(+)} Z_{i+1}^{(+)} \dots Z_{N-1}^{(+)} |\psi\rangle \qquad (D.9)$$

is $\sqrt{2/N}$, which together with the second set of conditions in (D.4) implies that the normalised states $|\tilde{\psi}_i\rangle = \sqrt{N/2} |\psi_i\rangle$ violate maximally the CHSH Bell inequality between the parties i and N for $i = 1, \dots, N - 1$. This, by virtue of what was said in lemma 1, yields the following identities

$$(Z_i - Z_N)|\tilde{\psi}_i\rangle = 0 \qquad (D.10)$$

$$[X_i(I + Z_N) - X_N(I - Z_i)]|\tilde{\psi}_i\rangle = 0 \qquad (D.11)$$

$$\{Z_i, X_i\}|\tilde{\psi}_i\rangle = 0. \qquad (D.12)$$

They immediately imply that all terms in (D.8) for which one element of $\tau$ equals one and the rest equal zero vanish. To see it explicitly, let $\tau_i = 1$ and $\tau_j = 0$ for $j \neq i$. Then, for this $\tau$, $|\psi_\tau\rangle = X_i Z_i^{(-)} Z_N^{(+)} |\psi_i\rangle$. Applying (D.10) to the latter and exploiting the fact that $Z_i^{(-)} Z_i^{(+)} = 0$, one finally finds that $|\psi_\tau\rangle = 0$.

Let us now consider those components of (D.8) for which $\tau$ obeys $\tau_i = \tau_N = 1$ with $i = 1, \dots, N - 1$ and $\tau_j = 0$ with $j \neq i$, $N$. Then, the following chain of equalities holds

$$\begin{aligned} Z_1^{(+)} \dots Z_{i-1}^{(+)} X_i Z_i^{(-)} Z_{i+1}^{(+)} \dots Z_{N-1}^{(+)} X_N Z_N^{(-)} |\psi\rangle &= X_i Z_i^{(-)} X_N Z_N^{(-)} |\psi_i\rangle \\ &= X_i Z_i^{(-)} X_N Z_i^{(-)} |\psi_i\rangle \\ &= X_i Z_i^{(-)} X_i Z_N^{(+)} |\psi_i\rangle \\ &= Z_i^{(+)} Z_N^{(+)} |\psi_i\rangle \\ &= Z_1^{(+)} \dots Z_N^{(+)} |\psi\rangle, \end{aligned} \qquad (D.13)$$

where the second equality stems from (D.10), the third from (D.11), and, finally, the fourth equality is a consequence of the anticommutation relation (D.12) and the fact that $X_i^2 = 1$.

With all this in mind it is possible to group the terms in (D.8) in the following way

$$\Phi_N(|\psi\rangle |0\rangle^{\otimes N}) = |\text{aux}\rangle |xW_N\rangle + |\Omega\rangle, \qquad (D.14)$$

where $|\text{aux}\rangle = \sqrt{N} Z_1^{(+)} \dots Z_N^{(+)} |\psi\rangle$ and $|\Omega\rangle$ contains all those terms for which $\tau$ contains more than two ones or exactly two ones but $\tau_N = 0$.

Now, our aim is to prove that $|\Omega\rangle = 0$. To this end we first notice that (D.6) imply the following correlations

$$\langle\psi|Z_i^{(-)}Z_j^{(+)}|\psi\rangle = \frac{1}{N}, \qquad (D.15)$$

where $i \neq j$ and $i, j = 1, \dots, N - 1$. This is a direct consequence of the fact that $Z_i^{(\pm)} \le 1$, which in turn implies that each of correlators in (D.15) is bounded from above by $\langle\psi|Z_i^{(-)}|\psi\rangle$ and from below by $\langle\psi|Z_1^{(+)}\dots Z_{i-1}^{(+)}Z_{i+1}^{(+)}\dots Z_{N-2}^{(+)}Z_{N-1}^{(+)}|\psi\rangle$ and both are assumed to equal $1/N$ (see (D.6)).

The first relation in (D.15) together with (D.6) and the fact that $Z_j^{(+)} + Z_j^{(-)} = 1$ yields $\langle\psi|Z_i^{(-)}Z_j^{(-)}|\psi\rangle = 0$. This, due to the fact that $Z_i^{(-)}Z_j^{(-)}$ is a projector, allows one to write

$$Z_i^{(-)} Z_j^{(-)} |\psi\rangle = 0 \qquad (D.16)$$

for $i, j = 1, \dots, N - 1$. This is enough to conclude that $|\Omega\rangle = 0$, which when plugged into (D.3), leads directly to (F.6) because each component in $|\Omega\rangle$ has either three $\tau_i$ which equal 1, or two $\tau_i$ that equal one but then $\tau_N = 0$.

Since the self-test relies on the maximal violation of the CHSH Bell inequality by a set of states $|\tilde{\psi}_i\rangle$ ($i = 1, \dots, N - 1$), it also inherits self-testing of the optimal CHSH measurements, meaning that

$$\begin{aligned} \Phi_N(Z_i|\psi\rangle |0\rangle^{\otimes N}) &= |\text{aux}\rangle \otimes \sigma_z^{(i)} |xW_N\rangle, \\ \Phi_N(X_i|\psi\rangle |0\rangle^{\otimes N}) &= |\text{aux}\rangle \otimes \sigma_x^{(i)} |xW_N\rangle \end{aligned} \qquad (D.17)$$

for $i = 1, \dots, N - 1$, and

$$\begin{aligned} \Phi_N(D_N|\psi\rangle |0\rangle^{\otimes N}) &= |\text{aux}\rangle \otimes \frac{\sigma_z^{(i)} + \sigma_x^{(i)}}{\sqrt{2}} |xW_N\rangle, \\ \Phi_N(E_N|\psi\rangle |0\rangle^{\otimes N}) &= |\text{aux}\rangle \otimes \frac{\sigma_z^{(i)} - \sigma_x^{(i)}}{\sqrt{2}} |xW_N\rangle. \end{aligned} \qquad (D.18)$$

This completes the proof. □
It should be noticed that our self-test of the W state exploits two observables per site and, as in the case of the partially entangled GHZ state, the number of correlators one needs to determine is 2N, and thus scales linearly with N.

## Appendix E. Complete self-test of all the symmetric Dicke state

Here we show that the above self-test of the N-partite W state can be used to construct a self-test of all the Dicke states. Let us recall that Dicke states can be written in the following way

$$|D_N^m\rangle = \left(\binom{N}{m}\right)^{-1/2} \sum_i P_i (|0\rangle^{\otimes N-m} |1\rangle^{\otimes m}), \qquad (E.1)$$

where the sum is over all permutation of an N-element set and m = 0, ..., N (there is N + 1 such states). Let us notice that a Dicke state with m ⩽ [N/2] is unitarily equivalent to a Dicke state with m ⩾ [N/2], i.e., |D_N^m\rangle = σ_z^{\otimes N} |D_N^{N-m}\rangle for m = 0, ..., [N/2]. For this reason below we consider the Dicke states with m ⩾ [N/2].

Interestingly, to self-test Dicke states we can exploit the previously demonstrated self-test of the W state. This follows from the fact that any Dicke state can be written as

$$|D_N^m\rangle = \frac{1}{\sqrt{N}} (\sqrt{N-m} |0\rangle |D_{N-1}^m\rangle + \sqrt{m} |1\rangle |D_{N-1}^{m-1}\rangle) \qquad (E.2)$$

which, after recursive application, allows one to express |D_N^m\rangle in terms of the Dicke states of smaller number of particles

$$|D_N^m\rangle = \sum_{i_1, \dots, i_{N-m-1}=0}^{1} \frac{\binom{m+1}{m-\Sigma}^{\frac{1}{2}}}{\binom{N}{m}^{\frac{1}{2}}} |i_1, \dots, i_{N-m-1}\rangle |D_{m+1}^{m-\Sigma}\rangle, \qquad (E.3)$$

where Σ = i₁ + ... + iN-m-1. Due to the fact that |D_N^m\rangle is symmetric, the above decomposition holds true for any choice of N - m - 1 parties in the first ket in (E.3).

Having settled some basic information about the symmetric Dicke states, we can now move on to demonstrating how they can be self-tested. To facilitate our considerations we show how to self-test the following unitarity equivalent state

$$\begin{aligned} |xD_N^m\rangle &= \sigma_z^{(N)} |xD_N^m\rangle \\ &= \sum_{i_1, \dots, i_{N-m-1}=0}^{1} \frac{\binom{m+1}{m-\Sigma}^{\frac{1}{2}}}{\binom{N}{m}^{\frac{1}{2}}} |i_1, \dots, i_{N-m-1}\rangle |xD_{m+1}^{m-\Sigma}\rangle. \end{aligned} \qquad (E.4)$$

We then notice that the state corresponding to i₁ = ... = iN-m-1 = 0 is exactly |xD_{m+1}^m\rangle = σ_x^{\otimes (m+1)} |xW_{m+1}\rangle with |xW_{m+1}\rangle defined in (D.1)). Moreover, since |xD_N^m\rangle is symmetric on the first N - 1 parties, the state σ_x^{\otimes (m+1)} |xW_{m+1}\rangle will appear in any decomposition of the form (E.4) in which any choice of N - m - 1 parties from the first N - 1 ones are in state |0\rangle. Importantly, we already know how to self-test the W state σ_x^{\otimes (m+1)} |xW_{m+1}\rangle. However, due to the transformation σ_x^{\otimes (m+1)} we have to modify the conditions specified in theorem 5 in the following way:

$$\begin{aligned} Z_i^{(+)} &\leftrightarrow Z_i^{(-)} \quad (i = 1, \dots, N-1), \\ D_N &\rightarrow -E_N \quad \text{and} \quad E_N \rightarrow -D_N. \end{aligned} \qquad (E.5)$$

Now, to self-test a Dicke state |D_N^m\rangle for any m ⩾ [N/2] we can proceed in the following way:

(i) Project any (N - m - 1)-element subset S_i of the first N - 1 parties of |ψ⟩ (there are (N - 1) / (N - 1 - m) such subsets) onto ⊗_{j∈S_i} Z_j^{(+)} and check whether the state corresponding to the remaining parties satisfies the conditions for |xD_{m+1}^m\rangle = σ_x^{\otimes (m+1)} |xW_{m+1}\rangle.

(ii) For every sequence τ = (τ₁, ..., τ_N) consisting of m + 1 ones on the first N - 1 positions, check that the state |ψ⟩ obeys the following correlations

$$\langle \psi | Z_1^{(\tau_1)} \otimes \dots \otimes Z_N^{(\tau_N)} | \psi \rangle = 0, \qquad (E.6)$$

where Z_i^{(τ_i)} = [1 + (-1)^{\pi_i} Z_i] / 2
Let us now see in more details how the above procedure allows one to self-test $|D_N^m\rangle$. It is not difficult to see that the first condition leads us to the following decomposition

$$ \Phi_N(|\psi\rangle |0\rangle^{\otimes N}) = \left[ \bigotimes_{l \in S_i} Z_l^{(+)} |\phi_i\rangle \right] \otimes [ |0\rangle_{S_i}^{\otimes (N-m-1)} |xD_{m+1}^m\rangle ] + |\Phi_i\rangle \quad (E.7) $$

for any $i = 1, ..., \binom{N-1}{N-1-m}$, where all $S_i$ stand for different $(N-m-1)$-element subsets of the $(N-1)$-element set $\{1, ..., N-1\}$, and $|\phi_i\rangle$ is defined as

$$ |\phi_i\rangle = \bigotimes_{l \in \{1, ..., N\} \setminus S_i} X_l Z_l^{(-)} |\psi\rangle. \quad (E.8) $$

In other words, to construct $|\phi_i\rangle$ from $|\psi\rangle$ one has to act on the latter with $X_l Z_l^{(-)}$ on all parties who do not belong to $S_i$. Finally, $|\Phi_i\rangle$ is some state from the global Hilbert space collecting the remaining terms.

Let us now show that all the states

$$ |\tilde{\phi}_i\rangle = \bigotimes_{l \in S_i} Z_l^{(+)} |\phi_i\rangle \quad (E.9) $$

are the same. To this end, we will exploit the conditions D.10–D.12, which are clearly preserved under the transformation (E.5)

$$ (X_i - X_N)|\psi\rangle = |\psi\rangle \quad (E.10) $$

for any $i = 1, ..., N-1$. Consider two vectors $|\tilde{\phi}_i\rangle$ and $|\tilde{\phi}_j\rangle$ such that the corresponding sets $S_i$ and $S_j$ share $N-m-2$ elements (remember that these sets are equinumerous). Let $q$ and $p$ be the two elements by which these sets differ, i.e., $p \in S_i$ ($q \in S_j$) and $p \notin S_j$ ($q \notin S_i$). Then, using the condition (D.12) we turn the operator $X_t Z_t^{(-)}$ into $Z_t^{(+)} X_t$ at positions $t = q$ and $t = N$ for the state $|\tilde{\phi}_i\rangle$, and, analogously, at positions $t = p$ and $t = N$ for the state $|\tilde{\phi}_j\rangle$. We utilise the fact that $X_i X_N |\psi\rangle = |\psi\rangle$ for all $i = 1, ..., N-1$ stemming from (E.10), which shows that $|\tilde{\phi}_i\rangle = |\tilde{\phi}_j\rangle$. Finally, repeating this procedure for all pairs of states for which the corresponding sets $S_i$ differ by two elements, one finds that $|\tilde{\phi}_i\rangle \equiv |\phi\rangle$ for all $i$.

As a result, the state (E.7) simplifies to

$$ \Phi_N(|\psi\rangle |0\rangle^{\otimes N}) = |\phi\rangle |xD_N^m\rangle + |\Phi\rangle, \quad (E.11) $$

$|\Phi\rangle$ is a vector from the global Hilbert space defined as

$$ |\Phi\rangle = \sum_{\tau} (X_1^{\tau_1} Z_1^{(\tau_1)} \otimes \dots \otimes X_N^{\tau_N} Z_N^{(\tau_N)} |\psi\rangle) \otimes |\tau\rangle, \quad (E.12) $$

where the summation is over all sequences $\tau = (\tau_1, ..., \tau_N)$ that contain less than $N-m-1$ zeros (or, equivalently, more than $m$ ones) on the first $N-1$ positions.

Now, to prove that $|\Phi\rangle = 0$ it suffices to exploit the second step in the above procedure. That is, the condition (E.6) is equivalent to

$$ Z_1^{(\tau_1)} \otimes \dots \otimes Z_N^{(\tau_N)} |\psi\rangle = 0 \quad (E.13) $$

for every sequence $(\tau_1, ..., \tau_N)$ consisting of $m+1$ ones at the first $N-1$ positions. Then, every component of the vector in (E.12) contains a sequence of at least $m+1$ $Z_t^{(-)}$ operators, which by virtue of (E.13) implies that $|\Phi\rangle = 0$. This completes the proof.

For the self-testing of measurements the same argumentation as in the case of W-state self-test applies:

$$ \Phi(Z_i |\psi\rangle |0 \dots 0\rangle) = |\phi\rangle \otimes \sigma_z^{(i)} |xD_N^m\rangle \quad (i = 1, \dots, N-1), $$

$$ \Phi(X_i |\psi\rangle |0 \dots 0\rangle) = |\phi\rangle \otimes \sigma_x^{(i)} |xD_N^m\rangle \quad (i = 1, \dots, N-1), $$

$$ \Phi(Z_N |\psi\rangle |0 \dots 0\rangle) = |\phi\rangle \otimes \left( \frac{\sigma_z^{(N)} + \sigma_x^{(N)}}{\sqrt{2}} \right) |xD_N^m\rangle, $$

$$ \Phi(X_N |\psi\rangle |0 \dots 0\rangle) = |\phi\rangle \otimes \left( \frac{\sigma_z^{(N)} - \sigma_x^{(N)}}{\sqrt{2}} \right) |xD_N^m\rangle. $$

Analogously to the N-partite W state the total amount of correlators necessary for self-testing of any Dicke state scales linearly with N. This is because one essentially needs to obtain the same correlators as for the W state.

## Appendix F. Self-testing the graph states

In this section we provide the detailed proof of the self-test of graph states, stated in theorem 4.
Before proving the theorem we need to make some introductory remarks. Let $|\psi_G\rangle$ be an N-qubit graph state that corresponds to a graph $G = \{V, E\}$, where $V = \{1, ..., N\}$ and $E$ stand for the sets of vertices and edges, respectively. Recall that any graph state can be written in the following form

$$|\psi_G\rangle = \frac{1}{\sqrt{2^N}} \sum_{i \in \{0,1\}^N} (-1)^{\mu(i)} |i\rangle, \qquad (F.1)$$

where the summation is over all sequences $i = (i_1, ..., i_N)$ with $i_j = 0, 1$, and $\mu(i)$ is the number of edges connecting qubits being in the state $|1\rangle$ in ket $|i\rangle$ (without counting the same edge twice).

Let then $\nu_i$ be the set of neighbours of the $i$th qubit, that is, all those qubits that are connected with $i$ by an edge, while by $|\nu_i|$ we denote the number of elements in $\nu_i$. Likewise, we denote by $\nu_{i,j}$ the set of neighbours of a pair of qubits $i$ and $j$, i.e., all those qubits that are connected to either $i$ or $j$ (notice that $\nu_{i,j} = \nu_{j,i}$), and $|\nu_{i,j}|$ the number of elements of $\nu_{i,j}$. We also assume that the parties are labelled in such a way that qubits $N-1$ and $N$ are connected and the party $N$ has the smallest number of neighbours, i.e., $|\nu_N| \le |\nu_i|$ for all $i$.

The main property of the graph states underlying our simple self-test is that by measuring all the neighbours of a pair of connected qubits $i, j$ in the $\sigma_z$ basis, the two qubits $i$ and $j$ are left in one of the Bell states (see propositions 1 in [34]):

$$\frac{1}{\sqrt{2}}(\sigma_z^{m_i} \otimes \sigma_z^{m_j})(|0+\rangle + |1-\rangle), \qquad (F.2)$$

where $m_i(m_j)$ is the number of parties from set $\nu_{i,j} \setminus \{j\}$ ($\nu_{i,j} \setminus \{i\}$) whose result of a measurement in $\sigma_z$ basis was $-1$, and where we have neglected an unimportant $-1$ factor that might appear.

We are now ready to prove the main theorem. Let us denote $Z_{\nu_{i,j}}^{(\tau)} = \otimes_{l \in \nu_{i,j}} Z_l^{(\tau)}$, where $\tau$ is an $|\nu_{i,j}|$-element sequence with each $\tau_i \in \{+, -\}$ (the operator $Z_{\nu_{i,j}}^{(\tau)}$ acts only on the parties belonging to $\nu_{i,j}$).

**Theorem 6.** Let $|\psi\rangle$ and measurements $Z_i, X_i$ with $i = 1, ..., N-1$ and $Z_N, D_N, E_N, Z_N \equiv \frac{D_N - E_N}{\sqrt{2}}, N \equiv \frac{D_N + E_N}{\sqrt{2}}$ satisfy the following conditions

$$\langle Z_{\nu_{N-1,N}}^{(\tau)} \rangle = \frac{1}{2^{|\nu_{N-1,N}|}}, \qquad \langle Z_{\nu_{N-1,N}}^{(\tau)} \otimes B_{N-1,N}^{(m_{N-1}, m_N)} \rangle = \frac{2\sqrt{2}}{2^{|\nu_{N-1,N}|}} \qquad (F.3)$$

for every choice of the $|\nu_{i,j}|$-element sequence $\tau$. The Bell operators $B_{N-1,N}^{(m_{N-1}, m_N)}$ are defined as

$$B_{N-1,N}^{(m_{N-1}, m_N)} = (-1)^{m_N} X_{N-1} \otimes (D_N + E_N) + (-1)^{m_{N-1}} Z_{N-1} \otimes (D_N - E_N), \qquad (F.4)$$

where $m_{N-1}$ and $m_N$ are the numbers of neighbours of the qubits, respectively, $N-1$ and $N$ (excluding the $N$th qubit and $N-1$th qubit, respectively) which are projected onto the eigenvector of $Z_i^-$. We then assume that

$$\langle Z_{\nu_{i,j}}^{(\tau)} \rangle = \frac{1}{2^{|\nu_{i,j}|}}, \qquad \langle Z_{\nu_{i,j}}^{(\tau)} \otimes Z_i \otimes X_j \rangle = \frac{(-1)^{m_j}}{2^{|\nu_{i,j}|}} \qquad (F.5)$$

for all connected pairs of indices $i \neq j$ except for $\neq (N, N-1)$. As before, $Z_{\nu_{i,j}}^{(\tau)} = \otimes_{l \in \nu_{i,j}} Z_l^{(\tau)}$. Then, for the isometry $\Phi_N$ one has

$$\Phi_N(|\psi\rangle |0\rangle^{\otimes N}) = |\text{aux}\rangle |\psi_G\rangle. \qquad (F.6)$$

**Proof.** The conditions in (F.3) imply that the normalised state

$$|\tilde{\psi}_{N-1,N}^{(\tau)}\rangle = \sqrt{2^{|\nu_{N-1,N}|}} Z_{\nu_{N-1,N}}^{(\tau)} |\psi\rangle \qquad (F.7)$$

violates maximally the CHSH Bell inequality, which in turn implies that

$$\{X_{N-1}, Z_{N-1}\} |\tilde{\psi}_{N-1,N}^{(\tau)}\rangle = 0 \quad \text{and} \quad \{X_N, Z_N\} |\tilde{\psi}_{N-1,N}^{(\tau)}\rangle = 0, \qquad (F.8)$$

where $X_N = (D_N + E_N)/\sqrt{2}$ and $Z_N = (D_N - E_N)/\sqrt{2}$. These identities hold true for any of $2^{|\nu_{i,j}|}$ projected states $|\tilde{\psi}_{N-1,N}^{(\tau)}\rangle$, and therefore it must also hold for the initial state $|\psi\rangle$, i.e.

$$\{X_{N-1}, Z_{N-1}\} |\psi\rangle = 0 \quad \text{and} \quad \{X_N, Z_N\} |\psi\rangle = 0. \qquad (F.9)$$

This is because one can always decompose $|\psi\rangle$ in the eigenbasis of the operator $Z_{\nu_{N-1,N}}$ which is a tensor product of $Z$ operators acting on the neighbours of $i, j$.

Then, let us focus on the second bunch of conditions (F.5). They imply that the length of the projected vectors $|\psi_{i,j}^{(\tau)}\rangle = Z_{\nu_{i,j}}^{(\tau)}|\psi\rangle$ is $1/\sqrt{2^{|\nu_{i,j}|}}$, so is the norm of $Z_i|\psi_{i,j}^{(\tau)}\rangle$ and $X_j|\psi_{i,j}^{(\tau)}\rangle$ for any connected pair $i \neq j$. This together with (F.5) mean that the vectors $Z_i|\psi_{i,j}^{(\tau)}\rangle$ and $X_j|\psi_{i,j}^{(\tau)}\rangle$ are parallel or antiparallel, or, more precisely, that

$$(-1)^{m_i} Z_i |\psi_{i,j}^{(\tau)}\rangle = X_j |\psi_{i,j}^{(\tau)}\rangle \qquad (F.10)$$

for any connected pair of parties $i \neq j$.
Let us now consider one of the parties connected to the party $N-1$ (there must be at least one such party as otherwise the $N$th one would not be the one with the smallest number of neighbours or the graph would be bipartite). We label this vertex by $N-2$. It then follows from conditions (F.10) that for the particular pair of vertices $N-2, N-1$, one has the following identities

$$X_{N-2} |\psi_{N-2,N-1}^{(\tau)}\rangle = (-1)^{m_{N-2}} Z_{N-1} |\psi_{N-2,N-1}^{(\tau)}\rangle \qquad (F.11)$$

and

$$Z_{N-2} |\psi_{N-2,N-1}^{(\tau)}\rangle = (-1)^{m_{N-1}} X_{N-1} |\psi_{N-2,N-1}^{(\tau)}\rangle \qquad (F.12)$$

hold true for all configurations of $\tau$. With their aid the following sequence of equalities

$$\begin{aligned}
X_{N-2} Z_{N-2} |\psi_{N-2,N-1}^{(\tau)}\rangle &= (-1)^{m_{N-1}} X_{N-2} X_{N-1} |\psi_{N-2,N-1}^{(\tau)}\rangle \\
&= (-1)^{m_{N-1}+m_{N-2}} X_{N-1} Z_{N-1} |\psi_{N-2,N-1}^{(\tau)}\rangle \\
&= -(-1)^{m_{N-1}+m_{N-2}} Z_{N-1} X_{N-1} |\psi_{N-2,N-1}^{(\tau)}\rangle \\
&= -(-1)^{m_{N-2}} Z_{N-1} Z_{N-2} |\psi_{N-2,N-1}^{(\tau)}\rangle \\
&= -Z_{N-2} X_{N-2} |\psi_{N-2,N-1}^{(\tau)}\rangle
\end{aligned} \qquad (F.13)$$

holds true for any choice of $\tau$, where first and the second equality stems from (F.12) and (F.11), respectively, the third one is a consequence of the anticommutativity of $X_{N-1}$ and $Z_{N-1}$. Finally, the fourth and the fifth equality follows again from (F.12) and (F.11), respectively.

Since the identity (F.13) is obeyed for any configuration of $\tau$, it must also hold for the state $|\psi\rangle$, that is, $\{X_{N-2}, Z_{N-2}\} |\psi\rangle = 0$. Taking into account the conditions (F.3), this procedure can be recursively applied to any pair of connected particles, yielding (together with (F.9))

$$\{X_i, Z_i\} |\psi\rangle = 0 \qquad (F.14)$$

for any $i = 1, \dots, N$.

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

The action of the isometry is given by

$$\Phi_N(|\psi\rangle |0\rangle^{\otimes N}) = \sum_{i_1, \dots, i_N=0}^{1} X_1^{i_1} \dots X_N^{i_N} Z_1^{(i_1)} \dots Z_N^{(i_N)} |\psi\rangle |i_1 \dots i_N\rangle. \qquad (F.15)$$

Let us now consider a particular term in the above decomposition in which the sequence $i_1, \dots, i_N$ has $k > 0$ ones at positions $j_1, \dots, j_k$, i.e.

$$X_{j_1}^{i_1} \dots X_{j_k}^{i_k} \bigotimes_{l \in I} Z_l^{(+)} \bigotimes_{l \in I} Z_l^{(-)} |\psi\rangle, \qquad (F.16)$$

where $I = \{j_1, \dots, j_k\}$. By using the previously derived relations, we want to turn this expression into one that is proportional to the auxiliary state $Z_1^{(+)} \otimes \dots \otimes Z_N^{(+)} |\psi\rangle$. To this end, let us first focus on the party $j_k$ and consider one of its neighbours which we denote by $l$. For this pair of parties, the conditions (F.10) imply that

$$X_{j_k} |\psi_{j_k,l}\rangle = (-1)^{m_{j_k}} Z_l |\psi_{j_k,l}\rangle, \qquad (F.17)$$

where, to recall, $m_{j_k}$ is the number of neighbours of $j_k$ being in the state $|1\rangle$ except for $l$. The above identity together with the anticommutativity relation $\{X_{j_k}, Z_{j_k}\} |\psi\rangle = 0$ allow us to replace in (F.16) the operator $X_{j_k}^{i_k} Z_{j_k}^{(-)}$ by $(-1)^{m_{j_k}} Z_{j_k}^{(+)} Z_l$. Now, if the value of $i_l$ in the corresponding ket $|i_1, \dots, i_N\rangle$ is zero, the last operator $Z_l$ can be simply absorbed by $Z_l^{(+)}$, while if $i_l = 1$, one uses that fact that $Z_l^{(-)} Z_l = -Z_l^{(-)}$, meaning that one has an additional minus sign. Altogether this turns the operator $X_{j_k}^{i_k} Z_{j_k}^{(-)}$ into $(-1)^{m_{j_k}'} Z_{j_k}^{(+)}$, where $m_{j_k}'$ is the number of neighbours of $j_k$ (including $i_l$) which are in the state $|1\rangle$. Plugging this into (F.16) we can rewrite the latter as

$$(-1)^{m'_{j_k}} X_{j_1}^{i_1} \dots X_{j_{k-1}}^{i_{k-1}} \bigotimes_{l \in I'} Z_l^{(+)} \bigotimes_{l \in I'} Z_l^{(-)} |\psi\rangle, \qquad (F.18)$$

where now $I' = I \setminus \{i_l\}$, and so we have lowered the number of elements of $I$ by one. It should be stressed that this affects the numbers of neighbours of those parties that are still in $I'$, which will be of importance for what follows.

Now, we can apply recursively the same reasoning to the remaining elements of $I'$, keeping in mind that at each step one element is removed from $I'$. We thus arrive at

$$(-1)^{\mu'(i)} Z_1^{(+)} \otimes \dots \otimes Z_N^{(+)} |\psi\rangle, \qquad (F.19)$$
with $\mu'$ defined as

$$ \mu'(\mathbf{i}) = \sum_{l=1}^{k} m_{j_l}^{>}, \qquad (F.20) $$

where $m_{j_l}^>$ is the number of neighbours of $i_{j_l}$ being in the state $|1\rangle$ and having smaller indices than $j_b$, or, in other words, those elements of $I = \{j_1, \dots, j_k\}$ smaller than $j_l$ that are neighbours of $i_{j_l}$. One immediately notices that $\mu'(\mathbf{i})$ equals $\mu(\mathbf{i})$ for a given $\mathbf{i}$, and therefore by applying the above reasoning to every term in (F.15), one arrives at

$$ \Phi_N(|\psi\rangle |0\rangle^{\otimes N}) = (Z_1^{(+)} \otimes \dots \otimes Z_N^{(+)} |\psi\rangle) \otimes \sum_i (-1)^{\mu(i)} |\mathbf{i}\rangle, \qquad (F.21) $$

which after normalising both terms can be written as

$$ \Phi_N(|\psi\rangle |0\rangle^{\otimes N}) = |\text{aux}\rangle |\psi_G\rangle \qquad (F.22) $$

with $|\text{aux}\rangle = (1/\sqrt{2^N})(Z_1^{(+)} \otimes \dots \otimes Z_N^{(+)}|\psi\rangle)$.

Once relation (F.14) is satisfied for all $i$ the proof for measurement self-testing goes along the same lines as the proof for the self-testing of the state. Let us check how isometry $\Phi_n$ acts on the state $X_{\tilde{i}}|\psi\rangle$. Equation (F.18) takes the form:

$$ \begin{aligned} \Phi_N(X_{\tilde{i}}|\psi\rangle |0\rangle^{\otimes N}) &= \sum_{l,l'} (-1)^{m'_{j_l} + m'_{j_{l'}}} X_{j_l}^{i_{j_l}} \dots X_{j_{k-1}}^{i_{k-1}} \bigotimes_{l \neq l'} Z_l^{(+)} \bigotimes_{l \in I'} Z_l^{(-)} X_{\tilde{i}}|\psi\rangle \\ &= \sum_{I \oplus \tilde{i}, l} (-1)^{m'_{j_l} + 1} X_{j_l}^{i_{j_l}} \dots X_{j_{k-1}}^{i_{k-1}} \bigotimes_{l \neq l'} Z_l^{(+)} \bigotimes_{l \in I'} Z_l^{(-)} |\psi\rangle \\ &= (Z_1^{(+)} \otimes \dots \otimes Z_N^{(+)}|\psi\rangle) \otimes \sum_i (-1)^{\mu(i \oplus \tilde{i})} |\mathbf{i}\rangle \\ &= |\text{aux}\rangle \otimes \sigma_x^{(\tilde{i})} |\psi_G\rangle, \quad \forall \tilde{i} \in \{1, 2, \dots, N-1\}, \end{aligned} $$

where $I \oplus \tilde{i}$ is equal to $I/\tilde{i}$ if $\tilde{i} \in I$ and to $I \cup \tilde{i}$ otherwise, and $\mu(\mathbf{i} \oplus \tilde{i})$ is the number of edges connecting qubits being in the state $|1\rangle$ in ket $|\mathbf{i} \oplus (0 \dots 0\tilde{i} 0 \dots 0)\rangle$ (without counting the same edge twice). Similarly it can be shown that

$$ \begin{aligned} \Phi_N(Z_{\tilde{i}} |\psi\rangle |0\rangle^{\otimes N}) &= |\text{aux}\rangle \otimes \sigma_z^{(\tilde{i})} |\psi_G\rangle, \quad \forall \tilde{i} \in \{1, 2, \dots, N\}, \\ \Phi_N(D_N |\psi\rangle |0\rangle^{\otimes N}) &= |\text{aux}\rangle \otimes \left( \frac{\sigma_x^{(N)} + \sigma_z^{(N)}}{\sqrt{2}} \right) |\psi_G\rangle, \\ \Phi_N(E_N |\psi\rangle |0\rangle^{\otimes N}) &= |\text{aux}\rangle \otimes \left( \frac{-\sigma_x^{(N)} + \sigma_z^{(N)}}{\sqrt{2}} \right) |\psi_G\rangle. \end{aligned} $$

Finally, for self-testing graph-states one has to measure $3 + |E|$ correlators, where $|E|$ is the total number of edges, which even for the fully connected graph is strictly better scaling than the complexity of quantum state tomography.

## ORCID iDs

I Šupić https://orcid.org/0000-0002-0361-6631

## References

[1] Aaronson S 2010 Proc. 42nd ACM Symp. on Theory of Computing, STOC vol 10 (New York) pp 141–50

[2] Barz S, Kashefi E, Broadbent A, Fitzsimons J F, Zeilinger A and Walther P 2012 Science 335 303

[3] Aolita L, Gogolin C, Kliesch M and Eisert J 2015 Nat. Commun. 6 8498

[4] Reichardt B W, Unger F and Vazirani U 2013 Nature 496 456–60

[5] Nielsen M and Chuang I 2000 Quantum Computation and Quantum Information (Cambridge: Cambridge University Press)

[6] Mayers D and Yao A 2004 Quantum Inf. Comput. 4 273

[7] Bell J S 1964 Physics 1 195

[8] McKague M, Yang T Y and Scarani V 2014 J. Phys. A: Math. Theor. 45 455304

[9] Wang Y, Wu X and Scarani V 2016 New J. Phys. 18 025021

[10] Bamps C and Pironio S 2015 Phys. Rev. A 91 052111

[11] Šupić I, Augusiak R, Salavrakos A and Acín A 2016 New J. Phys. 18 035013

[12] Kaniewski J 2017 Phys. Rev. A 95 062323

[13] Yang T H, Vértesi T, Bancal J D, Scarani V and Navascués M 2014 Phys. Rev. Lett. 113 040401

[14] Kaniewski J 2016 Phys. Rev. Lett. 117 070402

[15] Coladangelo A, Goh K T and Scarani V 2017 Nat. Commun. 8 15485

[16] Vazirani U and Vidick T 2014 Phys. Rev. Lett. 113 140501
[17] Miller C A and Shi Y 2016 *J. ACM* **63** 33

[18] Coladangelo A, Grilo A, Jeffery S and Vidick T 2017 *arXiv:1708.07359*

[19] McKague M 2013 *Theory Comp.* **12** 3

[20] Gheorghiu A, Wallden P and Kashefi E 2017 *New J. Phys.* **19** 023043

[21] Wu X, Cai Y, Yang T H, Le H N, Bancal J D and Scarani V 2014 *Phys. Rev. A* **90** 042339

[22] Pál K F, Vértesi T and Navascués M 2014 *Phys. Rev. A* **90** 042340

[23] McKague M 2014 *Theory of Quantum Computation, Communication, and Cryptography* (Lecture Notes in Computer Science vol 6745) ed D Bacon (Berlin: Springer) pp 104–20

[24] Acín A, Brunner N, Gisin N, Massar S, Pironio S and Scarani V 2007 *Phys. Rev. Lett.* **98** 230501
Barrett J, Hardy L and Kent A 2005 *Phys. Rev. Lett.* **95** 010503
Colbeck R 2006 *PhD Thesis* University of Cambridge

[25] Sikora J, Varvitsiotis A and Wei Z 2016 *Phys. Rev. Lett.* **117** 060401

[26] Clauser J F, Horne M A, Shimony A and Holt R A 1969 *Phys. Rev. Lett.* **23** 880

[27] Peres A 1995 *Phys. Lett. A* **202** 16–7

[28] Thapliyal A V 1999 *Phys. Rev. A* **59** 3336

[29] Yang T H and Navascués M 2013 *Phys. Rev. A* **87** 050102(R)

[30] Prevedel R, Cronenberg G, Tame M S, Paternostro M, Walther P, Kim M S and Zeilinger A 2009 *Phys. Rev. Lett.* **103** 020503

[31] Krischek R, Schwemmer C, Wieczorek W, Weinfurter H, Hyllus P, Pezze L and Smerzi A 2011 *Phys. Rev. Lett.* **107** 080504

[32] Chiuri A, Greganti C, Paternostro M, Vallone G and Mataloni P 2012 *Phys. Rev. Lett.* **109** 173604

[33] Hein M, Dür W, Eisert J, Raussendorf R, van den Nest M and Briegel H J 2006 *Proc. Int. School of Physics 'Enrico Fermi' on Quantum Computers, Algorithms and Chaos*

[34] Hein M, Eisert J and Briegel H J 2004 *Phys. Rev. A* **69** 062311

[35] Wu X 2016 *PhD Thesis* Center for Quantum Technologies, Singapur

[36] Fadel M 2017 *arXiv:1707.01215*