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 DWave quantum computer.
Initial Set Up#
The following steps set up your development environment for Ocean:

Installation is not needed if you are using an IDE that implements the Development Containers specification (aka “devcontainers”), whether locally on your system (e.g., VS Code) or cloudbased (e.g., GitHub Codespaces), because you can work in an updated Ocean environment through the Ocean Docker file.

Optionally authorize Ocean to access your Leap account to facilitate token management.
Configuring Access to Leap’s Solvers
Enable the running problems on DWave remote compute resources, including quantumclassical hybrid solvers and the DWave quantum processing unit (QPU).
Ocean’s Programming Model#
Learn Ocean software’s workflow for problem solving.
DWave Compute Resources#
Use Ocean’s samplers to solve problems on DWave’s compute resources (solvers) or locally on your CPU.
Because most industrial problems (large, complex, and hard) are best approached with quantumclassical hybrid solvers, a good place to start is with examples of the EndtoEnd Examples: Hybrid section. If you wish to learn how to work directly with the quantum computer, see the examples of the EndtoEnd Examples: QPU section.
EndtoEnd Examples: Hybrid#
For beginners, formulating problems as Quadratic Models can be a more intuitive introduction to solving optimization problems. Nonlinear Models may be more familiar for users with experience in nonlinear programming; for many problems, these models—if effectively formulated—are expected to enable superior performance.
Quadratic Models#
Diet Planning solves a mixedinteger linearprogramming (MILP) problem using a Leap hybrid CQM solver.
Bin Packing solves a binary constrained problem using a Leap hybrid CQM solver.
StockSales 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 outofthebox Ocean hybrid solver.
Map Coloring: Hybrid DQM Sampler solves a discrete quadratic model (DQM) using a Leap hybrid DQM solver.
Problem With Many Variables builds a hybrid workflow and solver for a large graph problem.
Nonlinear Models#
These examples solve small instances of known optimization problems using a Leap hybrid nonlinearmodel solver.
Traveling Salesperson helps you start using Leap’s hybrid nonlinearmodel solver.
Vehicle Routing demonstrates more advanced usage options for solving nonlinear models.
EndtoEnd Examples: 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 twovariable problem.
Boolean AND Gate demonstrates programming the QPU more directly (minorembedding).
Map Coloring example solves a more complex constraint satisfaction problem.
MultipleGate Circuit looks more deeply at minorembedding.
Postprocessing with a Greedy Solver improves samples returned from a QPU by postprocessing with a classical greedy algorthim.
Using the Problem Inspector improves minorembedding on a graph partition problem.
Working With Different Topologies runs your code on software samplers with different QPUinspired topologies.
Additional Examples#
DWave’s dwaveexamples GitHub repo contains many more code examples:
Demos
Typically in the form of short code examples you can open in a supported cloudbased IDE or copy (clone) locally and run. For example:
Nurse scheduling, maze, circuit fault diagnosis, and others provide examples of constraintsatisfaction problems.
Map coloring, jobshop 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 webbased 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 DWave System
This guide in the System Documentation introduces the DWave 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.
DWave ProblemSolving Handbook
This guide provides advanced guidance on using DWave solvers, in particular QPU solvers. It lists, explains, and demonstrates techniques of problem formulation, minorembedding, 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 dwavecloudclient discusses how to configure selection of and communications with solvers.
The introduction to dwavehybrid explains how to use the Python framework for running and building hybrid samplers.