.NET Oxford Meetup XVI: Getting Entangled in Q#


Last week was our July .NET Oxford meetup, and this time it was all about Quantum computing and Microsoft's new Q# programming language! Joining us this month was Anita Ramanan and Frances Tibble from Microsoft, doing a fantastic job with introducing us to the fascinating world of Quantum computing!

I actually had a sneak preview of their talk the week before at the Developer Day conference in Reading. I sortof felt like my mind had melted at the end of it - so it was great to get the chance to try and soak some of it in a second time!

anita

Intro, News, and Prize Draws

This time, it was Matt's turn to do the intro talk. Starting with the usual, 'about us' intro, also thanking our amazing sponsors Corriculo (see below), then moving onto news items and prize draws...

intro

News

New Features in ASP.NET Webforms

For those still stuck in the world of WebForms, Microsoft has been hard at work adding more modern functionality to WebForms. Examples of this are Configuration Builders and Dependency Injection. The latter being huge, and I'm sure will make a lot of WebForms developers very happy! I know Matt is one of them - hence why he probably chose and was quite excited by this news item!

(Channel 9 Video with details)

Flaw in .NET Core 2.1 extends end-of-life for .NET Core 2.0 support

The second news items was about the end-of-life support date for .NET Core 2.0. As a non-Long Term Support (LTS) release, it was supposed to end three months after its release date. This was previously going to be the 1st September. However, due to an issue they've found in .NET Core 2.1 - this has been extended by an additional month.

(Further details can be found here)

Prize Draws

A massive congratulation to the winners this month ...

Jetbrains

Congratulations to Nayyar Kazmi for winning a year-long Jetbrains product licence! He hasn't yet chosen which product he's going to pick - but if I was a betting man, I'd guess he'll pick the Resharper+Rider package!

Manning Books

Congratulations to Dimitris Papaconstantinou for winning a Manning ebook of his choice! The winner has the choice of any of the awesome Manning ebooks from their website, and Dimitris choose Machine Learning with TensorFlow.

Remember that we have our special Manning coupon code (ug367) which gives all of our members a 36% discount on any of their e-books! They've also asked me to share a link to some of their new courses for their LiveVideo system.

Oz-Code

Congratulations to Hugo Nava Kopp for winning the Oz-Code licence! For those that don't know, this is a Visual Studio extension that puts your debugger on steroids! Take a look at their website for videos of their features.

If you haven't checked it out, then definitely download the trial and have a play. All our member get a free 3 month trial licence (see below) or 50% off a full licence! To claim, you can visit this link to pick up your licence!

prizesponsors

The slides for the intro talk can be found here, and the Reveal.js source code can be found here.

Corriculo Recruitment

Before moving onto the main talk, I'd just like to thank our sponsors, Corriculo Recruitment for all they've done. We wouldn't be able to do what we do without them. They've been our sponsors from the very start, helping us out with venue costs, providing plenty of food and drinks for everyone, as well as helping us out in many other ways. And they've never ever pushed recruitment in anyone's faces - which is something I was initially concerned about with having a recruitment company as a sponsor - but it was completely unfounded. A really great company, and a fantastic group of people. They're definitely a core part of the .NET Oxford team, and hopefully will be for a long time to come!

The Talk: "Quantum Computers: Don't Panic!"

During the talk, both Anita and Frances took turns covering different areas. Whilst both are software developers - Anita has more of a physics background, so covered the intro to Quantum mechanics, and explaining high-level descriptions of things like superposition. Then Frances, who has more of a computing background, focused more on the programming side of things and Microsoft's new Q# programming language.

anita

Anita used a couple of different examples to try and explain the very basics of the quantum world. Her first, was to imagine she left her laptop where it was, and she then left the room. In a normal classical world, unless someone moved it, it would still be there when she got back. In a quantum world, when she left the room, her laptop could then be anywhere in the room - it's in a state of superposition. Then when she comes back into the room, that state will collapse, and she can see where the laptop now is. There's even a small chance that she could find the laptop outside the room, which is an effect called quantum tunnelling. She states that we still don't know why this is the case. There are many theories - ranging from the many-worlds theory, to the hidden variable theory, plus many more. But in reality - we just don't know.

Another example she used to explain superposition is with the Theseus and the minotaur story. In the story, Theseus uses a ball of string in the maze whilst trying to find the minotaur, so he can find his way back. Each wrong route he takes, he'd then have to backtrack to try another route. Anita explained that in a quantum world, he could try all the routes simultaneously. We can then use concepts such as quantum interference to dampen incorrect paths, and amplify the correct path.

