dwavesystems / dwavesystems/dimod
`BQM.is_variable()` and `BQM.is_scalar()` or similar
Open
enhancement
- Dominant language
- Python
- Stars
- 143
- Forks
- 91
- Avg merge
- 1h 24m
- Merged PRs (30d)
- 3
Description
For requests like https://github.com/dwavesystems/dimod/issues/921, it would be nice to have some way of detecting whether a `BQM`/`QM` are scalars or single variables. Something like
```
def is_variable(self):
return self.num_variables == 1 and self.offset == 0 and self.is_linear()
def is_scalar(self):
return self.num_variables == 0
```
Contributor guide
Assessment
This issue has not been assessed yet.