Software Tool Chains for Quantum Computing Alan Geller



















- Slides: 19
Software Tool Chains for Quantum Computing Alan Geller Software Architect Qu. Ar. C, Microsoft Research Microsoft Proprietary
Quantum Computing at Microsoft Research • Microsoft Proprietary
Overview Microsoft Proprietary
Why is this important now? • The first classical computers were invented in the 1940 s • Software for classical computers didn’t proliferate until modern IDEs were developed ~30 years later • We shouldn’t have to wait 30 years after we have a quantum computer to be able to easily write quantum software! Microsoft Proprietary
Activity View Code Debug Compile Execute & Validate Microsoft Proprietary
Component View Code Debugger Debug Runtime & Simulator Microsoft Proprietary IDE Compile Execute & Validate Compiler
Coding • Programming languages – Different languages lend themselves to different programmers and to different types of problems – We use F# because it’s the most productive for us • Code readability is very important – Code is a communication mechanism for humans, not just input to a compiler Microsoft Proprietary let QFT (qs: Qubits) = let n = qs. Length for a. Idx in n-1. . 0 do let a = qs. [a. Idx] H a for k in 2. . a. Idx+1 do let c = qs. [a. Idx-(k-1)] CR k c a
Compiling • The compiler front end maps the quantum algorithm to “quantum intermediate language” (QIL) • The back end rewrites the QIL for execution on actual hardware – Different quantum computers will require different rewrites of the original QIL • We have designed and built a layered architecture to support flexible rewriting Microsoft Proprietary Push symbol n = Property: qs. Length Push symbol input. Sequence = Call function Operators. op_Range. Step Args: Call function Operators. op_Subtraction Args: Var: n Int: 1 Int: -1 Int: 0 For each a. Idx In: input. Sequence Do: Push symbol a = Property: qs. Item[a. Idx] Invoke operation H with args: Var: a For k From: 2 To: Call function Operators. op_Addition Args: Var: a. Idx Int: 1 By: 1 Do: Push symbol c = Property: qs. Item[(expr)] Invoke operation CR with args: …
Executing and Validation • Execution takes place at many levels • Simulation is a special form of execution • Validation is determining whether or not the result of a computation is correct – For some problems, validation is straightforward (3 -SAT and other NP decision problems) 300 Kelvin - Room CMOS CPU 77 K-Nitrogen Superconducting CPU Memory 4 K-Helium Quantum – For others, this is more difficult (chemistry simulation) Control Microsoft Proprietary Memory Qubits
Debugging • Because debugging involves looking at the intermediate state, it is difficult to debug on real hardware • Often the best solution is to debug using simulation – We have a debugging interface for our system using LIQUi|�as the simulation engine • The alternative is to guess a fix and retest until you think the answer is right Microsoft Proprietary
Architecture Microsoft Proprietary
Basic Picture Language F# C# … Front End Parser/Lexer QIL Compiler Back End Gate Rewriting Optimization Error Correction Layout Execution Engine Simulation Resource Manager Hardware Interface Debugger Simulation Microsoft Proprietary IDE
LIQ���� |� http: //github. com/msr-quarc/Liquid Language F# C# … Front End Parser/Lexer QIL Compiler Back End Gate Rewriting Optimization Error Correction Layout Execution Engine Simulation Resource Manager Hardware Interface Debugger Simulation Microsoft Proprietary IDE
So. L�� |�and QCo. De. S Language F# C# … Front End Parser/Lexer QIL Compiler Back End Gate Rewriting Optimization Error Correction Layout Execution Engine Simulation Resource Manager Hardware Interface Debugger Simulation Microsoft Proprietary IDE QCo. De. S
Rewriting in So. L�� |� • A machine model presents a logical view of a quantum computer • Machine models are layered – Physical machines provide a direct mechanism for executing their supported gates – Virtual machines map logical qubits and gates into qubits and actions on the machine “below” • Machine models can be stacked arbitrarily Microsoft Proprietary Rotation Rewriter Magic State Rewriter • Rewrites arbitrary rotations to Clifford + T sequences • Rewrites T gates using magic states • Manages distillation and magic state qubits • Rewrites Clifford gates and state preparation as pulses • Rewrites measurements as oscillation readouts Transmon • Remaps logical to physical qubits to adapt to chip topology Rewriter QCo. De. S Interface • Rewrites pulses and readouts into QCo. De. S experiment steps
Rewriting in So. L�� |�(2) • Error correction codes are virtual machine models • Simulation is a physical machine model • Machine model stack can be as deep or as shallow as necessary 2 D Toric Code Rewriter LIQ���� |�Simulation Engine Microsoft Proprietary • Rewrites logical Pauli gates into chain operations • Rewrites logical measurement into chain measurements • Performs scheduled syndrome measurements and decoding • Rewrites gates into stabilizer circuits (CHP) • Rewrites measurements into amplitude computation and random choice
Rewriting in So. L�� |�(3) • We can write machine models for hardware that doesn’t exist yet • We can experiment with new codes and new techniques • Machine models can be written by anyone • Implements logical qubits using the 2 D color code • Implements T gates transversely by switching to a 2 D-3 D Color 3 D color code Code Magic State Rewriter Ising Majorana Braider Microsoft Proprietary • Rewrites T gates using magic states • Manages distillation and magic state qubits • Rewrites Clifford gates and state preparation as braids • Rewrites measurements as interferometric
Status • Microsoft Proprietary
Thank You Alan Geller Software Architect Qu. Ar. C, Microsoft Research © 2015 Microsoft Corporation. All rights reserved. Microsoft, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U. S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. Microsoft Proprietary