Anita also discussed the kinds of things we can use quantum computers for. The slide in this section showed four different areas ... nitrogen fixation, carbon capture, materials science, and machine learning. She briefly covered each of these, but focussed more on the Nitrogen Fixation example, explaining the process of extracting ammonia from atmospheric nitrogen to produce fertiliser. This process (called the Haber Process), uses a lot of energy and requires very high temperatures. In fact, 4% of the global energy output each year! Anita then explains that there is a much more efficient way. Beans contain bacteria which can also produce ammonia - except this is at room temperature. Whilst we understand how this works, we're unfortunately not able to simulate this with enough detail to actually replicate it. We'd actually require 1.5 x 10^51 physical bits (ie. all of the atoms on earth x 10!) to compute this! Or "just" 170 qubits.

This led on nicely to an explanation of qubits, with a slide showing light bulbs with switches in three states - on, off, and also a superposition state demonstrated by a dimmer lightbulb switch, explaining that this state could be anywhere in-between. She also went into more detail into how the quantum interference and amplitude works (mentioned briefly above in the Theseus and the Minotaur section). I won't try and repeat the maths, but they have this covered in their many blog post articles about this which you can find in the links below.

The next section Anita talks about is quantum entanglement. I'm sure we've all heard this term before, and most of us are probably aware that this relates to two particles that are tied together, regardless of their distance from each other. Anita gives the example of both herself and Frances sharing entangled particles, and then Anita who happens to be an astronaut in this story, takes her particle into outer space, whilst Frances remains on earth. If at any point Anita measures her particle, it will collapses down into either the 0 or 1 state - and Frances' particle will instantaneously also collapse down into the opposite state. This would hold true regardless of distance. Unfortunately, she points out that this can't be used for instantaneous communication.

So how do we actually build a quantum computer? Anita introduced something called an Ion Trap, which is actually research being done here in Oxford, hence it's known as the Oxford Ion Trap. Anita explained at a basic level how this works and also how we use this to define the zero, one, and superposition states.

Then there's Microsoft's research into Quantum Computing. They're doing something called topological quantum computing, which deals with extremely low temperatures. And by extremely low temperatures, they're talking extremely low! Colder than deep space, and potentially the coldest place in the universe! They use what they refer to as a Quantum Fridge to do this. Anita explained at a high level how this works - which I won't try to repeat here, but will instead link to resources in the links section further down this post.

frances

It was then Frances' turn, talking about developing with Microsoft's new Q# programming language. Their new quantum language was announced September last year, and we mentioned it in the news section of our September .NET Oxford meetup. At the time, it hadn't been given a name - but we all correctly guessed that they'd called it Q#. And who said naming things was hard?!

Frances explained what Q# was and talked about some of the different operations. We saw some of the mathematical concepts that Anita introduced earlier come into play, and how they fit into the Q# language.

The operators she covered were M (measure), NOT, CNOT (controlled not), Z, and H (Hadamard). She then used these gates to explained and demo doing quantum teleportation in Q#.

If anyone was still struggling to grasp how it works though - hopefully this slide cleared it all up ...

quantumteleportationexplained

Obviously just joking there, but the title made me laugh :) Seriously though, Frances has done a fantastic job writing all this up in very detailed blog posts. The one about quantum teleportation in Q# can be found here, so she's saved me the job of even attempting to explain it here!

One point she mentioned was that the Q# code lives in files with the .qs extension, and these would live alongside your C#, VB.NET, or F# files. In the same way as you might off-load rendering code to a GPU (think vertex/pixel shaders if you're from a graphics background) - you'd also off-load Q# (.qs) code to a Quantum Computer (or simulator at this stage). Then the rest of your code would be in the usual .NET files.

The slides for Frances' section can be found here.

Anita then reclaimed the stage in the final section where she spoke about cryptography. This is one obvious topic in which people worry about with Quantum computing. Most of us already know that current popular cryptography works by relying on the fact that prime number factorisation takes a very long time, and is very computationally expensive - so it's currently very difficult to reverse the multiplication of two large prime numbers. So does this mean that when Quantum Computers become a thing, cryptography is useless? For anything encrypted using current cryptography method relying on prime factorisation, thanks to Shor's algorithm, probably yes. But then Anita goes onto explain that there are groups working on new post-quantum encryption techniques. She explains in principle how this works using an example where both Anita and Frances are organising a surprise party for Satya, who is trying to snoop in on the conversation to find out what is going on ...

satya

