Programming - Stanford University

8d ago
4 Views
0 Downloads
6.31 MB
91 Pages
Last View : 4d ago
Last Download : n/a
Upload by : Macey Ridenour
Share:
Transcription

CS269: Quantum ComputerProgrammingDan Boneh & Will Zeng Guests

http://www.smbc-comics.com/comic/the-talk-3

This course is:At the leading edge of a new technology, discipline, and industryA programming-first approachA great way to challenge yourself to think about computation in a totally new wayA way to learn “just enough” quantum physicsAn experiment!

Course detailsOnline at: http://cs269q.stanford.eduTwo lectures per week. Tuesday, Thursday 10:30-11:50, McCullough 115There will be one written problem sets, three programming projects, andone final programming project.Textbook: Quantum Computation and Quantum Information: 10thAnniversary Edition by Michael A. Nielsen and Isaac L. ChuangReadings: posted online with the syllabus for each lecture. These arecritical.

Course Topics & TimelineFinal Programming ProjectProgramming Proj. 3Programming Proj. 2Programming Proj. 1Problem Set 1IntroductionLinear AlgebraQuantumMechanicsLecture 1Low LevelProgrammingQuantum OpsInstruction SetsClassical CtrlNoise &BenchmarkingHybridAlgorithmsVQE SimulationQAOAOptimizationHardware &CompilationHybridAlgs(QML)Error Correction& Error CorrectedAlgorithmsShor’s Factoring AlgorithmGrover’s Search AlgorithmOtherTopicsMBQCBlind QCLecture 20

Quantum Computing isn’t the answer to everything.But it will almost certainly free us to solve more problems.

Today’s lecture:Q1. Why program a quantum computer?Q2. How do I program a quantum computer?

Classical computers have fundamental limitsTransistor scalingEconomic limits with 10bn fornext node fabUltimate single-atom limitsSource: mass-production-of-10-nm-cpus-to-2019

Classical computers have fundamental limitsTransistor scalingEconomic limits with 10bn fornext node fabUltimate single-atom limitsReturns toparallelizationAmdahl’s lawEnergy consumptionExascale computing project hasits own power plantPower density can melt chips

But Requirements for Compute Continue to GrowSource: https://blog.openai.com/ai-and-compute/

And there’s more we want to doSimulation DrivenDrug DesignOrganic Batteries &Solar CellsArtificial GeneralIntelligence

Why build a quantum computer?New power New opportunity Fundamental curiosityQuantum computing power* scales exponentially with qubitsN bits can exactly simulate log N qubitsThis compute unit.Commodore 64AWS M4 Instance1 Million x Commodore 64can exactly simulate:10 Qubits30 QubitsSize of today’s systems.Note these are imperfect qubits.* We will be more precise later in the lectureEntire Global Cloud1 Billion x(1 Million x Commodore 64)60 Qubits

Why build a quantum computer?New power New opportunity Fundamental curiosityFor N qubits every time step ( 100ns*) is an exponentially large 2N x 2N complex matrix multiplicationCrucial details:-limited number of multiplications (hundreds to thousands) due to noisenot arbitrary matrices (need to be easily constructed on a QC)small I/O, N-bits in and N-bits outThe “big-memory small pipe” mental model for quantum computingpoly(N) bits2N x 2 NN qubits* for superconducting qubit systemsN bits

Why build a quantum computer?New power New opportunity Fundamental curiosityMachine Learning Development of newtraining sets andalgorithms Classification andsampling of large datasetsSupply ChainOptimization Forecast andoptimize for futureinventory demand NP-hard schedulingand logistics map intoquantum applicationsRobotic Manufacturing Reducemanufacturing timeand cost Maps to a TravelingSalesman Problemaddressable byquantum constrainedoptimizationComputationalMaterials ScienceAlternative EnergyResearch Design of bettercatalysts for batteries Efficiently convertatmospheric CO2 tomethanol Quantum algorithmsfor calculatingelectronic structureWhat isn’t on here: breaking RSA with Shor’s algorithm Powered by existinghybridquantum-classicalalgorithms machinelearning

Quantum hardware development is acceleratingPlotted by number of qubits in developmentOpenQuantumMaking quantum technologies useful sooner and formore peopleImage: Strangeworks

