dwavesystems / dwavesystems/dimod
BQM.is_index_labelled or similar
Open
enhancement
- Dominant language
- Python
- Stars
- 143
- Forks
- 91
- Avg merge
- 1h 24m
- Merged PRs (30d)
- 3
Description
It comes up a lot, it would be good to have an attribute describing whether a BQM is index labelled or not.
*Additional Context*
There is a related concept, `BQM.is_naturally_labelled` that we may also want to expose.
*Workaround*
For now
```
is_index_labelled = all(v in bqm.variables for v in range(len(bqm))
is_natrually_and_index = all(vi == v for vi, v in zip(range(len(bqm)), bqm.variables))
```
Contributor guide
Assessment
This issue has not been assessed yet.