A tool for visualizing problems submitted to, and answers received from, a D-Wave structured solver such as a D-Wave 2000Q quantum computer.
This example shows the canonical usage: samples representing physical qubits on a quantum processing unit (QPU).
from dwave.system import DWaveSampler
import dwave.inspector
# Get solver
sampler = DWaveSampler(solver=dict(qpu=True))
# Define a problem (actual qubits depend on the selected QPU's working graph)
h = {}
J = {(0, 4): 1, (0, 5): 1, (1, 4): 1, (1, 5): -1}
assert all(edge in sampler.edgelist for edge in J)
# Sample
response = sampler.sample_ising(h, J, num_reads=100)
# Inspect
dwave.inspector.show(response)
If D-Wave Ocean SDK 2.0+ is installed:
dwave install inspector
Otherwise, install the package from PyPI:
pip install dwave-inspector
and then install the closed-source dependencies with:
pip install dwave-inspectorapp --extra-index=https://pypi.dwavesys.com/simple
Alternatively, clone and build from source:
git clone https://github.com/dwavesystems/dwave-inspector.git cd dwave-inspector pip install -r requirements.txt python setup.py install
When building from source, the closed-source component still needs to be installed as above.
Released under the Apache License 2.0. See LICENSE file.