Self-testing and certification using trusted quantum inputs

Device-independent certification of quantum devices is of crucial importance for the development of secure quantum information protocols. So far, the most studied scenario corresponds to a system consisting of different non-characterized devices that observers probe with classical inputs to obtain classical outputs. The certification of relevant quantum properties follows from the observation of correlations between these events that do not have a classical counterpart. In the fully device-independent scenario no assumptions are made on the devices and therefore their non-classicality follows from Bell non-locality. There exist other scenarios, known as semi-device-independent, in which assumptions are made on the devices, such as their dimension, and non-classicality is associated to the observation of other types of correlations with no classical analogue. More recently, the use of trusted quantum inputs for certification has been introduced. The goal of this work is to study the power of this formalism and describe self-testing protocols in various settings using trusted quantum inputs. We also relate these different types of self-testing to some of the most basic quantum information protocols, such as quantum teleportation. Finally, we apply our findings to quantum networks and provide methods for estimating the quality of the whole network, as well as of parts of it.


I. INTRODUCTION
Quantum entanglement is at the heart of many quantum information protocols [HHHH09], such as quantum state teleportation [BBC + 93], and utilised in quantum repeaters [BDCZ98], which are fundamental for long-distance quantum communication.Entanglement can also result in Bell nonlocality through the correlations between measurements performed by distant parties, manifested as violations of Bell inequalities [Bel64, BCP + 14].Now this form of nonlocality can be a resource for tasks such as quantum key distribution [Eke91, BHK05, ABG + 07], certifiable randomness expansion [PAM + 10, Col06, AM16], delegated quantum computation [RUV13], communication complexity [BCMdW10] and measurement-based quantum computation [AB09,HB11].
Besides being an information theoretic resource on their own, Bell inequality violations have the remarkable property of witnessing entanglement without the need to know the underlying physical system.In other words, Bell nonlocality witnesses entanglement in the device-independent paradigm in which devices are not characterized.But Bell inequality violations can certify more than the mere presence of entanglement and, in fact, they are also useful in the context of quantum state certification.In quantum state certification, a device claims to produce systems with particular quantum states, and the goal is to have a task that certifies this claim.The certification task for the source depends very much on the assumptions made in a scenario, such as whether measurement devices can be fully characterised and trusted (device-dependent) or not characterised nor trusted at all (device-independent).When it comes to the certification of a source of entangled particles in a completely * ivan.supic@unige.chdevice-independent manner, certification is based on correlations violating Bell inequalities and is described as self-testing [MY04].This question has gained a lot of attention in recent years [McK14,CGS17,Kan17,ŠCAA18,ŠB19].A notable trait of self-testing is the inability to recover the exact form of the state, and measurements: the best one can hope is to certify them up to operations which leave the observed probability distributions invariant.Local isometries and complex conjugation are examples of such operations.
On the other side, in the device-dependent scenario where measurement devices are perfectly characterized, a lot is known, e.g.see [PLM18,MK18,TM18] for recent progress in the efficient certification of quantum states.In between these two extreme cases one has different relaxations of the device-independent scenario, being sometimes coined as semi-device-independent.This term was originally introduced in [PB11] for the case in which an upper bound on the dimension of the systems is assumed, but we use it here to describe any scenario between the completely device-dependent and device-independent scenarios.For instance, if one assumes a perfect knowledge about one of the two devices, entanglement can be witnessed through correlations displaying Einstein-Podolsky-Rosen (EPR) steering [Sch35,WJD07], which has led to the study of one-sided device-independent quantum information processing [CS17, UCNG19] and quantum certification based on steering [ŠH16,GKW15].Other works have also considered the problem of state certification by assuming a bound on the dimension of the involved quantum systems [TKV + 18, FK19].
While all these different scenarios differ in the assumptions invoked for the certification, they are all based on the statistics describing an input-output process consisting of classical inputs, labelling choices of measurements or states, and outputs, associated to measurement results.Our work goes beyond this framework and study certification protocols in which the in-puts have a quantum nature.In this scenario, each party could individually generate other characterised quantum systems in a trusted way.These characterised quantum systems can then be used as quantum input into an uncharacterised device.This type of certification naturally appears in the context of semiquantum nonlocal games [Bus12] but also in quantum information protocols with no classical analogue such as teleportation [BBC + 93].It is also relevant in the context of deviceindependent quantum certification, as the characterised quantum systems could themselves have been certified separately in a device-independent manner, see for instance [BŠCA18].Our main results consist of different new self-testing protocols using quantum inputs.