Quantum Hardware comesin many forms

Photonic Quantum Computers Use LightImage: Xanadu

Superconducting Qubits are Supercooled RF CircuitsImage: IBM

Images: Rigetti

Ion Trap Quantum ComputersImage: IonQ

Why build a quantum computer?New power New opportunity Fundamental curiosityInvestments across academia, government, and industry are global and growingPlus approximately 400M in global VC investment

Large Companies are involved

In a growingecosystem ofstartups andincumbents

Why program a quantum computer?New power New opportunity Fundamental curiosity

Why program a quantum computer?New power New opportunity Fundamental curiosity

Why program a quantum computer?New power New opportunity Fundamental curiosityQuantum computing reorients the relationship between physics and computer science.Every “function which would naturally be regarded as computable” can becomputed by the universal Turing machine. - Turing“. nature isn't classical, dammit.” - Feynman

Why program a quantum computer?New power New opportunity Fundamental curiosityQuantum computing reorients the relationship between physics and computer science.Every “function which would naturally be regarded as computable” can becomputed by the universal Turing machine. - Turing“. nature isn't classical, dammit.” - FeynmanPhysical phenomenon apply to information and computation as well. Superposition No-cloning Teleportation

How do I program a quantum computer?Hybrid Quantum Computers Quantum Programming Hybrid Programming Hybrid Algorithms

How do I program a quantum computer?Hybrid Quantum Computers Quantum Programming Hybrid Programming Hybrid AlgorithmsQuantum computers havequantum processor(s) andclassical processorsQuantum processorOtterbach et al. arXiv:1712.05771Full quantum computing systemImages: Rigetti

How do I program a quantum computer?Hybrid Quantum Computers Quantum Programming Hybrid Programming Hybrid AlgorithmsQuantum computers havequantum processor(s) andclassical processorsClassical control racksChip goeshereQuantum processorOtterbach et al. arXiv:1712.05771Full quantum computing systemImages: Rigetti

How do I program a quantum computer?Hybrid Quantum Computers Quantum Programming Hybrid Programming Hybrid AlgorithmsPractical, valuable quantum computing is Hybrid Quantum/Classical ComputingCPUQPUbits:[0].[N]qubits:0.MSmith, Curtis, Zeng. “A Practical Quantum Instruction Set Architecture” arXiv:1608.03355

How do I program a quantum computer?Hybrid Quantum Computers Quantum Programming Hybrid Programming Hybrid AlgorithmsPractical, valuable quantum computing is Hybrid Quantum/Classical ComputingCPUQPUbits:[0].[N]qubits:0.MSmith, Curtis, Zeng. “A Practical Quantum Instruction Set Architecture” arXiv:1608.03355

How do I program a quantum computer?Hybrid Quantum Computers Quantum Programming Hybrid Programming Hybrid AlgorithmsPractical, valuable quantum computing is Hybrid Quantum/Classical n set is optimized for this.Smith, Curtis, Zeng. “A Practical Quantum Instruction Set Architecture” arXiv:1608.03355

How do I program a quantum computer?Hybrid Quantum Computers Quantum Programming Hybrid Programming Hybrid AlgorithmsQuantum programming is preparing and sampling from complicated distributionsCPUbits:[0].[N]1. Send programe.g.X0CNOT 0 13. SampleQPUqubits:qubits:0.M0.M2. PrepDistribution

How do I program a quantum computer?Hybrid Quantum Computers Quantum Programming Hybrid Programming Hybrid AlgorithmsBitsState (single unit)BitProbabilistic BitsReal vectorQubits

How do I program a quantum computer?Hybrid Quantum Computers Quantum Programming Hybrid Programming Hybrid AlgorithmsBitsState (single unit)BitProbabilistic BitsReal vectorProbability of 0Probability of 1Qubits

How do I program a quantum computer?Hybrid Quantum Computers Quantum Programming Hybrid Programming Hybrid AlgorithmsBitsState (single unit)BitProbabilistic BitsReal vectorQubits

How do I program a quantum computer?Hybrid Quantum Computers Quantum Programming Hybrid Programming Hybrid AlgorithmsBitsState (single unit)BitProbabilistic BitsReal vectorQubitsComplex vector

