bqth29 / simulated-bifurcation-algorithm

Python CPU/GPU implementation of the Simulated Bifurcation (SB) algorithm to solve quadratic optimization problems (QUBO, Ising, TSP, optimal asset allocations for a portfolio, etc.).
MIT License
103 stars 25 forks source link

Ising polynomial interface device and dtype conversion #20

Closed bqth29 closed 11 months ago

bqth29 commented 11 months ago

PR Description

Inspired by PyTorch API, the IsingPolynomialInterface, and thus all the polynomials (spin, binary, integer) provided by the package have a to(device: torch.device, dtype: torch.dtype) method to convert its tensors dtype and change the computation device in place.

New features

codecov[bot] commented 11 months ago

Codecov Report

Patch coverage is 100.00% of modified lines.

Files Changed Coverage
...furcation/polynomial/ising_polynomial_interface.py 100.00%
src/tests/test_spin_polynomial.py 100.00%

:loudspeaker: Thoughts on this report? Let us know!.