Subtitles section Play video Print subtitles DAVE BACON: A quantum computer is a new type of computer that stores and acts on information in its quantum form. Today, we are entering into an exciting era where quantum computers are beginning to be large enough and performant enough to execute tasks in less than a second that would take years to execute on a normal computer. Here is Google's own Bristlecone chip. This is a quantum computer made of superconducting circuits with 72 quantum bits. Google's researchers are using this chip to attempt to achieve a task that cannot be solved in years on a supercomputer. Hi. I'm Dave Bacon from Google. I run the team that builds software for Google's quantum computers. And today, I'd like to tell you a little bit about how we program Google's quantum computers. We do this using an open source framework called Cirq. A quantum computer stores its information using quantum bits, or qubits. The information in these qubits is then maneuvered around using the laws of quantum physics. To describe an algorithm on a quantum computer, you would use what is called the quantum circuit model. The quantum circuit model is essentially a diagram describing how to perform a quantum computation. Here is an example of a quantum circuit. You read this diagram like a sheet of music from left to right. Each of the qubits in a quantum computer corresponds to a single horizontal wire in the quantum circuit. Here we see that this quantum circuit operates on four qubits. The boxes in the diagram correspond to quantum gates that are applied to one or more qubits, depending on how many wires the box is connected to. Here's a single qubit gate. And here is a two qubit gate. Quantum gates are instructions to send control signals to the quantum computer to perform a certain quantum action on the qubits. Finally, one has instructions for reading out the quantum information. This corresponds to quantum gates that perform measurements and turn quantum bits into classical bits. If we have a quantum circuit diagram, we can use this diagram to send microwave pulses and instructions to our quantum computing hardware to execute the quantum gates, and then read out the result of the circuit, like reading a sheet of music. As we sweep from left to right, we play the given gates as they appear. The quantum circuit diagram is cool looking. But of course, if we had to draw a diagram to do this, and we are writing really long quantum programs, this would quickly become very challenging to do. To solve this problem, researchers have developed frameworks, or programming languages, to write more traditional looking programs that represent the quantum circuit. An open source framework that we use at Google for this effort is called Cirq. Welcome to the [? Cirqus. ?] Let's write a simple circuit. Cirq is a Python framework. This means you can use all the goodness of Python in helping to write your quantum program. The central object in Cirq is a circuit object. Here we show creating a circuit object. Another key set of objects are qubits. Let's define two qubits with simple names. Now we can perform some quantum gates on these qubits. Let's apply a single qubit Hadamard gate denoted by H to one of the qubits, followed by a two qubit controlled NOT, or CNOT gate, between the qubits. Finally, let's measure the quantum bits. What circuit have we produced? Simply use Print to see the circuit. No, it's not 1993. But ASCII diagrams are useful for seeing the quantum circuit that you've built. Here we see the H gate for a Hadamard, followed by the controlled NOT gate with the ampersand symbol and the x symbol. And finally, the measurements represented by M. Once we've constructed a quantum circuit, what do we do with it? In Cirq right now, you can perform a simulation of the circuit. Here we run the circuit 10 times and see the measurement results. Measurement results in quantum computers don't always give the same values of bits. One run of the circuit may result in the output being 0, and another in it being 1. Here we see that the measurement results differ for each run of the simulation. Cirq also contains an interface for running the quantum circuit against actual quantum hardware. Now that you've seen a simple quantum circuit in Cirq, you might think, great. Now I can write really large quantum programs. For example, it is known that quantum computers can efficiently factor numbers, something that breaks modern public key cryptography. That's pretty scary. Today's quantum computers, however, are very far from being able to perform this task. This is because essentially, quantum computers can only perform so much quantum computation before the quantum computation falls apart. Consider again a quantum circuit. Every gate that you apply in this circuit corresponds to some pretty complicated electronics, shaping and setting of electromagnetic fields to the quantum computer. These pulses are not always perfect, and so every single one of the gates you perform has some effective chance of failing. Boom! One of our single qubit gates has failed. In addition to not being able to execute gates exactly, quantum computers also have a problem just doing nothing. That is, if you leave quantum bits around, over time, the quantum information stored in them will decay away. We call this process decoherence. Boom! While waiting to execute the next gate, one of our qubits has failed due to decoherence. Today's quantum computers don't perform exactly as we specify them in the quantum circuit model. We call this the problem of noise in quantum computers. Because of noise, the size of our quantum computation is limited for today's quantum computers. It is limited both in the number of qubits and the number of operations we can perform on these qubits. If quantum computers are noisy, can we ever build a really large quantum computer? The answer to this is yes. Using a magic protocol called quantum error correction. We won't focus on error correction here, but it is a procedure for turning a bunch of noisy qubits into a fewer number of much less noisy qubits. Since today's quantum computers cannot perform arbitrary large or long quantum computation, an important question is, what can they do? This is the main question of what people call the NISQ era. NISQ stands for Noisy Intermediate-Scale Quantum. And it is used to distinguish today's quantum computers from future error corrected quantum computers. Are there algorithms of practical value in the NISQ era? We do not know the answer to this question. On the other hand, we also know that we are starting to build quantum computers which exceed the capabilities of classical computers, the so-called supremacy frontier. Because of this, there is tremendous excitement in quantum computing. We are entering into the unknown, an era where there is potential for important discovery. We built Cirq for NISQ computers and to aid in this discovery. Because Cirq is focused on NISQ computers and not on quantum error corrected computers, we made some choices that we believe are important for these near-term devices. As an example, one choice we made is that we believe that the programmer who is coding for NISQ algorithms needs to be very aware of the idiosyncrasies of the hardware upon which the quantum computation is run. Hardware is not abstracted away in Cirq. In Cirq, this is captured by device objects. Here is the device object for our Bri