How do I program a quantum computer?Hybrid Quantum Computers Quantum Programming Hybrid Programming Hybrid AlgorithmsBitsState (single unit)BitProbabilistic BitsReal vectorQubitsComplex vector 2 Probability of 0 𝛽 2 Probability of 1

How do I program a quantum computer?Hybrid Quantum Computers Quantum Programming Hybrid Programming Hybrid AlgorithmsBitsState (single unit)BitProbabilistic BitsReal vectorQubitsComplex vector

How do I program a quantum computer?Hybrid Quantum Computers Quantum Programming Hybrid Programming Hybrid AlgorithmsBitsState (single unit)BitProbabilistic BitsReal vector.QubitsComplex vector

How do I program a quantum computer?Hybrid Quantum Computers Quantum Programming Hybrid Programming Hybrid AlgorithmsBitsState (single unit)BitProbabilistic BitsReal vectorQubitsComplex vector

How do I program a quantum computer?Hybrid Quantum Computers Quantum Programming Hybrid Programming Hybrid AlgorithmsBitsState (single unit)BitProbabilistic BitsReal vectorQubitsComplex vector

How do I program a quantum computer?Hybrid Quantum Computers Quantum Programming Hybrid Programming Hybrid AlgorithmsBitsProbabilistic BitsState (single unit)BitReal vectorState (multi-unit)BitstringProb. Distribution (stochastic vector)Probability of bitstring xQubitsComplex vector

How do I program a quantum computer?Hybrid Quantum Computers Quantum Programming Hybrid Programming Hybrid AlgorithmsBitsProbabilistic BitsQubitsState (single unit)BitReal vectorComplex vectorState (multi-unit)BitstringProb. Distribution (stochastic vector)Wavefunction (complex vector)

How do I program a quantum computer?Hybrid Quantum Computers Quantum Programming Hybrid Programming Hybrid AlgorithmsBitsProbabilistic BitsQubitsState (single unit)BitReal vectorComplex vectorState (multi-unit)BitstringProb. Distribution (stochastic vector)Wavefunction (complex vector) x 2 Probability of bitstring x

How do I program a quantum computer?Hybrid Quantum Computers Quantum Programming Hybrid Programming Hybrid AlgorithmsBitsProbabilistic BitsQubitsState (single unit)BitReal vectorComplex vectorState (multi-unit)BitstringProb. Distribution (stochastic vector)Wavefunction (complex vector)OperationsBoolean LogicStochastic Matrices

How do I program a quantum computer?Hybrid Quantum Computers Quantum Programming Hybrid Programming Hybrid AlgorithmsBitsProbabilistic BitsQubitsState (single unit)BitReal vectorComplex vectorState (multi-unit)BitstringProb. Distribution (stochastic vector)Wavefunction (complex vector)OperationsBoolean LogicStochastic MatricesUnitary Matrices

How do I program a quantum computer?Hybrid Quantum Computers Quantum Programming Hybrid Programming Hybrid AlgorithmsBitsProbabilistic BitsQubitsState (single unit)BitReal vectorComplex vectorState (multi-unit)BitstringProb. Distribution (stochastic vector)Wavefunction (complex vector)OperationsBoolean LogicStochastic MatricesUnitary MatricesComponent OpsBoolean GatesTensor products of matricesTensor products of matrices

How do I program a quantum computer?Hybrid Quantum Computers Quantum Programming Hybrid Programming Hybrid AlgorithmsBitsProbabilistic BitsQubitsState (single unit)BitReal vectorComplex vectorState (multi-unit)BitstringProb. Distribution (stochastic vector)Wavefunction (complex vector)OperationsBoolean LogicStochastic MatricesUnitary MatricesComponent OpsBoolean GatesTensor products of matricesTensor products of matricesSampling

How do I program a quantum computer?Hybrid Quantum Computers Quantum Programming Hybrid Programming Hybrid AlgorithmsBitsProbabilistic BitsQubitsState (single unit)BitReal vectorComplex vectorState (multi-unit)BitstringProb. Distribution (stochastic vector)Wavefunction (complex vector)OperationsBoolean LogicStochastic MatricesUnitary MatricesComponent OpsBoolean GatesTensor products of matricesTensor products of matricesSamplingBorn rule x Probability of bitstring x2

