Skip to content

Conversation

@arcondello
Copy link
Member

In some cases we would get errors when we shouldn't.

@arcondello arcondello requested a review from wbernoudy September 4, 2025 21:13
<class 'dwave.optimization.symbols.Permutation'>
"""
def __init__(self, Constant array, ListVariable x):
def __init__(self, Constant array, ArraySymbol x):
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the main fix, but there were a few other edge cases as well

@arcondello arcondello force-pushed the fix/Permutation-symbol-construction branch from 4a643b5 to fcd4af1 Compare September 4, 2025 21:14
@arcondello arcondello added the bug Something isn't working label Sep 4, 2025
# The total operation must of the form A[i0, i1][i2, i3]

i0, i1 = self._iter_indices()
i2, i3 = index if isinstance(index, tuple) else (index, slice(None, None, None))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assuming there are only two indices here breaks the case of A[:, x][(x,)] and makes a somewhat more confusing error for A[:, x][x, :, :].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants