1 >> Alexander Holroyd: Good afternoon. Happy to have our own Alex Bocharov from here at MSR to talk about the incredible shrinking quantum circuit. >> Alex Bocharov: Hello, everyone. Thanks for coming to the talk. I work for about a year now in a pretty new QuArC group, quantum architecture and computation group, and although we are new kids on the block, we manage to make some progress, and this would involve me, Krysta Svore and Yuri Gurevich in software engineering group, who is also well known mathematician with a fairly broad background. So without further adieu, let me start. The road map for this talk will be pretty simple. I'll give some definitions, and I'm afraid I have to spend 15, maybe even more minutes in the definition part. Then I'll give a couple of slides on the success story, which explains the title of the talk. We'll see which one was shrinking so much. And then dive straight into the math background of it, which hopefully would expose you to a source of interesting mathematics and open problems like that. And I will wind up with some open directions for further research. So the talk is on the key topic of quantum compilation. The quantum compilation is currently in its adolescence. So therefore, it keeps asking questions that sound simple but actually incredibly complex. So it requires some heavy guns to solve. Now, I will actually spend very little, I need very little from the actual quantum and quantum physics, from quantum work. Maybe I'll make just two or three statements to tie it in together. So an idealized version of quantum computation is as follows. You have a system that is non-deterministic. It's all quantum, inherently parallel. And the process of quantum computation is iteration of the following look. You prepare a quantum state, and you let it evolve, and then you measure the result. Repeat as needed. Now so you mention you set up a shed in your cat cage and, you know, let it evolve and then see if the cat is dead or alive. So the mathematical model of the evolution is quite simply a unitary operator on a complex vector space, and this vector space dimension is a power of two. Its dimension is two to the power N, where N is a number of quantum registers, or, as they are called, quantum qubits. Now, the measurement is actually not a mere observation of the result. It 2 actually has, according to the quantum first principles, a side effect, a systematic side effect of actually constraining a system to a smaller subspace. If you measure the result and the measurement was to determine whether it belongs to the sub-zero subspace or the sub-one subspace, then not only get a 01 as a measurement, but you also see the system collapse to one of those subspaces according to what was measured. But for right now, this talk is almost exclusively about the evolution part. So it's almost exclusively about the unitary operator that describes the evolution of quantum system. And we are kind of -- usually, quantum computer is designed to interact with a classical environment, but we leave it completely outside. We want to see what happens in this cloud shape space. So here are some mathematical definitions. There is only one physical fact that is required on this slide, and then we are almost completely depart from physics. So qubit is a unit of quantum information. You can think of it as an elementary particle, which kind of governed by Schrodinger equation. But from a mathematical standpoint, qubit has two basis states. That is called up and down. And starting with Richard Feynman, people used cat notation. So zero in cat is up and one in cat is down. The single qubit can be in a super position of the two basis states, and this proposition has complex cohesion. The cohesions must be normalized such that the sum of their absolute squares is one. And it might seem that this defines the qubit as a three-dimensional real state, because we have just eliminated, we have one constraint over four parameters. But in fact, it's smaller, but from a physical standpoint if you remove any multiplier that has absolute value of one from the super position, from the physical standpoint, nothing changes. So this state can always be normalized such that its first component is real and, therefore, it's a cosign of something, and then some phase multiplied by sign of something. And, of course, I'm used to zero cat here. Sorry about this. So imagine zero has to be here. So, in fact, it's two dimensional, and people like to map this on to a regular, two-dimensional sphere, which is called Bloch sphere after physicist Alex Bloch, and the mapping is done by a spherical coordinate. So theta is the usual theta spherical coordinate, and phi is the other spherical coordinate. 3 And so every state is represented on this Bloch sphere. Now let's go now to a two qubit situation. Two qubit situation, and I will not go further on. So my N is either one or two for the rest of the stalk. Turns out that all the complexity is already presented there. Rather, about two-thirds of all the complexity in quantum compilation happens on the one qubit on two qubit level. So the two qubit state space now has four basis states, up/up, up/down, down/up, and down/down. And the evolution of a two qubit system is described naturally by a four by four unitary matrix, and there are special kind of matrices that are more interesting than the others that are called controlled unitary. So a Bloch matrix, which has an identity on the left top and some two by two unitary matrix on the bottom right, is called a controlled unitary. And again starting from Richard Feynman, there is this little pictograms that people assemble in rather large circuits. The wire, the horizontal wires stand for qubits, and the boxes contain unitaries, and this kind of thing which is almost a musical notation, means control. So why is it called controlled? Let's take a look. So I have labeled the columns with the basis states with the basis states in two qubit state space, and we see that if the first index of the basis state is zero, then nothing happens. And if it's one, then something is applied, which means that we can view the first qubit, this one, as a control wire. And if there is nothing applied to control wire, then nothing happens. If there is a one applied to controlled wire, then you perform some action. A very important thing that is actually almost a logical operator is a cNOT, where this one is just a not operator, and this is a controlled not called cNOT, but the more common notation for control in this science is lambda. Lambda-x or cNOT are synonyms, and they stand for this kind of matrix, and this is the pictogram for it. So it turns out, and it's a result going back to 1995, that any two qubit controlled operation can be decomposed into, up to three uncontrolled single qubit operations. Just operation on this one qubit on this one wire and two 4 cNOT operations. And this is a fairly interesting decomposition. Generally, a controlled operation does two things. First of all, it applies a phase shift to a system, and it also creates entanglement between the two qubits. It's not always, but in general when you do something like that, on the exit you get a quantum system where you actually cannot reasonably ask what is the state of this qubit and what is the state of that qubit. It's one common state where the two qubits have been entangled. So this is a rewrite of this situation, and this rewrite means that we want the phase operations, that we want to separate them out and isolated inter-qubit interaction to some primitive, to just one cNOT primitive. Now, if you now want to run it on the actual quantum computer, then what happens is that you only need one primitive operation, that is a two qubit one, that /SPWAFRPBGles the qubits, and then you will need further to decompose those fairly complicated things into single qubit primitive. This is, by the way, probably the last time I'm showing this pictogram until sometime later in the talk. The more common and more understandable algebraic notation is this. So this part is a tensor product of identity times single qubit operation, then you compose the with cNOT, then you have a tensor product of identity with another single qubit operation, compose it with cNOT, and finally this is identity composed with this single qubit operation. So all this serves to show, that it looks like in principle, we can reduce everything to single qubit compilation, period. But in the end of the talk, I'll give a hint of why this might be not a very good idea. But for now, let's run with it. So what we want to do now, we want to now do single qubit decomposition, which is in mathematical terms defined quite simply as fuzzy group theory on a unitary group. What we want to do is we want to be able to find a countable subgroup of operations that can be done on a practical quantum device and be able to approximate everything else with this countable set. This is, of course, uncountable, so you really cannot -- this is a proper inclusion. So you only are talking about approximation. And with this countable subgroup, called circuits, you have an additional function that measures the cost of a circuit. Naively, it's a length of a circuit, but there are some variations to that. There are some operations that are more expensive 5 and less expensive. So you compute the cost of the circuit and of the product of a single qubit decomposition is the following. Given a single qubit unitary operation in a unitary group in epsilon, which is a desired approximation precision to which you want this approximated, and required to find the circuit in the circuit group such that distance between the circuit and this unitary is less than epsilon and the cost of the circuit is optimal in some sense, either optimal, period, or symptotically optimal. So the next very important question is what do people believe in? What kind of circuits they think can run on the quantum computer which would approximate everything else? In other words, what are the primitives? And there is only a handful of things that people compose the circuit of, and we start with the simpler ones. So there is a simple group of just 16 elements generated by those things, which are known as Pauli matrices. If you ever had any exposure to quantum physics, you probably instantly recognize what they are. They are matrix acting on spins. But for now, you just -- let's just consider them to be some anointed elements anointed elements of SU(2). Their geometric interpretation is also very simple. On the Bloch sphere, which is populated with a state of a single qubit system, when you apply either of those, that will be an angle pi rotation around the corresponding axis. So X rotates around X axis. Y and Z rotate around Y and Z axis. So it is intuitively clear that you cannot go too far with those. I mean, they are very small, finite group. So let's add something else. Let's at least add pi over four rotation here. This makes group a little bit larger, but it's still small and still finite. >>: [indiscernible]. >> Alex Bocharov: What is this is that? Let's see. Okay yeah, this is pi over two rotation. This is E to the power -- I is E to the power I pi over 2. >>: [indiscernible]. >> Alex Bocharov: I did, sorry. It's actually kind of complicated, but you're right. So we need to add something else. We need to actually start combining 6 some rotations together. And one incredibly important operation that is a staple of all the useful classical circuits is Hadamard gate. And as you see, it kind of mixes the X and Z components together, but adding a Hadamard gate to all on the previous slides still creates a fairly small, finite group. From a purely algebraic point of view, it's a group of 192 elements. But from the physical viewpoint, it's just 24 elements, because the phase is irrelevant. Now, finally, we need -- we add just one more thing, which is this operator. Also, we just adding rotation by a smaller angle yet. And when you add this one, you get an infinite group. And moreover, this group is everywhere dense in SU(2). Request of so here is an example of a circuit in this group. So it's just a sequence of letters standing for composition. Hadamard, T, Hadamard, T, blah, blah, blah, phase gate. And what it does, it approximates a fairly small rotation. This circuit approximates a rotation by angle pi over 32 to a precision of about ten to the power minus 4. And so this is kind of interesting, because you had a rather large angles, and now you need -- you're kind of rotating around various axis to move state in the position where it appears to have rotated to a very small angle. >>: All of these things are literally rotations of S2, are they? >> Alex Bocharov: They can be all interpreted as rotations on the usual sphere. Actually, so SU(2) is almost the same as SO3. So it's almost an orthogonal rotation. It's up to a center of two elements, I think. Now, it turns out that we are going to be much better off compiling into a different bases. So again, those are three unitary operations. They are rotation by one of the same odd angle around corresponding axis. So V1 is a rotation around X axis. V2 is rotation about Y axis. V3 is rotation about Z axis. But again, it's just a finite angle, but you can approximate anything with the circuits composed out of this. Including small rotations. So it turns out that the circuits, which you compose all of this, they scale out rather wildly. The grid, when you start creating it with various compositions of this, is creating -- is growing like five to the power L, where L is the length of composition and they populate the SU(2) rather densely. Slightly more convenient version is not using just the V2, V3, V1, but using Pauli matrices along with this. Turns out that if you add Pauli matrices and 7 take those three big angle rotations, then the inverses will be automatically generated in this group. >>: The ones that [indiscernible], would it be sufficient just to include V1? >> Alex Bocharov: Yeah, I mean, the other alternative is to include phase gate and Hadamard gate, both S and H here. Then you could drop either two of the Vs. So one of the V would be sufficient. So here is an example of a circuit that again approximates that same angle, pi over 32, but to a much greater precision. I don't remember what the precision is, probably ten to the power minus seven or something like that. So I will now spend some time comparing these two bases and the compilations in the two bases. But before I do, let's look at what the goals are. We want to have an algorithm. It's not sufficient to say that you can do it. You want a specific algorithm, that given an operator and a precision, generates a circuit at a requested distance of epsilon, and we also want the cost of a circuit be polylogarithmic in terms of one over epsilon. So polylogarithmic would mean that we actually want the cost depend on order of magnitude of epsilon only. And D is the degree of this polynomial that defines the polylogarithmic, and of course I won't go through this slide, because it's kind of simplish, but anyone who ever done asymptotical analysis in this tense, that the degree is much more important than the constant in front of it. So all the progress in the year 2012 was around slashing this degree. And it's amazing how much happened in just nine months of 2012. Somewhere in -- okay. I need to back up and say something. So this decomposition algorithm could be just as simple as is shown, just given a target gate and precision create a circuit at this distance. But optionally, such algorithm could use special states prepared on additional qubits. So while this kind of algorithm would be limited, would not require any additional qubits, just one qubit is enough for anything, a more complicated type of decomposition would require some ancilla qubits where they would create some state and then clean it up. >>: So in other words saying that would be you have your word that you end up with, but it has blocks [indiscernible] identical blocks in it. 8 >> Alex Bocharov: Yeah, you have many wires. You are interested in performing an action on only one wire, but you have created some auxiliary states and then you have garbage that you need to clean on the other wires. >>: But algebraically, is it [indiscernible]? I mean, you want to create a word in the group with the generators, and you're saying if there are a bunch of identical sub words in it, then I only count the cost of the words. >> Alex Bocharov: No, it's not quite that. What it is really, from the algebraic standpoint, you have to go out of the limits of SU(2). You need inject operations from unitary groups of higher dimensions, which will then collapse back to SU(2), but in the middle you allow kind of going out of one dimension, kind of, then going back in. So here is what was happening. In April, Cody Jones and co-authors compiled in H, T basis, and they had a polylogarithmic result with D equal to two, but they used quite a large number of ancillary qubits. In June, myself and Krysta Svore figured out how to compile in H, T basis at the cost of which was polylogarithmic with actually a rather large degree. Larger than two, obviously. But we didn't use any ancillas. In September, Duclos-Cianci and Krysta Svore created an entirely different scheme that actually reduced this degree to about 1.22 while using quite a number of additional qubits. The story is a little bit more complicated, because they haven't reduced the notion of offline and online usage. I can't go into this. But to simplify, one might say they used some ancillas. In November, myself, Yuri Gurevich and Krysta Svore figured out the comp ration for the first time figured out the compilation into V basis, which is all log one over epsilon, meaning the D has been reduced to one using none of the ancillas. Then in December, Kliuchnikov, Maslov and Mosca figured out pretty much the same for H, T basis using two ancillas. And finally, right on Christmas Day, I'm not kidding, Peter Sellinger figured out compilation in H, T basis with this theoretically the best cost, using none of the ancillas. Now, this is the asymptotics. Now let's look at specific guarantees and what 9 was happening. So the year started with many people content with a rather old solutioned given by Newton and Dawson. So there is a bunch of curves here that might seem confusing so let's go over the axis first. So both axis are on logarithmic scale. The horizontal axis is precision, and the vertical axis is a resulting circuit cost expressed in units called T-counts. They are comparable between various methods. And if you look at the curve very closely, you can see that we are talking here circuits -- we are looking here at circuits that has hundreds of thousands of T gates in them. And the D, the degree of the polynomial in the post occasion was about four here. 3.97. Now, this is a somewhat better curve. It's mine and Krysta Svore's, the June curve, but it was very quickly super seated. So this is the state distillation protocol by Duclos-Cianci and Krysta Svore. It's one of the best ones on this picture, but it uses a bunch of ancillas, as I mentioned before. So in November, we found the algorithm that still seems to be the best in algebraic sense. So this is a curve. I will show explicit guarantees as my talk develops, but this is a kind of compilation into V basis. And if you see what happens here, right here, you have about 140,000 gates, and here you have about 17 V gates. So then Kliuchnikov, Maslov and Mosca and Peter Sellinger created the kind of asymptotically best solutions for H, T basis, and they represented by some of the curves here. So the red curve is Sellinger's. And one might ask, why this curve here was not the closure of a story and something else needed. The problem here is that V basis is very expensive to actually run on a quantum computer. So while algebraically this is a fine and interesting curve, in practical terms, the real curve is somewhere here. If you kind of factor in the current cost. So these solutions are running neck to neck to each other, and one of the open questions that we have and we want to make a progress on is how to implement a V gate for the V basis at practically the same cost as a T gate. I mean, if you have it six times more expensive than the T gate, then this curve comes down lower and becomes one of the best ones. >>: [indiscernible]. >> Alex Bocharov: I'll be showing it in. I'll dive into it, yeah. 10 >>: [indiscernible] ten times more expensive than a T gate or something like that? >> Alex Bocharov: >>: That's outside the picture of algebra. I know. >> Alex Bocharov: So here is the thing. The gates that make your quantum computational, the addition of which actually creates an infinite group that is everywhere dense, cannot be made in a fault tolerant fashion, noise resistant fashion very easily. You need to go through a certain contortions which are usually called state distillation protocol. You basically need to create a special resource state elsewhere outside your quantum circuit, and then teleport the state into the quantum circuit to perform the gate. And for V gate, this process is much more expensive than for T gate. >>: The question still stands. Is it a constant factor more expensive, depending on the type of gate? For example, with current technology, V is ten times as expensive as T? >> Alex Bocharov: Well, another problem with the V gate is that this factor is not really deterministic. So when I say ten, ten is an expected factor. But it's a kind of quantum random walk before my V gate and occasionally you can run into larger expense than that. So there are all sorts of things, but Cody Jones, whom I already mentioned as one of the early contributors, the April paper by Cody Jones, is currently working on something that is very promising in terms of bringing the cost of V gate down. So there is a kind of cutthroat competition here, I would say. I mean, it has been a lot of people working. But the progress was simply amazing, and this entire class of algorithm came down almost five orders of magnitude in quality. Or came up in quality five orders of magnitude in the course of just nine months. So the thing that made this possible is a mapping between the group theory and number theory, which is kind of interesting development. And I would like to 11 start with a V basis, because that's our baby, and we kind of get into much more depth in the V basis space. So but in general, for any basis, for any circuit set, the recipe is the following. So you have a circuit, a set of circuits that have some generators. The first thing you need to figure out is what kind of matrices these circuits are [indiscernible] to. You need to characterize those matrices. Once you have this kind of correctization and you happen to have a matrix that is in that subgroup, so it's guaranteed to have an exact representation in terms of circuits of this subgroup, then how do you actually synthesize, how do you constructively synthesize the circuit for this matrix. And then we have to remember that the circuit subgroup is countable. The SU(2) is not countable. So the third step, which is often the hardest, is figuring out now, given any unitary and an epsilon, how do you find this matrix in this group, subgroup at a distance less than epsilon from the target. And this is the answer to the first question for W circuits. Remember, it's three poly matrices and three V matrices. And we want to know which unitaries are represented exactly without any error. By W circuits containing lesser equal than L gates. So the turns out that it's an integer coefficient combination of poly matrices divided by a normalizing factor that is a half integer power of five. So that's the characterization. And once you look carefully at this characterization, then this is a property for these integers for you for you to be unitary. The sum of squares of integer coefficients must be five to the power L. So looking at this four square decomposition of five to the power L, one might think quaternions, right, and this is the case. Turns out that all the matrices like that are in one-to-one mapping on a group of quaternions generated by these generators. So this is the quaternion units, and those are the things that [indiscernible] the three V matrices. That's observation number one. Observation number two is that there is a whole lot of four square decompositions of five to the power L. There is approximately ten to the power -- ten times five to the power L different four square decompositions. 12 So we have a lot of matrices that are conforming to this characterization. This actually is a consequence of Jacobi four square theorem. The number of our square decomposition of an old integer is eight times some or all of the divisors of N. And if you look at what are all the divisors of five to the power L, you get this thing here. So it scales very aggressively. You grow the circuits, and you get a lot of them. Okay. So now you have a unitary that is like this. How do you synthesize the circuit back? Well, again, since we already have one-to-one mapping into quaternions, and I'm missing a lot of details here, it's quite interesting. But quaternions is a division ring so you can actually factorize this quaternion at a linear cost, and the factors are going to give you the circuit structure. So that's the first two questions answered. What is the characterization, what are the matrices that are represented as W circuits, and how do you synthesize them? But then the difficult part of the problem is when you have a target gate here, how do you find something that is very close to it. So let's talk about this picture. This is really not a two-dimensional sphere in three-dimensional space. This is a kind of symbol here for three-dimensional sphere in four-dimensional space. So this is specifically a sphere of radius five to the power half L, or you can think of it as a quaternion sphere if you want. But it turns out that you have a very good chance of getting as close as five to the power of minus L over three with circuits of lines L or less to any target. It's actually not guaranteed. It's a kind of average. The worst case distance is slightly larger. So but assuming for a second that all those ten times five to the power L grid points were distributed perfectly uniformly on this sphere, then you would get, on average, about six points in this neighborhood. Just compute the volumes, it's really pure geometry. There is nothing more scientific. And so you can hope to find at least one, sometimes there isn't, but on average there is six points here. So you need to do a direct search. There is no other way around it, finding a handful of points out of exponentially many is complicated. But there are some optimizations that I'm not going to go into. You can actually practically do it on a classical computer up to L of about 34. But we 13 need a better solution. Before I'm going to be talking about what the better solution is and what setup the better solution is, an example. So here is a target unitary from a [indiscernible] structure, but you can get that it's really a unitary. And this is a U matrix, a conforming matrix which, as you can see, consists of integers, of Gaussian integers divided by square root of five to the power of 34, and that 34 suggests that you can read off a circuit of we count 34 from it. And this is a rather good approximation of this target. The distance is 8.5 to the power ten to the power -- it's ten to the power minus nine order of magnitude, which is rather good one. Of course, the sum of all the four integers is five to the power 34, and you can easily read this thing out. It would require, at most, 204 [indiscernible] quaternion divisions, which is kind of just a little bit more sophisticated than integer long division. And in the end, you have a dangling Pauli matrix. This is how it happens. You kind of divide things out and the norm of the quaternion goes down, down, down, until the norm of quaternions, is one. And only Pauli matrices correspond to quaternions of norm of one. So this is all good, but if you want a higher precision and we want a faster algorithm, even if you have to sacrifice something. So here, we need to go even deeper into number theory and make an open conjecture that is still unproven. However, it's similar to the conjectures that our colleagues in H, T basis space, Kliuchnikov, Maslov, Mosca and Sellinger is making. Here is a conjecture, and it's kind of dense. So let's consider a prime number P, and let's consider a three-dimensional sphere in four-dimensional space of radius P to the power half L. And let's look at all the integer grid points on this sphere. So A, B, C and D are integers now. As I mentioned a couple of times before, there is all P to the power L of those grid points. There are many. If you project this grid sitting on this three-dimensional sphere on any two-dimensional coordinate plane, of course you get a bunch of integer points or Gaussian integers, if you will, on the two-dimensional planes that are within the circle of radius P to the half -- to the power half L. So this projected points have a certain density among all the Gaussian integers that could be found here. And this is a simple fact what the density is. It's 14 about one over L. It's an easy geometry. However, what we want to that if you have a ring like that, a narrow ring. And moreover, if segment within this ring that is squeezed between the boundary of a a tangent to the inner side of the ring, then in both this ring and this segment, we do have about the same density of projected points grid. assume is you have a circle, and in both from the So we want to hypothesize that in this ring, there is approximately this many Gaussian integers, and we want to posit that about every [indiscernible] of them is a projection from the four-dimensional grid. In this segment, there are approximately so many Gaussian integers, and we want to posit that every else of them is a projection from the four-dimensional grid. So we write a bunch of literature on number theory, and this is tough. I mean, this is tough. Then we run some simulations, some experiments with P equal to five and P equal to 13, which is kind of the closest suitable Ps to run. And we didn't find a single counter example. No evidence that this is not true. So this goes back to the time of [indiscernible] and the more general problem of how many integer grid points do you have in a flat counter and how many of them can be actually complemented to be a four square decomposition of a certain number. So let's assume for now that this is true. It actually -- our algorithm based on a quantum leap -- sorry, leap of faith all work and so even if this conjecture is not true, then the case where it's not true is probably ->>: [indiscernible] blue segment. >> Alex Bocharov: No, this blue segment, so there is a constant. So this radius is P over will over two, and this constant is greater than two. >>: [indiscernible]. >> Alex Bocharov: Yes, you can rotate it. >>: And still you expect many, many fewer points in A projecting into A than into the ring? >> Alex Bocharov: Well, the density, we expect to be the same. It's just how many integer grid points are there. This is a simple geometry, there is 15 nothing to prove there. The number of integer grid points is P to the quarter of L, but we don't know how many of them are projections from the four square decomposition of P to the power L. >>: [indiscernible]. >> Alex Bocharov: So delta is a small constant. So also know that we are talking asymptotics, when L goes to infinity. So this ring is awfully narrow, and the segment is also very narrow. But it's actually quite long, the segment is actually very long. It's approximately P to the power quarter L long. So it's exponentially long and has a constant width. So here is what's happening now. We start with approximating a special kind of unitaries, which are just Z rotations. Rotations around ZX is on Bloch sphere to a certain power. And for our W circuits, P equal to five, so this is five and this is approximately O to the quarter, to the power quarter L Gaussian integers in here. As per conjecture, there is about every else of them is actually -- is completed, can be completed to a composition of five to the power L into four squares. And that's what we need to probability polynomiality of the following simple algorithm. The algorithm is like that. The input is a rotation and an epsilon, which is an approximation that we want. And we set L to be a ceiling of four, one over epsilon log five. And here is the first time you can see the explicit constant. Here is an explicit guarantee, not just some asymptotics. That's how constant. When we are doing a direct search, by the way, we would sometimes fail and we took exponentially long time, but the constant would be three instead of four. So let's take the neutral set of all the Gaussian grid points in here, and we start iterating through it at random. So we pick a random integer grid point in G, and then we test whether there exists two other integers such that the sum of the four -- the squares of four integers is five to the power L. This, by the way, is known to be a probabilistic test with this complexity, with this expected complexity. There is a paper by Rabin and Shallot that shows how to do that. And it's fairly easy to implement. I implemented it in mathematical. 16 So if such [indiscernible] exists, then we said a complexion to this ABCD tuple. And in either case, we delete the point we already tested from G, and we run until G is non-empty. So in the worst case, we'll have exponentially many steps here. But the expected number of steps is OL, because of the conjecture on the previous slide. So with the probability O 1 over L, we would run into something that is completed to have four square decomposition of five to the power L. And then, of course, when we can find it, we are create a matrix here, which is conforming, and can be exactly decomposed into a W circuit. And the very important part that I totally forgot to mention, everything in this sector is epsilon close to RZ. It's, again, an easy fact. So any candidate that would peek in here is granted to be epsilon closed. So we found something that is epsilon close and exactly decomposable, so we are done. This is an experiment run on 1,000 of random rotations. The red curve is the theoretical guarantee. The blue curve is what we actually were getting on average, and the size of the markers are suggestive of the standard deviation, which was not very large. So the take-away from this slide is that you can get a very, very tight precision in practice in polynomial time but, in fact, it's just some seconds per target. Now the tight match between blue and red curve is really not very insightful, because the algorithm is actually designed to bail out as soon as any suitable candidate is found. Maybe if it was allowed to run somewhat longer, it would find an even better approximation. So that's the W circuit. And it was done, the trade-off is if you want to spend exponential time looking for a good approximation, you can actually get a nicer constant in front of your term, of your logarithmic term. But if you want to do it fast, you can do it and get a slightly [indiscernible] constant. >>: Did you test how to find these compositions once you found this integer [indiscernible]? >> Alex Bocharov: Actually so I was doing it bottom-up, right. So I was doing it bottom-up, and I might have done it top-down. So here is the deal. So you 17 find this integer point. It's actually completable to the four square decomposition of five to the power L. Then you create this matrix here, and then remember a few slides ago, I mentioned that this is in one-to-one correspondent with the quaternion that you can factorize. And when you factorize a quaternion, its factors point right away at what the matrices are used in which order. >>: And algorithmically that characterization -- >> Alex Bocharov: five. >>: It's linear cost. It's trial division by quaternion norm of And then you get the smaller one [indiscernible]. >> Alex Bocharov: So you have this -- that's your quaternion. And this is the ones that correspond to the [indiscernible] basis. Actually, you have to take them and -- with minuses as well. This is K. So you do six trial divisions. You need to see which one divides it. And it doesn't matter. You take the first one that divides. And then ->>: Is the L smaller? >>: So this is this quaternion, and it corresponds -- it has a quaternion norm of five to the power K, where K is less or equal than L. And what happens when you find the divisor and divide it out, then this goes down by one and you end up with. Okay. This is fun. So let's now go to H, T basis. You will see more of the same, but it's actually somewhat more complicated. It's the same thing as if you go to number fields, then algebraic extensions of number fields are actually more subtle thing than transcendental extensions. Are we running out of time? >> Alexander Holroyd: Yes. >> Alex Bocharov: Okay. So I guess I need to do the H, T basis some other day. So let me zoom through this slide real quick. One thing that is necessary for H, T basis is something called order eight cyclotomic integers, 18 which is extension of integer ring with square root of Y. And the matrices that we want are more complicated, and this is an example of a matrix you have to deal with. It's kind of headier, and that's the kind of circuit you get. And then Peter Sellinger did essentially the same thing. He has the same segment looking quite the same as in W basis, but then he had a tougher work of solving a [indiscernible] equation in -- actually, in norm equation. And in terms of performance comparison, you have seen some curves. You have seen that theoretically, V-basis is much better if you disregard the current cost of running a V gate. This is an example. This is my implementation of Sellinger's algorithm mathematical. And so you have a really small angle rotation, a tiny angle rotation. And this runs in, actually, a couple of seconds, produces an approximation, H, /T circuit approximating to ten to the power minus 30, and so you can really, really do this for a small angle in terms of not so small angles. So open problems. We need to be looking at another order of magnitude improvement. There is a lot of slack in all this story. So one slack is due to the fact that when you have an arbitrary unitary, you first decompose it into three axial rotations, which is a waste. You should go and try not to do that. Another source of slack is this decomposition. For the two qubits you are, like I showed this diagram in the very beginning, you decompose it into a single qubit in cNOT, and the open proposal is that you should be using entirely different basis. And hopefully, it's completely open question whether it's better or worse using this basis, but there are some indications that you can get another factor of three or four improvement doing that. We would like to thank a whole lot of people for talking with us about this. And there are some key publications that provide all the necessary details on the algorithms. I included only really the key ones, but they obviously reference other things that has been developed and published entirely in the year 2012, very recent. And now I have to thank you for your attention. 19 >>: [indiscernible] results, they were conditioned on this conjecture, so the number of points ->> Alex Bocharov: So it's not -- the curves are the quality of the resulting circuits, and they are not conditional on those conjectures. What is conditional is the classical cost of compiling a circuit. So imagine you have a classical computer, and you have a cross-compiler that runs on the classical computer and produces the circuits that your quantum algorithm needs. What is the cost there? Well, for it to be probabilistically polynomial in the context of our algorithm and Peter Sellinger's algorithm, you need those conjectures. >>: Even if the conjecture fails? >> Alex Bocharov: >>: If the conjectures fails -- So what if you don't -- >> Alex Bocharov: No, it's probably a geometrical fact that you do have those points. The question ->>: It's the upper bound you want, is it? I mean, the conjecture says the number of points is what you expect it to be. >> Alex Bocharov: >>: So let's have a look here. The fact that it's dense is proved. >> Alex Bocharov: Yes. The density is provable. Oh, okay. right. There is a correctness issue here as well. So if ->>: I think you are [indiscernible]. >> Alex Bocharov: So theoretically, they could be, in this region, there could be no Gaussian integer that can be completed to the projection of a dimensional grid. But, I mean, it's fairly unlikely. I mean, it's much less likely than having it at a low density. What could go -- what could rather go wrong is that you do have those points, 20 but you have only a handful of them. What we posit here is we have exponentially many of them in here, such that the ->>: So if you have only a handful, that means you need to examine lots of -- >> Alex Bocharov: Yes, then your classical side complexity, your compilation algorithm will round exponentially many steps. But indeed, I mean, personally, I don't believe it. I bet anything on that. But there is theoretically a possibility that you don't have any single point in here. So some experiments we were running is actually running a [indiscernible] Smirnoff test on the distribution of Gaussian integers in here, and it's pretty uniform, which means that you can -- not the Gaussian integers. The Gaussian integers that are completed as a projection of four square decomposition of five to the power L, what is the density of that subset in an angle space, in a polar angle space, and it's pretty uniform, meaning that whenever your target angle might be, you will most likely get about the same number of points there. And, of course, if the tangent of your angle is rational, then it's fairly easy to find a guarantee. To prove that there are points, a streak to prove like that. >>: Your conjecture is the number of such points, isn't it? >> Alex Bocharov: Okay. There are two levels. The conjecture about the number of two points, which would ensure the probabilistical polynomial complexity of the classical side algorithm. But there is also the second level is issue about correctness. What if you don't even have a point, and the uniformness test ->>: Doesn't your conjecture say that you have points, and many? >>: But [indiscernible]. >>: The conjecture fails. >>: It's not just that it would be hard to find, but [indiscernible] you'd have to go to a larger L to find it. >> Alex Bocharov: That is true. There are all sorts of tricks. You don't 21 really have to approximate this particular angle. You can shift it a little bit and re-run. But we never had to do that. It just works so far. >>: As far as just theoretical guarantee. >> Alex Bocharov: Yeah, there is a whole bunch of open problems there are a whole bunch of facts that needs proof in here.