How do I program a quantum computer?Hybrid Quantum Computers Quantum Programming Hybrid Programming Hybrid AlgorithmsBitsProbabilistic BitsQubitsState (single unit)BitReal vectorComplex vectorState (multi-unit)BitstringProb. Distribution (stochastic vector)Wavefunction (complex vector)OperationsBoolean LogicStochastic MatricesUnitary MatricesComponent OpsBoolean GatesTensor products of matricesTensor products of matricesSamplingBorn ruleMeasurement

How do I program a quantum computer?Hybrid Quantum Computers Quantum Programming Hybrid Programming Hybrid AlgorithmsQuil (Quantum Instruction Language) gives each quantum operation an instruction instruction qubit targets Start in 0𝛹 [1, 0, 0, 0]00011011

How do I program a quantum computer?Hybrid Quantum Computers Quantum Programming Hybrid Programming Hybrid AlgorithmsQuil (Quantum Instruction Language) gives each quantum operation an instruction instruction qubit targets 𝛹 [1, 0, 0, 0]X 0 # “quantum NOT”00011011

How do I program a quantum computer?Hybrid Quantum Computers Quantum Programming Hybrid Programming Hybrid AlgorithmsQuil (Quantum Instruction Language) gives each quantum operation an instruction instruction qubit targets 𝛹 [1, 0, 0, 0]X 0 # “quantum NOT”Apply X instr to 0th qubit00011011𝛹 [0, 1, 0, 0]00011011

How do I program a quantum computer?Hybrid Quantum Computers Quantum Programming Hybrid Programming Hybrid AlgorithmsQuil (Quantum Instruction Language) gives each quantum operation an instruction instruction qubit targets 𝛹 [1, 0, 0, 0]X 0 # “quantum NOT”00011011𝛹 [0, 1, 0, 0]00X 0H 0 # Hadamard gate011011

How do I program a quantum computer?Hybrid Quantum Computers Quantum Programming Hybrid Programming Hybrid AlgorithmsQuil (Quantum Instruction Language) gives each quantum operation an instruction instruction qubit targets 𝛹 [1, 0, 0, 0]X 0 # “quantum NOT”00011011𝛹 [0, 1, 0, 0]00011011X 0H 0 # Hadamard gateApply H instr to 0th qubit𝛹 [1/ 2, 1/ 2, 0, 0]00011011

How do I program a quantum computer?Hybrid Quantum Computers Quantum Programming Hybrid Programming Hybrid AlgorithmsQuil (Quantum Instruction Language) gives each quantum operation an instruction instruction qubit targets 𝛹 [1, 0, 0, 0]X 0 # “quantum NOT”00011011𝛹 [0, 1, 0, 0]00011011X 0H 0 # Hadamard gate𝛹 [1/ 2, 1/ 2, 0, 0]00CNOT 0 1011011

How do I program a quantum computer?Hybrid Quantum Computers Quantum Programming Hybrid Programming Hybrid AlgorithmsQuil (Quantum Instruction Language) gives each quantum operation an instruction instruction qubit targets 𝛹 [1, 0, 0, 0]X 0 # “quantum NOT”00011011𝛹 [0, 1, 0, 0]00011011X 0H 0 # Hadamard gate𝛹 [1/ 2, 1/ 2, 0, 0]00011011CNOT 0 1Apply CNOT instr to 0 and 1 qubits𝛹 [1/ 2, 0, 0, 1/ 2]00011011

How do I program a quantum computer?Hybrid Quantum Computers Quantum Programming Hybrid Programming Hybrid AlgorithmsQuil (Quantum Instruction Language) gives each quantum operation an instruction instruction qubit targets 𝛹 [1, 0, 0, 0]X 0 # “quantum NOT”00011011𝛹 [0, 1, 0, 0]00011011X 0H 0 # Hadamard gate𝛹 [1/ 2, 1/ 2, 0, 0]00011011CNOT 0 1𝛹 [1/ 2, 0, 0, 1/ 2]00011011Qubits 0 and 1 are ENTANGLED

