Quantum Computing and the Forest SDK Robert Smith 2 February 2019 - - PowerPoint PPT Presentation

quantum computing and the forest sdk
SMART_READER_LITE
LIVE PREVIEW

Quantum Computing and the Forest SDK Robert Smith 2 February 2019 - - PowerPoint PPT Presentation

Quantum Computing and the Forest SDK Robert Smith 2 February 2019 Rigetti Computing Proprietary and Confidential a quick poll Rigetti Computing Proprietary and Confidential Rigetti Computing Proprietary and Confidential Rigetti Computing, in


slide-1
SLIDE 1

Rigetti Computing Proprietary and Confidential

Quantum Computing and the Forest SDK

Robert Smith

2 February 2019

slide-2
SLIDE 2

Rigetti Computing Proprietary and Confidential Rigetti Computing Proprietary and Confidential

a quick poll

slide-3
SLIDE 3

Rigetti Computing Proprietary and Confidential

Rigetti Computing, in a nutshell

  • Build universal, gate-based hybrid

classical/quantum computers

○ Quantum computers are not more powerful than classical ones, yet ○

… but they can do real, interesting

computations

  • Full-stack company

○ all in-house: design → manufacturing → … → applications development

  • Wide range of papers published
  • Flagship product: Quantum Cloud Services
slide-4
SLIDE 4

Rigetti Computing Proprietary and Confidential

  • Fastest quantum programming environment available to the public
  • SW HW Infra innovations give 30x speed-up over HTTP services

○ 2 hours of computation becomes 4 minutes

  • Personal Quantum Machine Image (QMI) with SSH

access, preloaded with a full suite of advanced tools:

Quantum Cloud Services

Forest SDK

○ Compiler ○ Simulator ○ Python API ○ Optional libraries

slide-5
SLIDE 5

Rigetti Computing Proprietary and Confidential

Open source @ Rigetti

  • 3 years ago, released an open standard for Quil

○ A portable quantum instruction language for hybrid computation ○ Language-independent: Python, OCaml, Lisp, JavaScript, …

  • Since then, Rigetti has released a handful of OSS

pyQuil MAGICL rpcq forest-benchmarking

  • qaml

grove ALEXA cmu-infix & more

Many contributions back to OSS projects: CAD tools, testing libs, etc.

slide-6
SLIDE 6

Rigetti Computing Proprietary and Confidential

Applications

grove forest-benchmarking your app?

Program Construction & API

pyQuil

Quantum RPC Framework

rpcq

Simulator

qvm PyQVM

Compiler

quilc

Quantum Computer Execution Stack

The Forest SDK

Applications

grove forest-benchmarking your app?

Program Construction & API

pyQuil

Quantum RPC Framework

rpcq

Simulator

qvm PyQVM

Compiler

quilc

Quantum Computer Execution Stack

slide-7
SLIDE 7

Rigetti Computing Proprietary and Confidential

The Forest SDK: today’s talk

Applications

grove forest-benchmarking your app?

Program Construction & API

pyQuil

Quantum RPC Framework

rpcq

Simulator

qvm PyQVM

Compiler

quilc

Quantum Computer Execution Stack

slide-8
SLIDE 8

Rigetti Computing Proprietary and Confidential

The Rigetti Quantum Virtual Machine: qvm

  • Extremely high-performance: Eats all available CPU cores and RAM if

you let it

  • Can execute the entire Quil language
  • Supports lots of execution modes

○ Standard & stochastic pure-state evolution (latter with Kraus operators) ○ Full density matrix evolution ○ Path integral formulation: calculate 1 amplitude with linear memory

  • Simulates perfect and imperfect quantum computers
  • Includes a compiler to translate Quil into machine code

○ Screaming fast execution, outperforms many simulators by 2x

slide-9
SLIDE 9

demo

./qvm --verbose --benchmark ./qvm --verbose --benchmark --compile

slide-10
SLIDE 10

Rigetti Computing Proprietary and Confidential

  • The only general purpose, fully automatic, optimizing quantum compiler
  • Built with portability in mind

○ Can compile to user-specified quantum architectures

  • Can compile any unitary gate

(2q, 3q, 4q, ... doesn’t matter)

  • Has lots of special knowledge to do quantum

equivalents of:

○ register allocation ○ peephole optimization ○ flow analysis and optimization ○ optimal compilation

One of the most amazing pieces of software I’ve worked on in my career.

The Rigetti optimizing Quil compiler: quilc

slide-11
SLIDE 11

demo

./quilc cat bernstein-vazirani.quil | ./quilc -Pd

slide-12
SLIDE 12

Rigetti Computing Proprietary and Confidential

Fully automatic compilation is good!

  • As if it were the 1950s, some software firms suggest we should be:

○ hand compiling quantum programs ○ have our programs always be aware of the target architecture

