dwavesystems / dwavesystems/dwave-optimization
Consider supporting slicing with symbols
Open
enhancement
- Dominant language
- C++
- Stars
- 31
- Forks
- 36
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 9
Description
Currently you can index one array symbol with another
```python
A = model.constant(np.arange(5))
idxs = model.constant([0, 1, 2])
A[idxs]
```
and you can slice array symbols
```python
A = model.constant(np.arange(5))
A[:3]
```
but you cannot include other symbols in the slice
```python
A = model.constant(np.arange(5))
stop = model.constant(3)
A[:stop] # throws an error
```
We should consider supporting this.
See also https://github.com/dwavesystems/dwave-optimization/issues/327
Contributor guide
Assessment
This issue has not been assessed yet.