dwavesystems / dwavesystems/dwave-optimization

Consider supporting slicing with symbols

Open
#328 2 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.