coming up I'll walk you through the new
Microsoft quantum development kit now in
preview this is an important milestone
that we've been working on to empower
you in the quantum computing revolution
it forms a part of our differentiated
approach to delivering a scalable and
end
onam system the quantum development kit
makes it easy for you to start
experimenting now it includes a native
quantum focus programming language
called cue sharp local and Azure hosted
simulators for you to test your cue
sharp solution and sample cue sharp code
and libraries to help you get started in
the next few minutes I'll walk through a
few code examples and I'll explain where
quantum principles like superposition
and entanglement apply if these concepts
are new to you then check out our
previous episode to learn more and you
can download the code from our website
to follow along let's get started here
I'm in Visual Studio I'd like to start
with our version of hello world and
quantum computing called teleportation
which is core to quantum algorithms and
a great primer to begin your quantum
computing journey
teleportation enables communication
between quantum bits on a single piece
of quantum hardware or even between
remote quantum computers it serves as a
basis of a future quantum Internet and
shares many operations with quantum
algorithms you will create and develop
in this program I'll highlight the steps
to initialize quantum resources apply
operations and run your quantum
algorithm let's look at the code I've
opened two project files for this demo
one in our native quantum language Q
sharp and the other in a standard
programming language C sharp this is
because a quantum computer is like a
coprocessor it's much like how you
program a GPU or FPGA and then call the
code for the accelerator from say your
CPU to sharp is designed with a similar
hybrid compute model in mind now let's
look at the Q sharp program the syntax
should look somewhat familiar as we've
designed it with ideas drawn from
languages like C sharp and F sharp for
example here you have code colorization
you can define and call operations use
let and if commands and more
the teleport classical message operation
takes as input a classical message
represented by a boolean value the first
thing to do is allocate a register to
store quantum information here I've
allocated two qubits initially assigned
to the state 0 with the using command I
then assign each qubit a name message
and there I'm going to encode the
message into the message qubit by
applying an X operation which is
analogous to a knot in classical logic
here if the message is 1 we apply the X
operation to the qubit message flipping
its state to teleport the message let's
look at this operation teleport teleport
takes two qubits as input message and
there the first step is to allocate one
more qubit and we call it here it's also
initialized to state 0 now we use the H
operation or how to margate to place our
qubit here into a superposition state H
takes the state 0 to 0 plus 1 and the
state 1 to 0 minus 1 recall that a qubit
is a quantum bit of information and it
can be in a so-called superposition of
values not just 0 or 1 like a classical
bit but rather a combination of 0 and 1
this leads to a type of massive
parallelism we can exploit in quantum
algorithms and is a key quantum
operation that you will use at the start
of most every quantum algorithm you
design now after placing here into
superposition we apply a two qubit
controlled-not
or si not gate to the qubits here and
there si not flips the value of the
their qubit if the here qubit is 1
otherwise it does nothing to either 2
bit it's like an XOR gate in classical
logic now together these two operations
H and C not have enabled us to create
entanglement between qubits here and
there once entangled the state of these
two
it's is intrinsically correlated if I do
something to one of them it
instantaneously changes the state of the
other one even if I've spread them
across the universe from each other this
entangled pair is a key resource for
sending the message I take the message
qubit and load it into the entangled
pair using another see not on qubits
message and here followed by H on qubit
message now I need to measure out the
entanglement to conclude the
teleportation of the message I measure
both the message and here qubits using
the M operation at the end of a quantum
algorithm you will often perform a
measurement to project the quantum
information to a classical state which
you can then output and read here we use
the measurement output to conditionally
apply quantum operations Z then X to the
their qubit now returning to teleport
classical message we can measure the
their qubit to see if it has the message
let's check to see if the message was
actually teleported into the their qubit
and go back to the main culling program
in the c-sharp file now the quantum
development kit comes with a built in
Universal quantum simulator with it you
can run small instances of your quantum
programs on your local hardware to
around 30 simulated qubits the qubit
restriction is purely driven by your
development machine I'm using my
everyday laptop for this simulation in
general you'll need 16 gigs of RAM to
simulate 30 cubits simulating one more
qubit requires double the memory
simulating one less halfs the memory
simulating 40 qubits requires roughly a
thousand times more memory than 30
cubits coming in around 16 terabytes
so we also offer a simulator hosted and
Azure that enables going beyond 40
qubits to test our program let's
initialize and target the local
simulator and call teleport classical
message eight times each time with a
random message of 0 or 1 or true or
false
I'm going
to print the results of the screen using
the functionality of c-sharp now let's
hit run we can see that when the boolean
value is true the their cubit also
received true
so the message has been correctly sent
we've successfully teleported
information and you've completed your
first quantum algorithm you can also
debug your quantum program by setting a
breakpoint and stepping through the code
which we'll cover in an upcoming
Microsoft Mechanics episode you can also
use the built-in trace simulator
provided with the preview release to
estimate how many qubits and operations
you are using in different parts of your
quantum program as you can see here in
the excel file it outputs how many
quantum gates are used within the
different operations with such
information you can optimize your
algorithm to reduce the number of qubits
and operations required and we'll cover
this in more detail in future episodes
as well now let's take a quick look at a
more complex program this example serves
as a foundation for using quantum
computing to solve problems in material
science or chemistry for example to
learn about new catalysts for improving
the efficiency of a chemical reaction
let's look at finding the ground state
energy of a simple molecule hydrogen now
here again we call our quantum program
from a classical one this time written
in F sharp in this example we're going
to load classical data about estimations
of the bond links and then for each bond
length we use the quantum computer to
estimate the ground state energy given
that configuration this example also
uses many of the built-in library
functions in Q sharp by calling
Microsoft quantum canon to enable easy
programming of a very fundamental
quantum algorithm and you can see the
many libraries available arithmetic
phase estimation and more now in the F
sharp code I can exploit real time
plotting to see the output as it's
calculated when I hit run you can see it
plotting
the ground state energy calculated on
the quantum computer 454 different on
links the output from the quantum
computer as you can see closely matches
the results from theory developed over
the last several decades now molecular
hydrogen is a very small molecule with
just two hydrogen atoms we can easily
simulate it locally to test larger
molecules we can use the azure base
simulator
when the algorithm requires more than 40
qubits and ultimately the quantum
computer will allow us to go far beyond
40 qubits
we'll be able to study complex molecules
that today require longer than the
lifetime of the universe to study on our
best supercomputers and it will take
just a matter of hours or days with a
quantum computer our quantum development
kit enables you to write programs for
these large calculations today so that
was a quick introduction to the new
Microsoft quantum development kit in
preview now you can get started by
accessing the preview at the link shown
and get access to Q sharp our simulators
code samples and tutorials quantum
computers will be revolutionary and
enable us to start solving some of the
world's most challenging problems in
areas such as machine learning global
warming and clean energy to find out
more about quantum computing and
Microsoft's approach join our quantum
community and thanks for watching I look
forward to seeing how you will harness
quantum computing to kick-start the
quantum computing revolution
[Music]