>> Hello. My name is Mariia.
Today, I will tell you about
some really great tools that we
created to help people
learn quantum computing.
So earlier today, you heard
a lot about quantum computing,
and you have to admit that
it's a very exciting topic.
There is also this idea
of being able to solve
the problems that are
impossible to solve now.
So this means that,
there are a lot of people there
who really want to learn
quantum computing.
What can we do to teach
them to help them learn?
As a first step towards
teaching people,
is creating materials
that they can use
to learn themselves on their own.
So we'll know that learning
with the teacher is awesome.
You can be guided.
You can have your questions answered,
but not everybody has the luxury
of having access as a mentor.
In fact, I'm pretty sure
that vast majority of people
learning quantum computing
these days are on their own.
So we need to be able to help them.
There are a lot of materials on
the Internet that cover
quantum computing.
I mean, it's 2019 after all.
There are books, there are videos,
but a lot of these materials
have some disadvantages.
First, if you're reading a book
or you're watching some videos,
it's by definition, basic learning.
You consume information, but
you're not very engaged with it.
There are resources that
offer active learning,
but are very few of them.
Really, you cannot master a concept
or an algorithm until you
have actually tried to
apply it to solve a problem
to implement the algorithm.
It doesn't really matter if this is
a quantum algorithm or a classical.
That's why the course is
on classical algorithms
always have written assignments.
They had labs, they have ways to
implement things to make sure that
you have actually internalized them.
Second, let's say, you have found
some exercises to practice on.
For example, books have exercises.
But what is the book doesn't
have the answers or hints?
I have a very specific book in mind.
It's the one which everybody
recommends to people who start
learning quantum computing.
It has lovely exercises,
but it doesn't have answers.
So if you have solved
the exercise and you want
to check if you're correct,
or if you're stuck on
an exercise and you need a hint.
Well, congratulations you're stuck.
So what we are trying to do?
We're trying to remedy those issues.
We created a project
called Quantum Katas,
named after this breaks
that's used in martial arts.
I heard from people who actually
tried martial arts that
it's a terrible name,
but I've never done it myself,
so works for me.
So the Katas are sets of
programming exercises
on quantum computing
that you can do using Q sharp.
Each Kata offers a set of
tasks of increasing
complexity on one topic.
Each task has to be solved
by writing some code.
So it's active learning.
You try to do something active.
The most important part is that
the Katas have testing framework,
which takes your solution,
runs it, and evaluate it
to figure out whether
it's correct or not.
So Katas implement
all the principles of good learning.
It's learning by doing,
they give you immediate feedback,
and there is increasing complexity
of the tasks you attempt.
There are also answers for
the tasks in the code.
So if you are stuck,
you can go to see the answers,
and figure out what you
have been doing wrong
or in what direction you
have to be thinking.
So Katas project is
only about a year old.
So far, we're have been seen Katas on
different projects,
on different topics.
So we cover a lot of topics
that would usually be covered
in an introduction to
quantum computing materials,
starting from the very,
very basics like the gates that
are used in quantum computing,
like teaching you to recognize
the correct gate for the situation,
to very advanced topics
like Grover's algorithm.
Bettina talked earlier today
about Grover's algorithm,
and it's actually my favorite example
of what we can do to teach people,
because it's one of
the very famous algorithms
in quantum computing.
A lot of people have
heard something about it.
Usually, it's something
like, "All right.
It's this algorithms that can
speed up database search."
That level of detail.
But once you actually go
in and try to implement
it to solve a certain problem,
even the simple one,
that's when you start to figure
out how easy it's it works.
What are the scenes
that nobody mentions?
Trust me, there are scenes
that books don't mention.
The more you play with it,
is the more you start
to understand it.
Maybe database search is
not the best application
for this algorithm.
So Katas are all open source,
and freely available for
everybody to download,
to learn themselves,
to teach other people.
In fact, they're open source,
so a lot of them were contributed
by people outside of our team.
They're available online
as Jupyter notebooks.
Now, it's time for demo.
Well, I like to live dangerously.
This is the Kata
which teaches you to solve
problems with Grover's algorithm.
I did mention that this my favorite.
So let's take a look
at how this is works.
Okay. It doesn't.
Minor technical
malfunction. Now, it does.
So I'm running this locally.
It's also available online,
but I didn't want to run the risk of
dropping Internet connection
or something exciting exist.
So it's a Jupyter notebook.
You see there are
some instructions in
the beginning on how to
initialize the Kata.
Basically, it loads
some packages that it
will need to evaluate your solutions.
The first part is,
writing oracles for the problems
that you're trying to solve.
So what does Grover Algorithm do?
Basically, it's given
an implementation of a function
which takes binary input and
gives you a binary output,
zero or one, indicating whether
this input is the solution
to the problem you're
looking for or not.
The goal of Grover's
algorithm is to find
any input that will produce
the value of function equal to one.
It's basically trying to reverse
engineer's function without
knowing what it is.
So the most interesting
thing about it,
is actually implementing
this oracle that it uses,
because you cannot use as
a classical implementation
of the function
to get this speedup that
Grover's algorithm gives you.
You need to be clever and to describe
the conditions on the input,
which will give you the answer
you were looking for.
So Boolean satisfiability problems
are actually an excellent example of
the problems that can be
solved using Grover search,
because they map to
this binary input binary output
really, really well.
Binary input is just the values
of the Boolean variables
that you assigned to those variables,
and the output is
the value of the function.
So the easiest example of
a SAT instance that you
can do is this one,
the AND expression of two variables.
So you see that the first task
gives you a very simple task.
It describes as the inputs to
the operations that
you will implement.
It tells you what's the goal is,
what's the transformation as it
is done by your code should be?
In some tasks, it describes
the return if the operation
has the return.
But this one is a transformation,
so there is no need.
Since there is a code cell,
in which you actually
write your code,
it gives you the signature of
the operations that
you need to implement,
and here you can write a code.
I have seen this task
once or twice before,
so I should be able to
write some code for it,
and run it by executing the cell.
Executing the first cell
takes a little bit of time.
But after that, it's much faster.
Okay. Actually, it does and
this code I wrote isn't correct.
Purely for demonstration
purposes, I'll show you.
So this is actually
a compilation error.
It will also tell you if
your solution can be
compiled but it's incorrect.
This one is actually
fairly easy to resolve,
its just a missing semicolon.
Then we runs this. So again.
Suspense, success. So yes.
I did know how to
solve the first task.
So after this,
the second task offers
a slightly more complicated task.
It's an OR formula which
is very similar to end,
but in quantum it takes
a little more effort to solve.
I could go on solving
these tasks just
because we have a lot of time
from cutting the previous talk short,
but really I want to be conscious
of flange coming up soon.
So let's just look through the tasks.
So you see, the next one is
another example of the formula,
then we get to
more complicated formulas in
which you need to
actually combine some of
the pieces you have
implemented earlier
and use them as building blocks.
Then thirdly, so they get
to the SAT problem itself.
It gives you a definition
of what is a SAT problem,
how it can be represented.
Then it explains to you
how this task gives user input
how it is represented.
Because representing SAT problem
you need to have to look at some
data structure which represents it.
Then on and on,
and then you get the full SAT problem
with arbitrary number of clauses.
Then the second part of
the kata and offers you
to implement Grover's Algorithm using
the oracles which you have
done in the third section.
So this is one of
the major principles of the katas,
the next task build
on the previous ones.
Or the covers that topic from
slightly different angle.
But usually in the end of the kata,
you need to be able to put
everything you've learned together.
In the end, you have to
implement the algorithm
and see to make sure
that it works even if
you don't know the number of inputs,
to see the number of solutions.
There's a formula. Does anybody
have any questions at this stage?
Because in the second part I will be
talking about something
slightly different.
Okay, excellent. Let me
return to the presentation mode.
Okay. So now that we
looked at the tools that
people can use to learn quantum
computing as their own.
In the second part of my talk,
I will tell you about how
we used the quantum katas
and other tools to teach
students quantum computing.
I will also tell you how you can get
access to those excellent materials,
just in case you want
to teach somebody.
So this went on retort a
course introduction to
quantum computing at
University of Washington.
Martin will tell you more
about it after lunch,
it was a major effort by
a lot of people in the team,
and it was a very
interesting experience.
Just to give you something
to look forward to.
Meanwhile, I'll give you an overview
of some materials we created
for it that we're happy to
share with other teachers.
So here is an overview
of course materials.
Basically it was
a 10 week long course.
So we had 17 lectures and we
have slides from those lectures.
We've had written assignments
that come with the solutions.
We had six programming assignments
which I will be talking
about in much more detail.
We offered a big subset
of quantum katas as webs.
So the material which
students can use to
learn the actual programming
necessary to do
programming assignments
before they continue to do
programming assignments.
All sorts of your final projects
which we offer and
the students do in teams.
So we did programming projects
rather than final exams.
But again, Martin will
talk more about it.
I shouldn't steal his spotlight.
Here is a brief overview of
what topics we covered
in the lectures.
You will see that
these are topics that
any introductory course and
quantum computing will have.
In fact this course
had a lot more information
than some of the courses
that we will have.
So it was a 10-week course
and reflected full.
We had actually several universities
already using these materials
for teaching their courses.
One of our partners took
these materials and they
basically took a lot
of these materials which
are more introductory,
except Fourier Transform I think,
which is a bit more advanced.
From this section, they only took
Shor's Algorithm and they
made a great course.
They didn't feel short on materials.
Then there are written assignments.
They are tasks based on
theory and applications.
They don't involve any programming.
So basically it's a task
which is given to you
on paper and you return
right off of it.
It's also many integrated.
Fortunately, I was not
involved in grading them.
Therefore, written assignments, they
cover different topics of the course.
We gave approximately one
assignment for two weeks.
Then there are
programming assignments.
That's what really made
the course stand out because for
hands-on component is
always very available
and it's always done in
normal computer science courses.
But in quantum computing,
it's a bit harder to do it.
So the loveliest piece of model
it is the task are
automatically graded.
Our teaching assistants
loved me for it.
Because I mean there are only so
many times you can look at to
sharp called for
Grover's algorithm to grade it.
There's not a lot of times.
So they are very
similar to the katas.
I will show them a bit later and
the gains they cover
the same material,
but they are designed to accompany
the written assignments.
For example, if you have
a task about the circuit,
like the one shown here,
it's really easier to
just do it on paper.
If you have a task,
for example about drawing a circuit,
it's done on paper.
But if you want to do
something a different angle,
programming assignments
are excellent for that.
So how we did it,
we taught the lectures to introduce
the theoretical material.
Then we offered a CAT or several on
these topics for people to practice
and internalize the topic.
Then we followed it with
a graded and programming assignment.
Now it's time for another demo.
I will show you the programming
assignments themselves.
Just to continue
the trend I started who is
talking about Grover's algorithm,
this is programming assignment from
Week 4 in which we cover
Grover's algorithm.
We also happens to cover
Fourier transform on that week.
We had basically a snowpocalypse
and it was a long week to cover.
So you can see the structure
of the project here,
it's very similar to
the structure of the Katas.
You have the file with the tasks,
you have the file with reference
implementations which you can
see just to check yourself
how it is graded,
and you have testing harnesses.
The file with the tasks is
similar to what Bettina showed
us earlier and this is how
the Katas looked when they are in
project mode as opposed
to notebook mode,
and this file is the only one
that the students get once
they get the homework.
You sees that it has
a little introduction
telling you what topics
are covered and what
Katas should be solved before
attempting this material,
and then we have the tasks.
Again, they look very similar.
Because the Katas, they give
you the inputs to the tasks,
the output or the goal of the task,
and the signature, and you
have to write the code here.
So basically, how the
workflow looks like?
We give this file to the students,
the students work on it or
fill ins a blank spaces,
and in the end of the week or
once the assignment is due,
they send it back to
the teaching assistant.
Then the teaching assistant
takes the students file,
substitutes it into the project,
builds with it lecture.
I can pretend that I'm
a very lazy student
and this is the file
which I submitted.
I really should have
put more effort into it
but as our commitments.
So as this file
builds and then if you switch
to Test Explorer mode,
you will see that it has 10 tests,
one test per task.
If you do Run all tests,
you will see that all
10 of them failed.
Okay. I guess I'm not getting
a good grade on this one.
So segregating part can be automated
even further because you can
do this copying over files,
and substituting them, and
running some tests on them.
You can do all of this
from common line from
a script which is what
our teaching assistants need.
Basically, it's
the one thing you care about
is how many tests passed.
This is basically
the grade out of 10.
One saying set, we are
considering improvements on.
Well obviously, a lot of
things can be improve.
I want to do a refresh on the tasks,
I want to do more tasks,
and maybe a little simpler ones
because we got a lot of feedback on
these materials basically
that the tasks are too
hard which I understand.
I can error on the side of
being too hard sometimes.
One of big scene in these was a set,
you notice that the Katas
count with the tests.
If you are trying to solve them,
you get your feedback
immediately and you don't
need to think about how
to verify your code.
When you have this
programming assignment,
you only given the file
was the tasks.
You're not given the testing harness.
The reason why we're
doing this way now is
that the testing harness
uses the correct solutions.
A lot of times, there is
no other ways that you can
test the solution other than
compare it with the correct one.
These solutions are all in the open.
You can just look at this file,
find the correct solution.
We cannot really give out
a graded assignment which
comes with solutions built in,
this is not how it's
supposed to work.
So this is why we had to
withhold as a testing harness.
For now, I think we can
do better than this and
package the testing
harness so that it
doesn't expose the students to
the reference tasks but also doesn't
require them to write testing harness
upfront because writing
testing harness is not trivial and
most students just cannot do
it in the very first week
because they have seen this whole
quantum computing same yet.
I think this is it for
the material that I had for you.
So any questions?
>> [inaudible]
>> There is a mic coming up.
>> I was curious how
are you hiding [inaudible].
I was wondering how
the implementation is hidden
when if the Katas in the notebook
rather than in the project
because you said like,
"Essentially, the project
which we are seeing here
is the same that we
have gotten over."
>> So when the kata comes in
notebook format like here,
it's essentially
a different front end for
the same thing that you've
had seen in the assignment.
So I can show you the repository
where the Katas reside.
GitHub repository, and you have
seen the links previously.
For example, if you look at
the same Grover's algorithm,
there is the same solution file
and project file and it has
a reference implementation file
which has the answers.
So in the notebook format,
they are hidden purely by virtue or
for just not exposing people
to this file structure.
Just because Jupyter Notebook,
you look at the notebook and
it doesn't show you the rest
of the files in that folder.
But if you go to the repository,
you can get access to these files.
So for programming assignments,
we cannot do the same thing.
We need to package those files
tighter like builds them
up in a DLL at least so
that the students can still like
disassemble the DLL and reconstruct
what was inside for it.
But honestly if they do that,
they deserves that grade.
>> Thank you.
>> Any other questions?
I guess that is it then.
Thank you for listening to me.