II. FRAMEWORKS FOR QUANTUM STATE CERTIFICATION
In this section we identify four basic frameworks for quantum state certification in a bipartite setting, corresponding to four forms of device-independence.Throughout this work, as a simplification, we will assume that in every instance the device produces identical and independently distributed (i.i.d.) copies of the same system.Additionally, in all bipartite scenarios the two parties will be referred to as Alice and Bob.

Device-dependent state certification
The first framework accounts for characterised and trusted measurement devices, which can be applied to systems generated by an untrusted and uncharacterised preparation device.State certification can be achieved by quantum state tomography [PR04]: informationally complete measurements [Pru77] can be made on the i.i.d.copies of the quantum system.The probabilities of obtaining different measurement outcomes are used to determine the state.For example, if the source produces one-qubit states, an example of an informationally complete set of measurements are those projective measurements associated to the three Pauli operators {σ x , σ y , σ z }.The probability to obtain outcome a when measuring x-th measurement on the unknown state is given by where M a|x denotes the measurement element corresponding to the outcome a.The aim of quantum state tomography is to recover the state from a given set {p(a|x), M a|x } a|x .
An analogous procedure can be described to characterise an unknown quantum measurement using a characterised set of quantum states.The set of quantum states is used as a probe and the probabilities of obtaining different measurement outcomes are used to recover the form of the measurement.The set of states sufficient for this process is called a tomographically complete set of states.For a qubit measurement, a tomographically complete set of states are, for example, the eigenstates of the three Pauli operators.
Performing tomography is however not necessary for quantum state certification in the device-dependent setting.For certification we merely wish to prove that a particular state is produced, and thus we only need to establish whether it is that state, or not.A solution to this, for a pure state, is to have a projective measurement with that state as one of its outcomes.For entangled states this might require entangled measurements, but there are other approaches not requiring such complicated measurements [PLM18,TM18].

Self-testing
The device-independent scenario is that which completely lacks a characterisation of the devices.In this case, Alice's and Bob's devices are treated as black boxes with classical inputs and classical outputs.The corresponding certification task is named self-testing [MY04].The aim is to recover the entangled state |ψ only from the probabilities of obtaining different outputs when certain inputs are chosen.Self-testing can only hope to recover a state able to produce a nonlocal probability distribution (see [GKW + 18]), which means that it cannot be performed on single systems.The starting point in every self-testing procedure is the correctness of the Born rule, which allows to calculate the correlation probabilities when unknown measurements M a|x and M b|y are performed on the shared state : Since all one has access to is the probabilities, one cannot differentiate between physical set-ups (involving potentially different states and measurements) that give rise to the same probabilities.For instance, self-testing cannot prove that is exactly equal to |ψ but it may allow one to prove that the two states are related by a suitable local isometry Φ = Φ A ⊗ Φ B : where junk represents the state of the uncorrelated degrees of freedom.

One-sided device-independent certification
As mentioned, between these two cases there are methods for certification, known as semi-device-independent, based on assumptions on the devices but that do not require a full characterization.Next we illustrate this approach through two well known examples.
A quantum state can be certified in an asymmetric scenario: one party has characterised measurements while the other treats their devices as black boxes.This certification task is clearly between the device-dependent and the deviceindependent settings and thus it has been introduced as onesided device-independent self-testing [ŠH16,GWK17].Here it is possible to carry out tomography using trusted measurement devices, but with only classical inputs and outputs for the black-box devices.The part of the state belonging to the party with uncharacterised devices can be recovered only up to local isometries.Only states which do not admit a local hidden state model, i.e. steerable ones, can be self-tested in this way [CS17, UCNG19].