How do I program a quantum computer?Hybrid Quantum Computers Quantum Programming Hybrid Programming Hybrid AlgorithmsQuil (Quantum Instruction Language) gives each quantum operation an instruction instruction qubit targets X 0 # “quantum NOT”X 0H 0 # Hadamard gateCNOT 0 1𝛹 [1/ 2, 0, 0, 1/ 2]00011011

How do I program a quantum computer?Hybrid Quantum Computers Quantum Programming Hybrid Programming Hybrid AlgorithmsQuil (Quantum Instruction Language) gives each quantum operation an instruction instruction qubit targets X 0 # “quantum NOT”X 0H 0 # Hadamard gateCNOT 0 1𝛹 [1/ 2, 0, 0, 1/ 2]00# Move quantum data to classical data# MEASURE qubit register [ bit register ]MEASURE 0 [2]011011

How do I program a quantum computer?Hybrid Quantum Computers Quantum Programming Hybrid Programming Hybrid AlgorithmsQuil (Quantum Instruction Language) gives each quantum operation an instruction instruction qubit targets X 0 # “quantum NOT”X 0H 0 # Hadamard gateCNOT 0 1𝛹 [1/ 2, 0, 0, 1/ 2]00# Move quantum data to classical data# MEASURE qubit register [ bit register ]01101150-50 branchMEASURE 0 [2]𝛹 [1, 0, 0, 0]00Classical BitRegister0110𝛹 [0, 0, 0, 1]110000[0][1][2][3]00.0110110010[0][1][2][3].

How do I program a quantum computer?Hybrid Quantum Computers Quantum Programming Hybrid Programming Hybrid AlgorithmsSome more examples of MEASUREMENT25%𝛹 [1/2, 0, 0, 3/4]00011011MEASURE 1 [3]75%Quantum MemoryClassical Memory

How do I program a quantum computer?Hybrid Quantum Computers Quantum Programming Hybrid Programming Hybrid AlgorithmsSome more examples of MEASUREMENT25%𝛹 [1/2, 0, 0, 3/4]00011011MEASURE 1 [3]75%Quantum Memory𝛹 [1, 0, 0, 0]00011011Classical Memory0000[0][1][2][3].

How do I program a quantum computer?Hybrid Quantum Computers Quantum Programming Hybrid Programming Hybrid AlgorithmsSome more examples of MEASUREMENT25%𝛹 [1/2, 0, 0, 3/4]00011011MEASURE 1 [3]75%Quantum Memory𝛹 [1, 0, 0, 0]00011011𝛹 [0, 0, 0, 1]00011011Classical Memory0000[0][1][2][3]0001[0][1][2][3].

How do I program a quantum computer?Hybrid Quantum Computers Quantum Programming Hybrid Programming Hybrid AlgorithmsSome more examples of MEASUREMENT25%MEASURE 1 [3]𝛹 [1/2, 0, 0, 3/4]0001101175%100%𝛹 [1/ 2, 1/ 2, 0, 0]00011011MEASURE 1 [3]Quantum Memory𝛹 [1, 0, 0, 0]00011011𝛹 [0, 0, 0, 1]00011011Classical Memory0000[0][1][2][3]0001[0][1][2][3].

How do I program a quantum computer?Hybrid Quantum Computers Quantum Programming Hybrid Programming Hybrid AlgorithmsSome more examples of MEASUREMENT25%MEASURE 1 [3]𝛹 [1/2, 0, 0, 3/4]0001101175%100%𝛹 [1/ 2, 1/ 2, 0, 0]00011011Classical MemoryQuantum Memory𝛹 [1, 0, 0, 0]00011011𝛹 [0, 0, 0, 1][2][3].MEASURE 1 [3]𝛹 [1/ 2, 1/ 2, 0, 0]00011011.

How do I program a quantum computer?Hybrid Quantum Computers Quantum Programming Hybrid Programming Hybrid AlgorithmsQuantum programming is preparing and sampling from complicated distributionsCPUbits:[0].[N]1. Send programe.g.X0CNOT 0 13. SampleQPUqubits:qubits:0.M0.M2. PrepDistribution