The short version is that due to quantum data not being copy-able, Satya can't do a man-in-the-middle attack and copy the stream of data. Also, because once you observe the quantum state, it gets collapsed down - Satya also can't peek in on the stream without the receiver of the data knowing it. Anita actually went into much more detail than this, but you get the idea!

Summary

I've tried to cover the main areas of the talk, but obviously there was a lot of detail that I can't possible cover in this blog post. Luckily, whilst there's not an online version of the .NET Oxford talk, there are online versions of the same talk done elsewhere. I've included them in the links below, and would highly recommend anyone who's interested in this to both watch the video, and also check out their main landing page which has lots of links to various blog posts and resources.

A massive thankyou to both Anita and Frances for joining us and sharing the fascinating Quantum world with us!

Links

Dev Tips

As usual, we end with a dev tips section where anyone can get up and do a 30-second-ish dev tip. The idea being a fast turnaround, each person passing the mic to the next person. A nice way to get more people involved. We also always ask our speakers if they'd like to do one too. I think this time, we had the most dev tips we've had so far! ...

Frances

"Sometimes in an operation you may need extra qubits for computation, and you can do this by allocating them. When they are allocated, they are given to you in a 'Zero' state. It's really important that once you're done using the qubits, you 'Reset' them, so that they are returned in the same clean state, ready for use elsewhere. If you forget, the compiler will complain!"

Anita

"You can try out Q# without installing anything by visiting: https://tio.run/#qs-core"

Dan Clarke (me!)

Listen to developer podcasts. This is the main way I keep up to date with the latest technologies, and being audible means you can listen whilst doing other things - eg. on your commute, whilst making dinner, whilst cleaning up, whilst at the gym, etc. There are some really great podcasts out there, eg. .NET Rocks, MS Dev Show, Coding Blocks, No Dogma, Cynical Developer, and many more.

James World

"When writing user stories, one of the stakeholders developers often forget is themselves! Think about what you need to know to troubleshoot the story when the phone rings at 2am. Make sure you log the important events in your features - you’ll thank yourself later! Add an item to your code review check list to cover this."

Matt Nield

"When you’re learning a new language or framework, you can often fall foul of the fear of missing out. You realise just how much you don’t know yet and try to fill all of the gaps in your knowledge. Instead, concentrate on what you need to know to get the job done. With time you’ll build on that knowledge and fill those gaps."

Tim Boyle

"Roslyn Syntax Visualizer is a built-in Visual Studio Extension that facilitates inspection and exploration of Roslyn syntax trees and can be used as a debugging aid when you develop your own applications atop the .NET Compiler Platform (“Roslyn”) APIs."

Guy Fletcher-Wood

"Material Design in XAML is a framework for making WPF UIs a lot better looking. It has a new look for all the standard tools, as well as some new ones. It's easy to use, and has literally wowed some end users looking at our user interfaces. Highly recommended."

Pub

As usual, afterward we headed to the Old Tom for plenty of geek-out conversations. Not everyone joins us at the pub, but we had our usual regular faces, plus a few new members joining us. Coincidentally, chatting with a new member (Nick) at the pub, it turns out that he works at Rebellion where I used to work, and was definitely a trip down memory lane and we were chatting about who is still there and what everyone's up to!

Upcoming Meetups

Below are our upcoming meetups for this year. Not all have been announced on Meetup.com yet, but if you subscribe to the meetup, you'll get email notifications as they are announced.

August 7th: CosmosDB, Azure Functions, and PowerBI:

In August, we have James Broome and Mike Larah joining us from endjin talking about analysing flight data in real-time using CosmosDB, Azure Functions, and Power BI.

(Meetup.com event page)

September 11th: "Pilot Decision Management" and "Chatting with your Data":

In September we have two talks - Clifford Agius will be talking about Pilot Decision Management, and how their training relates and can benefit programmers. Then we also have .NET Oxford co-founder, Matt Nield talking about using bots to access your data.

(Meetup.com event page)

October (9th?): Jon Skeet:

October should be with Jon Skeet himself! He has a few talks, and we're not yet sure which one he's doing - but, it's Jon Skeet! He can talk about anything he likes! At the moment this is pencilled in for the 9th, but that hasn't been confirmed yet.

November: Performance in the Javascript Era:

November will be with Benjamin Howarth, talking about various different aspects of performance in an era where much more functionality has been pushed to the frontend. This isn't just a Javascript talk though - it covers a lot of aspects that are important to us .NET developers too!

December: More Lightning Talks!

We thought that December would be a nice place to slot in another lightning talk event. It may be a long way off, but if you do want to do one, feel free to get in touch! First timers are most welcome too!


Please retweet if you enjoyed this post ...