Entanglement

Quantum entanglement is a physical phenomenon that occurs when pairs or groups of particles are generated or interact in ways such that the state of each particle cannot be described independently of the state of the other, even when the particles are separated by a large distance—instead, a quantum state must be described for the system as a whole.

Maybe a more visual example is in order. Let say that you have todays newspaper, and that it's 100 pages in length. If you ready 10 pages, you would know 10% of the content. If you read another 10 pages, you'd now know 20% of the content, and so on. However, if the newspaper was highly entangled, if you read 10 pages you would know almost nothing. Why, because the information is in between those pages, not on them. So you'd have to figure out a way to read all of the pages at once.

Now that we've described those terms, let's show you a quick sample from Microsoft's quantum computing SDK. As we mentioned, quantum computing is in its infancy at the time of writing, so the best we can do is show you where it's heading. We'll do that with a very brief example, and then leave it up to you if you wish to learn more.

So what does a quantum computing program look like? Like this:

class Program
{
static void Main(string[] args)
{
using (var sim = new QuantumSimulator())
{
var rand = new System.Random();
foreach (var idxRun in Enumerable.Range(0, 8))
{
var sent = rand.Next(2) == 0;
var received = TeleportClassicalMessage.Run(sim, sent).Result;
System.Console.WriteLine($"Round {idxRun}:tSent {sent},tgot
{received}.");
System.Console.WriteLine(sent == received ? "Teleportation
successful!!n" : "n");
}
}
System.Console.WriteLine("nnPress Enter to continue...nn");
System.Console.ReadLine();
}
}

Yep, that's it! Well, sort of. You see, a quantum computing program using the Microsoft quantum SDK is comprised of two parts. The first is the C# component you see here. Actually, it can be C#, Python, and several other languages on the frontend. On the backend, which we will see in a moment, is the quantum side of things, written in Q#; that's Microsoft's new language for quantum computing. Each Q# operation generates a corresponding C# class of the same name, which will have a Run method. This method is asynchronous because the operation will run asynchronously on the quantum computer.

According to the Microsoft documentation on Q#:

"Q# (Q-sharp) is a domain-specific programming language used for expressing quantum algorithms. It is to be used for writing sub-programs that execute on an adjunct quantum processor, under the control of a classical host program and computer.

Q# provides a small set of primitive types, along with two ways (arrays and tuples) for creating new, structured types. It supports a basic procedural model for writing programs, with loops and if/then statements. The top-level constructs in Q# are user defined types, operations, and functions."

So let's talk about what our C# code does. It simply sends a message using teleportation (and now you know why we started with terminology!). Let's take a look at the backend and see what's going on:

operation Teleport(msg : Qubit, there : Qubit) : ()
{
body
{
using (register = Qubit[1])
{
// Ask for an auxillary qubit that we can use to prepare
// for teleportation.
let here = register[0];
// Create some entanglement that we can use to send our message.
H(here);
CNOT(here, there);
// Move our message into the entangled pair.
CNOT(msg, here);
H(msg);
// Measure out the entanglement.
if (M(msg) == One) { Z(there); }
if (M(here) == One) { X(there); }
// Reset our "here" qubit before releasing it.
Reset(here);
}
}
}

And now there are many thoughts running through your head. More questions than answers, right? Fear not; it's a bit more of a technical approach to writing software for sure, but we'll give you a little bit of insight so that it will all make sense.

H, CNOTM, what is going on? These are all Q#-defined functions and will exist in the Q# component file of your project. Let's take a look at one of them and explain what's going on.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.222.185