>> Hello, I'm Chris Granade from
the Quantum Architectures and
Computation Group
here at Microsoft.
Today, I'll be talking about
the Quantum Development Kit,
our recent effort to
empower people to get
hands-on and learning
with quantum programming
at a high level.
There's a number of
different pieces of
the Quantum Development
Kit including
comprehensive documentation
to help you get started,
but the most exciting
piece is Q-sharp,
our new language for thinking
about quantum algorithms
at a high level.
So, let's go on and get started.
Q-sharp should at some level
be a familiar language.
We can break things down
into operations, functions,
namespaces, other elements that
are familiar from
other languages.
So, for instance, if we want
to run ''Hello, World!'',
we can do that by using
the message function to
print out to a console.
Once we have that, we can
use that from C-sharp and
Visual Studio in a manner
very similar to how
you might send code to
a GPU or an FPGA
as an accelerator.
Here, we'll ask for
a target machine,
a quantum simulator,
that is something
running locally on
our desktop that simulates how
an ideal quantum computer
would work for
small numbers of
qubits up to about 30.
We can ask our target machine,
our quantum simulator,
to go and run our new operation
and wait for the answer back.
So, if we do that, we'll
see a ''Hello, World!''
just as we expect.
So, it's a good hands-on way
to get started with.
Of course, a quantum
programming language
wouldn't be very
interesting or useful if you
couldn't allocate qubits.
So, let's do that. We can
allocate a new qubit.
We can use what's
called a Hadamard
operation to prepare
a superposition state
on that new qubit.
Then if we were to measure it,
we'll get 50-50 statistics
out between
a zero or one outcome,
so that makes a good
random number generator.
So, let's simulate
how that would work.
We'll allocate a qubit,
apply a Hadamard,
measure the result, and then
that's the result we can
return back out to
the classical rolled.
Once we have that, it's
very similar at
the C-sharp level.
We can save out
the result from having
run our new operation
into a variable.
We can loop over, we can
print it to a console,
we can do whatever we'd
like with it at that point,
giving us a very flexible way of
interacting with
this new funding routine.
So, let's run it and
see what we get.
So, we get about
the 50-50 statistics
we'd expect out of that,
showing that operates
the way we'd expect.
We can build on that
and do even more
by using the other operations
built into Q-sharp
such as the controlled-NOT
operation to prepare
entangled states instead of
simply superposition states
on the single qubit.
So, now, we'll
allocate two qubits,
apply Hadamard to the first
to prepare a superposition,
and then make an entangled pair
using the controlled-NOT
operation, I mentioned earlier.
Now, when we measure,
we know that because
they're entangled,
we'll get the same answer
on both qubits.
So, we'll return that out
to the classical rolled,
pull it from C-sharp
in the same fashion.
Again, we get the same kinds
of 50-50 stats we expect.
Except now correlated between
the two things with
that entanglement.
We can also run in
Visual Studio Code
on not only Windows,
but also MacOS and Linux.
So, let's look at
using the elements that we
just saw in Visual Studio,
here to build up
something that's actually
really useful quantum
building block
as we look at other algorithms.
So, in particular, let's
start with teleportation.
That's a little bit
of a whimsical name,
but it really points to
a very basic building block
that gets used in a lot of
different contexts within
quantum programming,
as a way to move information
around the quantum device.
So, we can write out
the same things we did earlier,
if a Hadamard and a
controlled-NOT to prepare
some entanglement.
We'll do the opposite to
unprepare some entanglement to
make a measurement that lets
us move that information.
We'll then apply a correction
based on that measurement,
and we can use standard
classical techniques
such as unit testing
to build up confidence
that we actually did
what we intended to do
here and actually moved
information correctly.
So, let's run that.
Here, we can run it
using the.Net Core SDK,
the same way we'd
run anything else.
So, it's C-sharp or F-sharp
on your favorite
operating system.
When we run that, we get that
the state was teleported
successfully.
But, this somehow it
feels a little bit
unsatisfying as an ending point
because I had to list
out each of the individual
operations and that's
great if you understand
deeply what each of those do.
But, it really isn't speaking
to how do we get hands-on,
thinking at a high level
about quantum algorithms.
So instead, Q-sharp lets
us do something else,
which is extract those into
a new operation, document them,
and give a name
to those patterns that occur
in front of programming.
The same way that we might
refactor code classically.
Now, instead of listing
Hadamard C-NOT,
I say prepare some entanglement.
Now, the description
of teleportation say,
it reads more logically
in terms of what we're
trying to implement rather
than how we're
trying to implement.
So, now, I can say prepare
an entangled pair,
add joint says to unprepare,
so that we can use that
preparation as a measurement.
We can then apply the correction,
and call this operation
to do teleportation
as a library routine
went for a particular state
that we want to send.
I can run that in the same way,
and I'll see that it succeeds
for the exact same reason.
Once we have these kinds
of building blocks,
we can use them to do
some really neat things.
So for instance, if you're
interested in chemistry,
a problem you might
want to ask is given
some Hamiltonian to describe
a particular chemical system.
What is the ground state
of that Hamiltonian?
What is the ground state energy?
This is something that
determines a lot of
different properties
such as reaction rates.
So, it's really interesting in
a lot of different
chemistry applications.
So, let's start with
a simple H2 molecule,
that where we can compare
the theory and we'll
describe the initial state
of a simulation of that molecule,
sorry, each step
of the simulation,
the initial state
of that simulation,
and the statistical techniques,
we'll use to extract information
about the ground state.
I can run this in
exactly the same sense as I
run all of the basic
building blocks,
we saw earlier using
the.NET Core SDK.
We'll see a plot that
compares the ground state energy
to be from a quantum
simulation to
what we know from theory
for this simple molecule,
giving us some
confidence again that
we've built up the simulation
in a useful way.
So, these are some
of the things you
can do with the Quantum
Development Kit.
It's all powered
by a large set of
open source libraries that
formed the standard library
that you can download,
look at, see how they work,
peel back the layers,
and also contribute to it.
We're very thankful to
the Q-sharp community for
many of the contributions
we've gotten
back into the standard library.
You can always look and
see how, for instance,
state preparation for
arbitrary states is defined
by looking at
the Q-sharp source code
in the standard libraries.
To try and help make it easier
to get hands-on and learn,
whether you're new
to quantum entirely,
or whether you're a quantum
researcher looking to branch
into more
programming-based efforts,
we've recently also released
a set of what we call Katas or
self-paced exercises to teach
different concepts in
quantum programming.
Starting from what are the
basic operations available to
a quantum programming and ranging
through more advanced
topics such as,
how do you represent
classical functions as
oracles or subroutines
in a quantum program.
So, we really hope
you'll give it a try,
and we look forward
to your feedback.
Thank you very much.