■ which changes every 6 months

○ writing un-portable code ○

… because otherwise it “won’t be appropriate” for NISQ machines

  • Computers are fast; what problems they can solve may surprise you
  • If people can write C for microcontrollers, then they can write portable

Quil for quantum computers quilc is a good & improving demonstration of that

slide-13
SLIDE 13

Rigetti Computing Proprietary and Confidential

demo

cat bernstein-vazirani.quil | ./quilc -Pd --verbose

slide-14
SLIDE 14

Rigetti Computing Proprietary and Confidential

What does a compiler target look like?

  • Generally a graph of qubits
  • Each qubit supports a collection of single-qubit gates

○ Could be static or parametric ○ e.g., RX(pi/2), RZ(%theta)

  • Each qubit-pair supports a collection of two-qubit gates

○ e.g., CZ, CNOT, CPHASE(%theta)

  • Each qubit-{triplet, quadruplet, …} supports

{3, 4, …}-qubit gates

○ The ion trap folks go nuts with these, e.g., Mølmer-Sørensen gate

Different qubits may be tuned for different operations!

slide-15
SLIDE 15

Rigetti Computing Proprietary and Confidential

Try hand-compiling a GHZ state on a quantum computer with this architecture!

quilc can compile for this architecture

qubit 0 qubit 3 qubit 1 qubit 2 CNOT 0 2 CZ 0 1 CZ 1 0 I S W A P 2 3 I S W A P 3 2 CPHASE(%theta) 1 2 CPHASE(%theta) 2 1

slide-16
SLIDE 16

For FOSDEM, we ported quilc...

16

  • … to Google’s Bristlecone

architecture (72 qubits)

  • … to IBM’s ibmqx5

architecture (16 qubits)

  • Any program written in Quil in

whatever gate set will compile to Rigetti’s, Google’s, and IBM’s architectures portably

○ And quilc optimizes for them

  • Can work on the full chip or any

subgraph of it

  • The only compiler that can do so?
slide-17
SLIDE 17

Rigetti Computing Proprietary and Confidential Rigetti Computing Proprietary and Confidential

cat molmer.quil | ./quilc -Pd --isa 8Q cat molmer.quil | ./quilc -Pd --isa bristlecone cat molmer.quil | ./quilc -Pd --isa ibmqx5 cat molmer.quil | ./quilc -Pd --isa bristlecone --enable-state-prep-reductions

demo

slide-18
SLIDE 18

Rigetti Computing Proprietary and Confidential

qvm & quilc are free to download

  • Free downloadable installers for Linux, macOS,

and Windowsβ

○ Comes with a EULA

  • Open-source alternative to qvm: PyQVM

○ Just released; part of pyQuil ○ FOSS license: Apache 2.0 ○ Much slower for lots of qubits, doesn’t come with all the bells and whistles

  • No real alternative to quilc

○ Follow folk advice and hand-compile?

slide-19
SLIDE 19

Rigetti Computing Proprietary and Confidential

19

Pros of Open Source

  • Open source allows us to reap

the rewards of sharing the parts that users mostly use so that the customer experience can be improved

  • Using RPC and creating good

APIs allows anybody to slot in their own open source variants

  • Languages (like Quil) and APIs

are best fostered as a part of an

  • pen source community

Pros of Closed Source

  • Closed source programmer tools

allow us to innovate, sell, make money, license, and write EULAs

  • Can’t afford to “give everything for

free” unlike the multi-billion dollar giants with tens or hundreds of thousands of employees

  • Relying on the community for the

most important tools is a haphazard bet. Otherwise Linux would be the #1 desktop OS

Split open/closed source = Good for startups

slide-20
SLIDE 20

just kidding

slide-21
SLIDE 21

Rigetti Computing Proprietary and Confidential Rigetti Computing Proprietary and Confidential

github.com/rigetti/qvm github.com/rigetti/quilc Apache 2.0 · AGPL

slide-22
SLIDE 22

Rigetti Computing Proprietary and Confidential

qvm & quilc are written in Common Lisp

  • Many innovations couldn’t have happened without it

○ Time & money budget aren’t infinite at a startup ○ Developing in Lisp is snappy

  • Nobody has figured out expressive syntax for quantum computing

○ Lisp is great—even optimized—for metasyntactic experiments

  • Debugging a compiler in Lisp with Emacs+SLIME is much nicer than in

Python or C++

○ Optimizing compilers are very difficult to debug

  • Our team primarily consists of first-time Lisp programmers

○ New employees are always productive in just a few days

slide-23
SLIDE 23

23

A book about Lisp for programmers Practical Common Lisp free ebook online

slide-24
SLIDE 24

The first 3 people to… ...will get a beer on me.

Email: robert@rigetti.com Code: github.com/rigetti/qvm Code: github.com/rigetti/quilc Slack: rigetti.com/community