Composites are available in several packages in the D-Wave Ocean SDK. Composites inherit their name from the design pattern they follow, the Composite Pattern.
Using one or more composites, a sampler can be composed with a number of pre- and post-processing layers.
Note: As it stands, composites can only be used to compose samplers for Binary Quadratic Model problems.
The lecture notebook covers several composites, exploring how they can be used and why they are useful!
- StructureComposite
- EmbeddingComposite
- FixedEmbeddingComposite
- TruncateComposite
- FixVariablesComposite
- TrackingComposite
- SteepestDescentComposite
You can run this example without installation in cloud-based IDEs that support the Development Containers specification (aka "devcontainers").
For development environments that do not support devcontainers
, install
requirements:
pip install -r requirements.txt
If you are cloning the repo to your local system, working in a virtual environment is recommended.
Your development environment should be configured to access Leap’s Solvers. You can see information about supported IDEs and authorizing access to your Leap account here.
The notebook can be opened by clicking on the
Ocean-Composites.ipynb
file in VS Code-based IDEs.
To run a locally installed notebook:
jupyter notebook
Released under the Apache License 2.0. See LICENSE file.