With Q#, Microsoft is throwing programmers the keys to quantum

Krysta Svore Microsoft Q# Quantum Computing Coding
Microsoft

Computers are about to get weird.

After decades as theory, the first quantum computers now sit in a select few labs across the globe. They’re rudimentary, and arguably less practical than early electronic computers like the 50-ton ENIAC. Yet researchers are making headway. IBM, Google, and Intel are making progress on quantum hardware, and a practical quantum computer finally feels like a near-future reality instead of a subject for science fiction.

That’s an opportunity. It’s also a problem. Quantum physics is a weird realm of teleportation and probability that doesn’t follow the rules we’re familiar with. Most people don’t understand quantum mechanics, and that includes programmers, the people who will need to put quantum computers to practical use.

Microsoft has a plan to educate them.

Making the mystery approachable

Any developer looking to learn a new programming language, like C# or Javascript, wants to make immediate use of her lessons. Yet quantum computing’s infancy can make that difficult. Creating a program for many quantum devices is a lot like trying to write in binary machine code – except even more difficult, because quantum mechanics. This isn’t just a field that’s well understood but hard to translate. It’s an area of study where some fundamentals remain unknown.

Microsoft Quantum Q#, coding on a computer
Matt Smith/Digital Trends

That includes the reason why quantum computers work. “What we have in quantum computing is proof points that quantum computers can outperform classical computers,” said Krysta Svore, Principle Research Manager at Microsoft’s Quantum Architectures and Computation group. “The Holy Grail in our field would be an actual mathematical proof of that.”

Quantum computing is so new, and so unlike anything before it, that even top researchers remain in the dark about important and fundamental elements.

Teaching programmers to code for quantum on real hardware is out of the question for now. Microsoft’s quantum programming language, Q#, side-steps that problem by offering simple access to the tools needed to begin programming. That means making Q# as familiar and approachable as possible, even while scientists continue to make breakthroughs in the fundamentals of how quantum computers work.

Q# isn’t tucked away behind a wall of terrible documentation and poorly explained installers. Programmers can access it through Visual Studio, the world’s most popular development environment. And programmers don’t need access to a quantum computer to use it.

Instead, they can program as if their code would run on an actual quantum device but then run it on a virtual simulation. That’s possible because the quantum computer isn’t treated as its own complete, independent system, but instead as an accelerator that’s called on by a classical computer running classical computer code.

“We envision the quantum computer being another resource in Azure, next to say the GPU, the FPGA, the ASIC, to use. Azure becomes this whole fabric that includes in its compute, a quantum computer,” Svore told Digital Trends.

Most programmers are familiar using purpose-built hardware for specific tasks, and most are familiar calling on resources in the cloud. Firing up Q# isn’t different from those well-known tasks. Quantum hardware might be exotic and rare, but the programming environment Microsoft offers for Q# is exactly what you’d see today if you looked over the shoulder of a programmer at most Fortune 500 companies. That makes it far less intimidating.

“The ultimate vision is that the user isn’t saying ‘Ok, now I need to take this app and run it on this part on the CPU, this part here, this part there,’” said Svore. “It’s the same with quantum computing. We want the accelerator to be seamless.”

A quantum community

Programmers can introduce themselves to Q# through a set of free tutorials that Microsoft calls Quantum Katas. Each lesson involves “a sequence of tasks on a certain quantum computing topic” that programmers are challenged to solve. Finding the correct solution is the goal, but the journey is just as important. The katas aren’t meant to be solved in a single pass. They teach through trial-and-error, introducing programmers to the basics of quantum programming along the way.

Q# and the Quantum Katas bring a transformative level of feedback to quantum programming

Chris Granade, a Research Software Development Engineer at Microsoft, saw them for himself while attending a tutorial session hosted by the University of Technology Sydney. “It was really amazing to watch that people could go from zero knowledge in quantum, to writing it,” he told Digital Trends. “What was transformative, was that when people had a misunderstanding, they didn’t suffer with it. They could run the katas, they could see the got the wrong answer, and that feedback really got people to understand in a hands-on way.”

That hands-on experience immediately transforms quantum computing from a theoretical concept to a practical reality, which makes all the difference in how people approach it. Programmers may not make physical objects, but they’re used to seeing feedback just like any other craftsperson. They create a thing and it works – or it doesn’t. Q# and the Quantum Katas bring that level of feedback to quantum programming, giving anyone interested a chance to dig in and understand what quantum computing makes possible.

The change Granade saw in person isn’t just happening in classrooms. The Quantum Development Kit, of which Q# is a part, can be downloaded by anyone under an open-source license. Interested developers can not only begin to use it, but actively contribute to the community. Svore told Digital Trends that QDK downloads number in “the upper tens of thousands,” and participants have already added “a handful of substantial contributions,” including new algorithms and documentation.

While still a niche, this Quantum Development Kit places the bar of entry low enough that even a novice programmer can begin to experiment with Q# and, in doing so, begin to understand what makes quantum computing tick. That’s helpful not just for programmers, but for the entire field of quantum physics. Explaining quantum theories is a major headache not only because the quantum world is strange compared to the “classical” physics most programmers know, but also because the practical implications of quantum physics can be difficult to demonstrate.

“You don’t need to know the physics. You don’t need to know the quantum mechanics.”

Classical computers deal with binary absolutes. 1s and 0s. Off or on. Quantum deals with probabilities, and programming for quantum means creating algorithms that manipulate probabilities to produce the correct solution. “You know this wave includes my solution. These other waves include not a solution. So, I want those waves, when they interfere, to go away,” Svore explained. “And I want the wave that includes my solution to get really big. At the end, we measure the quantum states. The probability of getting the high wave out is more likely the higher that wave is. That’s how we design quantum algorithms.”