Bounded dimension self-testing
Certification protocols can be based on an assumption of the dimension of the involved systems.An advantage of this approach is that it can be applied to prepare-and-measure scenario [GBHA10, TKV + 18, FK19].Alice prepares systems which are subsequently measured by Bob; the task is based on communication between two parties thus making it different from the other settings certifying entangled states.The central assumption made in such settings is that the system is associated with a Hilbert space of a fixed dimension, but otherwise devices are not characterised.In [SCB + 19] prepareand-measure scenarios are used to certify properties of quantum measurements by assuming the bound on the overlap between the states Alice can prepare, instead of bounding the Hilbert state dimension.

III. SELF-TESTING WITH QUANTUM INPUTS
In all the previous approaches to self-testing, and independently of the assumptions on the devices, the parties feed the devices with classical information, which can label a state preparation of measurement choice, and observe an output, corresponding to a measurement result.In this work, we consider a different framework in which parties can locally prepare some characterised quantum states, which are later treated as inputs to their untrusted measurement devices.Measurement-device-independent (MDI) protocols are examples of this approach, which is becoming increasingly popular in recent years.Firstly, it has been proven that, in this scenario, all entangled states are capable of exhibiting measurement correlations which cannot be simulated with separable states [Bus12], see also [BRLG13, ŠSC17, RMV + 18].The same approach has been pursued in [CSŠ17,ŠSC19] to clarify the role of entanglement in quantum teleportation protocols.The main goal of this work is to construct self-testing protocols in this scenario.
Before describing self-testing with quantum inputs let us point out what kind of conclusions we can expect.Since, in this scenario, the measurement devices are not trusted along with the source of the systems, they may be associated with Hilbert spaces of arbitrary dimension.Additionally, all of the experimental observations are insensitive to a set of transformations; this is similar to the situation in standard selftesting protocols.So if the underlying experiment deviates from the claimed one in suitable ways as not to alter the observed statistics, these deviations cannot be determined and define an equivalence class of preparations.Any local change of basis to the states and measurements remains hidden, as well as embedding of the state in some Hilbert space of higher or lower dimension.Consequently, the best we can hope for is to find local isometries (one for Alice and one for Bob) relating the state we want to certify with the state shared by Alice and Bob.Importantly, in this scenario, complex conjugation can be dropped from the set of undetectable state transformations.The reason for this is the full characterisation of quantum inputs, which can be chosen from a tomographically complete set of states.Thus we can distinguish the statistics produced by |ψ , in general, from those produced by the state |ψ * .Similarly to the self-testing nomenclature we call the ideal state reference state and the shared state physical state.For the sake of simplicity, we restrict our study to protocols where in the ideal scenario parties always apply the Bell state measurement (the projector onto the Bell states of the corresponding dimension).That is, in all experiments with quantum inputs the reference measurement is the Bell state measurement, while the actual measurement the parties apply is named physical measurement.Of course, the formalism can in principle be generalized to other measurement settings, but we do not consider them here.

