dwave-system icon indicating copy to clipboard operation
dwave-system copied to clipboard

uniform_torque_compensation can return chain strength = 0

Open jackraymond opened this issue 4 years ago • 0 comments

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()

jackraymond avatar Jan 15 '21 17:01 jackraymond