This repo’s Python package dice-leap-poc can solve QUBOs with local classical code paths by default. D-Wave Leap is optional: it uses D-Wave’s cloud hybrid sampler (LeapHybridSampler) when you install the leap extra and provide credentials.
Official D-Wave docs: Leap authorization (Ocean) · Leap service overview
- Open Leap (D-Wave’s cloud console).
- Sign up or sign in. Plans and quotas are defined by D-Wave (including free/trial options when available).
- Ensure you have a project selected (or create one) in the Leap UI — solvers and tokens are associated with projects.
You can authenticate in either of these ways (pick one).
- Log in at cloud.dwavesys.com/leap.
- Open your project / API token (wording varies by UI version).
- Copy the API token (SAPI token) shown for that project.
If your account type does not show a copyable token in the UI, use Option B.
After installing the Leap stack in your venv (step 3), run:
dwave setup --authThis walks you through browser login and stores credentials (often under ~/.dwave/). In cloud IDEs where localhost callbacks fail, use:
dwave setup --oobFor a specific project:
dwave setup --auth --project YOUR_PROJECT_IDSee: Authorizing access to the Leap service.
From the dice-leap-poc/ directory, with your venv activated:
pip install -e ".[dev,leap]"[leap]pulls indwave-system(and transitively the Ocean pieces needed forLeapHybridSampler).- Without
[leap], choosingleap_hybridwill fail with an import/configuration error by design.
export DWAVE_API_TOKEN="your-token-here"The embabel-dice-rca QUBO bridge runs dice-leap-poc/scripts/solve_json.py as a subprocess; it inherits the environment of the shell that started the JVM. Set DWAVE_API_TOKEN before mvn spring-boot:run (or your IDE run configuration).
If you used dwave setup, credentials may live under ~/.dwave/. That directory is gitignored in this repo (see root .gitignore) — do not commit it.
dwave pingcd dice-leap-poc
pytest tests/test_leap.py -m leap -qRequires DWAVE_API_TOKEN (or valid dwave config) and pip install -e ".[dev,leap]".
cd dice-leap-poc
source .venv/bin/activate # if you use a venv
export DWAVE_API_TOKEN="..." # if not using dwave config alone
PYTHONPATH=. python scripts/solve_json.py \
--input sample_data/toy_dw_md.json \
--strategy-choice qubo \
--solver-mode leap_hybridExpect solver_mode leap_hybrid in the printed JSON line. First calls may be slower (cold start, queue).
To run cloud Leap tests in CI, add a repository secret DWAVE_API_TOKEN and use the optional workflow .github/workflows/dice-leap-poc-leap.yml. Default PR checks do not require Leap. See docs/CI_BRANCH_PROTECTION.md.
| Do | Don’t |
|---|---|
| Keep the token in env vars, password managers, or GitHub Secrets | Commit tokens or paste them into tracked files |
Rely on .gitignore for ~/.dwave/ style paths |
Share tokens in screenshots or chat logs |
| Follow your org’s quota / spend policies | Run large hybrid jobs in CI without limits |
- dice-leap-poc/README.md — install, solver modes, smoke scripts
- dwave.md — architecture (DICE + QUBO + optional Leap)
- docs/DWAVE_REAL_WORLD_METRICS.md — pilot metrics