dwavesystems / dwavesystems/dwave-system

uniform_torque_compensation can return chain strength = 0

Open
#379 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
98
Forks
67
Avg merge
7m
Merged PRs (30d)
1

Description

**Description**
The uniform_torque_compensation can return a chain strength of '0' which will be confusing to some users. One might imagine workflows where this creates an issue, e.g. if a user switches naively between an efficient embedding and a clique embedding.

**To Reproduce**
import sys
import networkx as nx
from dimod import BinaryQuadraticModel
from dwave.system.samplers import DWaveSampler
from dwave.system.composites import EmbeddingComposite
solver = "Advantage_system1.1"
N = int(sys.argv[1])
graph = nx.complete_graph(N)
bqm = BinaryQuadraticModel.from_networkx_graph(graph, vartype='BINARY')
dwave_sampler = DWaveSampler(solver=solver)
num_reads = 1000
he_sampler = EmbeddingComposite(dwave_sampler)
he_response = he_sampler.sample(bqm, num_reads=num_reads,
return_embedding=True)
print(he_response.info['embedding_context']['chain_strength'])

**Expected behavior**
The solution is to calculate RMS(J) only for variables that have non-zero couplings, and if no variables have couplings to set chain strength = max(|h|)/|hrange| (exploiting full energy scale).

**Environment:**
- OS: [Ubuntu 16.04.4 LTS]
- Python version: [e.g. 3.7.0]

**Additional context**
Uniform torque compensation should really be applied per component. It is not an efficient use of the QPU to submit multiple components, so perhaps we needn't worry about this technicality, this issue is bypassed for example in using ConnectedComponentsSolver()

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.