dwavesystems / dwavesystems/dwave-system
embed_bqm silently assumes that chain_strength is a positive number
- Dominant language
- Python
- Stars
- 98
- Forks
- 67
- Avg merge
- 7m
- Merged PRs (30d)
- 1
Description
https://github.com/dwavesystems/dwave-system/blob/b233941673cda08c194d769b067ab06ce43ea077/dwave/embedding/transforms.py#L274-L278
`embed_bqm` assumes a positive sign for `chain_strength`:
```python
import networkx as nx
from dwave.embedding import embed_bqm
import dimod
g = nx.Graph()
g.add_edge(100, 101)
bqm = dimod.BQM.from_ising({1: 0}, {})
emb = {1: [100, 101]}
for chain_strength in [-2, 2]:
print(
embed_bqm(bqm, embedding=emb, target_adjacency=g, chain_strength=chain_strength).quadratic
)
```
Output:
```
{(101, 100): 2.0}
{(101, 100): -2.0}
```
The parameter is described as "coupling strength". I would expect that it either
1. Applies the sign passed (your sampler could be a maximizer)
2. Assumes minimization: It accepts any number and enforces the sign by taking `abs` of the input.
The current scheme where the sign is flipped is unexpected
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.