A. Self-testing with only quantum inputs
In this section we consider bipartite self-testing in which all parties use quantum inputs, i.e.MDI state certification.The scenario is as follows: two parties, Alice and Bob, share a quantum state AB .Each of them can perform a joint measurement on their share of the entangled state and the prepared quantum input, ψ A x for Alice and ψ B y for Bob.We are using the notation that ψ ≡ |ψ ψ| is the projector onto the pure state |ψ .Since the Hilbert spaces are unbounded in dimension, the measurements are modelled as projectors: {M A A a } a for Alice and {M BB b } for Bob.Measurement outcomes are labelled with a for Alice and b for Bob (see Fig. 1).The aim of self-testing with quantum inputs is to prove that from the observed statistics p(a, b|ψ x , ψ y ) it follows that there must exist a local isometry transforming the physical state AB into the reference one ψ A B .Similarly to standard self-testing we can only hope to certify the presence of pure states.Analogously to the theorem given in [SVW16] we can prove that the correlations of any mixed state can be achieved with a pure state of the same dimension.The proof of this theorem is presented in Appendix A.
Before stating the main theorem of this section let us recall some of the specificities of the scenario when the parties can prepare tomographically complete set of inputs (for more details see [BRLG13,ŠSC17]).The observed probabilities can be written in the following way: where is named the effective measurement.If the set of quantum input states is tomographically complete, in the sense that it is sufficient for quantum process tomography, one can recover the exact form of the effective measurements from the observed probabilities.This insight is in the core of the proof that quantum inputs can successfully probe every entangled state [Bus12, BRLG13] and its analogue is the central object in the contributions to the understanding of non-classical quantum state teleportation [CSŠ17, ŠSC19].To briefly summarise, if the effective measurement is not a separable operator for every pair a, b the shared state must be entangled.
The following theorem will identify precisely how the resemblance between the effective measurement and the shared state can be used for the recovery of the state.In particular, if the effective measurements are pure and entangled the self-testing statement for the shared state can be formulated.To state the theorem, we need to introduce some notation.The d-dimensional generalized Z and X operators are defined as Z = Theorem 1.Let two parties, Alice and Bob, share the state AB and have access to a tomographically complete set of inputs {ψ x } x and {ψ y } y respectively.Each party performs a joint measurement on their share of AB and quantum input ψ x or ψ y .If the correlation probabilities can be written in the form and MA B a,b are such that where U a and U b are the correcting unitaries defined as U m = kl X k Z l δ m,kl , then there exists a local isometry Φ such that The proof of the theorem is given in Appendix B.Here we explicitly show the isometry which is used to prove the theorem.The isometry is given in Fig. 2. It implicitly assumes that the measurement operators are projective.Since the dimension of the shared state is not assumed, the Naimark extension can be used: if the measurements {M a }, {M b } are not projective one can always increase the dimension of the registers A, B and see the measurements as projective on a higher dimensional system.The true power of quantum inputs is exhibited when one is interested in the robustness of the self-testing procedure.The standard task of robust self-testing can be phrased as follows: if the conditions for self-testing are approximately met can we still say something about the distance between Φ( ) and ψ?When the set of quantum inputs is tomographically complete the state of the registers A and B of the isometry on Fig. 2 can be recovered even if the conditions for the ideal selftesting (2) are not satisfied.In that case the fidelity between Tr AA BB Φ( AB ) and the reference state |ψ can be directly estimated.Furthermore, if the parties used exactly the Bell state measurement the physical state will be exactly mapped to the state of registers A and B , allowing to obtain the tight bound on the fidelity between Tr AA BB Φ( AB ) and |ψ .A noisy Bell state measurement will give only a lower bound on the fidelity.For example, if the noisy Bell state measurements of the form M i = 0.95B i + 0.051/4, where {B i } i is the ideal Bell state measurement, is applied on the state = φ + , the recovered fidelity between Tr AA BB Φ( AB ) and φ + will be 0.893.
Note that the ability to prepare quantum inputs is strictly more than what one can do in a device-independent scenario.Thus, one would expect that whenever there is a standard device-independent self-test for a state |ψ , it can be also performed with quantum inputs.The idea is simple: if some projectors are used to produce measurement correlations which are self-testing the state |ψ , they can be effectively prepared by performing a Bell state measurement and a suitable input.An example of adapting the self-test from the CHSH inequality to the scenario with quantum inputs is provided in Appendix D.
The similar overall reasoning about self-testing with only quantum inputs can be applied to every multipartite entangled state.The more detailed discussion is given in Appendix C.Here we just state the corollary: Corollary 2. Self-testing with quantum inputs can recover any pure genuinely multipartite entangled state.

