scieee AI-readable full text Open interactive document viewer

Black-box Testing of Quantum Systems

Vázquez Gomis, Pablo

Abstract

Quantum Computing is a growing field in Computer Science, Physics and Mathematics because it presents stunning results in solving very complex problems faster that any classical computer. However, the physical difficulties that Quantum Mechanics presents, added to the complex development of quantum algorithms, made the field to be very prone to errors. Thus, ensuring the quality of the devices and algorithms will take a very important role in the future of the field. In this Thesis we present a brief introduction to Quantum Mechanics, followed by a new possible testing framework based on a formalism that we call Hybrid Turing Machines. This formalism allows to design complex systems by joining quantum and classical Turing Machines. Finally, we present a study of one of the very few techniques in Quantum Testing for black boxes, called Self Testing, along with a practical experiment.

Full text

Black-box Testing of Quantum Systems Trabajo de Fin de Grado Curso 2020–2021 Autor Pablo Vázquez Gomis Director Alfredo Ibias Manuel Núñez Grado en Ingeniería Informática Facultad de Informática Universidad Complutense de Madrid Black-box Testing of Quantum Systems Trabajo de Fin de Grado en Ingeniería Informática Departamento de Sistemas Informáticos y Computación Autor Pablo Vázquez Gomis Director Alfredo Ibias Manuel Núñez Convocatoria: Junio 2021 Grado en Ingeniería Informática Facultad de Informática Universidad Complutense de Madrid 10 de junio de 2021 Dedicatoria A mi abuelo, Juan Gomis, por enseñarme a ver el mundo de forma crítica y objetiva e inspirarme siempre a ser la mejor versión de mí mismo. A mis padres Elena y Alfonso y a mis hermanos Elena, Juan y Gonzalo, por todo su apoyo durante los años buenos y los difíciles. Por darme las herramientas y la libertad para decidir mi camino. A mi novia y a mis amigos por todos los buenos momentos a lo largo de estos años y por todas las historias que hemos vivido y las que aún están por descubrir. v Agradecimientos Me gustaría agradecer a mis directores Manuel Nuñez y Alfredo Ibias por su inestimable ayuda en este proyecto y, junto a Miguel Benito, darme a conocer el mundo de la investigación y ayudarme a dar mis primeros pasos en él. Me gustaría también agradecer a mis profesores, en especial a Gonzalo Méndez y Félix del Teso, su apoyo durante mi etapa universitaria. Por último, agradecer las oportunidades que me ha dado la Facultad de Informática de la UCM así como a todas las personas que me han hecho crecer durante estos años. vii Resumen La Computación Cuántica es un área en expansión en campos como Informática, Física y Matemáticas debido a sus increíbles resultados resolviendo problemas complejos mucho más rápido que cualquier ordenador clásico. Sin embargo, las dificultades físicas que presenta la Mecánica Cuántica, añadido a la complejidad que conlleva el desarrollo de algoritmos, ha hecho que la Computación Cuántica sea muy susceptible a errores. Por tanto, asegurar la calidad de los aparatos y algoritmos va a ser de vital importancia en el futuro del campo. En este trabajo presentamos una breve introducción a la Mecánica Cuántica, seguido de un posible nuevo marco de referencia basado en un formalismo al que llamamos Maquinas de Turing Híbridas. Este formalismo permite especificar sistemas complejos juntando máquinas de Turing cuánticas y clásicas. Por último, presentamos un estudio en una de las pocas técnicas existentes en el testeo de caja negra de sistemas cuánticos, el llamado Self Testing, junto con un experimento practico. Palabras clave Computación Cuántica, Máquinas de Turing cuánticas, desigualdades de Bell, Self Testing ix 2Chapter 1. Introduction scribed by a wave function Ψthat evolves according to his famous equation i~∂ ∂tΨ(r, t) = ˆ HΨ(r, t)(1.1) In addition, Heisenberg and Born had already gave a description based on matrices which Schrödinger proved to be equivalent to his interpretation of continuous waves. Figure 1.2: The Stern-Gerlach Experiment2 The Stern-Gerlach Experiment These mathematical descriptions were key to interpret the results of the Stern-Gerlach experiment. Particles, such as atoms and electrons, behave as if they had angular momentum and as such they presented magnetic properties. In 1922, they discovered that when particles with a spin in a given direction were deflected by a non-homogeneous magnetic field and measured afterwards, rather than showing a continuous spectrum (shown as 4 in Figure 1.2) as were classically expected it showed only two discrete values (shown as 5 in Figure 1.2). This results showed that spin is a quantum property and, as such, measurement of that property has a discrete distribution. In 1926, Max Born proposed that the wave function could be interpreted as the probability distribution of finding the particle Ψ(~r)at some point xin space [Born (1926)]. This probability is given by |Ψ(x)|2. Einstein was very concerned with the probabilistic nature of quantum mechanics and in 1935 along with Boris Podolsky and Nathan Rosen proposed a thought experiment arguing that quantum mechanics was incomplete [Einstein et al. (1935)]. This led to the hidden variable interpretation, which we will see in detail in Section 4.2. Another very interesting interpretation is the many world interpretation in which there is no distinction between classical and quantum and a measurement generates two simultaneous universes for which we only perceive one. 1.2. Objectives and work plan The main goal of the work behind this Thesis is to review the current state of the black-box testing of quantum system and propose some new ideas in this scenario. Given that the field of Quantum Computing is still growing, there has not been many approaches dealing with testing. Although 2By Tatoute - Own work, CC BY-SA 4.0, https://commons.wikimedia.org/w/index. php?curid=34095239. 1.2. Objectives and work plan 3 it will definitely be of crucial importance in a future, most of the efforts now focus on the physical realizations of quantum computers or in the mathematical specification and proofs of work of new algorithms. However, there have been some exceptional advances in the field. Here we present one of the most relevant results of such investigations called Self Testing. In this black-box device-independent scenario we can, for certain states, certify that a source is in fact generating quantum states and what quantum state is generating. These results are of vital importance in order to certify devices such as random quantum generators but most importantly, they are used in protocols of key distribution using quantum devices and channels such as [Bennett and Brassard (1984)]. Such systems are mostly compiled of a mixture of quantum and classical systems, delegating hard computing task to the quantum part and allowing the classical system to do every other task. In order to appropriately represent these systems, we introduce a formalism based on what we call Hybrid Turing Machines. The work plan of the Thesis is as follows. Chapter 2 gives an introduction to the basic mathematical notions behind Quantum Mechanics, by following the historical process, emphasising in the current state. Then, Chapter 3 gives a background on Turing Machines, both classical and quantum, and how they work in order to later present the mixed Hybrid Turing Machine. Chapter 4 presents the ideas and the mathematical formalism of Self Testing along with an experimental example simulated with qiskit [Gambetta et al. (2021)]. Finally, in Chapter 5 we review our results, present our conclusions and sketch possible lines for future work. Chapter 2 Quantum Computing: Fundamentals 2.1. Mathematical Foundations In 1955, John von Neumann presented his book entitled “Mathematical Foundations of Quantum Mechanics” [Von Neumann (1955)] in which he introduced a new mathematical formulation of Quantum Mechanics. At the time, there were two formulations for Quantum Mechanics presented by Schrödinger as “Wave Mechanics” and Heisenberg-Born-Jordan as “Matrix Mechanics”. As we said before, Schrödinger already had proven the equivalence of the two and later on Dirac and Jordan developed the “Transformation Theory”, which joined both theories.1Von Neumann presented a new mathematical framework, based on Hilbert Spaces, that was equivalent but much simpler that the previously stated methods. This mathematical foundation is currently the most commonly used in the field of Quantum Computation and it will be used throughout this document. This mathematical notation also provides a level of abstraction to the fundamental physics underlying it. So, the same mathematical machinery can represent the spin of a particle or the angle of an electromagnetic field or any other physical object with quantum properties. Von Neumann stated that both representation of quantum mechanics could be unified into an infinite Hilbert Space. Rieffel and Polak [Rieffel and Polak (2011)] explained that since the Schrödinger equation 1.1 is linear, the set of solutions expands to a complex vector space that also has an inner product. Von Neumman realize that with infinite dimensions, the set of solutions describes a complex Hilbert Space2. We call such space the state 1It is worth to mention that although this theory was correct, it lead to many errors when used. 2Usually, an infinite dimensional space is not needed in the field of Quantum Compu5 6Chapter 2. Quantum Computing: Fundamentals space. Definition 2.1.1 A complex Hilbert Space His a complete complex vector space with an inner product h·,·i:H×H → C that satisfies the following conditions: Positive:hv, vi ≥ 0. Nondegenerate:hv, vi= 0 ⇐⇒ v= 0. Linear:hax1+bx2, yi=ahx1, yi+bhx2, yi. Symetric:hx, yi=hy, xi. Given the fact that a state space Sis an inner product space, it is also a norm space with norm kvk=phv, vi In addition, since it is a norm space we have that it is also a metric space with a metric given by d(v, w) = kv−wk where v, w ∈S. The proof to these statements can be found in [Klipfel and Bons (2009)]. When working in the field of Quantum Mechanics, it is common to use the Dirac Notation to represent vectors and other mathematical operations. This notation was introduced by Paul Dirac in 1939 [Dirac (1939)] as a way to simplify and unify the notation used at that time. We present the equivalence to vectors and matrices as they are the most common representation but this notation is used when working with wave mechanics. In particular, Dirac presented the following ideas. A column vector ~v is represented as a ket |vi where vis just an arbitrary label. Its transpose conjugate is called a bra hv|. In the matrix representation, they represent row and column vectors, respectively. |vi=   v1 . . . vn   hv|=v1,··· , vn Given two vectors |aiand |bi, their inner product is represented as ha|bi and formally defined as follows: ha|bi=a1,··· , an   b1 . . . bn   = n X i=1 aibi tation. 2.2. Quantum States 7 Similarly, given two vectors |aiand |bi, the outer product is represented as |aihb|and formally defined as follows: |aihb|=   a1 . . . an   b1,··· , bn=   a1b1··· anb1 . . ..... . . anb1··· anbn    Let us note that the outer product will be useful in order to represent transformations. Given two Hilbert spaces Vand W, the tensor product ⊗:V×W→ V⊗Wis defined for each par of kets |ψi ∈ Vand |φi ∈ Was follows: |ψi⊗|φi≡|ψi|φi≡|ψφi Let us note that if Vhas dimension nand Whas dimension mthen V⊗W will have dimension n·m. For example, we have |0i⊗|0i=1 0⊗1 0=    1×1 1×0 0×1 0×0     =    1 0 0 0     2.2. Quantum States Just as the state space is the space of the set of solutions of the Schrödinger equation 1.1, a quantum state is the representation of a single solution within the Hilbert space of solutions. Formally, a quantum state is a ray in a Projective Hilbert Space H, that is, a set of equivalence classes such that given two vectors v, w ∈ H, we have v∼w⇐⇒ v=λw where the ∼operator represents the equivalence between vand wand λ∈C. Because there is no physical difference between vectors in the same equivalence class, it is common to add the constrain that a quantum state is a unitary vector in the Hilbert Space. In this case, there is no need to normalize later on when dealing with probabilities. A quantum state is usually represented by a ket |ψifor some label ψ. The usual representation of Euclidean Spaces considers a set of orthonormal vectors of the space. This set is called the basis of the space. In the case of Quantum Computation, it is common to use the computational basis states whose basic set of basis in matrix representation is: |0i=1 0|1i=0 1 8Chapter 2. Quantum Computing: Fundamentals So, for any arbitrary state of the system |ψiwe have |ψi=a|0i+b|1i with a, b ∈C. If a, b 6= 0 then we say that |ψiis in a superposition of states |0iand |1i. Although we have mentioned the computational basis, it is worth to point out that this is not the only basis that it is used in Quantum Computation. In fact, we can always express any arbitrary state with respect to some orthonormal basis set {b1, b2,··· , bn}in the following way: |ψi= n X i=1 αi|bii where αi∈C. There is an important property concerning the physical indistinguishability of apparently different states. Specifically, there is no distinction between the states |ψiand eiφ |ψi. Therefore, we have |ψi ∼ eiφ |ψi In this case, the term eiφ is called a global phase. On the contrary, if we consider the states |ψiand a|0i+eiφb|1ithe we can distinguish them, that is, we have |ψia|0i+eiφb|1i In this case, the term eiφ is called a relative phase. We will use the notation explained in Section 2.1 to refer to the inner product of two states. Since any arbitrary state |ψimust be a unit vector then we have k|ψik =phψ|ψi=hψ|ψi=|a|2+|b|2= 1 We can expand the space by using the tensor product described in Section 2.1. As an example, if we have two independent systems H1and H2, with nand mdimensions respectively, and their respective state vectors are |ψ1iand |ψ2i, then we can represent both systems as H1⊗ H2with state vectors |ψ1i⊗|ψ2i. Let us note that such union will extend its dimension up to n·m. In the literature, it is common to denominate state vectors as qubits. A qubit is a state of dimension 2since it is the most basic unit of information possible in a quantum system. 2.2.1. Transformations Transformations are a fundamental key part of Quantum Computing because they describe a way to manipulate quantum states and as such make 2.2. Quantum States 9 use of the computational advantages it brings us. This idea is very well described by the second postulate on Nielsen and Chuang’s book [Nielsen and Chuang (2010)]: The evolution of a closed quantum system is described by a unitary transformation. That is, the state |ψiof the system at time t1is related to the state |ψ0iof the system at time t2by a unitary operator Uwhich depends only on the times t1and t2, ψ0=U|ψi Aclose quantum system is a system that does not interact with any other system. Although this is not really physically possible, there are very good approximations that make such a postulate still valid. Another thing to keep in mind is the fact that this evolution only describes changes of the system in discrete times. If we would like to consider a continuous representation, we must, once again, turn our attention to the Schrödinger Equation 1.1. In practice, in particular for the scope of this work, a discrete transformation is sufficient for the purposes of computation. The final key piece of information is the fact that transformations must be unitary. Definition 2.2.1 Aunitary tranformation Uis a mapping from a Hilbert space Honto itself U:H → H such that UU†=U†U=I where U†is the Hermitian adjoint. Umust also be linear such that if we apply it to an arbitrary state we get U|ψi=aU |0i+bU |1i. More generally, for any orthonormal basis {b1, ..., bn}we have U( n X i=1 αi|bii) = n X i=1 αiU|bii There are many transformations that are widely used in the literature. For example, we can mention the Pauli operators, which rotate the quantum system in one of the three possible dimensions for a 2-state system by π degrees. Their matrix representation is: σx=1 0 0 1σy=0−i i0σz=1 0 0−1(2.1) Let us note that since these matrixes are unitary and Hermitian, they can be also used as measurements (see next section). 10 Chapter 2. Quantum Computing: Fundamentals 2.2.2. Measurements Measurement in Quantum Mechanics (and other areas of Physics) are directly related to properties that we can observe, such as position and spin. This is what is known as an observable. In this field, an observable is represented by an Hermitian Operator Mwhose spectral decomposition is the following M=X m mPm where Pmis the projector onto the eigenspace of Mwith eigenvalue m. Before any measurement is done, the probability of getting the result mfor some state |ψiis given by the following expression: p(m) = hψ|Pm|ψi(2.2) and the resulting state of such measurement ends up being: Pm|ψi pp(m) This mathematical notation is trying to express the results of the SternGerlach experiment and the variations of it. For example, we can define the two discrete bands shown in the experiment as +1 and −1with respect to a center 0on the zaxis. Then, in order to describe the measurement, we have MZ=|0ih0|−|1ih1|, whose eigenvalues are +1 (with eigenvector |0i) and −1(with eigenvector |1i). Actually, the solution to MZgives out eigenspaces λ0|0iand λ1|1ibut they are equivalent to |0iand |1i. It can be seen that there is a direct correlation between the possible results of the experiment and the eigenvalues corresponding to the observer MZ. When measured, the probability of finding, for example, +1 on some state |ψi=a|0i+b|1iis equal to p(+1) = hψ|0ih0|ψi = (ah0|+bh1|)|0ih0|(a|0i+b|1i) = (ah0|0i+bh1|0i)(ah0|0i+bh1|1i) =|a|2 In addition, the state reached after we get the result +1 is |0ih0|(a|0i+b|1i √a2=a|0i a=|0i Let us note that after the measurement, there is no information about the previous state and there is no possible way of restoring it, other than 2.2. Quantum States 11 executing the same transformations once again. Given an observable M, let aibe all the possible result measurements, that is, all the eigenvalues of M. We denote the average value of Mby hMi=X i aip(ai) where p(ai)is the corresponding probability with regard to some state |ψi. 2.2.3. Pure and Mixed States Section 2.1 describes the usual mathematical representation of a pure system, that is, a system such that we have all the information. This might seem contradictory since some of the most crucial ideas of Quantum Mechanics say that the measurement of the system is probabilistic and, as such, we cannot know the complete information of such system. However, what the concept of purity tries to describe is the certainty that the state vector describes the whole system in H. However, we might have, as a result of noise or whatever external factor, a mixture of states such that we might have a state |ψ1iwith probability p1and a state |ψ2iwith probability p2. Keep in mind that such probabilities only describe our lack of information about the complete system and are not a result of quantum mechanical measurements. The set {pi,|ψii} of all the possible states is called an ensemble of states. We describe such systems by using a mathematical tool called density matrices. Definition 2.2.2 Given an ensemble of states {pi,|ψii}, where Pipi= 1, we define a density matrix ρas ρ=X i pi|ψiihψi| Next, we enumerate some simple properties of this type of states. The evolution of the state described by ρby some unitary operator Uis given by ρ0=UρU† The probability of a measurement of the state described by ρis given by the trace of the projection of such measurement p(m) = tr(MmM† mρ) Where the trace of a matrix is the sum of the elements of its diagonal tr(ρ) = Piρii. In addition, the state resulting after a measurement is MmρM† m p(m) 18 Chapter 3. Formal Definition of Quantum Systems For every output string y∈Σ∗ Ti,there exists a one to one label transformation f: Σ∗ Ti→Σ∗ Qisuch that f(y)∈Σ∗ Qiis the input string of Qi For every measured output string w∈Σ∗ Qithere exists a one to one label transformation g: Σ∗ Qi→Σ∗ Ti+1 such that g(w)∈Σ∗ Ti+1 is the input string of Ti+1 An input string x∈Σ∗ T1is accepted iff each input string (transformed under some labels) of Tiand Qiare accepted. For the sake of simplicity, we will assume that the labels in the outputs and input machines are the same. So, for all α∈ΣTiwe have f(α) = αand for all α∈ΣQiwe have g(α) = α. The idea is to connect machines using its inputs and outputs. Informally, this model describes a system in which we do 2Nsteps of computation alternating classical and quantum. This resembles closely to how quantum computers are thought of work. Heavy intensive tasks that can not be done classically must be done in quantum computers but everything else, although possible to do in a quantum system is easier (and cheaper) to do in a classical one. The idea is, at some time of the computation, a computer receives some classical input that drives the computation or describes the program to be computed then, after the machine halts, the result of the computation is passed as the input of the next machine thus connecting one another. This approach allows the creation of complex machines that can closely resemble the new paradigm of computation. The model presented in Definition 3.3.1 is a specific case of such type of interconnected machines. One could imagine the same framework to be applied to any kind of Turing Machine that has an input and a output such that the latter could be used as input of the next machine. Next, we formally introduce a formalism according to this idea. Definition 3.3.2 An Abstract IO Machine (AIOM) is an element from the set of classes of Turing Machines that satisfy the following criteria It has an input alphabet ΣIand an output alphabet ΣO. It can accept or reject every input string x∈Σ∗ Iand generate some output string y∈Σ∗ O. An AIOM can be any kind of machine that has an input and a output, such as classical normal Turing Machines, Quantum Turing Machines, Probabilistic Turing Machines, etc. This allows us to generalize the notion of QC-HTM for all these types of machines. 3.3. N-Hybrid Turing Machines 19 Definition 3.3.3 An N-Hybrid Turing Machine (HTMN)is a tuple of N AIOMs hM1, . . . , MNi such that For every output string y∈Σ∗ Oithere exists a one to one label transformation δ: ΣOi→ΣIi+1 such that δ(y)∈ΣIi+1 is the input string of Mi+1. An input string x∈ΣI1is accepted iff each input string (transformed under some labels) of Miis accepted. This definition also allows to change the order of the QC-HTM and start and end on the same machine. Note that in a QC-HTM we could simply assume that the last machine or the first one does not modify the output at all but this scenario is better handle by an HTM. Chapter 4 Self Testing The growth of Quantum Computing brings some of the most interesting promises and theoretical results in our era. As a consequence, the fields of cryptography and securing information had to find a way to work within the quantum framework. In 1984, Bennett and Brassard presented the first protocol for a secure public key distribution protocol in a quantum setting [Bennett and Brassard (1984)]. In that protocol, Alice sends qubits to Bob in one of two possible measuring basis (e.g. the computational basis {|0i,|1i} and the Fourier basis {|+i,|−i}). When received, Bob measures those qubits with a random choice of the two posible basis. Alice and Bob share in a public manner the basis that they use and discard all the results where the basis do not match. A subset of the results with the same basis is then made public. With very high probability, if some results are not equal to each other we can know that a third party has been eavesdropping. Otherwise, the set of results that reminds private would be the key shared by Alice and Bob. It should be noted that such protocol, as many others, heavily rely on the fact that the measurement devices can be trusted. Challenging such assumption, Mayers and Yao proposed and coined the procedure known as Self testing [Mayers and Yao (2004)]. 4.1. The Self Testing Scenario Let us suppose that we have some device that is said to produce an entangled state |ψiin a system with two particles. One of these particles is send to Alice and the other one to Bob. Both of them are really far away from each other and they both have some measuring apparatus with some classical settings xfor Alice and yfor Bob. Due to the distance they cannot communicate their choice of settings but they can share, after a while, the results that they have found. Each of these results is a classical value, denoted by afor Alice and bfor Bob. With all this information they can 21 22 Chapter 4. Self Testing generate a probability distribution for each possible combination of settings. Informally, Self Testing refers to the procedure in which we can determine which state the source is producing only from each probability distribution with respect to the settings. Figure 4.1: Diagram of the Self testing Scenario It should be noted that not all the states can be uniquely determined by their probability distribution. Thus, only certain sources (those who generate those special states) can be self tested. One important class of states (and measurements) that can be self tested are those that violate Bell’s inequality. Due to their practical uses, such states are the most commonly found in the self testing literature. 4.2. Bell’s Locality When the theory of Quantum Mechanics started to gain popularity, scientist like Albert Einstein [Einstein et al. (1935)] did not like some of its implications, in particular, the concept of entanglement. Let us consider the state φ−=1 √2(|01i−|10i) on some Hilbert Space H=H1⊗H2. Let us suppose that each Hilbert space belongs to Alice and Bob respectively such that φ−=1 √2(|0iA|1iB−|1iA|0iB) where |xiArepresent the qubit of the system belonging to Alice and |xiB the qubit belonging to Bob. If Alice were to measure her local system with some set of measurements Mz={M0, M1}and got the result 0then, at the same moment, Bob’s system would collapse into the state 1and viceversa. The idea that the collapse of Bob’s system would happen faster than light could travel to that system was shocking at the time (in fact, it still is) and Albert Einstein, Boris Podolsky and Nathan Rosen proposed a new way to interpret such result [Einstein et al. (1935)]. They argued that the wave 4.2. Bell’s Locality 23 function did not collapse into one or another state when measured but instead there existed a set of hidden variables λsuch that when those particles were generated, they already had a deterministic, but unknown to us, result and measurement was just a way of discovering such result. The key idea is that in both interpretations there appeared to be no way of knowing what is happening when a particle is measured and both could predict the correct results after measurement. In 1964, John Bell proposed a way to physically test whether the hidden variable interpretation was correct [Bell (1964)]. Let us imagine that a source emits a pair of particles and each particle is given to Alice and Bob, respectively. Alice can now measure her particle in one of these settings x and Bob can do the same with his particle y. The possible outcomes of each measurement are denoted by a, in the case of Alice, and by b, in the case of Bob. By making some measurements and assuming that the source always emits the same particle, experimental results have found that p(ab |xy)6=p(a|x)p(b|y) This result implies that the particles seem to not be independent from each other. The idea of locality can be expressed in the following way. Definition 4.2.1 The set of correlations p(ab |xy)is said to be local if there exists a hidden variable λ, with probability distribution q(λ), such that p(ab |xy) = ZΛ q(λ)p(a|x, λ)p(b|y, λ)dλ (4.1) The notion of q(λ)is included to take into account physical properties that are not fully controllable. Let haxbyidenote the average value of ab for some xy, that is, the value Pa,b ab ·p(ab |xy). Then, let us consider the CHSH inequality [Clauser et al. (1969)]: ha0b0i+ha0b1i+ha1b0i−ha1b1i ≤ 2 This inequality holds when a set of correlations is local but there are some states that are not and the result is known as a violation of Bell’s inequality. The proof of this result can be found in [Brunner et al. (2014)]. For example, let us consider the state |φ−iand the measurements A0=σz⊗Iand A1= σx⊗Ifor Alice and the measurements B0=I⊗1 √2(σz+σx)and B1= I⊗1 √2(σz−σx)for Bob. The average value of hazbziis equal to 1 √2. In this case, the CHSH inequality can be rewritten as hA0B0i+hA0B1i+hA1B0i−hA1B1i ≤ 2 If we compute the average value for each term we get hA0B0i=hA0B1i=hA1B0i=1 √2hA1B1i=−1 √2(4.2) 24 Chapter 4. Self Testing Then, the CHSH inequality ends up being 1 √2+1 √2+1 √2+1 √2= 2√22 that clearly violates the CHSH inequality, proving the non locality of the correlations found. This result is one of the most amazing results in Quantum Mechanics because it does not only provides a method for practical testing of non-locality but it also certifies the quantum properties of entanglement, one of the most useful tools in Quantum Computing. This results also give us a simple method to check, only using a set of correlations and measurements as the device-independent scenario, the problems found in Section 4.1. Since entanglement is a unique quantum property that can violate Bell’s inequality, any non-local system must be a quantum system and as such we can test other properties of it. One key point of finding the violation of a Bell’s inequality is the choice of measurements. In fact, only local anticommuting observables can lead to the maximal violation of Bell’s inequalities. The proof of this statement can be found in [Šupić and Bowles (2020)]. 4.3. Formal Definition of Self Testing The main result found by Mayers and Yao was that for specific states, such as those that violate Bell’s inequalities, we can certify that a source is in fact generating quantum states in such state. More importantly, it does it in a black-box device independent scenario with nothing but the correlations between the settings and the results. Given an ideal setting, that is, a state |φiand some projective measurements for Alice and Bob Pa|xand Pb|y, the actual probability distribution found by running the experiment multiple times with all the possible settings ˜p(ab|xy)is said to self test the machine if we have ˜p(ab|xy) = p(ab|xy)(4.3) up to a local change of basis. The probability distribution p(ab|xy)represents the ideal probability distribution that is found with the ideal state |φiand the local projective measurements. There are a couple of constraints that must be taken into account and complicate Expression 4.3. Since we are working in a device independent scenario, we cannot rule out different degrees of freedom happening inside the machine. Another constraint is the fact that the ideal measurements are defined with respect to some basis [McKague et al. (2012)]. In order to solve these difficulties, we need to ensure that there exists an isometry that can extract the ideal state from the physical one. The next two definitions are taken from [Šupić and Bowles (2020)] and were presented in the context of self testing in [Mayers and Yao (2004)]. 4.3. Formal Definition of Self Testing 25 Definition 4.3.1 Given two Hilbert spaces HS1and HS2, an isometry is any linear transformation from HS1to HS2that preserves the inner product. If we work in the self testing scenario presented in Section 4.1, we need the concept of local isometry. Definition 4.3.2 Given two Hilbert spaces HS1and HS2, a local isometry is a tensor product of isometries acting locally, that is, ΦA⊗ΦB:HA1⊗HB1→ HA2⊗HB2 Let us remind that, in order to take into account different degrees of freedom, the spaces HS1and HS2can have different dimensions. Once we have the concept of isometry, we are ready to give a complete description of self testing. We have seen in Section 4.2 that given some probability distribution we can test whether the devices act in a non local way and thus share an entangled state. What self testing attempts to do is to find the actual entangled state and its measurements from the correlations alone. The key to self testing is to find the isometry that can extract from the physical state |ψi embedded in a higher space the reference state |φitensor with some junk state. The formal definition is as follows. Definition 4.3.3 The correlations p(ab|xy)self test the state |φiif for any state |ψiand measurements {Ma|x}and {Nb|y}, compatible with the correlations p(ab|xy), there exist local isometries ΦAand ΦBsuch that ΦA⊗ΦB(|ψi) = |φi⊗|ξi for some junk state |ξi. The main idea of self testing is to prove the existence of such isometry. By revealing the maximal violation of some Bell’s inequality, we can ensure the anticommutativity of the local measurements and build the isometry. Given some unknown measurement operators Mxand Ny, for Alice and Bob respectively, that lead to the maximal violation of some Bell’s Inequality, we can build the Unitary controlled operators ZA,ZBand XA,XBas follows ZA=1 √2(M0+M1)ZB=1 √2(M0−M1) ZB=N0XB=N1 Using these gates, we can build the so-called partial swap gate isometry (see Figure 4.2). The input of the isometry would be the state compatible with the correlations (the state generated by the source) embedded to a higher space 26 Chapter 4. Self Testing |0iAH•H• |ψiAZAXA |ψiBZBXB |0iBH•H• Figure 4.2: Circuit of the partial swap gate isometry which is represented as two states in the ground state. The output of the gate would be the state we wanted to self test |φiand some other junk state |ξi. It is important to notice that the output states are separable and as such we can ignore the junk state. The proof of this statement can be found in [McKague et al. (2012)] and a more explicit explanation can be found in [Šupić and Bowles (2020)]. Let us emphasize that there is no need to actually execute the isometry in order to self test the state: it is enough to prove its existence. This means, in particular, that by knowing the correlations and the fact that a violation of a Bell’s inequality exists, one can know whether a certain state is being generated by the source by means of the partial swap gate. 4.4. Experimental Results In order to show the advantages of self testing, next we present some real experiments and a step by step. These experiments are developed using qiskit, a python library developed by IBM [ Gambetta et al. (2021)] and executed locally in an MSI-Modern 14, running an Intel Core i7 processor and 16 GB of RAM. We will be working in the scenario where Alice and Bob has settings x= 0,1and y= 0,1. The output for both of them, in all settings, will be a, b =±1. The first part will follow the same example as the one presented in Section 4.2. Because we are working in a device independent scenario, and as such it is a black box scenario, when simulating the scene we must break such assumption and give a formal description of the inner workings of the source. However, we can later ensure that the calculations made by Alice and Bob have no knowledge of the source. In our case, the source is described as a quantum circuit that can be embedded in other circuits. The formal specification in this example would be the entangled state |φi=1 √2(|00i+|11i)(4.4) 4.4. Experimental Results 27 This can be presented, using the computational basis, as the following circuit: |0iH• |0i Now, given some setting xand y, the measurement operators for Alice and Bob are the following: A0=σzA1=σx B0=1 √2(σx+σz)B1 1 √2(σx−σz) However, qiskit only allows to measure in the computational basis σz. Thus, if we need to measure in a different basis, we need to transform the state to that basis and then measure in the computational basis. In this running example, the circuit transformations are the following: A0IA1H(4.5) B0RY(π 4)HB1RY(π 4)(4.6) Finally, considering the self testing scenario, the final circuit represented in a black box scenario would be: Source Ax By Let us note that Alice and Bob only act on their share of the state and as such they are working independently from each other. Once we have a practical way of representing and executing the scenario, we can run the experiments multiple times (executing the circuit), with all possible combinations of xand ywith the goal of computing the correlations p(ab|xy). Specifically, for each setting we transform the circuit given in Equation 4.5 and execute it 1.000.000 times to get a set of correlations the most accurate possible. The loop is executed with the seed 1by qiskit so that the results can be replicated. An interesting result is that the correlations end up being equal to each other due to how qiskit executes the circuit with a seed rather than a more pseudo-random run. The results of our experiments are described in table 4.1. These correlations allow us to compute the averages for hAxByi. We can use these values to check whether they maximally violate some Bell’s Inequality. hA0B0i= 0.706462 hA0B1i= 0.706462 hA1B0i= 0.706462 hA1B1i=−0.707162