The Quil Programming ModelTargets a Quantum Abstract Machine (QAM) with a syntax for representing state transitionsΨ: Quantum state (qubits) quantum instructionsC: Classical state (bits) classical and measurement instructionsκ: Execution state (program) control instructions (e.g., jumps)# Quil ExampleH 3MEASURE 3 [4]JUMP-WHEN @END [5].

The Quil Programming ModelTargets a Quantum Abstract Machine (QAM) with a syntax for representing state transitionsΨ: Quantum state (qubits) quantum instructionsC: Classical state (bits) classical and measurement instructionsκ: Execution state (program) control instructions (e.g., jumps)0. Initialize into zero statesQAM: Ψ0, C0, κ01. Hadamard onqubit 3Ψ1, C0, κ1# Quil ExampleH 3MEASURE 3 [4]JUMP-WHEN @END [5].

The Quil Programming ModelTargets a Quantum Abstract Machine (QAM) with a syntax for representing state transitionsΨ: Quantum state (qubits) quantum instructionsC: Classical state (bits) classical and measurement instructionsκ: Execution state (program) control instructions (e.g., jumps)0. Initialize into zero statesQAM: Ψ0, C0, κ01. Hadamard onqubit 3Outcome 0Ψ2, C0, κ2Ψ1, C0, κ1Outcome 12. Measure qubit 3into bit #4Ψ3, C1, κ2# Quil ExampleH 3MEASURE 3 [4]JUMP-WHEN @END [5].

The Quil Programming ModelTargets a Quantum Abstract Machine (QAM) with a syntax for representing state transitionsΨ: Quantum state (qubits) quantum instructionsC: Classical state (bits) classical and measurement instructionsκ: Execution state (program) control instructions (e.g., jumps)0. Initialize into zero statesQAM: Ψ0, C0, κ01. Hadamard onqubit 3Outcome 0# Quil ExampleH 3MEASURE 3 [4]JUMP-WHEN @END [5].3. Jump to end of programif bit #5 is TRUEΨ2, C0, κ2Ψ1, C0, κ1Ψ2, C0, κ3Outcome 12. Measure qubit 3into bit #4.Ψ3, C1, κ2.

Pennylane

Main tools in thiscourse. All OSSApache v2Pennylane

PyQuilControlComputerPulseprogramQPU00 1 0 1 0 1 1 0 0 0 1.Readout1QubitoperationsImage: Rigetti

How do I program a quantum computer?Hybrid Quantum Computers Quantum Programming Hybrid Programming Hybrid AlgorithmsWe need hybrid programming because of errorsChance of hardware error in a classical computer:0.000,000,000,000,000,000,000,1 %Chance of hardware error in a quantum computer:0.1%

How do I program a quantum computer?Hybrid Quantum Computers Quantum Programming Hybrid Programming Hybrid AlgorithmsQuantum programming is preparing and sampling from complicated distributionsCPUbits:[0].[N]1. Send programe.g.X0CNOT 0 13. SampleQPUqubits:qubits:0.M0.M2. PrepDistribution

How do I program a quantum computer?Hybrid Quantum Computers Quantum Programming Hybrid Programming Hybrid AlgorithmsBy parameterizing quantum programs we can train them to be robust to noise4. Optimizechoice of 𝛳against someobjective1. Send programe.g.RX(𝛳) 2CPUQPUbits:[0].[N]qubits:qubits:0.M0.M3. Sample2. PrepDistribution

Quantum Machine Learning Quantum neuron: an elementary building block for machine learning onquantum computers. (Cao et al. 2017) Quantum circuit learning. (Mitarai et al. 2018) Quantum machine learning in feature Hilbert spaces.(Schuld and Killoran 2018)A generative modeling approach for benchmarking andtraining shallow quantum circuits. (Benedetti et al. 2018)