B. Self-testing with quantum-classical inputs
In this section we consider a hybrid scenario in which one party, say Alice, uses quantum inputs, while the other one, Bob, uses classical inputs (see Fig. 3).Let us consider the following scenario: Alice and Bob share a state AB .Alice can prepare quantum inputs {ψ A x , ψA x } x , where ψx = 1−ψ x , and apply a joint measurement {M A A a } a , while Bob queries his device with classical input y, which corresponds to applying a projective measurement {M b|y } b .In this scenario the probability to obtain outcomes a and b, when Alice's quantum input is ψ x and Bob's classical input is y is For each classical input y we can define the effective measurements Now we are ready to state the theorem which self-tests the state |φ + from a Bell-like expression.Let I qc be defined in the following way: (p(a, 0|ψ 1 , 1) + p(a, 0| ψ1 , 1)) + a=1,3 (p(a, 1|ψ 1 , 1) + p(a, 0| ψ1 , 1)). (6) The algebraic maximum of I qc is equal to 4. We show that there exist quantum inputs for which the only way to achieve the algebraic maximum is to share a maximally entangled pair of qubits.
The detailed proof is given in Appendix E.Here we give the intuition for the proof.The main insight comes from the observation that the algebraic maximum of I qc implies that the effective measurements (5) can be exactly recovered.Once they are recovered, one can use methods from standard and one-sided-device independent self-testing to prove that a convenient isometry transforms AB into φ + .The isometry is explicitly given in Fig. 4. Operators M z and M x are given as

IV. BASIC QUANTUM INFORMATION PROTOCOLS AS SELF-TESTS
So far we have introduced self-testing in two different semidevice-independent scenarios.In this section we show that, besides being natural extensions of standard self-testing, the introduced protocols have a practical importance in relating self-testing to some of the most widely used quantum information protocols.In section IV A we discuss how quantum state teleportation can be viewed as a self-test, while in section IV B we show how one can certify the set of states composing a quantum repeater or a quantum network.AB and resembled the standard SWAP isometry.The systems A 1 and A 2 can be discarded at the end of the process.

A. Quantum state teleportation as a self-test
As noted in [CSŠ17], quantum state teleportation can be seen as a representative of one-sided-measurement-deviceindependent protocols.Indeed, Alice uses a quantum input, performs a joint measurement, while Bob performs quantum state tomography and learns his reduced state.Note that in the spirit of [CSŠ17] we do not involve the part of the protocol in which Alice communicates the outcome of her measurement to Bob and he applies the correcting unitary.The correcting unitary can alternatively be applied by a verifier which supervises the teleportation experiment.The reduced state of Bob ϕ a|x is obtained through the following expression where ψ A x is a quantum input, i.e. a state to be teleported, M A A a is the measurement Alice applies, while AB is the state shared between Alice and Bob (see Fig. 5).The success of a teleportation experiment is usually assessed from an average teleportation fidelity, defined as , where |x| is the total number of input states, and p(a|ψ x ) is the probability to obtain outcome a when the input state is ψ x .It was proven in [HHH99] that in case the input states are tomographically complete, the state having Bell state fidelity F s ( AB ) = φ + | AB |φ + leads to the average teleportation fidelity of (F s ( AB )d + 1)/(d + 1), where d is the dimension of the states to be teleported.This can be seen also as a self-testing statement: the observed average teleportation fidelity Ftel gives a lower bound to the Bell state fidelity F s .However, it is obtained under assumption that the shared state is of dimension d 2 .Here we show how to estimate a lower bound to the Bell state fidelity of the state shared between Alice and Bob from an arbitrary teleportation experiment, including the case when the set of input states is not tomographically complete.
As explained in [CSŠ17] a teleportation experiment can be characterized by the effective teleportation measurement This is clearly tightly related to the effective measurement of Eq. ( 1), but now in this new scenario.If the set of input states is tomographically complete, Ma can be recovered exactly from the set of teleported states ϕ a|x .Otherwise, a teleportation experiment is characterized by the set of effective teleportation measurements compatible with the relation Any set of bipartite operators ÑA B a that have a positive partial transposition and satisfy the no-signalling condition are valid effective teleportation measurements [ŠSC19,HS18].
Observe now the quantum circuit on Fig. 6.Let us denote the output of the circuit as ψ A A AB o .In case AB is maximally entangled and {M a } is the Bell state measurement, the state o = Tr AA ψ o is pure and maximally entangled.In fact, since the given quantum circuit is a valid isometry the fidelity between o and |φ + lower bounds the fidelity between AB and |φ + .Since there is no proof that the circuit we use is the optimal isometry, the optimal fidelity might only be higher.In principle, when the set {ψ x } x is not tomographically complete we cannot know exactly o .However, since we can optimize over all effective teleportation measurements compatible with the observed teleportation data.Thus, the lower bound on the fidelity between the physical state and |φ + can be obtained as a solution to the following , where w = exp i2π/3.The graph shows the lower bounds derived from the knowledge of the whole set of teleported states on the self-tested fidelity with the maximally entangled pair of qutrits as a function of the parameter p.In none of two cases the set of input states is tomographically complete, hence no conclusion about the fidelity of the shared state with maximally entangled pair of qutrits can be drawn from the observed average teleportation fidelity.semi-definite programming (SDP) optimization: MT A a ≥ 0, ∀a, The SDP (9) provides a lower bound on the fidelity between the physical state and |φ + from the full observed data in a teleportation experiment.In principle the knowledge of the whole set of teleported states {ϕ a|x } a,x is not necessary.One can fix some of the known teleportation quantifers, such as average teleportation fidelity, teleportation weight or one of the teleportation robustness measures introduced in [ŠSC19].
In Fig. 7 we solve the SDP in (9) for two cases without a tomographically complete set of states, two situations where the average teleportation fidelity cannot be used.