Do you understand what Svore means?

If not, don’t feel bad. It’s not easy to grasp, and it’s not easy to demonstrate. Even thought experiments meant to simplify quantum mechanics, like Schrodinger’s famous cat, can leave you scratching your head.

Microsoft Quantum Q# Engineers
Microsoft

Microsoft hopes that Q#, and the Quantum Katas, will offer a hands-on alternative for approaching the subject. “You don’t need to know the physics. You don’t need to know the quantum mechanics. In fact, I’ll admit I didn’t take quantum mechanics until graduate school,” said Svore. “I entered quantum computing without ever taking physics in college. I’m a computer scientist by training.”

Quantum programming could become a window of insight by giving programmers a chance to make practical use of quantum theories without ditching the tools they’ve come to rely on. There’s no need to spend years learning physics. Just jump in, make an application that uses Q#, and see what happens.

Preparing for tomorrow

Today’s practical use of Q# is limited because there’s no hardware to call on. Microsoft hasn’t built a quantum computer yet, and even if it had, it would be too primitive to perform useful calculations. But a programmer can check their work by running Q# on a simulated quantum computer. That makes it possible to code a program for quantum with a reasonable expectation that, once the hardware is available, it will work.

Krysta Svore, Chris Granade, Microsoft Quantum Q#
Krysta Svore, Principle Research Manager at Microsoft’s Quantum Architectures and Computation group (left) and Chris Granade, a Research Software Development Engineer at Microsoft. Matt Smith/Digital Trends

That’s crucial. Quantum computers are not merely a better modern-day PC. They’re fundamentally different. They require different hardware, different algorithms, and a different approach to solving complex problems. Even if a time traveler appeared with a functional, stable, million-qubit quantum computer, we’d have trouble putting it to use, just as Roman scholars would be perplexed if handed a laptop. 99.9 percent of modern developers, programmers, and computer scientists have zero experience coding for quantum, and no clue how quantum physics work. The basics must be introduced before more impressive discoveries can be made.

Teaching that will take time – but Microsoft’s Q# is an important step forward.

Emerging Tech

Awesome Tech You Can’t Buy Yet: Self-balancing skates, tiny tripods, and more

Check out our roundup of the best new crowdfunding projects and product announcements that hit the Web this week. You can't buy this stuff yet, but it sure is fun to gawk!
Emerging Tech

Don’t be fooled — this automated system sneakily manipulates video content

In the vein of “deep fakes," Recycle-GAN, a new system from Carnegie Mellon University, presents another case for how difficult it will be to distinguish fiction from reality in the future.
Home Theater

Vizio is bringing Dolby Atmos to your living room without any setup headaches

Vizio’s new home theater sound systems offer all of the good parts of Dolby Atmos object-based surround sound to your living room without the troublesome setup chores of some other systems.
Emerging Tech

Neural networks? Machine learning? Here's your secret decoder for A.I. buzzwords

Don't know your machine learning from your evolutionary algorithms? Worried every time you sit on a bus in case Google's Larry Page sits down next to you with a pop quiz? Our handy A.I. buzzword guide is here to help.
Computing

Security flaw on modern PCs could leave your encrypted data exposed

Hackers can revive the decade-old cold boot attack to steal your data by exploiting weaknesses in a modern PC's or Mac's firmware, researchers discovered. The hack requires attackers to have physical access to your PC.
Computing

Don't buy a new router, fix your Wi-Fi with these quick tips

Don't panic when your Wi-Fi goes down. Instead, fix it. These simple solutions to the most common Wi-Fi Problems will get you back online at high speed in no time (hopefully) without buying a new router.
Mobile

This orange puck keeps you online in any country, with one hidden catch

Staying connected on your travels can be a challenge and sometimes results in hefty cell phone bills you could do without. We tried out the Skyroam Solis, a global Wi-Fi hotspot and power bank billed as the perfect solution.
Computing

Our favorite gaming desktops make the latest consoles look pathetic

PC gaming doesn't always come cheap, but it doesn't have to be extortionate either. In this guide we've put together a list of the best gaming PCs you can buy, with everything from the big and flashy, to the super compact.
Computing

These 15-inch laptops are both powerhouses, but which should you buy?

The Asus ZenBook Pro 15 UX580 offers an innovative twist on the tried-and-true touchpad: the LCD-equipped ScreenPad. That's not all that Asus has up its sleeve, but is it all enough to compete?
Computing

Don't spend hundreds on Pro Tools or Logic. Try one of these free alternatives

Believe it or not, Pro Tools isn't the only digital audio workstation worth your time. Check out our picks for the best free recording software, whether you're looking for a lightweight app or a full-blown audio workstation. Updated meta…
Computing

Microsoft may go back to black with 2018 Surface Pro and Surface Laptop

Microsoft may be adding black as a color option to its refreshed Surface Laptop and Surface Pro models on October 2nd. Rumors of the new color along with an image of the black Surface Laptop popped up over the weekend.
Computing

Microsoft could debut transparent Surface Dial sequel at October event

Microsoft's upcoming October Surface event could show off more than just laptops. A new FCC filing suggests Microsoft may also debut a new Surface Dial device, potentially with a transparent center.
Home Theater

HDMI 2.0b is a whole lot more than just a connection to your TV

HDMI 2.0b is the backbone for many of the latest updates in 4K UHD technology. And while a new cable standard can often involve a bunch of changes for consumers, that is not the case this time around.
Deals

The best laptop deals for September 2018

Whether you're getting ready for a new school year, shopping for a special student, or just need a new computer, we've got you covered: These are the best laptop deals going, from discounted MacBooks to an on-the-go gaming PC.