dwavesystems / dwavesystems/dwave-system

Unhelpful error for overlapping chains

Open
#389 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**
Embedding overlapping chains with the FixedEmbeddingComposite gives a DisconnectedChainError error, although the chains make sense individually.

**To Reproduce**
```
>>> qpu_2000q = DWaveSampler(solver={'topology__type': 'chimera'})
>>> FixedEmbeddingComposite(qpu_2000q, embedding={'a': [0, 4, 5], 'b': [0, 4, 1]}).sample_ising({}, {'ab': -1})
```
gives an error:
```
DisconnectedChainError: chain for a is not connected
```

From the user's perspective, ``'a': [0, 4, 5]`` is a good chain:
```
>>> qpu_2000q.adjacency[0]
{4, 5, 6, 7, 128}
```

**Expected behavior**
Would be helpful to get an error showing something like, OverlappingChainError with the overlapping nodes:
```
>>> set([0, 4, 5]) & set([0, 4, 1])
{0, 4}
```

**Environment:**
- OS: WIN
- Python version: 3.7.0

**Additional context**
I assume the chain is disconnected in the embedding because of prior use by a previous variable, but from the user's perspective each of the chains by itself is connected.

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.