Getting Started¶
New to Ocean? The following sections describe how to install Ocean tools, what they are and how they fit together, and give examples of using them to solve hard problems on a D-Wave quantum computer.
Initial Set Up¶
D-Wave’s Leap integrated development environment (IDE) is the fastest way to get started writing your quantum application or just learning to use Ocean tools. This cloud-based IDE—run in your browser—is available to all Leap accounts. It provides reusable/disposable workspaces (developer environments pre-configured with Ocean and other standard libraries as well as D-Wave extensions) for running code from your own GitHub repository or a collection of code examples you can then modify.
Alternatively, install the tools and configure for running problems on D-Wave remote compute resources, including quantum-classical hybrid solvers and the D-Wave quantum processing unit (QPU), or locally on your CPU.
Ocean’s Programming Model¶
Learn Ocean software’s workflow for problem solving.
D-Wave Compute Resources¶
Use Ocean’s samplers to solve problems on D-Wave’s compute resources (solvers) or locally on your CPU.
Examples¶
See how Ocean tools are used with these end-to-end examples.
Because many large, hard problems are best approached with quantum-classical hybrid solvers, a good place to start is with examples of the Beginner-Level Examples: Hybrid Computing section and then learn how to work directly on the quantum computer with examples of the Beginner-Level Examples: Using the QPU section.
Beginner-Level Examples: Hybrid Computing¶
Diet Planning solves a mixed-integer linear-programming (MILP) problem using a Leap hybrid CQM solver.
Bin Packing solves a binary constrained problem using a Leap hybrid CQM solver.
Stock-Sales Strategy in a Simplified Market solves an integer constrained problem using a Leap hybrid CQM solver.
Structural Imbalance in a Social Network solves an unconstrained problem using a Leap hybrid BQM solver.
Large Map Coloring demonstrates using an out-of-the-box Ocean hybrid solver.
Map Coloring: Hybrid DQM Sampler solves a discrete quadratic model (DQM) using a Leap hybrid DQM solver.
Beginner-Level Examples: Using the QPU¶
Vertex Cover solves a small graph problem.
Constrained Scheduling solves a small constraint satisfaction problem.
Boolean NOT Gate mathematically formulates a BQM for a two-variable problem.
Boolean AND Gate demonstrates programming the QPU more directly (minor-embedding).
Intermediate-Level Examples¶
Map Coloring example solves a more complex constraint satisfaction problem.
Multiple-Gate Circuit looks more deeply at minor-embedding.
Problem With Many Variables builds a hybrid workflow and solver for a large graph problem.
Postprocessing with a Greedy Solver improves samples returned from a QPU by post-processing with a classical greedy algorthim.
Advanced-Level Examples¶
Using the Problem Inspector improves minor-embedding on a graph partition problem.
Working With Different Topologies runs your code on software samplers with different QPU-inspired topologies.
Additional Examples¶
D-Wave’s dwave-examples GitHub repo contains many more code examples:
Demos
Typically in the form of short code examples you can open in the Leap IDE or copy (clone) locally and run. For example:
Nurse scheduling, maze, circuit fault diagnosis, and others provide examples of constraint-satisfaction problems.
Map coloring, job-shop scheduling, and others can complement similar examples presented here.
RNA folding, portfolio optimization, and others provide prototype applications in a variety of industries.
Jupyter Notebooks
These examples, in a web-based interactive environment that includes documentation and code, are helpful for both walking beginners through the theory and practice of problem solving and explaining complex features. They can also serve as a framework in which to develop your own code. For example:
Structural imbalance notebook can complement the Structural Imbalance in a Social Network example.
Hybrid computing notebooks walk you through using and developing hybrid solvers.
Pegasus notebook, reverse annealing notebook, and others explain features of the quantum computer.
Further Learning¶
Getting Started with the D-Wave System
This guide in the System Documentation introduces the D-Wave quantum computer, provides some key background information on how the system works, and explains how to construct a simple problem that the system can solve.
D-Wave Problem-Solving Handbook
This guide provides advanced guidance on using D-Wave solvers, in particular QPU solvers. It lists, explains, and demonstrates techniques of problem formulation, minor-embedding, and configuring QPU parameters to optimize performance.
Package introductions
The following Ocean packages have extended introductions:
The introduction to dimod describes Ocean’s supported models (e.g., BQMs), the format of returned solutions, Symbolic Math, and Scaling for Production.
The introduction to dwave-cloud-client discusses how to configure selection of and communications with solvers.
The introduction to dwave-hybrid explains how to use the Python framework for running and building hybrid samplers.