The Variational Quantum EigensolverUsed for the electronic structure problem in quantum chemistry1. MOLECULAR DESCRIPTIONe.g. Electronic Structure Hamiltonian2. MAP TO QUBIT REPRESENTATION3. PARAMETERIZED ANSATZe.g. Bravyi-Kitaev or Jordan-WignerTransforme.g. Unitary Coupled ClusterVariational Adiabatic Ansatze.g. DI-HYDROGEN4. RUN Q.V.E. QUANTUM-CLASSICAL HYBRID ALGORITHMQUANTUM PROCESSORMEASURE TERM 1MEASURE TERM 2 PREPAREQUANTUMSTATE (𝞗)CLASSICAL PROCESSORMEASURE TERM NO'Malley, P. J. J., et al. (2015). Scalable Quantum Simulation of Molecular Energies. arXiv:1512.06860.Wecker, D., et al. (2015). Progress towards practical quantum variational algorithms. Physical Review A, 92(4), 042303.SUMTERMSCLASSICALOPTIMIZATION OFANSATZPARAMETER:𝞗McClean, J. R. et al. (2015). The theory of variational hybrid quantum-classical algorithms. arXiv:1509.04279.Peruzzo, A., et al. (2014). A variational eigenvalue solver on a photonic quantum processor. Nature communications, 5.

VQE Simulations on Quantum HardwarePeruzzo et al. 1304.3061Kandala et al.1704.05018O’Malley et al. 1512.06860

Quantum Approximate Optimization Algorithm[QAOA] Hybrid algorithm used for constraint satisfaction problemsGiven binary constraints:Traveling SalespersonSchedulingHadfield et al. 2017 [1709.03489]MAXIMIZEK-means clusteringOtterbach et al. 2017 [1712.05771]Boltzmann Machine TrainingVerdon et al. 2017 [1712.05304]

QAOA in ForestIn 19 lines of codefromfromfromfrompyquil import Programpyquil.api import WavefunctionSimulatorpyquil.gates import Hpyquil.paulis import sZ, sX, sI, exponentiate commuting pauli sumgraph [(0, 1), (1, 2), (2, 3), (3, 0)]nodes range(4)init state prog sum([H(i) for i in nodes], Program())h cost -0.5 * sum(sI(nodes[0]) - sZ(i) * sZ(j) for i, j in graph)h driver -1. * sum(sX(i) for i in nodes)def qaoa ansatz(betas, gammas):return sum([exponentiate commuting pauli sum(h cost)(g) \exponentiate commuting pauli sum(h driver)(b) \for g, b in zip(gammas, betas)], Program())def qaoa cost(params):half int(len(params)/2)betas, gammas params[:half], params[half:]program init state prog qaoa ansatz(betas, gammas)return WavefunctionSimulator().expectation(prep prog program, pauli terms h cost)minimize(qaoa cost, x0 [0., 0.5, 0.75, 1.], method 'Nelder-Mead', options {'disp': True})

Open areas in quantum programming DebuggersForest Optimizing compilers Application specific packagesforestopenfermion Adoption and implementationsOpenFermionXaCC

Q1. Why program a quantum computer?New power New opportunity Fundamental curiosityQ2. How do I program a quantum computer?Hybrid quantum programming (usually) in Python!

Course Topics & TimelineFinal Programming ProjectProgramming Proj. 3Programming Proj. 2Programming Proj. 1Problem Set 1IntroductionLinear AlgebraQuantumMechanicsLecture 1Low LevelProgrammingQuantum OpsInstruction SetsClassical CtrlNoise &BenchmarkingHybridAlgorithmsVQE SimulationQAOAOptimizationHardware &CompilationHybridAlgs(QML)Error Correction& Error CorrectedAlgorithmsShor’s Factoring AlgorithmGrover’s Search AlgorithmOtherTopicsMBQCBlind QCLecture 20

Actions for between now and the nextlecture:1. Read the syllabus.2. Read Mike & Ike Chapters 1 & 2. Especially review Sections 2.2, 2.3 & 2.6.3. Review Linear Algebra. You will need:Vectors and linear mapsBases and linear independencePauli MatricesInner ProductsEigenvalues & EigenvectorsAdjointsHermitian OperatorsUnitary MatricesTensor ProductsMatrix ExponentialsTracesCommutators and Anti-commutators4. Download and install pyQuil: https://pyquil.readthedocs.io

Classical computers have fundamental limits Transistor scaling Economic limits with 10bn for next node fab Ultimate single-atom limits Returns to parallelization Energy consumption Amdahl’s law Exascale computing proj