[MUSIC PLAYING]
MEGAN POTOSKI: So hi, everyone.
Now we'll be talking about a
new tool for quantum education.
And it also happens
to be a fun game.
So quantum computing
can be very complicated
and very intimidating to
first get involved with.
Now more than ever,
it's really critical
that we figure out
how to make this field
and the opportunities
that it can offer
more accessible to everyone.
And that's where
quantum chess comes in.
It's like regular chess,
but with the ability
to also make quantum moves.
Last year Google partnered with
Chris and Spiros Michelakis,
the Quantum Outreach
Lead at Caltech
to build this out further.
We had two goals in mind.
First, we wanted to provide
a fun and approachable
way for anyone to learn the
fundamental concepts of quantum
mechanics.
And second, we wanted
to create a case study
to teach aspiring developers
how to build a project like this
on Cirq, Google's open
source Python framework
for creating and executing
quantum circuits.
So today we're going to
cover how quantum chess works
on a classical computer, show
some examples of quantum moves
you can make, and
also show how we've
adapted it to run on Cirq.
So now I'll hand
it over to Christ
to explain in more detail.
CHRIS CANTWELL: Thanks, Megan.
Hi, everyone.
I'm Chris Cantwell.
I was the original
creator of quantum chess.
I'm going to talk to you a
little bit about the motivation
behind the game and
some of the game
play aspects of quantum chess.
So if you were here
earlier, you heard
[? Hartnett ?] mention the
desire to teach interference
patterns to third graders.
But, as he aptly
pointed out, as humans,
we aren't really built to
easily grasp these concepts.
I think that's because
we don't really
interact with quantum
physics on a daily basis,
as far as we can observe, right?
I like to use the
analogy of gravity a lot.
In this case I'll be talking
about classical gravity, not
quantum gravity.
I think we all have sort of an
intuitive understanding of how
gravity works.
I mean, we know if
you drop a ball,
it's going to fall
and hit the floor.
You can make pretty
good guesses about,
if you throw something,
how far it's going
to go before it touches down.
And you don't need to know
all of the complex math
behind gravity to be able to
make these intuitive guesses
about how it's going to work
or what's going to happen
in certain situations.
So I thought that if
we could give people
a way to interact with
quantum mechanics in a more
tangible way, some of these
intuitive understandings
might develop.
And I thought a game would
be a good way to do that.
And so I set out to
build a board game
on top of a quantum simulation.
I decided that the rules would
enforce all of movement needed
to be implemented through
unitary evolution,
and that the player would be
able to create superposition
in the game.
And I thought if you had
those two requirements,
then you might get other quantum
effects like entanglement
and interference for free.
And players might
be able to come up
with game play
strategies that actually
used quantum mechanics.
So one way to think about
movement in a board game
is through swapping
the occupancy state
of the squares on the board.
So if a piece is in a square,
you can think of it as a one.
And if a piece
isn't in a square,
you can think of it as a zero.
So if you want to move a
piece from point A to point B,
you swap the one and zero,
and you've effectively
moved where that piece is.
This leads to a natural unitary
for implementing movement
on top of a quantum state.
It's the swap
unitary, or the iSWAP.
In the game, I chose the
iSWAP for a number of reasons,
including possible future
hardware implementations.
Once you have that unitary,
you also have a natural way
for players to
create superposition
through the square root of an
iSWAP, which effectively puts
a piece in a superposition
of having moved
and not moved at the same time.
So with those two
unitaries, I was
able to build up the
rules of quantum chess--
or of chess, on top of a
quantum simulation of 64 qubits.
The main difference
is pieces now
have access to a split move.
So here on the left,
you see a board.
I can try and split this knight
to occupy both A3 and C3.
And what you're presented with
is a probability distribution
of finding the knight on
A3 or finding it on C3.
What's actually going
on in the back end
is you have a superposition
of possible boards,
one where the knight moved to
A3, seen here on the right,
and the other where the knight
moved to C3, seen on the left
here.
So that's the primary
way players can create
superposition in the game.
Another effect that you can get
pretty easily out of the game
is entanglement.
So one of the moves
you can do in chess
is, this pawn here on C2 could
normally move forward two
squares if it's its first move.
Now, on one board, there's a
knight there blocking the way.
So if you try to
do this move, you
actually end up with
an entangled state,
where if the knight
was there blocking,
the pawn didn't
complete the move.
And if the knight
wasn't there blocking,
the pawn did complete the move.
This is done with a controlled
iSWAP on the qubits that
represent those squares.
So you can see here on the right
that if the knight is there,
the pawn did nothing.
If the knight wasn't there,
the pawn did move forward.
And you also gain
a phase of [? i, ?]
because recall that the movement
is accomplished with an iSWAP.
The final effect that is
important in the game,
at least for our
discussion, is measurement.
So there are times when two
pieces that are different
might interact.
So if I wanted to try and
move this queen from D1 to C2,
there's a board in the
superposition where
the pawn is there, and
that wouldn't normally
be a legal move.
And there's another board
where the pawn isn't there,
so that is a legal move.
The game enforces the
rule that you always
have to be able to say what
type of piece is on a square.
And so what it will do is
actually measure the C2 square.
And you can see that here.
And it finds that the pawn
is there, which, notice,
collapses the superposition
such that the knight was here
blocking its move.
And then the queen wasn't
able to complete that move.
Measurements are
non-deterministic,
so you can get the
opposite outcome.
If we try this a
few more times, we
might see that opposite outcome.
We might get lucky
on the third try.
Or maybe we'll have
to try it five times.
I've gotten lucky in
the past and it's always
been on the second or third try.
We'll try it one
or two more times
and then I'll just move on.
There you go.
So you see the other
outcome, as well,
where the knight is
found to be in A3,
and so this pawn
did move forward.
The state collapses to that
state, where this queen can
then successfully move to C2.
So this was a quick overview
of the rules of the game
and how it works.
This project with
Google has been
to try and get the game to a
point where it could export
some of this quantum behavior
to an external resource that
could maybe then run
stuff using Cirq.
And so now it supports an
API that we can implement,
and we have
implemented with Cirq.
And we'll be able to see
some of that in effect.
Now I'm going to
pass it over to Doug.
DOUG STRAIN: Thank you.
So we know that there's
significant challenges
from bringing an algorithm
from theory into practice.
And we've seen these
challenges already
in the earlier
presentations, and we're
going to continue to see
them again and again as more
experiments move from theory
to using this hardware.
And since quantum
chess doesn't require
a lot of specific
domain knowledge,
we think this is going to
be a great proof of concept
to illustrate these
challenges and really
boil down the
essentials of what it's
going to take to
get an algorithm
ready for the NISQ era.
So to that end, we're
going to be introducing
a new tutorial in Cirq
that's going to educate users
through all of these
steps, from constructing
circuits from quantum chess
moves all the way to preparing
their experiments
for noisy hardware.
So among the challenges
that we're going to look at
are qubit mappings.
So each algorithm is going to
need to map logical qubits,
in this case squares on
a quantum chessboard,
into physical qubits
that match the topology
and the connectivity of the
underlying hardware device.
And it really has to
do this dynamically
so our day isn't ruined when
you find out one of the qubits
you were using has dropped
out or is performing badly.
So Cirq can help with
this, and the tutorial's
going to show you how.
Every algorithm is going
to need gate compiling
and decomposition, so hardware
doesn't support every gate.
So for instance,
this entanglement
needs a controlled iSWAP.
So that's a three qubit
gate that no hardware
is going to support.
So we need to translate
that into gates
hardware can support.
So Cirq can help with this, too.
And lastly and most
importantly, if you
want to run a quantum
computer in the next decade,
you have to deal with noise.
And being able to run
with a noisy sampler
is one step from
taking your algorithm
from perfect simulation
to actually running it
on hardware.
And that's what we're
going to show next.
So we're going to run
through these same moves
that Chris showed,
but now we're going
to run it through a
noisy sampler on Cirq.
So the view changed
a little bit,
so let me explain what
you're looking at.
And on the left side, you
can see the quantum board UI
as before.
And on the right side, you can
see a console output of what's
going on behind the scenes.
And the few things
that it's doing
are constructing the
circuit from the moves.
So you can see a text version
of that circuit there.
And that's something
that comes with Cirq.
It's then dynamically compiling
this into hardware gates,
and based on the
moves you've done,
mapping the squares
on the chessboard
into physical qubits.
Lastly, it's running it on
a noisy sampler that's going
to add noise to each gate.
And then it's going to perform
some basic error mitigation
to cancel out some of
that noise and get rid
of outcomes that don't make any
sense, like if pieces appear
and disappear for no reason.
So as this is running, the
last thing I'm going to mention
is that while Cirq
does have support
for adding noisy
models to simulation,
this noisy sampler is in
fact a little bit special,
because it's in fact a noisy
intermediate scale quantum
device, and is
actually running live
on our quantum processor
in the new data
center in Santa Barbara.
And it's using Google's quantum
computing service with Cirq
to call the quantum
engine API right now.
So what you're really
seeing right now
is quantum chess moves
occurring in real time
using a real quantum computer.
So in order to generate all
these probability statistics
that are generating these
nice, fiery animations,
it's requesting 1,000 samples,
more if post-selection
is required, sending it to
the actual quantum computer,
and getting results back
and interpreting this.
And all of this is
happening within about three
to five seconds per move.
So you can kind of see this
happening as you're watching.
So as well as seeing a live
demonstration of our quantum
computing service, you're
also probably witnessing
what is probably one of the most
expensive board games ever run,
as well.
And with that, I'm going
to hand it back to Megan
to give some closing remarks.
MEGAN POTOSKI: Amazing.
Thank you, Doug.
So I hope you all enjoyed
this brief introduction
to quantum chess.
Now I'll quickly discuss
some of our next steps.
So first we want to apply
quantum chess to education.
We've been working on
improving the user experience,
like creating puzzles
where you need
to make quantum moves
in order to win,
and making the game as easy
as possible for everyone
to understand, including middle
and high school students.
As Doug mentioned, we created
a quantum chess Cirq tutorial
so anyone can see,
start to finish,
how to run this kind of
project on quantum hardware.
We want to spread the
word about the game
and get it integrated into
some courses and lesson plans.
So if you may be interested in
trying this out, please let us
know.
Second, we're really excited
about the future applications
to quantum AI.
Games like chess
have historically
been very important
for providing
a basis for development
of classical AI.
Quantum chess could
play a very similar role
in powering the
development of quantum AI.
And for quantum
machine learning,
there's a better chance of
finding quantum advantage
on quantum data.
Quantum chess moves provide
a natural way for us
to generate this quantum data.
And third, with the ability
to make quantum moves,
the game of chess can now
become a lot more interesting.
So tomorrow, we're hosting
an optional activity
where you can see
quantum chess in action.
First you can watch a
chess game between Chris,
the creator of quantum
chess, and Conrad, a chess
grand master.
And then we'll work in teams
to solve a series of puzzles.
So that's it for
our presentation.
Thank you so much
for your time today.
[MUSIC PLAYING]
