You've surely heard of quantum computing and quantum computers. They're based on the often
non-intuitive nature of very small particles described by quantum mechanics.
So how do they work and what will they mean for us as a society and as developers? Luckily,
I have Hannah Sim, a PhD student from Harvard working on quantum algorithms,
here to give us the full story. This is Talk Python to Me, episode 158, recorded April 17,
2018.
Welcome to Talk Python to Me, a weekly podcast on Python, the language, the libraries,
the ecosystem, and the personalities. This is your host, Michael Kennedy. Follow me on Twitter,
where I'm @mkennedy. Keep up with the show and listen to past episodes at talkpython.fm,
and follow the show on Twitter via at talkpython. This episode is brought to you by Linode and
ActiveState. Check out what they're offering during their segments. It really helps support the show.
Hannah, welcome to Talk Python.
Hi, thanks for having me, Michael.
Yeah, it's really great to have you here. I'm super excited about the topic that we're going to cover,
quantum computers and a little bit of quantum mechanics even. So that's going to be so fun.
But before we get into those topics, let's start with your story. How'd you get into programming in
Python? During my first year of college, I was really trying to decide. I knew I was interested
in chemistry, but I was, I guess, trying to decide what type of research or lab I wanted to join.
And I recall really liking the idea of integrating chemistry with computation. And this comes from the
fact that by using computational chemistry, you can essentially probe what's happening inside a test
tube or a beaker in lab and really understanding what's happening down at the molecular level.
Yeah, there's so much that seems almost unknown in chemistry. I mean, we have really, really clear
models for what it looks like if I throw a ball across the room. But understanding how, say, electrons
actually interact and stuff, that starts to get a little tricky, right? So these computational
approximations and stuff become important.
Exactly. And I guess the project that I was working on in undergrad was using classical molecular
dynamics. Just because these quantum mechanical calculations are so expensive, we need to make
these classical approximations. And I use these types of simulations specifically to study protein DNA
interactions.
Wow. So you went like really into the hard problems, right? It wasn't like, you know, how does the electron
move around benzene? But like, let's go for DNA and proteins and stuff like that, right?
Yeah, I guess they're both very hard problems. It's just coming from it at a different point
of view, I guess.
Yeah, yeah.
Yeah. And I guess at this point, I hadn't taken any formal computing or programming courses. But I just
kind of more or less taught myself programming in Python just by playing around and scripting and
using Stack Overflow.
Yeah, it doesn't matter what skill level you're at, whether you're just getting started or you're
a complete professional, Stack Overflow will be involved in the process.
Oh, definitely. Definitely.
That's really cool. So I'd like to ask you a little bit about this learning to program at this stage,
because a lot of folks, especially sort of in government and stuff, they'll say, well, we need
to teach people programming, because programming is an important skill. And I feel like a lot of these
initiatives are trying to just create more programmers. But you know, here you've come and
you've learned programming just to solve just basically to be a better chemist, right?
Exactly. Yeah.
Yeah, I think it's I think this is a really interesting use case just to kind of highlight or like experience
the highlight because so many people think, well, we're going to make a bunch of programmers. And I
think actually, what we need is to make super powered people that do other stuff and superpower them
with programming.
Yeah. And especially these days, there are so many available kind of learning platforms you can use
online. But I realized that there's a real difference between just understanding how,
say, like Python syntax works versus kind of knowing the art of modeling and programming.
For sure. You know, programming, especially in Python, because you can get started pretty quickly,
right, is one of these things that like, you feel like you're starting to you kind of learned it in
a week or two. But then, you know, 10 years later, you're still learning something every day.
Exactly. Yeah.
Nice. So now you're in grad school, right?
Yes. I'm a second year grad student at Harvard with Professor Alana Spurguzik.
Nice. And what are you studying there?
So right now, I'm doing a PhD in chemical physics. But I guess part of our research group really
focuses on developing new quantum classical algorithms for implementing on current or near
term quantum computers, which I'll, of course, talk about a little more later.
Yeah, quantum or near term quantum computers. I think this is super, super interesting. How many
people work in your research group?
So we're a pretty big group, I'd say around 30 people, but around a third of those people work on
quantum algorithms.
Yeah. So I guess, day to day, what kind of stuff are you doing? Are you like,
writing algorithms? Are you trying to create hardware? What are you doing? Scrambling to
finish qualifying exams?
I've already gotten past that, luckily.
Good for you. That's a big step.
But yeah, like you said, we're either as a group kind of trying to come up with the next new quantum
algorithm. But like I said before, because we're working with current or near term quantum
processors, we really, there are some constraints that we need to consider, such as how qubits
will respond to the noise and just the limitations and the number of these quantum bits or their
limited connectivities on the actual device and seeing how that will affect the types of algorithms
that we can come up with.
Yeah, that's really interesting because it's not just the bit is on or off. It can be many things.
Yeah.
Exactly.
Yeah. I'm really looking forward to digging into the quantum computing aspects because
it's still sort of a little bit beyond my understanding. But I think an important foundational
item maybe we should cover because, you know, most people listening are programmers, data scientists,
or maybe biologists or astrophysicists. But, you know, none of those groups necessarily
study quantum mechanics per se. Everybody's heard of quantum mechanics because,
you know, just pop culture. But, you know, maybe we could just talk real briefly about,
like, what is quantum mechanics as an area of physics?
To be very honest, it's like quantum mechanics is something that no one will ever fully understand,
just going in. I guess to put it broadly, you can think of it as a physical theory that describes
what happens in nature at the atomic or subatomic scale. Like you mentioned before,
just how electrons kind of move around and interact. That's really captured by quantum mechanics.
And to kind of contrast this with classical mechanics, where you can essentially, again,
you've already mentioned this example, but we can really predict where, say, something like a tennis
ball will be at some time T. But in quantum mechanics, we're really gaining an intuition of the
probability of finding a quantum particle at these various locations.
Yeah. So it's way more statistical driven than it is just measurement, right?
Right, right.
So when do we reach, like, where do I find quantum mechanics? So obviously, planets don't behave
quantumly. People don't behave quantumly. My little Apple ear pod thing, probably still too large,
right? A grain of sand, smaller? How small does it get? Like, where do you go? Like,
okay, we have to start thinking about like, forget, or start to at least factor in these quantum
mechanical principles rather than just say, like, Newton type stuff.
You're right in that all of these things that you've mentioned are classical particles, but we do
kind of use quantum mechanics everywhere. For example, if you look at kind of break down the
percentage of where computing, I guess, including times and efforts spent on supercomputers go,
So there are really a lot of significant chunk of them goes into performing these chemistry
calculations or some type of modeling of physical systems. And of course, all of these calculations are
really important for drug discovery, materials design and other industrial processes. But to really
capture accurate results for these types of calculations, you need to have a good understanding of
what's happening at the atomic or molecular level. And this is where quantum mechanics is,
I guess, at this scale, you really can't capture these behaviors and properties without considering
quantum mechanics, right? That's where the classical stuff actually starts to fall down.
How interesting. I don't want to go through all the aspects of quantum mechanics, because this is a
programming podcast, not a science one. But what parts or aspects of quantum mechanics are relevant for,
say, quantum computers, right? Like we have Heisenberg's uncertainty principle,
we all know about Schrodinger's cat, like, what kind of stuff do we kind of, what are the essential
things we need to know, just as the foundation of thinking about quantum computers?
To kind of put a spin on that question, this can be really captured by kind of looking at the difference
between quantum computing and classical computing, because we do directly apply laws of quantum mechanics
mechanics at the level of the basic unit of computation, essentially how we consider this quantum bit or
qubit.
Right. In traditional programming, we have bits, and they can be on or off zero or one. What's a qubit?
Right. So quantum bit, it's a little bit more complicated, just in terms of how they can be
represented, and how different processes are effectively operations can influence the state of that qubit.
So I guess what I can say is, we as quantum computer scientists can observe and work with directly in
quantum computing are actually samples of probability distributions of finding each qubit in the zero or
one state. Often people say that this is like being able to access the zero and one state at the same
time. But I think there's just subtle differences between these two explanations.
Okay. So instead of being zero or one, it's almost like it can be anywhere in between those two
possibilities in sort of a statistical model.
Exactly. There's some probability that you'll find this qubit in the zero or one state. Yes.
That's pretty interesting. Now, with traditional computers, they're super small too, right? I mean,
like the dyes these days for like the modern Intel processors and other ones, they're like at the 14
nanometer range. And it's been a long time since I've studied chemistry, but I'm feeling like
a couple of nanometers, that's like the diameter of an atom, right? That's pretty small, isn't it?
Right, right.
So do traditional CPUs like the one in my MacBook now, do they have to think about quantum computing
when building those types of devices?
They are definitely approaching this quantum realm, if you will, according to this Moore's law. And I
think this is actually one of the big motivations behind quantum computing, where, as you said, as the
size of each transistor is getting really smaller and smaller, it will just approach a size in which we
can really no longer ignore the effects of quantum mechanics. And this is why some people are like,
oh, we might need a different paradigm of computing. And this is where quantum computing may step in.
Right. So as we get our general CPUs smaller and smaller and more focused, right, like,
we're getting to the point where we just can't pack in more stuff without effectively entering the
quantum realm. Am I understanding that correctly?
Yes.
Okay. I guess if we're talking about quantum computers at the lowest, lowest level,
we already talked about how you have qubits versus regular bits, and how we have the statistical
difference, which I'm not really, I understand what you're saying, but I don't understand how to do
computation with it. So maybe give us a sense of like, what does it mean to try to implement like
algorithms or computation, like down at that level? Like, how do these things really work?
So the model of computation that I work with every day is the gate based quantum computation. And this
is quite analogous to the, I guess, the classical circuit model, where you essentially have, you select
a number of qubits to work on. And then you kind of propagate the circuit through time by applying
different types of operations on it. But this time, instead of these logic classical gates,
like and and or, we're now applying these quantum gates that kind of obey these mathematics of quantum
mechanics.
What kind of gates do you get there? Like, and and or, that makes a lot of sense to me.
What does, give us some examples of the quantum gate?
Say that we start at the zero state in a quantum computer. So if you apply, say, Hadamard gate,
let's see, how do I, how do I?
How do you explain this over audio?
Right. So the effect of a Hadamard gate, you can think of it as turning this, just the zero state
into this even superposition of zero and one state. So this effectively means that it's equally likely
to find this qubit at the end of this application of the Hadamard gate in the zero and one state.
There's a 50% chance of finding it in the zero or one state.
This is pretty wild. I guess one of the things that I always hear when I hear about quantum computing
is it's like it can compute sort of inherently can compute many possibilities at once.
And regular computers, they don't do that, right? They just like go right down their path. And I mean,
obviously they'll do like weird things, like try to guess the rest of the computation based on,
you know, while they're waiting for some other part of the system, but that's not really the same
thing, right? That's just doing extra work quickly in order. So where does that sort of factor in or
where does that come from? Or is even that the right way to think of it?
Yeah, I think there is actually some common misconceptions about quantum computing in that
people think that it's, it's somewhat like parallel computing in some sense, right? Just being able
to access all possible states at the same time. But I wouldn't say that that's entirely accurate.
It's just that, again, like I said, because we're kind of working with this evolution of this probability
distribution, in some sense, you're not just working with a discrete state, but you're able to kind of
affect a, you're effectively working with this distribution instead of a single state.
This portion of Talk Python to me is brought to you by Linode. Are you looking for bulletproof hosting
that's fast, simple, and incredibly affordable? Look past that bookstore and check out Linode at
talkpython.fm/Linode. That's L-I-N-O-D-E. Plans start at just $5 a month for a dedicated server
with a gig of RAM. They have 10 data centers across the globe. So no matter where you are,
there's a data center near you. Whether you want to run your Python web app, host a private get server,
or file server, you'll get native SSDs on all the machines, a newly upgraded 200 gigabit network,
24-7 friendly support, even on holidays, and a seven-day money-back guarantee. Do you need a
little help with your infrastructure? They even offer professional services to help you get started
with architecture, migrations, and more. Get a dedicated server for free for the next four months.
Just visit talkpython.fm/Linode. When I see quantum computing applied right now,
there's two areas that I hear it applied quite a bit, at least as much as it is applied. One of those
seems to do around solving science problems. You're a computational chemist person, and you're
studying this, right? That's very much in that space. And the other one I hear it all the time
is cryptography. And if people get quantum computers working, cryptography is broken. We all suggest,
you know, go get a cabin or something like that and live in the woods. So what kind of problems would
you say are like especially well suited for being addressed by quantum computers?
First of all, I think this is a very good question, because I think it's worth noting that quantum
computers will not be able to solve every problem exponentially faster than classical computers can.
So like you said, there are some kind of types of problems that quantum computers will be good at or
are well suited for. And that includes this factoring problem, which has applications in cryptography,
like you mentioned, quantum chemistry and Hamiltonian simulation. Others include combinatorial optimization
and possibly machine learning, with the intuition that maybe quantum computers can be used to
effectively capture complex patterns and data. That's really interesting. So that's definitely one
of the areas that I didn't just mention, but it certainly is on my radar is like quantum computers could be
a game changer for machine learning. Let's take them in order though. Let's, let's talk about the,
the sort of straight computational stuff. Like I want to model a bridge really, really well, or I want to
try to understand, you know, this sort of scientific problem better. And instead of doing approximations,
like maybe even weather, right? Maybe like climate science, maybe we can get like a truly accurate
forecast for like a hundred days or something like that with quantum computers. How does quantum computing help
like complex computation like that?
The problem that you came up with such as bridges, I'm a little less clear on how quantum computers can directly help
near term at least.
I'm just throwing stuff out there. I don't really know computers that well.
So well, maybe going back to problems in chemistry, right? There's this idea that because you can think of molecules
essentially as a system of quantum particles, there's a better map that you can use in order to kind of map
this problem onto the quantum computer where maybe each qubit represents some, some type of a orbital.
And in that case, by kind of evolving this quantum state on your quantum computer,
you're effectively modeling this molecule. And by doing so,
the medium is like inherently more suited to modeling stuff that behaves like it does.
Yeah. But I guess this is still very much a, it's a rapidly developing field, but there's so many
open questions like how do you map quantum system to a more general problem? And that's very much an
active area of research.
So with machine learning, right, machine learning is going through dramatic changes. And I think one of
the areas where it's gotten super, super advanced is the different types of computation already being
applied to machine learning. So what I mean is, for a long time, the stuff was done just on
general purpose CPUs. And then it was moved over to GPUs where you could do way more work and have a
better model. And then now it's finding its way over to things like tensor processing units and stuff like
that coming out of Google. So do you see that that maybe keeps going into the quantum realm with some
of the stuff?
Adding on to the name, I guess, now you can think about QPUs, right? And as I mentioned earlier,
this kind of quantum circuit model, I think right now, one thing people are thinking about is using a
quantum circuit as some type of, let's say, a quantum neural network where you're training these parameters
on these quantum gates in order to, I guess, represent some type of model that can describe
some data. But I guess there's a lot of work being done on quantum machine learning, but it's,
again, still pretty early in its stages. So I think we're trying to really kind of figure out as a
community what quantum machine learning means even. Does this mean that we're working with
a classical data or quantum data or maybe both? There are lots of open questions.
Well, I think part of the problem is we don't understand how normal learning,
human or animal learning works all the way, right? And so our models are just like pokes in the dark,
right? Like we are not like, well, this is how it works in people and brains. So here's how we're
doing computers. It's like, well, we don't know that either. So let's try this.
Yeah. And add quantum to that equation and add two things that we don't fully understand.
And we don't know.
I feel like computers are going that way in general, the computers and software,
even before we talked about quantum computers, is that software is getting further to a place where
it kind of defines itself and it builds itself up and it can do things that we don't necessarily,
we can't ask it for a justification of why it did that thing. It just, we gave it some examples and
now it does things that seem mostly right. And quantum computing seems like it's just going to take us
farther down that realm of like, well, it works. Why? I don't know, but it really, it works really well.
Yeah. No, definitely. Definitely.
Yeah. So do you think what it means to be a programmer is going to be different in 30 years?
Right. Even thinking about what a quantum software engineer means currently, I'm still trying to
kind of figure that out because I feel like that's the type of profession or career I want in the
future. But what do you have to kind of do to prepare for this position? Right. How do you prepare
for a position that's not fully defined yet? Exactly. Yeah.
I would say you're way in a better place than most people though right now. Quantum computing research
lab at Harvard is definitely like one of the places I would think might help you on that path.
I hope so. I hope so.
That's pretty cool. So I know what it means to build reliable software in the traditional
sense of computing, right? Like, cause it's with the exception of parallel, like true parallel
execution, which throws its own things in there, which by the way, I think it's interesting that
the bugs created in parallel programs, traditional form often get called Heisen bugs,
which are, are borrowed from the whole quantum mechanics world, right? Like, you know, you observe
it, it changed the timing of the race condition and the race conditions gone, but you stop observing
and it comes back, things like that. I know with the exception of like the race conditions,
what for standard programming, what it looks like to build reliable software, unless the underlying
hardware is broken. Basically, once you get it working, it stays working. Like what's the story
with quantum programs? Like it sounds like if it's statistical based that it's mostly okay, or is it,
can we get to a place where it is fully deterministic in the same sense that we have now?
I think the power of quantum computing comes from the fact that it's not deterministic. I mean,
this is a real challenge that, we need to kind of find ways to efficiently sample from these
distributions of possible states.
So like in networks and stuff, we have like error checks and ways to sort of retry if something goes
wrong. Could we have something like that in computer and quantum computing where it's like, well,
while we ran this, we also ran like a, some sort of a checksum type thing and that failed.
So we're just going to rerun that computation at this step.
I have to say, I'm not too familiar with this area, but I think there is some methods for,
I think we call it a post-processing where, like you mentioned before, if you get an outcome that
you know is wrong, then you kind of ignore that run and then keep going through these or propagating
these quantum circuits until you get to an outcome that you know is right or is reliable.
Yeah. I just wonder if there's a way to like weave in like a known computation that it has to come
out with the same answer. And then you also get the thing you're actually trying to compute. And if
they're either going to be both broken or both. Okay. I don't know. Like I've not done any quantum
programs. I don't really know. I'm just trying to imagine how like you build reliable stuff out of this.
Yeah. And that's still very much a challenge just because quantum bits or qubits themselves are
still quite sensitive to noise. So it's hard to really check if the fault is coming from your
program or from the noise on the qubits. Yeah. And all these things are pretty experimental,
right? Like I haven't been to Best Buy for a while, but I didn't see any quantum computers. Like I saw,
they have a little Apple section and they have a bunch of Windows machines. I haven't seen any Linux
stuff over there, but you can go buy regular computers, but you can't go get quantum computers.
And so would you say that quantum computers exist today or they're just research projects that are
like poking at this concept of it? Like how far down this quantum computer path are we?
So I would say that definitely, yes, quantum computers exist today. And there are different
types of architectures that implement this. That being said, it's not like, like you said,
you can walk into a store and buy a quantum computer. And because of this, what's really
happening is that a lot of academic institutions and companies, they basically have these large
refrigeration units that are cooled down to very, very low temperatures. And this is where the qubits
reside. And because like I said before, that qubits are very delicate and sensitive to noise. There are
lots of scientists and engineers kind of trying to every day working to maintain these qubits.
But in order to make these quantum computers work and at the same time have them accessible to the
public so that they can try programming on these quantum computers. I think one way that they figured
this out is to have it through the cloud where anyone around the world can just kind of submit
these quantum program jobs.
Right. Yeah. People have said that sort of cloud computing is a little bit like jumping back to the
whole, like, you know, fire up a terminal dial into some big mainframe type of experience,
right? For a long time computing sort of moved to the desktop. And now in some sense,
it's kind of moved back to like the new modern mainframe. So you can take advantage of just all the scale of the
data centers. And it seems like that's the perfectly reasonable solution, at least in the early days
for these quantum computers is like they'll live in some special place underground away from other
interference, like really, really cold. And then we can like schedule jobs on them kind of like AWS Lambda
or something, right?
Yeah, I actually submitted some jobs on Rigetti computing's 90 qubit chip last weekend. And it was
very exciting. That's a theory. Yeah, that's super cool. All right. So you said computer quantum computers exist.
And can you give us some examples? So there's Rigetti. I heard IBM has something I've early days. I heard D wave.
I think I saw like a Nova show on D wave or something a long time ago. Maybe give us a rundown of some of these systems.
Like you said, Rigetti computing has their qubit processor, IBM, Google, Microsoft, but also a lot of academic institutions
have their own chips. And right, the D wave. The D wave is actually also how I first found out about this idea of quantum computing.
Because I think D wave was one of the first mainstream machines that were covered by media in order to really discuss this new technology called quantum computing.
Right. There was this concept of quantum computing, but then to actually see this thing, which is pretty interesting.
And it only had just like two bits or something like it was really, really not a massive computing system, but it was working right in the early days.
Right.
That's pretty awesome. Then there's the IBM 50, right?
So what's the story of that one?
So I believe they have a 50 qubit superconducting chip. I haven't actually had any experience programming on it, but I can say in general for IBM and these other major companies, often what they'll have are these quantum processors, but also their own kind of in-house quantum programming packages that they come with.
Any user can kind of play around with creating these quantum circuits and try running them on these qubit chips.
That's a pretty interesting question. Like if you have this entirely different way of thinking about programming and modeling, right?
Like when I sit down to program in Python, like it's all about if this, if not that, while that, you know what I mean?
Like it's all based on the and or gates. And so the programming languages are going to be really different.
But before I ask you about that, I want to actually ask you one other thing.
So you said there's the Regetti 19 qubit system, the IBM 50 qubit system.
I have a 64 bit Intel core seven or whatever.
How do I relate? Like, how can I relate the number 16 or 50 to what I know in terms of like regular CPUs?
Is there a relationship? What is it?
This is a good question. I have to say in classical computers at this point, you know, the common user like myself, when I program, I really don't have to worry at the level of if the bit is undergoing some noise process.
And if there's any like bit flips that I'm worrying about, there are these like error correction codes and these redundancy checks that are in place.
But for quantum computers, I think we're still at the stage where we can't kind of ignore these effects.
So when we say these 19 qubit chips, 50 qubit chips, these qubits are actually physical qubits that haven't been.
So we don't have enough qubits in order to fully kind of implement these quantum error correction codes,
such that when we run these quantum programs, we know with great probability that our program will run reliably, so to say.
There will be a lot of noise that undergo and the computation or the result that we get at the end.
We don't know if there has been some like various bit flips and other noises that happened.
I guess right now it's a little too early for like a direct comparison.
Sure.
But it sounds like maybe they're not as fully leveraged as say the systems that we have.
Something to that effect, maybe.
This portion of Talk Python to Me is brought to you by ActiveState.
ActiveState gives you a faster way to build and secure open source runtimes from your first line of code through to production.
Every second you spend building your Python distro or trying to secure your Python programs
is less time spent doing the work you love.
You've got better things to do than trying to resolve dependencies
or making sure that you tick off all security boxes when you ship to production.
Standardize on your Python builds so you can have less friction in the development cycle
and you can deliver apps faster.
You can also get a unique server-side way to verify your Python applications at runtime.
Bake security right into your code without impacting performance.
Go faster, spend more time doing the work you love,
and comply with your enterprise security needs.
Try ActiveState and see why it was chosen by IBM, Microsoft, NSA, Siemens, PepsiCo, and more.
Join millions of developers who trust ActiveState to build their open source language distros.
Visit talkpython.fm/ActiveState for a special offer.
That's talkpython.fm/ActiveState.
We have this new programming model.
How do we program it?
Like I mentioned before, I think this is a great time to really get into quantum programming or quantum computing
because you have actually several choices of packages that you can use to program on a quantum device.
Some of them include IBM's Quantum Experience where they have some drag-and-drop interface
in order to try to create your own quantum program.
Wow. Is it almost like Scratch or something like that?
Yeah, you could think of it like that.
I played around with it a little bit and it's quite fun.
Besides that, they have their, I guess, non-drag-and-drop software package called Qiskit.
Okay.
I think Rigetti Computing has Forrest.
Their platform is called Forrest, but their programming language is called Quill.
I think Microsoft has Qsharp.
And Google actually has a package called OpenFermion,
which is a package that can be used to develop quantum algorithms
specifically for fermionic or essentially molecular systems.
So that's, of course, one of my favorites.
Yeah, of course.
Those all sound really interesting, but none of them sound very familiar, right?
Like the only one that I've really looked through the programming model of
was the Qsharp one from Microsoft.
And that's because it actually has interesting Python tie-ins.
But most of these that you mentioned actually have some way to interact with them from Python, right?
Yes.
Yeah. So tell us about that relationship.
I guess I've mostly played around with Rigetti Computing's PyQuil,
where you essentially, right now, a Python program,
you'd have these Python functions for these quantum gates.
And what you're doing is kind of initiating a quantum circuit
by inputting the number of qubits you want in a circuit.
And then you can basically place different gates in different parts of the circuit
in order to perform the computation you want
or alternatively produce a quantum state that you want.
And they have these different backends where one backend could be a simulator
where you can kind of look at how the wave function
or the quantum state is evolving as you propagate your circuit.
But then another backend is when you directly now communicate
with the actual quantum computers,
maybe for Rigetti in Berkeley or something,
where after you write this quantum program in Python,
you can just directly send it to the machine to run.
That's pretty awesome.
You mentioned the simulators, right?
There's only a handful of these computers.
What do they cost?
If I wanted to, I don't even know if it's possible,
but if I wanted to go buy, say, the D-Wave,
I'm a real big enthusiast,
and I want to put into my garage the IBM 50,
what would that cost?
It depends on what your job is.
Because you're going to need a lot of money.
Yeah.
Luckily, I think in the US, at least,
there's this real initiative to kind of get quantum computing going
and have it more accessible to the public.
So I wouldn't be surprised if a lot of these kind of national labs
start investing in quantum computing
and even purchasing these machines.
Sure.
So a long time ago, IBM had their mainframes,
and Bill Gates and crew came along and said,
no, we're going to have a computer on every desk.
Things like that effect.
And there's some quote, I think it was from the IBM people,
like, how many computers do there need to be in the world?
Like nine, maybe 10?
I don't know.
Right.
And it's probably like that way now for these quantum computers, right?
There's like one or two of each of the ones you've named.
I don't know.
Not too many.
But I feel like this time,
because of all the infrastructure needed to say,
keep it cool,
keep it away from interference with other sorts of radiations and interactions,
like it might actually stay in the cloud only.
Do you think that we'll ever have quantum computers,
like just in laptop form?
Or is this something we're always going to connect to over services?
I mean, of course, right?
Having your personal quantum computer is the dream.
But like you said,
there's still quite a way to go before we can really find ways to consider these noises
and maybe avoid these necessities for cold conditions.
Right now it's super cold.
Like how cold does it have to be?
Like you don't want to touch it cold, right?
Yeah, like millikelvin.
Millikelvin.
Yes, close to absolute zero,
which is, yeah.
But that being said,
I mean, even with classical computing,
you know, when you mentioned this IBM quote,
at that point,
I'm sure there were a lot of skeptics
and people who were like,
oh, I don't know if that's going to be achievable.
But hey, like today,
we did achieve that.
So maybe for quantum computers,
new technologies will kind of come in and new research scientists will find ways in order to make quantum computing more accessible.
Right.
Maybe some material science problem is solved that requires only liquid nitrogen level cold,
not millikelvin cold.
Exactly.
Interesting.
Yeah.
And we also have simulators, right?
So not everybody has access to these machines.
But I know that at least the Qsharp one,
because I looked through their documentation,
they have like a literal simulator that you can go and write your programs from Python or Qsharp or Jupyter or whatever,
however you want to do on that thing.
Like you can go write your programs and simulate it.
Is that pretty common these days?
Yeah.
So I've been actually working with Regetti's PyQuil simulator,
and I think a lot of them work pretty similarly.
And this type of tool or framework is really important for theorists.
And just because we're kind of looking to develop algorithms for near term computers,
but at the same time,
we want to do something useful.
So in some sense,
we want to assume these like error corrected qubits.
Yeah.
So how accurate is this, right?
Like it is a simulator,
and you're simulating things that we have a hard time fully contemplating.
Like if I write some program and get it working on the simulator,
how close is that to working?
Like how,
what's the difference in say performance,
things like that?
At this point,
it would be great if the simulator that you're using has some way of creating noise
or accounting for noise in your simulation.
And assuming that you have a good enough noise model,
I think the result that you get should be pretty comparable to experimental results.
Okay.
That's encouraging.
What about performance?
It depends on what you're doing maybe, right?
Right, right.
Because right now,
like I mentioned before,
these like experimental setups,
you know,
there has to be a group of engineers and scientists that are trying to really optimize these operations
in order to kind of perform a calculation using the actual quantum device.
So when we talk about maybe runtime or some type of performance measure like that,
it's hard to compare really directly right now.
But I guess at least simulations take way shorter and takes less manpower.
I say it's similar to how other fields in computational science works,
where theory and experiments kind of go hand in hand and help each other kind of advance.
Yeah, I definitely think it's cool that these simulators exist because there's not that much access to even,
you know,
these limited quantum computers we have.
So definitely lets people do research and explore and test.
Mm-hmm.
Nice.
Okay, so let me ask you some sort of slightly higher philosophical questions about quantum computing.
What are the things to really get excited about?
Like what's going to be invented?
What is going to be possible that is not possible now because of quantum computing?
What do you see on the horizon?
We've already kind of discussed the possible applications of quantum computing.
But I think just looking at the field itself, even now, I think research or development,
they're all moving very fast in quantum computing.
But at the same time, I'd say this is a good time for people to get into quantum computing
because there's just so many open questions that you can ask.
And quantum computing is one of those fields where people from various backgrounds,
such as math, physics, chemistry, engineering, and computer science,
they can really all get involved and significantly contribute.
Yeah, that's really cool.
I feel like so much of what is sort of sold as a college degree of computer science
is much more just software engineering.
And the actual science part of it is not so much there.
But this seems like a place where computer science still is like very much the experiment,
explore, hypothesis, and test stage rather than we just go through like,
you know, we're using unit testing in Scrum and we're going to do that.
And here's how we, you know, factor our database and whatnot.
Right.
No, it seems pretty cool.
So what about energy, right?
Like energy consumption by data centers is actually really huge because we never see them, right?
There are these giant places in just a few spots on the globe, right?
I think the closest data center to me is Prinnville, Oregon, which is out by, and this literally,
the reason it is there is it's by one of the dams in the, I believe the Columbia River,
so that it has like close access to lots of power.
Right.
And so the traditional CPUs take a ton of power to exist and do their work.
How does that work in the quantum computing world?
Like if we got a really well working quantum computer, would it use less energy?
Would it use more?
What do you think?
I think as a theorist, I have much less of an intuition for these types of questions.
But given that, I actually talked to one of my colleagues who is an experimentalist, and
he mentioned that at least for certain types of qubit architectures, such as superconducting
qubits, they do expect less power consumption per qubit.
Okay.
That's pretty encouraging.
Compared to the classical.
Yeah.
And I don't know the numbers, but I know that some problems are solved immensely faster
by quantum computers.
So, you know, maybe it even takes more energy, but it could solve it a thousand times faster.
So in the long run, maybe it's, you know, way, way more efficient.
So there's interesting trade-offs on that angle too, I would suspect.
That's true.
Because I guess that's where you're like, in classical computing, you probably won't ever
find it or get to the answer within the time of the universe.
But for quantum computing, maybe it'll be possible.
Right, right.
But I feel like, you know, that's awesome and that's probably going to happen.
But at the same time, like, we'll just ask more complicated questions and we'll ask them
more often.
So it'll open up what we can do more with the various watts we got around, but it probably
won't make any significant difference, I guess.
It's pretty cool though.
So it's all pretty exciting.
Like, are there things that we should be concerned of?
You know, I mentioned like cryptography, getting in a cabin, checking out a society sort of
thing.
What should, I guess, we be careful of or just like, what would maybe be not a great consequence?
Regarding this like loss of privacy, perhaps that people fear.
I think quantum computing will actually help with that fear in some sense because of these
proposals for different types of quantum key distribution protocols or just in general, how
quantum computing will help cryptography.
Even in some of the standard encryption conversations these days, I hear people talking about like
quantum safe algorithms that are sort of resistant to being cracked by quantum computing techniques
that are different than say, just depending upon exchanging primary key, primary numbers,
primes.
But do you have any experience with these?
Do you know what that's about?
I've definitely heard of them, but I don't think I have enough expertise to say anything.
Sure.
I'm just trying to understand like, what is that, you know, what does that algorithm look
like?
How, like, how do you implement something like that?
That is just, I don't know, a problem that would be not so easily solved by quantum computing
and pretty, pretty interesting.
But just going back to if we should.
Should we be worried, right?
Like, it sounds like maybe there'll be this like rough patch while we transition algorithms,
but maybe in the long term, quantum computing doesn't necessarily mean bad stuff for encryption
and privacy.
Yeah.
And I just want to say, like, as with all technologies, I think we always need to be
wary of where and how this new technology will be used.
But I think given that quantum computing is still very much early in its stages, and we're
trying to figure out how to really fully leverage its strengths and capabilities to do practical
tasks.
So I think those will be relevant questions, but just not right now.
Right.
We're a little too early for that.
Yeah.
Probably what will happen is we'll come up with these amazing quantum computers and people
will just use them to like animate GIFs, like with their head stuck on a cat or, you know,
something kind of like now.
Yeah.
All right.
So maybe we'll just leave it there for the quantum computers.
That's really interesting.
I have a slightly better understanding than I did before.
Thank you for sharing all that.
And of course, I'll put all the links to like the various computers and APIs and stuff in
the show notes.
So let me ask you the two final questions I ask at the end of the show.
Always.
If you're going to write some code, maybe some Python code to talk to a Rigotti server or
something like that, what editor do you use?
So I go back and forth between Sublime and Vim just because my dad was a software engineer
and he exposed me to Vim.
That's Vim from an early age.
Awesome.
All right.
How about a notable PyPI package?
Like many of these amazing things you've been talking about, you can literally pip install
them, right?
Yes.
So I've already mentioned these two before, but of course, being a chemist, I really enjoy
using OpenVermion for basically implementing quantum chemistry algorithms for quantum computers,
as well as PyQuil, which I've mentioned earlier by Rigetti Computing.
Not only is it really well tested and documented, but it has a really great Slack community where you
can just post questions about the syntax as well as general questions about quantum computing.
Oh, very cool.
It's really nice to have these Slack communities or Gitter channels or whatever popping up
that you can actually get in touch really easily with people doing similar things in all specials.
Definitely.
Yeah.
Cool.
All right.
So it's not too early for people to get started with quantum computing.
Now you say you think it's a good time to get started, build some experience and like
play with some simulator, something like that.
Yes, definitely.
I encourage it highly.
All right.
Awesome.
Well, Hannah, thank you so much for being on TalkByThan.
Thank you, Michael.
Bye.
This has been another episode of Talk Python to Me.
Today's guest was Hannah Sim, and this episode has been brought to you by Linode and ActiveState.
Linode is bulletproof hosting for whatever you're building with Python.
Get four months free at talkpython.fm/Linode.
That's L-I-N-O-D-E.
ActiveState gives you a faster way to build and secure open source runtimes.
From your first line of code through to production, check it out at talkpython.fm/ActiveState.
Want to level up your Python?
If you're just getting started, try my Python jumpstart by building 10 apps or our brand new
100 days of code in Python.
And if you're interested in more than one course, be sure to check out the Everything Bundle.
It's like a subscription that never expires.
Be sure to subscribe to the show.
Open your favorite podcatcher and search for Python.
We should be right at the top.
You can also find the iTunes feed at /itunes, Google Play feed at /play, and direct
RSS feed at /rss on talkpython.fm.
This is your host, Michael Kennedy.
Thanks so much for listening.
I really appreciate it.
Now get out there and write some Python code.
I'll see you next time.