Full text
University of Minho School of Engineering Bruno Filipe Jardim Machado Analyzing quantum learning protocols with ZX october 2024
University of Minho School of Engineering Bruno Filipe Jardim Machado Analyzing quantum learning protocols with ZX Master’s Dissertation in Informatics Engineering Formal Methods Dissertation supervised by Luís Soares Barbosa october 2024
Copyright and Terms of Use for Third Party Work This dissertation reports on academic work that can be used by third parties as long as the internationally accepted standards and good practices are respected concerning copyright and related rights. This work can thereafter be used under the terms established in the license below. Readers needing authorization conditions not provided for in the indicated licensing should contact the author through the RepositóriUM of the University of Minho. License granted to users of this work: CC BY https://creativecommons.org/licenses/by/4.0/ i
Acknowledgements This dissertation is the product of an unexpected amalgamation of interests, Quantum Computing and Formal Methods. The seed for these interests was sown as an undergraduate of Computer Science by two individuals, those being Luís Barbosa and José Nuno Oliveira. For that I would like to express my utmost gratitude to my supervisor Luís Barbosa, for the patience, advice, the countless opportunities and for always believing in me and my work, sometimes even more than I did. I would also like to thank professor José Nuno Oliveira for all the conversations, advice, passion for teaching and for guiding me into this direction. This dissertation benefitted immensely from the expertise of several people those being André Sequeira, Jaime Santos and of course professor Luís Paulo Santos. My appreciation expands, unquestionably, to my friends, namely and in no particular order, David, José, Pedro, Miguel, Simão and Tiago. They accompanied me throughout my academic journey and all the challenges it comes with. Their impact on my life over the last few years is unquestionable and surely I wouldn’t be in the place I am without them. I’m extremely proud of everything we’ve ever achieved together, especially what we did with NECC. Which was at times a second home for me and everyone named. Finally, I would like to thank my family, specially my parents for their unconditional support and encouragement. For raising me with the assurance that you can never know too much and that hard work never fails. Truly, all they have done for me cannot be expressed through words. And for that, I would like to dedicate this dissertation to my parents Maria and Joaquim This work was partially supported by FCT, the Portuguese Foundation for Science and Technology, within the project IBEX, with reference PTDC/CCI-COM/4280/2021. ii
Statement of Integrity I hereby declare having conducted this academic work with integrity. I confirm that I have not used plagiarism or any form of undue use of information or falsification of results along the process leading to its elaboration. I further declare that I have fully acknowledged the Code of Ethical Conduct of the University of Minho. University of Minho, Braga, october 2024 Bruno Filipe Jardim Machado iii
Abstract Quantum computing is a rapidly developing field of study, with new and useful applications coming by the day. However, current tools and techniques for the development of quantum software are quite lackluster, as computer scientists are forced to reason with quantum gates. This dissertation utilizes an emerging graphical language, the ZX-calculus . This calculus is formed of two generators, the spiders , each one abstracting a linear map over the Z- or X-axis. Accompanying these generators, come a set of rewrite rules that allow for the transformation of ZX-diagrams. The ZX-calculus allows for a reasoning about quantum computation that transcends the circuit model most computer scientists are accustomed to. The ZX-calculus is used in this dissertation in order to model, analyze and establish properties about a variety of different quantum protocols. These protocols span a plentitude of areas such as: quantum walks, quantum unconstrained binary optimization and quantum machine leaning. The analysis and circuit optimization conducted in quantum walks proved to be quite rewarding. As the number of gates was severely decreased for the discrete time models, the coined quantum walk and the staggered quantum walk. The staggered variant exhibited an unexpected characteristic, an alternative evolution operator, that is capable of approximating the original operator with a fraction of the gates. Contrasting the optimization and interesting properties exhibited by the quantum walks, the Quantum Approximate Optimization Algorithm didn’t possess any notable qualities. It did however, prove to be a bridge between the classical paradigm of the circuit model and the ever-growing measurement based paradigm. The final set of algorithms analyzed were a set of hardware efficient ansatzs. Which, in conjunction with novel techniques within the ZX-calculus framework allowed for a completely graphical analytical barren plateau detection. It was concluded that neither of the ansatzs analyzed possessed barren plateaus. Keywords ZX-calculus, Quantum Computing, PyZX, Quantum Walks, QAOA, QML, Barren Plateau, Barren Plateau Analysis iv
Resumo A computação quântica é um campo de estudo em rápido desenvolvimento, com novas e úteis aplicações a surgir diariamente. No entanto, as ferramentas e técnicas atuais para o desenvolvimento de software quântico são bastante insatisfatórias, dado que os cientistas da computação são obrigados a raciocinar com gates quânticas. Esta dissertação utiliza uma linguagem gráfica emergente, o ZX-calculus . Este cálculo é formado por dois geradores, as spiders , cada uma abstraindo um mapa linear sobre o eixo Z ou X. Acompanhando estes geradores, existe um conjunto de regras de reescrita que permitem a transformação de ZX-diagrams . O ZX-calculus possibilita um raciocínio sobre a computação quântica que transcende o modelo de circuitos ao qual a maioria dos cientistas da computação está habituada. O ZX-calculus é utilizado nesta dissertação para modelar, analisar e estabelecer propriedades sobre uma variedade de diferentes protocolos quânticos. Estes protocolos abrangem várias áreas, tais como: caminhadas quânticas, optimização binária não-constrangida quântica e machine learning quântico. A análise e optimização de circuitos executada nas caminhadas quânticas revelou-se bastante gratificante. O número de gates foi significativamente reduzido para os modelos de tempo discreto, a caminhada quântica com moeda e a caminhada quântica escalonada. A variante escalonada apresentou uma característica inesperada, um operador de evolução alternativo, capaz de aproximar o operador original com uma fracção das gates . Contrastando com a optimização e as propriedades interessantes exibidas pelas caminhadas quânticas, o Algoritmo de Optimização Quântica Aproximada não demonstrou características notáveis. Contudo, provou ser uma ponte entre o paradigma clássico do modelo de circuitos e o paradigma, em constante crescimento, baseado em medições. O último conjunto de algoritmos analisado foi um grupo de ansatzs eficientes para hardware. Em conjunto com técnicas novas dentro do quadro do ZX-calculus , permitiram uma detecção gráfica completamente analítica de barren plateaus . Concluiu-se que nenhum dos ansatzs analisados possuía barren plateaus . v
Palavras-chave ZX-calculus, Computação Quântica, PyZX, Caminhadas Quânticas, QAOA, QML, Barren Plateau, Análise de Barren Plateau vi
appears throughout the quantum machine learning field. Another class of circuits addressed in this dissertation are the ones that implement quantum walks, the quantum counterpart of random walks, first introduced by Aharonov et al. (1993) with the coined quantum walk . Later expanded in the work of Childs and Goldstone (2004) with the continuous time quantum walk . Portugal (2016) introduced an innovative model, the staggerd quantum walk . 1.3 State of the art 1.3.1 The ZX-Calculus ZX-Calculus is part of a broader research area of the use of categorical methods to reason about quantum computing, known as categorical quantum mechanics. From a mathematical standpoint the basic behavior can be captured by the structure of a dagger symmetric monoidal category. Much like ZX-Calculus, categorical quantum mechanics can be fully represented by string diagrams, diagrams originally proposed by Roger Penrose in 1971 as a way to reason about multi linear functions or tensors. Therefore, ZX-Calculus is a diagrammatic alternative to linear algebra when it comes to reason about quantum gates. It was first introduced in 2008 by Bob Coecke and Ross Duncan, although it wouldn’t be until 2017 that its completeness would be proved. Although ZX-Calculus allows us to reason in a graphical way about linear maps between qubits, it is only one of the languages used for that purpose. Alongside with ZX-Calculus, ZW-Calculus (Coecke and Kissinger (2010)) was also being developed, which provides a smooth way to describe the W-state: |Wi=1 √3(|001i+|010i+|100i)(1.1) ZW was the first of these graphical languages to have a complete set of rules. The earliest completeness results for ZX-Calculus were based on the ZW-Calculus. More recently a new graphical language has been developed to describe in a more natural manner quantum circuits that involve Toffoli gates. It is named the ZH-Calculus (Backens and Kissinger (2019)), as it generalizes the Hadamard gate from ZX-Calculus as a generator. It is, like its counterparts, sound and complete. The ZX-Calculus has a variety of different applications including the optimization of quantum circuits, which was explored by Fagan and Duncan (2019). Modern quantum computers are still far from being optimal, as they are severely limited by a lot of factors, but mainly they are limited by the coherence time of the qubits. Therefore performing extensive computations becomes almost impossible, as the qubits 2
may enter a state of decoherence before the computation is complete, rendering the result unusable. To combat this phenomenon it is necessary to perform as many computations as possible in the shortest window of time. Optimization of quantum circuits is a step in this direction In classical computers, two programs can have the same result without having the same number of computations. The same applies to quantum programs. As long as two programs have the same resulting tensor, they will perform the same computation. Thus, it is only a matter of choosing the one that does it with the least number of gates. The ZX-Calculus allows us to simplify and reduce circuits to their minimal form, although this is not as trivial as one might think, as de Beaudrap et al. (2022) showed. Until Duncan et al. (2020) the circuit extraction aspect of ZX-diagrams was poorly understood. Articulated with Kissinger and van de Wetering (2020b), a tool for automated reasoning with large scale ZX-diagrams was developed — PyZX. Actually, dealing with large scale ZX-diagrams becomes quickly unreasonable to handle by hand. Although there are tools that are similar to PyZX such as Quantomatic , they aren’t as efficient as PyZX since the former was designed with the intent of circuit optimization, and as of today it is the staple for circuit optimization. Currently the presence of ZX-calculus transcends quantum circuit reasoning and circuit optimization and has been applied to many other areas in quantum computing, such as: quantum error correction, measurement-based quantum computing, quantum natural language processing, among many others. More specifically ZX-calculus has been used by Zhao and Gao (2021) to analyze the barren plateau phenomenon in training quantum neural networks, and extend the barren plateaus theorem. This is exactly the context for this dissertation. 1.3.2 Quantum Computing and Quantum Machine Learning Although computer science as a discipline can be traced back to Charles Babbage and Ada Lovelace, it wouldn’t be until Turing (1936) that would emerge a formalized understanding of what computer science is. In tandem the field of study of quantum mechanics was making significant progress. These two fields would be considered considered completely distinct for the following years. That is until Benioff (1980) introduced the quantum Turing Machine, which uses the theory of quantum mechanics to describe a simple computer. This was the first time these two fields of study converged. With physicists encountering difficulties simulating quantum systems, Feynman (1982) suggested that to efficiently simulate quantum systems one had to use hardware that is built with these intrinsic properties. The first quantum algorithm was proposed by Deutsch (1985), which was later on expanded by Deutsch 3
and Jozsa (1992). They concluded that for a specific class of problems there exists a quantum computation that would solve the problem with an exponential speedup over any classical computation. Although these results had no practical application, they are fundamental for both Shor (1994) and Grover (1996) algorithms both of which attracted a lot of attention to the field of quantum computing. With these promising results research quickly expanded into a lot of the computer science areas. This is also true of the machine learning area, where Biamonte et al. (2017) postulated that quantum computers would surpass their classical counterpart on machine learning tasks. As of right now, in contrast to machine learning which is its own field of research and has clear economical significance, quantum machine learning is still a mainly theoretical field of study. 1.3.3 The barren plateau phenomenon The barren plateau phenomenon was first characterized by McClean et al. (2018). It is a phenomenon that appears when training a quantum machine learning algorithm. The optimization gradient quickly disappears, turning the domain of the problem flat, which makes it impossible for the algorithm to find the downward slope. This phenomenon can appear in two different ways: • Noise Free • Noise Induced The former of these surges in PQCs1that have a large amount of layers and are initialized with random parameters. This leads to the variance of the optimization gradient vanishing exponentially with the number of qubits, making it impossible to train these PQCs. The latter occurs in NISQ2(Preskill (2018)) computers. Since the qubits are prone to quantum decoherence as they, are strongly susceptible to the environment, the gradient itself vanishes exponentially with the number of qubits, that is the slope itself becomes more and more shallower. In the context of this dissertation when barren plateaus are mentioned the former variant is the one addressed, unless stated otherwise. McClean et al. (2018) initially proposed a few methods to avoid the barren plateau phenomenon, such as, using educated guesses for the initial set of parameters and utilizing pre-trained circuits, as they were quite successful combating the same problem in the classical scenario. 1A paramenterized quantum circuit is specific type of quantum circuit that incorporates gates that have adjustable paramenters, making them useful for optimization or machine learning applications. 2The noisy intermediate-scale quantum NISQ era is identified by quantum processors that are not yet capable of fault-tolerance or quantum advantage. 4
This initial educated guess tries to ensure that the initial conditions of the PQC land inside the narrow gorge of the barren plateau, thus ensuring the model is trainable. Later, Cerezo et al. (2021) proved that not only the initial parameters produced the barren plateaus. The cost function used could also lead to the emergence of this phenomenon. Cerezo et al. (2021) proved that for a global cost function, this is, when the ansatz is evaluated with respect to all parameters, the barren plateau was guaranteed even for depth 1. Although, if the cost function is only local to a few of the parameters the circuit is able to be trained until a depth of log(n), with respect to the number of qubits. However, as the depth of the circuit grows from log(n)to poly(n)the gradients start gradually disappearing in a polynomially, until it reaches a point where they fade exponentially. Later on Ragone et al. (2024) introduced a framework that unifies all the results about the problem until the date and a Lie algebraic theory to calculate the exact expression of the variance of the cost function. Acording to Ragone et al. (2024) the main reasons that originate barren plateaus are the following: excessive circuit expressivity, deeply entangled initial states, global cost functions, and noise channels. Following this work Cerezo et al. (2024) proposed the question ‘Does provable absence of barren plateaus imply classical simulability?’. This work poses a challenge for Quantum Machine Learning as a whole. The implications of this work could lead to a shift in the Quantum Machine Learning, as PQCs that don’t exhibit barren plateaus could be simulable classically. One must then embark in one of two directions following from this work. Either PQCs are discarded as a whole when it comes to Quantum Machine Learning, or one tries to find PQCs that are hard to simulate classically and don’t present barren plateaus. 5
Chapter 2 Background 2.1 Introduction to Quantum Computing 2.1.1 States In classical computing the most basic state of information is the bit, which can either have a value of 0 or 1. The quantum analogue of the bit is the qubit. The qubit exists in the two-dimensional C2Hilbert space, typically represented with the standard basis. States are usually discribed in the Dirac bra-ket notation, where hψ|stands for the adjoint of the vector |ψi. Notation hϕ|ψidenotes the inner product between ϕand ψ. |0i= 1 0 |1i= 0 1 These vectors form the computational basis . Contrary to the classical bit, qubits can be in any linear combination of these two states. |ψi=α|0i+β|1i As long as the complex coeficients kαk2+kβk2= 1, it will represent a valid superposition of the basis states. This restriction ensures that, when a measurement is done on this qubit one of the two base states |0i,|1ican be obtained with probabilities kαk2and kβk2 respectively. 6
2.1.2 Evolution Evolution proceeds through the application of unitary operators. An operator is defined as unitary if U†U=UU†=I. Since the inverse of a unitary operator is also a unitary operator, this means that every computation can be reversed by applying the inverse operators in the inverse order. A simple example of a unitary matrix is the Pauli-X matrix, which it itself is its own inverse. We can quickly check that by doing: XX = 0 1 1 0 0 1 1 0 = 1 0 0 1 Actually, every Pauli matrix is its own inverse, meaning all of them are involutory. Evolution is carried out by applying a unitary operator Uto a quantum state |ψi, yielding the resulting state |ψ′i=U|ψi. As an example, let us apply the above mentioned Pauli-X matrix to the state |0i. X|0i= 0 1 1 0 1 0 = 0 1 =|1i As we can see the Pauli-X matrix acts as the quantum equivalent of the NOT operator, that we are so familiar with from classical computing. 2.1.3 Composition Actually, although a qubit by itself can already perform certain computations that a classical bit simply would not be able to, it is required a larger state space to perform meaningful computations. This larger state space is created by the composition of two or more qubits. Quantum state spaces combine through the tensor product operation ⊗. If we wish to compose n m-dimensional states, the resulting state will be a mn-dimensional state. Thus the state space of quantum systems scales exponentialy with the number of qubits used to represent this state space. As an example, let us compose the states |1iand |0i. |1i⊗|0i= 0 1 ⊗ 1 0 = 0 0 1 0 =|10i=|2i 7
Although we can represent a huge amount of states with just the tensor product, most states cannot be described as |ai⊗|bi, for any aand b. A common example of one such state is the Bell state |Φ+i. Φ+=|00i+|11i √2 In this case one says that the two qubits are entagled. 2.1.4 Measurements To obtain information about a quantum system one needs to perform measurements. Quantum measurements are inherently destructive processes, since they collapse the original state into one of the states in the basis used to measure against. This is also known as the collapse of the wave function . Although quantum measurements can be interpreted in many different ways, when it comes to this dissertation it always refers to projective measurements , unless stated otherwise. From a mathematical standpoint measurements are defined by a set of measurement operators that perform an action on the system state space. A measurement, M, must obey the following relation. M†M=I(2.1) i.e., to be an Hermitian operator. Hermitian operator enjoy the spectral decomposition property: M=X m mPm(2.2) where mis the eigenvalue of the Hermitian projection operator Pm. The probability of a measurement having an outcome, m, in a given state, ϕ, is p(m) = hϕ|M† mMm|ϕi(2.3) which leaves the system in the following resulting state |ϕ′i=1 pp(m)Mm|ϕi(2.4) Projective measurements are usually performed in the computational basis of a given qubit. 8
Let’s consider the following measurement operators for the computational basis. M0=|0ih0|= 1 0 0 0 (2.5) M1=|1ih1|= 0 0 0 1 (2.6) Now consider the following state ϕ=α|0i+β|1i. We can calculate the probability of each outcome as p(0) = hϕ|M† 0M0|ϕi=hϕ|M0|ϕi=kαk2(2.7) p(1) = hϕ|M† 1M1|ϕi=hϕ|M1|ϕi=kβk2(2.8) 2.2 Introduction to ZX 2.2.1 Introduction ZX-diagrams are composed of spiders , of two sorts, Z and X, typically represented by green and red nodes with an associated real number that represents the phase of the spider , ranging between [0,2π[. Generally, this phase is omitted when zero. The calculus introduces a set of rewrite rules, which embody two overarching rules: • Only connectivity matters • Everything remains equal if you swap red and green nodes For example, this means that = = (2.9) are all equivalent. In fact since we can represent the Z spider (green) as having one input and two outputs, or two inputs and one output (the same can be said for the X spider), this means that we are able to have a vertical wire without any ambiguity, since it can be represented in either of these two ways. 9
This means that we can represent multi-qubit gates in ZX-diagrams. Actually, the gate described in (2.9) is the representation of a CNOT gate as a ZX-diagram. All quantum gates have an equivalent representation as a ZX-diagram. A few of those are the following: X→πZ ⊕ π → → H S T π 2 π 4 → → → (2.10) Therefore transforming a quantum circuit into a ZX-diagram is as simple as replacing the gates with their ZX counterpart. 2.2.2 Rewrite Rules The calculational power of ZX-calculus comes from the powerful set of rewrite rules it provides. The basic rewrite rules are the following: • Spider Fusion α β . . .. . . . . .. . . . . .=α+β . . .. . .(2.11) • Identity Removal =(2.12) • Hadamard cancellation =(2.13) •πcommutation = π α . . .−α. . . π π (2.14) 10
• State copy = απ α . . .. . . απ απ απ (2.15) • Color change = α α . . .. . .. . .. . .(2.16) • Strong complementarity = n. . .n. . . . . .m. . .m(2.17) • Hopf =(2.18) The Hadamard gate is present in the rules above, represented by a yellow box. This is merely a notation used out of convenience, as the Hadamard gate can be decomposed using Euler angles. This notation is simplified even further, in the coming ZX-diagrams as a dashed blue edge/wire, leaving us with: =π 2 π 2 − π 2 =(2.19) There are other rewrite rules in ZX-calculus, all derived from the rules above. One of those derived rules is the following hadamard pushing , which is derived from 2.16 and 2.13. α. . .α. . . =(2.20) With these representations and the rewrite rules we can already infer other results, such as the representation of CZ gates, with just 2 rules: hadamard pushing and hadamard cancellation . H H (2.21) 11
greatly both among them and in contrast to the classical setting. The relevance of quantum walks as a tool for algorithmic design justifies both a better understanding of their behavior and the optimization of their implementation, namely to increase resilience to decoherence phenomena. As such, the following sections are dedicated to modelling the continuous time quantum walk , coined quantum walk and the staggerd quantum walk as ZX-diagrams, acording to their specifications. 3.1.2 Continuous-Time Quantum Walks Continuous-time quantum walks were first considered as a quantum analogue of the classical continuous time random walks. Such a walk is determined, in contrast to a discrete time quantum walk, by a timevarying unitary matrix instead of a, e.g., coin operator, as is the case on coined quantum walks. This is what dictates how the walker evolved over the given graph. Implementation The Continuous-Time Quantum Walk can be easily translated to a quantum circuit. It is simply the Quantum Fourier Transform over nqubits, followed by the time-varying unitary evolution operator, followed by the Inverse Quantum Fourier Transform. Thus we have the following circuit: QF T U QF T † . . .. . .(3.1) The folowing implementation is directly derived from the work of Santos (2021). The Quantum Fourier Transform has a well known circuit representation. The following is a ZX-diagram representation of that same 3-qubit circuit with the decomposition of the controlled-phase gates into its basic gates. π 4 7π 4 π 4 π 8 15π 8 π 8 π 4 7π 4 π 4 (3.2) One can also derive the circuit for the Inverse Quantum Fourier Transform just from this diagram. All one needs to do is apply the control-phase gates and the Hadamard gates in the reverse order with the reverse phase. 18
Thus a 3 qubit implementation of this quantum walk yields the following ZX-diagram. π 4 7π 4 π 4 π 8 15π 8 π 8 π 4 7π 4 π 4 31π 16 π 8 π 4 π 8 7π 4 π 4 7π 4 15π 8 π 8 15π 8 7π 4 π 4 7π 4 (3.3) 3.1.3 Coined Quantum Walk Contrasting classical random walks the coined quantum walk walker does not have its position determined by stochastic transitions over the state space, but through the properties of quantum mechanics. The Coined Quantum Walk is a discrete time implementation of a quantum walk. An implementation is characterized by the use of a unitary operator that dictates how the walker evolves over time. The position of the walker is specified by a coin operator, usually the Hadamard operator as it is an unbiased operator, and a shift operator that is dependant on the coin operator. H=1 √2 1 1 1−1 Although the Hadamard operator is unbiased it is not necessary that the coin operator being unbiased. Using different operators as a coin allows for other probabilities distributions. The shift operator is simply an increment and decrement layer controlled on the coin operator. A one-step model can be found in the appendix (A.1) as it is too extensive to be detailed in the main text. 3.1.4 Staggered Quantum Walk In contrast to conventional, coin-based quantum walks, which proceed straightforwardly from one vertex to another, the staggered variant Portugal et al. (2016) takes advantage of forming partitions of graph cliques1over the graph structure of the walking space. Each partition forms a tesselation whose elements do not overlap. The set of cliques in each tessellation must cover all vertices of the graph, and the set of tessellations {T1,T2,...,Tk}chosen must cover all the edges. Then a unit vector, typically encoding a uniform superposition, is associated to each clique so that the vector belongs to the subspace spanned by the corresponding vertices. I.e., uk j=1 q|αk j|X l∈αk j |li,(3.4) 1A clique is a subset of vertices of an undirected graph such that every two distinct vertices are adjacent. 19
where αk jis the jth polygon in the kth tessellation. This way each tessellation kgives rise to an operator Hk= 2 p X j=1 uk juk j−I. (3.5) which propagates the probability amplitude locally, in each clique. The composition of all such operators defines the evolution operator, which, by solving the the time-independent Schrodinger equation, is equivalent to U=eiθkHk...eiθ2H2eiθ1H1,where eiθkHk=cos (θk)I+isin (θk)Hk(3.6) since H2 k=I, meaning that the Hamiltonian is a reflection operator that, when expanded in a Taylor series, generates a local operator. As an elementary example consider a line where the following two tessellations (depicted in red and blue below) are defined Tα={{2x, 2x+ 1}:x∈Z}and Tβ={{2x+ 1,2x+ 2}:x∈Z}.(3.7) Thus, |αxi=|2xi+|2x+ 1i √2and |βxi=|2x+ 1i+|2x+ 2i √2,(3.8) yielding Hamiltonians Hα= 2 +∞ X x=−∞ |αxihαx|−Iand Hβ= 2 +∞ X x=−∞ |βxihβx|−I. (3.9) Therefore, U=eiθHβeiθHαis the evolution operator. The probability distribution on a line after 50 steps, starting at |+i, for different values of θ, is depicted below, noticing that the walker is more likely to be found further away from the origin as the angle increases. 20
, A circuit implementation of the staggered model can be found in Santos (2021). As expected, it resorts to the joint tessellation dynamics, in contrast to a coined quantum walk that uses a coin as a shift operator. For the example discussed above, it yields DecInc ⊗n−1 Rx(2θ)Rx(2θ) where Rx(θ) = e −iθX 2and the Inc(rement) and Dec(rement) circuits have the usual implementation through generalized Toffoli gates. An implementation for a 3 qubit staggered quantum walk, starting at |4iand taking θ=π 3, which maximizes propagation, is represented in a ZX diagram as π 2π 3π2π 3π π π which takes advantage of the ZH-calculus H-box notation for representing Toffoli gates in a concise way. Expanding Tofolli into its basic gates leads to π 2π 3 7π 4 π 4 7π 4 π 4 π 4 π 4 7π 4 π2π 3π π 7π 4 π 4 7π 4 π 4 π 4 π 4 7π 4π 3.2 Quantum Approximate Optimization Algorithm 3.2.1 Introduction Fault-tolerant quantum computers capable of executing the most promising quantum algorithms are still a far away effort. Even so, the development of useful quantum algorithms to beexecuted in NISQ has had significant progress. Variational Quantum Algorithms (VQA) are one of such algorithms which take advantage of the current landscape in the realm of quantum computing. 21
All VQA share a common structure: a task is encoded into a parameterized cost function that is evaluated using a quantum computer, and a classical optimizer whic trains the relevant parameters. AVQA is a hybrid loop of a parameterized quantum circuit that runs in quantum computer, followed by an optimizer that runs on a classical computer. This optimizer updates the parameters in order to minimize the cost function, based on the outputs of the quantum circuit. This hybrid loop allows the circuit to stay shallow, thus somehow controlling the noise from NISQ devices. The Quantum Approximate Optimization Algorithm (QAOA) is one of the most promising algorithms in the category of VQA. As it aims to solve combinatorial optimization problems that were previously unsolvable with classical methods. The QAOA is capable of finding good approximations to many optimization problems in the Quadratic Unconstrained Binary Optimization (QUBO) category. A few examples of problems in this category are the Maximum Cut (MaxCut), Minimum Vertex Cover, Maximum Independent Set (MIS), among many others. 3.2.2 Constructing the QAOA Hamiltonian Let’s take the Maximum Cut problem as an example, as this problem is NP-complete and as such any QUBO problem is at most as difficult as the MaxCut. We can formulate the MaxCut as an optimization problem with the following objective function: max v 1 2X ij∈E (1 −vivj)vi, vj∈ {−1,+1}(3.10) where ij represents an an edge belonging to the edge set Eof a given graph, viand vjrepresent the cut a vertex is part of. Thus an edge will only be cut if the vertices are in distinct cuts. In order to solve an optimization problem in a quantum computer, one needs to characterize a quantum Hamiltonian that encodes the solution to the problem in its highest energy eigenstate. Therefore, it is necessary to convert the objective function in 3.10 into a Hamiltonian that encodes the solution2. This Hamiltonian is diagonal with the values of the diagonal corresponding to the values of the objective function, e.g. 2The eigenstate of this Hamiltonian can be measured in the computational basis. Thus one may obtain the solution with certainty. 22
C= f(0 . . . 00) . . . 0 0 0 0f(0 . . . 01) . . . 0 0 . . .... 0 0 . . . f(1 . . . 10) 0 0 0 0 . . . f(1 . . . 11) (3.11) Therefore, C|xi=f(x)|xi ∀x∈ {0,1}n(3.12) of course, this represents a major challenge, as the Hamiltonian we are describing is indeed too large (2n×2n) to be constructed explicitly and constructing it would mean solving the optimization problem. Alternatively we need to construct the Hamiltonian in a more compact way. The MaxCut Hamiltonian is obtained mapping the variables vionto the eigenvalues of Z. Thus yielding C=1 2X ij∈E (I−ZiZj)(3.13) This comes from the nature of the Pauli-Z operator. Z= 1 0 0−1 (3.14) Whose eigenvalues, −1and +1, correspond to the following eigenvectors in the computational basis. Z|0i= 1 0 0−1 1 0 = 1 0 =|0i(3.15) Z|1i= 1 0 0−1 0 1 = 0 −1 = (−1) |1i(3.16) This means that when we apply the Pauli-Z operator to state |0iit acts as an identity operator, but when we apply it to state |1iwe also obtain state |1ialthough affected by a phase factor. Thus, when we use the notation Zi|x0. . . xniit means we are applying a Pauli-Z operator to the i-th qubit, leaving all others unaffected. Similarly the notation ZiZj|x0. . . xnimeans we are applying a Pauli-Z operator to the i-th and j-th qubit, leaving all others unaffected. 23
Therefore, the following variable change xi=1 2(1 −vi)(3.17) specifies a move between binary variables and and spin variables, as appropriate, as shown in vi= 1 7→ xi= 0,(−1)xi= 1 = vi(3.18) vi=−17→ xi= 1,(−1)xi=−1 = vi(3.19) Such a variable change leads to the following objective function. max x 1 2X ij∈E (1 −(−1)xi(−1)xj)xi∈ {0,1}(3.20) Actually, (−1)xis just a compact way to describe the Pauli-Z operator that we saw in 3.16 as Z|xi= (−1)x|xi. Then this yields the Hamiltonian described in 3.13. This process allows us to describe an Hamiltonian that encodes the solution with a linear amount of terms in respect to the edges of the graph. The Hamiltonian just built is specific to the MaxCut problem, although there is a way to implement any Boolean function, as extensively discussed in the work of Hadfield (2021). 3.2.3 The Ansatz The QAOA prepares a parameterized ansatz state composed of the problem hamiltonian C, described in 3.2.2, and the mixer Hamiltonian B, which can be simply described as B=X i Xi(3.21) where each Xiis a parameterized RXin the i-th qubit. This parameterized ansatz has the following form |ψ(β, γ)i=e−iβpBe−iγpC···e−iβ1Be−iγ1CH⊗n|0i(3.22) where B and C are the mixer and the problem Hamiltonians, respectively. The layer iof the mixer Hamiltonian is parameterized by βi, similarly the problem Hamiltonian is parameterized by γifor the i-th layer. For 1≤i≤p. 24
Then a classical optimizer is used in order to vary the parameters of both the problem Hamiltonian and the mixer Hamiltonian and find the optimum parameters that maximize the function f(β, γ) = hψ(β, γ)|C|ψ(β, γ)i(3.23) For a number p, such that p→ ∞, of layers of the QAOA ansatz it can find the optimal solution. Running a quantum algorithm with an infinite amount of layers is untractable, for a value of pthat is small there is evidence for quantum advantage. The QAOA ansatz can be represented in the following circuit form. e−iγ1C . . .. . . H H H e−iβ1B |0i |0i |0i e−iγpC. . . e−iβpB(3.24) The phase-separation Hamiltonian (problem Hamiltonian) is composed of the following 2-qubit circuit. ⊕ ⊕ RZ(2t) |xi |yi (3.25) These phase-separation Hamiltonians are typically represented in the form of a ZX-diagram as a phasegadget. 2at (3.26) A property of the circuit 3.25 is that it commutes through other phase-separation circuits. For example, consider. 2at 2bt (3.27) This property means that we are free to move these phase gadgets as we see fit. 2at 2bt 2at 2bt =(3.28) 25
Although this wasn’t trivial to observe in the circuit form, it is clear that in the ZX-diagram form that the phase-gadgets simply commute through one another. This is due to the fusion and un-fusion (2.11) rule on the qubit belonging to both phase-gadgets. What was described is only half of our QAOA circuit, as we are still missing the mixer Hamiltonian. Fortunately it is simply a sum of Pauli-Xs on all qubits, and, therefore, it can be represented in the form of a ZX-diagram as an arbitrary single qubit rotation along the X-axis on all qubits. With these building blocks we can derive the QAOA MaxCut implementation for any graph we desire. Let’s use the following graph as an example. 3 2 4 1 (3.29) Then using the circuit in 3.25 for each edge, followed by the mixer Hamiltonian on all qubits we get the following ZX-diagram. 2at 2bt 2bt 2at 2bt 2at 2bt 2at (3.30) We can further use the rewrite rules (2.2.2) to obtain the following diagram. 2at 2bt 2bt 2at 2bt 2at 2bt 2at (3.31) Figure 1: The repeating pattern of the QAOA ansatz for the graph 3.29 This shows us, once again, how much more expressive the ZX-calculus is in comparison to the circuit model. As the graph for the problem is quite literally encoded into the ZX-diagram. This also shows us one of the main characteristics of NISQ algorithms, that is, being able to solve the problem at hand only using the necessary amount of qubits to encode the problem itself. 26
3.3 Hardware Efficient Ansatz 3.3.1 Introduction In Quantum Machine Learning not all problems have a well defined and known ansatz that solves the specific problem, or, in a more general sense, there isn’t a way to derive an Hamiltonian that encodes the solution to the problem. When we have such problems we might need to use a broader, more general ansatz that is able to represent and explore the state space necessary to solve the problem at hand. This is where one must resort to Hardware Efficient Ansatzs (HEA). These are parameterized quantum circuits which aim to use the resources available on the quantum computer on which they are being executed, taking into consideration the limitations of the hardware itself. This is, they utilize all the resources available to them and construct a general circuit that might contemplate the solution to the problem at hand, and then through gradient descent find the optimal solution. An example of one such ansatz is the following circuit. Rx Rx Rx Rx Rz Rz Rz Rz |0i |0i |0i |0i (3.32) Figure 2: Example of a simple HEA. The dashed box denotes the repeatable pattern of the circuit. This is also the ansatz denoted as ‘Circuit 1’ in the work of Sim et al. (2019). These ansatzs may also utilize 2-qubit gates as a way to perform the entanglement of two or more qubits, although, as stated above, this is limited to the capabilities of the quantum hardware. However, these HEA tend to exhibit the barren plateau phenomenon. Thus limiting severely their usefulness. Therefore, this warranted a change of analysis conducted comparatively to previously shown protocols. The HEA were subjected to analytical detection of barren plateaus, a technique that aims to characterize the existence of a barren plateau, without the execution of the circuit in a quantum computer. Up until now, every ZX-diagram in this dissertation conveniently ignored every scalar factor respective to itself, as they are irrelevant for the analysis conducted. However, this is not the case for the analytical detection of barren plateaus. 27
Note that, the resulting ZX-diagram still contains a considerate amount of Z-spiders and Hadamard gates. This suggests that the resulting circuit-like ZX-diagram still exhibits some of the graph-like nature prior to the circuit extraction. And as a consequence, it can be further optimized, mainly by resorting to the color-change rule (2.16), along with (2.11,2.12). Applying those rules, yields the following diagram. 5π 4 7π 4 15π 8 7π 4 11π 8 π 4 π 8 π 8 31π 16 π 8 π 4 π 4 13π 8 7π 4 (4.3) This ZX-diagram contains 33 gates of which • 14 are T-gates • 19 are Cliffords, of which –9 are CNOTs –6 are XCXs –4 are Hadamards XCX gates are not commonly used for describing a quantum process. Despite this, PyZX utilizes this denomination quite often. This gate is simply a CNOT with an Hadamard on each side of the control qubit. This final circuit can be considered as ‘fully-optimized’. This term is used rather loosely, as there are many different definitions of what a ‘fully-optimized’ circuit is. These definitions take into consideration different metrics that can be used to optimize against, e.g. total number of gates, total number of 2-qubit gates, T-count, circuit depth, among many others. In the context of this dissertation, the expression refers to a circuit that PyZX is unable to simplify further, which presents, in general, a balance between T-count and the total amount of gates. Many of the concerns prior to the optimization routines, e.g., the existence of a simpler Quantum Fourier Transform, proved to be, in some form, true. The Continuous Time Quantum Walk does not benefit hugely from the optimizations PyZX provides. An interesting property does however emerge from this optimization. The rotations relative to the unitary operator (and most other rotations for that matter) are now on the third qubit. As for the reason for this, it is inconclusive. 34
4.2 Coined Quantum Walk Contrasting to the Continuous Time Quantum Walk discussed in the previous section, the Coined Quantum Walk necessitates an increase in the total number of gates to yield a longer walk. Therefore, it yields the longest circuits out of all the quantum walks studied in this dissertation. Therefore, it leads to the most effective returns under the optimization techniques that PyZX implements. The model in A.1 is an implementation of a one-step Coined Quantum Walk. This model possesses a total of 440 gates, of which • 136 are T-gates • 304 are Cliffords, of which –124 are CNOTs –29 are Hadamards The gates not explicitly described above are either Zor Xrotations that are multiples of π 2. Since this quantum walk works in a repetitive manner, and each step used in this specific implementation adds 439 gates to the total amount of gates in the circuit, it is reasonable to think that there are some simple optimizations that could yield a simpler circuit. When ‘simple optimizations’ are mentioned it is strictly limited to non-transforming PyZX optimizations such as spider-simplifications (2.11) and id-simplifications (2.12). The model in A.2 is the circuit extracted after these optimizations. This model possesses a total of 417 gates, of which • 122 are T-gates • 295 are Cliffords, of which –122 are CNOTs –27 are Hadamards This yields an optimization of around 5%(5.227%), which just by itself doesn’t mean much. However, as soon as we utilize more elaborate (and transforming) optimization routines that PyZX offers a giant gain suddenly appears. The model in A.3 is the circuit extracted after these optimizations. These optimizations bring the total amount of gates to a total of 256 gates, of which 35
• 64 are T-gates • 192 are Cliffords, of which –74 are CNOTs –19 are CZs –114 are Hadamards Much like the Continuous Time Quantum Walk case, a lot of Hadamard gates are introduced to perform the optimization routine. These gates persist in the circuit after it is extracted. This optimization yields a gain of around 41%(41.18%)which is closer to what PyZX may achieve, as per Kissinger and van de Wetering (2020a). This is already an incredible result, as this algorithm is already one of the most promising algorithms in the NISQ era. The result further cements this reputation by increasing its resilience to decoherence and noisy devices. Even so, it is possible to go even further and optimize the Hadamard gates by applying color-changes (2.16), spider-fusions (2.11) and id-simplifications (2.12). The resulting ZX-diagram of the circuit can be found in A.4. This circuit has a total of 158 gates, of which • 64 are T-gates • 94 are Cliffords, of which –54 are CNOTs –1 is CZ –23 are XCXs –12 are Hadamards The extracted circuit has a gain of 64%(64.09%)over the original implementation. However, as a consequence of these transforming optimizations, the resulting circuit has no resemblance to the original one. Actually we have a much smaller circuit, but it seems to amount to a set of random gates. 36
4.3 Staggered Quantum Walk 4.3.1 Optimization Consider the following ZX-diagram which highlights the expanded the increment operator. π 2π 3 7π 4 π 4 7π 4 π 4 π 4 π 4 7π 4 π2π 3π π 7π 4 π 4 7π 4 π 4 π 4 π 4 7π 4π Some simple optimizations can be considered to deal with the CNOT gate at the end of the expansion of the Tofolli gate and the CNOT belonging to the increment operator, and similarly, but for a X-spider between the CNOT targets, in the decrement operator. Moreover, one may cancel the two X-spiders with phase π in the first qubit between the increment and decrement layers, and the two consecutive Hadamards in the last qubit. The result is the following ZX-diagram, π π 4 7π 4 2π 3 π 4 π 4 7π 4 7π 4 π 4 ππ 4 7π 4 2π 3 π 4 π 4 7π 4 π 4 7π 4π These optimizations slightly reduced the number of Clifford gates in the diagram. More advanced techniques, described in Kissinger and van de Wetering (2020a) and directly implemented in PyZX as the full_reduce method, may reduce the circuit T-count in about 50%Kissinger and van de Wetering (2020a). Although this is not the case for our small example, when we start applying such simplifications to staggered models with larger amounts of steps the T-count reduction can reach approximately 60-70%. Back to the example, this simplification yields 5π 3 5π 4 5π 3 π 4 π 3π 4 7π 4 π 4 7π 4 7π 4 π 4 This diagram no longer resembles a circuit, making difficult a comparison with the original one. The circuit extracted de Beaudrap et al. (2022) by PyZX has more gates than the one obtained from the simple optimizations mentioned above, although the T-count is indeed smaller. 37
In fact, the full_reduce method introduces several additional Hadamard gates to make all the edges Hadamard-edges, and color-change all the X-spiders. The subsequent circuit extraction ’preserves’ the nature of the graph-like ZX-diagram. As such there are a lot of Hadamard gates and Z-spiders that could cancel-out or color-change. Following the extraction with a small set of simplifications, basically resorting to fusion rewrite rules followed by color-changes, we get a much smaller circuit. This fully-simplified circuit now surpasses the original circuit in both the total amount of gates and T- count, but not the one obtained with the simple optimizations above. Although the reduction of both these metrics are not that significant in this example, when applying the same techniques in models with a greater number of steps reductions in the number of gates and T-count become quite clear. The following tables show, respectively, the total number of gates and the T-count value induced by the different optimization procedures used. Number of steps in the staggered quantum walk: Optimizations used: 1 2 4 8 None 39 77 153 305 Simple 31 59 115 227 Full-reduce + fusion/id/to_rg 37 47 72 118 Table 1: Number of total gates in the circuit in relation to the simplification routines used Number of steps in the staggered quantum walk: Optimizations used: 1 2 4 8 None 16 32 64 128 Simple 16 32 64 128 Full-reduce + fusion/id/to_rg 10 16 28 52 Table 2: Number of T gates in the circuit in relation to the simplification routines used 4.3.2 Alternative Evolution Operator When analyzing the ZX diagram for long staggered quantum walk (i.e. with more than 5 steps) a pattern starts to emerge, repeating itself as many times as the number of steps in the quantum walk. It seems able to represent, or at least to approximate, both the increment and decrement layers of the evolution operator. Its ZX representation is 38
α1β1α2α3β2α4 Figure 3: The alternative evolution operator. where αn=±π 4and βn=2π 3+mπ, with m= 0 or m= 1. There is also a slight variation of this operator, where a CNOT gate between the first and last qubit appears right after the β1Z-spider. α1β1α2α3β2α4 Figure 4: The variation of the alternative evolution operator. This diagram does not fully capture the staggered model we started with, but, once suitably enveloped, it captures the exact same tensor as the original circuit. The set of gates to be placed as an envelop, in the beginning and the end of the diagram, does not exhibit a specific structure, but for 4 rotations combined with a seemingly random arrangement of other phase-less gates. This construction appeared when optimizing the 3 qubit staggered quantum walk. However, it can be generalized for an nqubit implementation, yielding the following operator, in the form of a ZX-diagram: . . . ... ... α1β1α2α3β2... ... α4 . . . Figure 5: The generalization of the alternative evolution operator. This operator is defined by entangling the first and last qubits and placing them in superposition. This is achieved by the XCX-gate (which is a CNOT with a Hadamard on both sides of the control), followed by a CNOT gate between the first and last qubits and a rotation over the X-axis on the first one. Then follows a ladder of XCX-gates starting with the first qubit and the n−1th qubits and descending all the way to the second one. This is followed by a rotation over the Z-axis along with a X-axis rotation. Then a CNOT is applied to the first and last qubits, followed by a X-axis rotation and a XCX-gate over the first qubit and 39
the n−1th one. Finally, there is a second Z-axis rotation followed by the same ladder of XCX-gates, now appearing between the first and the n−2th qubits and descending all the way to the second. And, finally, a last X-axis rotation. The rationale behind this operator is easy to explain: it creates a uniform distribution over a certain number of states, applies a rotation that makes some states more likely than others and then spreads these probabilities over the remaining states using CNOT gates. This also explains why the pattern only shows up in staggered quantum walks over a certain length. The classical evolution operator resorting to the increment and decrement layers, needs to be repeated a number of times to be able to spread the probability distributions over the whole state space. This is what this version does on the first layer. Thus, it cannot approximate staggered quantum walks with a small number of steps as well as it can for longer ones. In any case, this alternative implementation has a number of advantages. First and foremost it reduces the total amount of gates needed to represent the evolution of the quantum walk. With the number of qubits increasing so does the cost of the increment and decrement layers, as a nqubit staggered quantum walk needs to implement MCX gates with n−1controls. Then, such MCX gates need to be expanded into their basic gates representation, as Slepoy (2006) stated. The alternative operator uses at most gates controlled by at most 1 qubit. Moreover, to go from a nto a n+ 1 qubit quantum walk, all that needs to be done is to add two more XCX-gates, one to each ladder of XCX-gates. Such is not the case of the evolution operator based on increment and decrement layers. In general, this makes the alternative operator much more efficient with respect to the total number of gates used, leading to lower depth and, therefore, potentially less error-prone circuits. As mentioned above, just by itself this operator is able of approximating the evolution of a staggered quantum walk. Although the approximation is not perfect it can yield results which are quite similar to the ones obtained with the original implementation of the staggered model, as shown in the graph below. 40
0 20 40 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111 States Probability Operator original_operator new_operator Figure 6: The state space probabilities for a 4-qubit quantum walk with 4 steps using the classical operator (red) and the alternative one (blue). One particular advantage of this alternative evolution operator is that it can work quite well on a quantum processor with limited connectivity. This is due to the fact that all the qubits used in the staggered quantum walk only need to be strongly connected to the first qubit, thus minimizing possible errors occurring from having to operate on two qubits with poor connectivity. However, a number of challenges remain, requiring further investigation. These concern the most suitable choice of parameters for αnand βn, as well as whether and how they depend on the number of qubits used in a particular staggered walk. Actually, when optimizing the 4 qubit implementation of this circuit the resulting parameters did not seem to follow any regular pattern. 4.4 Quantum Approximate Optimization Algorithm Using the model from 3.31 we are able to solve the MaxCut problem for the following graph. 3 2 4 1 For a small graph like this the MaxCut problem is quite trivial and can be solved directly, the solutions being: 41
3 2 4 1 3 2 4 1 (4.4) Figure 7: The two equivalent solutions to the MaxCut problem. Encoding the solutions into bitstrings , with one bit for each node of the graph, we get s1 = 0110 and s2 = 0101. The solutions s1 = 1001 and s2 = 1010 are also valid as they are the dual to the ones above. Therefore, when the circuit is executed those should appear the most probable outputs, and as the number layers of the QAOA tend to infinity, the optimal solution will be obtained with certainty. However, for such a simple example a couple of layers are sufficient. Since the QAOA is a hybrid loop, a part of the algorithm runs on a classical optimizer. This is where the parameters for the phase-separation and mixer Hamiltonians are determined. After optimizing the parameters the circuit can be finally executed in order to yield the solution. (4.5) Figure 8: The probability distribution of the solution for the MaxCut problem. As can be in figure 8the states |5iand |6i(along with |9i,|10i) are the most probable. After converting those states to bitstrings , it yields s1 = 0110 and s2 = 0101, which coincides with the proposed MaxCut in 4.4. 42
Due to the way the circuit for the QAOA was constructed 3.2.2, there isn’t much room for further optimization. The circuit takes such a simple and almost irreductible form that any optimization routine from PyZX yields a longer circuit. 4.5 Hardware Efficient Ansatz 4.5.1 Example Ansatz The first ansatz where this analysis was conducted was the one introduced in 3.40, as it is quite compact. . . . θ1θ2 . . . π π π −θ1 −θ2 (4.6) Bending the diagram, it yields: . . . θ1 θ2 . . . −θ1 −θ2 π π π(4.7) Applying color-change (2.16) and spider-fusion (2.11) on the inputs and outputs, leads to: . . . θ1 θ2 −θ1 −θ2 π π π 1 2n(4.8) Pushing the Hadamard gates through the second phase-gadget changes the color of the observable along with the legs of the phase-gadget itself. Thus, 43
Chapter 5 Conclusions and Future Work 5.0.1 Discussion and Contributions This dissertation aimed at exploring ZX in modelling and optimizing quantum algorithms, namely in the area of quantum data science. Chapter 1introduced the context and motivation of the dissertation along with its objectives. This was followed by an overview of the state of the art of both the ZX-calculus, Quantum Computing and Quantum Machine Learning and finally the Barren Plateau phenomenon. Chapter 2provides a brief overview of the mathematical foundation for the work presented in the dissertation. In particular, it explored a small set of use cases of the ZX-calculus and derivations. It was also detailed how the ZX-calculus is able, resorting to tools like PyZX , to reduce considerably the amount of T-gates in circuits. Chapter 3had the purpose of presenting the diverse set of algorithms that were object of study in the form of ZX-diagrams. These would be later exposed to diverse techniques within the framework of the ZX-calculus. The principal contribution of this dissertation resides in Chapter 4, A first set discussing possible circuit optimizations deals with the implementation of three different types of quantum walks. The first of these, the Continuous Time Quantum Walk, yielded the least interesting results. This is mainly due to the nature of the protocol itself. The following two, as discrete time variants, were much more amenable to the optimization routines employed, making these more resilient to decoherence and noise originated from the quantum hardware. For the Staggered Quantum Walk an interesting alternative evolution operator, was proposed, as documented in the paper ‘Reconfiguring staggered quantum walks with ZX’ (Jardim et al. (2024)) written in conjunction with Jaime Santos and Luís Soares Barbosa. This article was submitted and accepted to the International Workshop on Reconfigurable Transition Systems: Semantics, Logics and Applications — ReacTS’24 — and will be presented in the following 5th of November 2024. Comparatively 50
the results obtained on the Quantum Approximate Optimization Algorithm utilizing the ZX-calculus were quite lackluster, at least in terms of circuit optimization. TWe have also addressed some applications in the context of Measurement Based Quantum Computing (MBQC), which, due to their preliminary character weren’t included in the main part of the dissertation. They are nonetheless discussed below in Section 5.0.3. The chapter closes with an analysis of the barren plateau phenomenon in two different ansatzs. The first, an introductory example, was proven to not have barren plateaus. The second was a variation of the ansatzs present in the work of Sim et al. (2019). The reason for this choice was the fact that a combination of the work of Koch (2022) had already conducted similar analysis on the ansatzs denoted Sim 1 , Sim 2 and Sim 9 . Other sorts of ansatz include parameterized controlled gates or parameterized RYgates, which would make this type of analysis unfeasible, due to the complexity of representing these gates as ZX-diagrams, in the first case, or a lack of research documented in the literature, in the second. This prompted the creation of an ansatz that resembled the nature of Sim et al. (2019)’s work and allowed for this kind of analysis. This ansatz was proven to not have barren plateaus through a reduction to the ansatz denoted Sim 1 . 5.0.2 Future Work This dissertation calls for further research in several directions. Therefore the following items are suggested as future work! 1. Characterize precisely the gates that envelop the alternative evolution operator in the Staggered Quantum Walk, improving the approximation already obtained. 2. Formalize the parameters αnand βnused in the alternative evolution operator. This will make the alternative operator more reliable, as, in its current form, it does not guarantee that the next step of a given walk can be approximated. 3. Expand the work presented in Section 5.0.3 to accommodate different classes of problems besides the QUBO. 4. Convert Quantum Machine Learning ansatzs into MBQC protocols, so that these protocols could be executed in photonic hardware. 5. Integrate the work of Yeung (2020) within the framework for analytical barren plateau analysis to better accommodate ansatzs that include parameterized Ryrotations. 51
5.0.3 Measurement Based Quantum Computing As explained above, the following section discusses some, still preliminary, work in the MBQC domain. Measurement Based Quantum Computing is a rather novel, comparatively to unitary evolution quantum computing, method of performing quantum computations. First introduced by Raussendorf and Briegel (2001), it entirely relies on single-qubit measurements over a heavily entangled initial state, usually denoted by the cluster-state. These measurements are a inherently destructive and random process. However, they are correlated and can dictate the program evolution. The processing of the outcomes of such measurements in a specific order and in a specific basis, makes it to be propagated through the cluster. This cluster state is created by entangling pairs of qubits in a grid-like fashion with CZ-gates. This can be represented with the following ZX-diagram. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . (5.1) One can interpret the number of qubits in each column as the number of qubits available to perform computations and assume that information flows from the left to the right. This setting, in conjunction with an universal set of gates, such as {CZ, RX(θ), RZ(ϕ)}for all θ, ϕ is denoted the one way quantum computer , whose concept relies on the following facts, that are elaborated further in the work of Jozsa (2005) • Any permutation of gates can be implemented exclusively as 1-qubit measurements, as long as the two dimensional cluster state is large enough; • All the measurements are in the basis Mz={|0i,|1i} and M(θ) = {|0i±eiθ |1i} for some θ; • Measurements are always labelled 0 or 1 and uniformly random; • Quantum gates are implemented only up to Pauli corrections XaZb, where aand bare dependent on the measurement outcome. 52
The ‘one way’ qualifier comes from the fact that the original cluster state is irreversibly destroyed during the processing of information. In recent years MBQC has garnered a lot attention, namely because its suitability to be executed in photonic hardware. Indeed, comparatively to traditional quantum computers, photonic machines don’t require extreme conditions, such as being a few millikelvin above absolute zero to control decoherence. Photonic quantum computers are capable of functioning at room temperature and are much more cheaper to maintain/construct. As such, it was inevitable that a lot of research shifted to the MBQC paradigm. One particular example, is the work of Stollenwerk and Hadfield (2024). In which they derive an implementation of the QAOA protocol in the measurement based setting, through the use of the ZX-calculus. Recalling the formulation of the QAOA presented in the Section 3.2, this protocol is composed of two different Hamiltonians: the phase-separation Hamiltonian and the mixer Hamiltonian. They are arranged in the following manner e−iγ1C . . .. . . H H H e−iβ1B |0i |0i |0i e−iγpC. . . e−iβpB(5.2) The phase-separation is composed of two CNOTs enveloping a γparameterized RZgate. This translates in the following way to a ZX-diagram, and consequently to a phase-gadget ⊕ ⊕ RZ(γ) = γ =γ (5.3) This derivation allows for a MBQC-like formulation through a proof introduced in the same work (Stollenwerk and Hadfield (2024)), which yields γ=γmπ mπ mπ (5.4) Notice the need for an ancilla qubit where the outcome of the measurement is m∈ {0,1}. This measurement is then corrected for the other two qubits. Along with the formulation of the phase-gadget, Stollenwerk and Hadfield (2024) also provides a proposal for the mixing operator 53
β= mvπ (−1)mvβm′ vπ mvπ m′ vπ (5.5) This time there is the need for two ancilla qubits. As the input qubit is measured its information is transferred to the second ancilla qubit where it is corrected for the measurements performed in the input and the first ancilla qubit. Let us complete a derivation for an arbitrary Z-rotation yielding mπ mπ γ γ=(5.6) Thus, one is able to construct an implementation of the QAOA protocol in the paradigm of Measurement Based Quantum Computing. Consider the following example: −γ −γ −γ −β −β −β γ γ γ β β β π π(5.7) This is an implementation for the MaxCut problem in a K3graph with an observable on the first and second qubits, as any combination of 2 nodes is a solution to the MaxCut problem. Utilizing π-commutation (2.14), spider fusion (2.11) and color change (2.16) rules yields the following ZX-diagram. −γ −γ −γ γ γ γ 2β 2β π π(5.8) This circuit now allows us to implement the equivalence between the circuit model and the MBQC paradigm described above, resulting in 54
i1π π i2π π i1π i2π m12π γ m12π m12π m23π γm23π m23π γm13π m13π m13π m2π (−1)m22β m′ 2π m′ 2π m2π m1π (−1)m12β m′ 1π m′ 1π m1πm′ 12π γ m′ 12π m′ 12π m′ 23π γm′ 23π m′ 23π γm′ 13π m′ 13π m′ 13π (5.9) This implementation focuses on qubit reutilization, taking advantage of the way the qubits are aligned in the ZX-diagram, as qubits in the same row could be measured and entangled multiple times during the computation. Creating large cluster states for quantum computation is challenging. Thus, a solution is to keep the cluster state being constantly created as the computation goes on. This means that at one side of the cluster it is being destroyed and in the other it is being created and entangled at a faster rate than it is consumed. Hence the ‘same’ qubit can be measured multiple times. This can be observed in the ZX-diagram by the 1-legged Z-spiders, that represent the initialization of a qubit in the |+istate which is later entangled. One might be tempted to optimize or transform this ZX-diagram through the rewrite rules of the ZX-calculus. This is however a dangerous procedure, due to the fact that properties such as g-flow might be violated. This property is what allows for deterministic computations in a seemingly non-deterministic paradigm like MBQC. The g-flow property is assured in the ZX-diagram above through the fact that the circuit model has, intrinsically, this property. Thus when this protocol was converted to the MBQC paradigm, using the equivalences above (5.4,5.45.6) the g-flow property was preserved. In principle, these equivalences aren’t limited to their application in the QAOA and QUBO field. The techniques can be used in other domains of quantum computing, such as, Quantum Machine Learning. In fact, a lot of hardware efficient ansatzs, like the ones present in the work of Sim et al. (2019), can be easily transformed into MBQC equivalent ansatzs. Consider the previously mentioned Sim 1 ansatz. Rx Rx Rx Rx Rz Rz Rz Rz |0i |0i |0i |0i (5.10) Using the same laws applied to the QAOA example above (5.9), results in following ZX-diagram for a single qubit 55
m1π (−1)m1θ1 1m′ 1π m1π m′ 1πm2π m2π θ2 1 (5.11) Note that the construction that represents the RZrotation was simply inverted to assure the output qubit is in the same row as the input. This construction can then be repeated in a ladder like fashion to yield the complete ansatz m1π (−1)m1θ1 1m′ 1π m1π m′ 1πm2π m2π θ2 1 m1π (−1)m1θ1 2m′ 1π m1π m′ 1πm2π m2π θ2 2 m1π (−1)m1θ1 3m′ 1π m1π m′ 1πm2π m2π θ2 3 ... ... (5.12) This example illustrates how Quantum Machine Learning protocols run on a completely different paradigm and a plentitude of different quantum processors. 56
References Y. Aharonov, L. Davidovich, and N. Zagury. Quantum random walks. Phys. Rev. A , 48:1687–1690, Aug 1993. doi: 10.1103/PhysRevA.48.1687. URL https://link.aps.org/doi/10.1103/ PhysRevA.48.1687. Miriam Backens and Aleks Kissinger. Zh: A complete graphical calculus for quantum computations involving classical non-linearity. Electronic Proceedings in Theoretical Computer Science , 287:23–42, January 2019. ISSN 2075-2180. doi: 10.4204/eptcs.287.2. URL http://dx.doi.org/10. 4204/EPTCS.287.2. Paul Benioff. The computer as a physical system: A microscopic quantum mechanical hamiltonian model of computers as represented by turing machines. Journal of Statistical Physics , 22:563–591, 1980. URL https://api.semanticscholar.org/CorpusID:122949592. Jacob Biamonte, Peter Wittek, Nicola Pancotti, Patrick Rebentrost, Nathan Wiebe, and Seth Lloyd. Quantum machine learning. Nature , 549(7671):195–202, September 2017. ISSN 1476-4687. doi: 10.1038/nature23474. URL http://dx.doi.org/10.1038/nature23474. M. Cerezo, Akira Sone, Tyler Volkoff, Lukasz Cincio, and Patrick J. Coles. Cost function dependent barren plateaus in shallow parametrized quantum circuits. Nature Communications , 12(1), March 2021. ISSN 2041-1723. doi: 10.1038/s41467-021-21728-w. URL http://dx.doi.org/10.1038/ s41467-021-21728-w. M. Cerezo, Martin Larocca, Diego García-Martín, N. L. Diaz, Paolo Braccia, Enrico Fontana, Manuel S. Rudolph, Pablo Bermejo, Aroosa Ijaz, Supanut Thanasilp, Eric R. Anschuetz, and Zoë Holmes. Does provable absence of barren plateaus imply classical simulability? or, why we need to rethink variational quantum computing, 2024. URL https://arxiv.org/abs/2312.09121. Andrew M. Childs and Jeffrey Goldstone. Spatial search by quantum walk. Physical Review A , 70(2), August 2004. ISSN 1094-1622. doi: 10.1103/physreva.70.022314. URL http://dx.doi.org/ 10.1103/PhysRevA.70.022314. 57
Bob Coecke and Aleks Kissinger. The compositional structure of multipartite quantum entanglement, 2010. URL https://arxiv.org/abs/1002.2540. Niel de Beaudrap, Aleks Kissinger, and John van de Wetering. Circuit extraction for zx-diagrams can be #p-hard. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2022. doi: 10.4230/LIPICS.ICALP. 2022.119. URL https://drops.dagstuhl.de/entities/document/10.4230/LIPIcs. ICALP.2022.119. David Deutsch. Quantum theory, the church–turing principle and the universal quantum computer. Proceedings of the Royal Society of London. A. Mathematical and Physical Sciences , 400:117 – 97, 1985. URL https://api.semanticscholar.org/CorpusID:1438116. David Deutsch and Richard Jozsa. Rapid solution of problems by quantum computation. Proceedings of the Royal Society of London. Series A: Mathematical and Physical Sciences , 439:553 – 558, 1992. URL https://api.semanticscholar.org/CorpusID:121702767. Ross Duncan, Aleks Kissinger, Simon Perdrix, and John van de Wetering. Graph-theoretic Simplification of Quantum Circuits with the ZX-calculus. Quantum , 4:279, June 2020. ISSN 2521-327X. doi: 10.22331/q-2020-06-04-279. URL https://doi.org/10.22331/q-2020-06-04-279. Bryan Eastin and Emanuel Knill. Restrictions on transversal encoded quantum gate sets. Physical Review Letters , 102(11), March 2009. ISSN 1079-7114. doi: 10.1103/physrevlett.102.110502. URL http: //dx.doi.org/10.1103/PhysRevLett.102.110502. Andrew Fagan and Ross Duncan. Optimising clifford circuits with quantomatic. Electronic Proceedings in Theoretical Computer Science , 287:85–105, January 2019. ISSN 2075-2180. doi: 10.4204/eptcs. 287.5. URL http://dx.doi.org/10.4204/EPTCS.287.5. R. P. Feynman. Simulating physics with computers. International Journal of Theoretical Physics , 21(6): 467–488, 1982. Lov K. Grover. A fast quantum mechanical algorithm for database search, 1996. Stuart Hadfield. On the representation of boolean and real functions as hamiltonians for quantum computing. ACM Transactions on Quantum Computing , 2(4):1–21, December 2021. ISSN 2643-6817. doi: 10.1145/3478519. URL http://dx.doi.org/10.1145/3478519. 58
Bruno Jardim, Jaime Santos, and Luís S. Barbosa. Reconfiguring staggered quantum walks with ZX. ReacTS’24, Springer Lecture Notes in Computer Science, 2024 (to appear) , November 2024. Emmanuel Jeandel, Simon Perdrix, and Renaud Vilmart. Completeness of the ZX-Calculus. Logical Methods in Computer Science , Volume 16, Issue 2, June 2020. doi: 10.23638/LMCS-16(2:11)2020. URL https://lmcs.episciences.org/6532. Richard Jozsa. An introduction to measurement based quantum computation, 2005. URL https: //arxiv.org/abs/quant-ph/0508124. Aleks Kissinger and John van de Wetering. Reducing the number of non-clifford gates in quantum circuits. Physical Review A , 102(2), August 2020a. ISSN 2469-9934. doi: 10.1103/physreva.102.022406. URL http://dx.doi.org/10.1103/PhysRevA.102.022406. Aleks Kissinger and John van de Wetering. Pyzx: Large scale automated diagrammatic reasoning, 2020b. Mark Koch. Quantum machine learning using the zxw-calculus, 2022. URL https://arxiv.org/ abs/2210.11523. Jarrod R. McClean, Sergio Boixo, Vadim N. Smelyanskiy, Ryan Babbush, and Hartmut Neven. Barren plateaus in quantum neural network training landscapes. Nature Communications , 9(1), November 2018. ISSN 2041-1723. doi: 10.1038/s41467-018-07090-4. URL http://dx.doi.org/10. 1038/s41467-018-07090-4. Renato Portugal. Establishing the equivalence between szegedy’s and coined quantum walks using the staggered model. Quantum Information Processing , 15(4):1387–1409, January 2016. ISSN 1573-1332. doi: 10.1007/s11128-015-1230-7. URL http://dx.doi.org/10.1007/ s11128-015-1230-7. Renato Portugal, Raqueline A. M. Santos, Tharso D. Fernandes, and Demerson N. Gonçalves. The staggered quantum walk model. Quantum Inf. Process. , 15(1):85–101, 2016. doi: 10.1007/ S11128-015-1149-Z. URL https://doi.org/10.1007/s11128-015-1149-z. John Preskill. Quantum computing in the nisq era and beyond. Quantum , 2:79, August 2018. ISSN 2521-327X. doi: 10.22331/q-2018-08-06-79. URL http://dx.doi.org/10.22331/ q-2018-08-06-79. 59
π 2 3π 4 7π 4 π 8 π 4 π 4 7π 4 5π 4 11π 8 3π 8 π 4 7π 4 3π 4 7π 4 π 4 13π 8 5π 8 7π 4 π 4 π 4 3π 4 5π 8 5π 8 π 4 3π 4 π 4 13π 8 π 4 π 4 7π 4 7π 4 7π 4 π 4 5π 4 15π 8 5π 4 7π 8 11π 8 5π 8 7π 4 7π 4 π 4 π 4 3π 8 13π 8 π 4 π 4 7π 4 7π 4 11π 8 13π 8 π 4 7π 4 π 4 7π 4 7π 4 13π 8 7π 4 7π 8 7π 4 5π 4 5π 4 11π 8 π 4 π 2 13π 8 π (A.3)
π 2 3π 4 7π 4 π 8 π 4 π 4 7π 4 5π 4 11π 8 3π 8 π 4 7π 4 3π 4 7π 4 π 4 13π 8 5π 8 7π 4 π 4 π 4 3π 4 5π 8 13π 8 5π 8 π 4 π 4 3π 4 π 4 π 4 7π 4 7π 4 π 4 7π 4 5π 4 15π 8 5π 4 7π 8 11π 8 5π 8 7π 4 7π 4 π 4 π 4 3π 8 13π 8 π 4 π 4 7π 4 7π 4 7π 4 11π 8 13π 8 π 4 7π 4 π 4 7π 4 7π 4 13π 8 5π 4 7π 8 7π 4 π 5π 4 11π 8 π 4 π 2 13π 8 (A.4)