B. Self-testing of quantum networks
Equipped with the methods presented in the previous sections, we are in position to provide ways of self-testing elements of a quantum network.Complementary to the results about self-testing Bell state measurements [RKB18,BSS18], we provide means to self-test different links of potentially hybrid quantum network.Consider a network in the form of a quantum repeater, like the one on Fig. 8.All measurement devices, except the first and the last, have a classical input whose choice corresponds to a Bell state measurement on the two particles or measuring one of the particles shared with one of the neighbours.One might extend our method for self-testing from teleportation and find out how well the whole quantum repeater simulates a single maximally entangled state.If the fidelity is not satisfactory, it is possible to check separate links of the network.For example, the 'quality' of the source S 1 can be estimated by using the self-testing with quantumclassical inputs (section III B).Self-testing through EPR steering [ŠH16] can be used to self-test source S n−1 .Standard self-testing protocols can be used to self-test all the remaining sources.

DISCUSSION
In this work we have expanded quantum state certification to novel scenarios using quantum inputs.Developing a hybrid approach between full device-independent and devicedependent self-testing is one of the main motivations of this work, with applications to quantum networks where some nodes in the network are trusted, and others are not.The tools developed here in the MDI setting could also find an application in a networked device-independent setting using the ideas developed in [BŠCA18].
This approach also finds an application of recent work in the study of non-classical teleportation introduced by [CSŠ17].In particular, we have developed new numerical tools to relate quantum teleportation to the fidelity of the quantum states shared by the parties.Given the ubiquity of teleportation in quantum information processing, these tools could be used in the verification of teleportation-based quantum computing.
One direction for future research is exploring the set of quantum correlations in different scenarios with quantum inputs.This would open the doors for numerical self-testing, similar to the SWAP method from [YVB + 14, BNS + 15] or the numerical self-test presented in our Section IV A. Another interesting question is to search better isometries for self-testing than those considered in this work.Finding a good isometry Figure 8.A networked scenario where trusted quantum systems can be input into untrusted devices at the beginning and trusted quantum systems can be measured at the end.Intermediate, untrusted nodes can be used to teleport a state, or use quantum repeaters to establish entanglement.Techniques developed here can be used to certify the whole network along with individual links.is crucial for obtaining better noise-resistant self-testing protocols.In turn, this could make self-testing more applicable and practical.
Note-While finishing this manuscript we became aware of a similar work [ZZ19].
Since the set of quantum inputs is tomographically complete Eqs.(S1) imply that all effective measurements defined as are proportional to rank-one projective operators satisfying constraints (S2).Consider the isometry shown in Figure 2 (in the main text).Applying Φ to AB leads to where where Mab are the effective measurements.To get the second equality we used the cyclic property of the trace.The orthonormality of the projection operators is used to obtain the third equality.The fifth equality is a consequence of the identity where the first equality follows directly from the constraint (S2), while the second follows from (S2) and takes into account that there are d 2 different values of a and d 2 different values of b, which counts d 4 elements in the sum in (S7).Thus, Tr AA BB Φ( AB ) is a pure, normalised state.We conclude that there is no entanglement between AA BB and A B .Therefore, we can write where X ∈ {A, B}.Then there is a local isometry Φ such that This theorem represents the analogue of the self-testing of maximally entangled pair of qubits via the maximal violation of the CHSH (Clauser-Horn-Shimony-Holt) inequality.
Proof.Let us first verify that {A + j , A − j } for j = 0, 1 represent valid measurements.Positivity is ensured by the relation and similarly for the other operators A ± j .The completeness relation is also satisfied: In an analogue way one can prove that B j are valid measurement observables.This is basically enough to prove the self-testing theorem, since we have that the two parties use valid quantum measurements to maximally violate the CHSH inequality.This means that there must exist a local isometry mapping the state to the maximally entangled pair of qubits.
These equations allow one to conclude that B 0 and B 1 anticommute where B is the reduced state of A B .From equations we can conclude that Finally, Eqs.(S12), (S13), (S15) allow reducing the expression Tr A 1 ,A 2 Φ qc ( AB ) , where Φ qc is the circuit given in Fig. S2, to the output of the standard self-testing SWAP gate, giving

