D-Wave Ocean, also called the Ocean SDK, is an open-source collection of Python packages for formulating optimization problems and solving them on D-Wave quantum annealers, hybrid solvers and classical samplers. In quantum software, it plays the role that Qiskit or Cirq play for gate-based machines, but it is built around a different computational model: quantum annealing rather than quantum circuits.
Ocean lets a developer express a problem as a binary quadratic model, map it onto the physical qubit graph of a quantum processing unit, submit it through the Leap cloud service and analyze the returned samples. The same code can run on a local classical sampler for testing, which makes Ocean a practical entry point to annealing-based quantum computing.
How D-Wave Ocean structures a problem
Ocean works by converting an optimization task into an energy function whose lowest-energy states encode the best solutions. The annealer then searches for low-energy configurations of its qubits, and Ocean translates those configurations back into answers in the original problem variables.
The central abstraction is the sampler: any object that accepts a model and returns a set of samples with their energies. Because quantum, hybrid and classical samplers share one common interface, code written against one sampler usually runs on another with a single changed line.
Ocean supports several model types, each suited to a different class of problem. The table summarizes the main ones.
| Model | Variables | Constraints | Typical use |
|---|---|---|---|
| Binary quadratic model (BQM) | Binary or spin | Encoded as penalty terms | Direct QPU problems, max-cut, small scheduling |
| Ising model | Spin values of -1 or +1 | Encoded as penalty terms | Physics-style formulations |
| QUBO | Binary values of 0 or 1 | Encoded as penalty terms | Combinatorial optimization textbooks |
| Constrained quadratic model (CQM) | Binary, integer or real | Explicit equality and inequality | Logistics, allocation, packing |
| Nonlinear model | Lists, sets and integers | Explicit, structured | Routing and sequencing problems |
Main packages in the Ocean SDK
The Ocean SDK is a bundle of focused packages, installed together with a single pip command and usable independently. Knowing which package does what shortens the learning curve considerably.
| Package | Role |
|---|---|
| dimod | Defines models and the shared sampler interface |
| dwave-system | Connects to QPUs and hybrid solvers through samplers and composites |
| minorminer | Finds minor embeddings of problem graphs onto the qubit graph |
| dwave-cloud-client | Handles authentication, solver selection and job submission |
| dwave-samplers | Provides classical samplers such as simulated annealing and tabu search |
| dwave-networkx | Generates QPU topologies and graph algorithms |
| dwave-inspector | Visualizes embeddings, chains and returned samples |
Composites wrap samplers to add behavior. The most common, EmbeddingComposite, automatically embeds a logical problem onto the hardware graph, while fixed-embedding variants reuse a known mapping to save time and reduce variability between runs.
Access to quantum hardware goes through the Leap cloud service, which requires an API token stored in a local configuration file. Key sampling parameters include num_reads, the number of anneals per job, and annealing_time, which defaults to about 20 microseconds and can be adjusted within limits set by each solver.
Embedding problems onto the qubit graph
Minor embedding is the step that maps logical variables onto physical qubits when the problem graph does not match the hardware connectivity. A logical variable with many interactions becomes a chain of physical qubits that are strongly coupled so that they act as one.
The Advantage processors use the Pegasus topology, in which each qubit couples to up to 15 others, and the Advantage2 generation uses the Zephyr topology with up to 20 couplers per qubit. Higher connectivity means shorter chains, which improves solution quality and lets larger problems fit.
The chain strength parameter sets how firmly chained qubits are tied together. Too weak a value produces broken chains whose qubits disagree; too strong a value compresses the useful energy range of the problem. Ocean provides heuristics for a default value, but tuning remains a routine part of work with the QPU.
How Ocean compares with gate-based SDKs
Ocean differs from gate-model SDKs in its programming abstraction: the developer describes an objective function, not a sequence of gates. The table contrasts it with typical gate-based frameworks such as Qiskit and Cirq.
| Aspect | D-Wave Ocean | Gate-based SDKs |
|---|---|---|
| Computational model | Quantum annealing | Quantum circuits |
| Program input | Objective function and constraints | Gates, measurements and classical control |
| Compilation step | Minor embedding onto the qubit graph | Transpilation, routing and gate decomposition |
| Output | Samples ranked by energy | Bitstring counts from shots |
| Primary workload | Combinatorial optimization and sampling | General quantum algorithms |
Because annealers are not universal gate-based computers, Ocean cannot run algorithms such as Shor or quantum phase estimation. Its strength lies in optimization and sampling, where it competes with classical heuristics rather than with fault-tolerant algorithms.
Practical limits and common mistakes
Most problems with Ocean projects come from formulation and parameter choices, not from the SDK itself. The direct QPU handles problems of a few hundred densely connected variables, so larger real-world tasks usually go to Leap hybrid solvers, which split work between classical heuristics and the annealer.
- Penalty weights set poorly: constraints encoded as penalties either dominate the objective or fail to enforce feasibility.
- Ignoring chain breaks: results with many broken chains should trigger a review of chain strength or embedding.
- Too few reads: a single anneal is a sample, not an answer; hundreds or thousands of reads are typical.
- Skipping classical baselines: simulated annealing or a commercial solver should be compared before claiming an advantage.
- Precision limits: coefficient ranges are finite, so very different weights lose resolution on the hardware.
Explained without jargon
D-Wave Ocean is a toolbox that lets programmers talk to a special kind of quantum computer called an annealer. Instead of writing step-by-step instructions, the programmer describes what a good answer looks like, for example the shortest delivery route or the fairest shift plan.
Ocean then turns that description into a landscape of hills and valleys. The quantum machine settles into the lowest valleys it can find, and Ocean translates those spots back into usable answers, such as a route or a schedule.
A typical use case
A regional manufacturer wants to schedule 40 jobs across 6 machines while respecting maintenance windows and minimizing idle time. A developer models the task as a constrained quadratic model in Ocean, with binary variables for job-to-slot assignments and explicit constraints for machine capacity.
The developer first tests the model with a local simulated annealing sampler on a reduced instance, then submits the full model to a Leap hybrid CQM solver with a 30-second time limit. The returned schedules are checked for feasibility and compared with the plant’s existing rule-based planner. The team adopts the approach only after it consistently matches or beats the baseline across several weeks of historical data.