shinmorino / sqaod

Solvers/annealers for simulated quantum annealing on CPU and CUDA(NVIDIA GPU).
https://github.com/shinmorino/sqaod/wiki
Other
83 stars 21 forks source link

Add __index__ to preference classes #70

Open yannick-couzinie opened 1 year ago

yannick-couzinie commented 1 year ago

I cannot pinpoint when exactly this broke, but at least in Python 3.11.2 if you try to run the tests (or examples in sqaodpy/examples) you either get segmentation faults or errors complaining that maximize/minimize cannot be interpreted as integers.

Defining __index__ = __int__ in the maximize/minimize classes solves this problem.