Figure 1 .
Figure1.Measurement-device-independent scenario: The parties share an unknown state , emitted by the source S. The uncharacterised measurement devices receive trusted quantum inputs ψx (ψy).Each party applies a joint measurement on the received quantum input and a share of the state , resulting in the outcomes a and b.
ω j |j j| and X = d−1 j=0 |j + 1 mod d j|, respectively, where ω = exp 2πi/d.These matrices can be used to define an orthonormal basis of qudit Bell states |ψ kl = X k Z l |φ + , where |φ + = d−1 j=0 |jj .As Alice's and Bob's reference measurements are {|ψ kl ψ kl |} their outputs a and b are comprised of two dits k and l.
Figure 2. Representation of the isometry Φ.It takes as an input the state AB and each party performs a unitary operation U a/b conditioned on the outcome of the measurement M a/b .F is the Fourier transform gate acting as F |j = k e ijkπ/d |k , while the second gate is a generalized CNOT gate acting as CN OT |j |k = |j |j + k .

Figure 3 .
Figure3.Self-testing with quantum-classical inputs: Alice can prepare quantum inputs ψx and by measuring them together with a share of a state emitted by the source S, she obtains measurement outcome a. Bob, on the other side, treats all his devices as black boxes.He labels his measurement choice with a classical input y and obtains the measurement outcome b.

Figure 4 .
Figure 4. Representation of the local isometry Φqc.It takes as an input the stateAB and resembled the standard SWAP isometry.The systems A 1 and A 2 can be discarded at the end of the process.

Figure 5 .
Figure 5.Quantum state teleportation: Alice applies a global measurement on the state ψx and her share of the state emitted by the source S. Bob can apply quantum state tomography and learn exactly his reduced state ϕ a|x .

Figure 6 .Figure 7 .
Figure 6. Circuit used for self-testing from quantum state teleportation.Alice performs a unitary operation Ua conditioned on the outcome of the measurement Ma.F is the Fourier transform gate acting as F |j = k e ijkπ/d |k , while the second gate is a generalized CNOT gate acting as CN OT |j |k = |j |j + k .

Figure S1 .
Figure S1.Representation of one branch of the isometry Φ.It takes as an input the state |ψ A 1 •••An and each party performs a unitary operation Ua i conditioned on the outcome of the measurement Ma i .

Figure S2 .
Figure S2.Isometry Φqc used in the Proof of Theorem 3.