I used this code to perform an opt task and I read on the docs that the An Ising problem, given a null-diagonal square symmetrical matrix.
sb.set_env(time_step=.1, pressure_slope=.01, heat_coefficient=.06)
best_vector, best_value = sb.maximize(matrix, agents=100, device='cuda',
max_steps=10000, sampling_period=30, ballistic= True,
convergence_threshold=50, use_window=True, heated=True, `best_only=True)`
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
[<ipython-input-65-6fffbfba281a>](https://localhost:8080/#) in <cell line: 2>()
1 sb.set_env(time_step=.1, pressure_slope=.01, heat_coefficient=.06)
----> 2 best_vector, best_value = sb.maximize(matrix, agents=100, device='cuda',
3 max_steps=10000, sampling_period=30, ballistic= True,
4 convergence_threshold=50, use_window=True, heated=True, best_only=True)
5
6 frames
[/usr/local/lib/python3.10/dist-packages/simulated_bifurcation/simulated_bifurcation.py](https://localhost:8080/#) in maximize(matrix, vector, constant, domain, dtype, device, agents, max_steps, best_only, ballistic, heated, verbose, use_window, sampling_period, convergence_threshold, timeout, input_type)
864 domain = input_type
865
--> 866 return optimize(
867 matrix,
868 vector,
[/usr/local/lib/python3.10/dist-packages/simulated_bifurcation/simulated_bifurcation.py](https://localhost:8080/#) in optimize(matrix, vector, constant, domain, dtype, device, agents, max_steps, best_only, ballistic, heated, minimize, verbose, use_window, sampling_period, convergence_threshold, timeout, input_type)
315 domain = input_type
316
--> 317 model = build_model(
318 matrix=matrix,
319 vector=vector,
[/usr/local/lib/python3.10/dist-packages/simulated_bifurcation/simulated_bifurcation.py](https://localhost:8080/#) in build_model(matrix, vector, constant, domain, dtype, device, input_type)
1043
1044 if domain == "spin":
-> 1045 return SpinQuadraticPolynomial(
1046 matrix=matrix,
1047 vector=vector,
[/usr/local/lib/python3.10/dist-packages/simulated_bifurcation/polynomial/spin_polynomial.py](https://localhost:8080/#) in __init__(self, matrix, vector, constant, dtype, device, silence_deprecation_warning)
155 )
156
--> 157 super().__init__(
158 matrix,
159 vector,
[/usr/local/lib/python3.10/dist-packages/simulated_bifurcation/polynomial/base_multivariate_polynomial.py](https://localhost:8080/#) in __init__(self, matrix, vector, constant, accepted_values, dtype, device, silence_deprecation_warning)
81 )
82 self.__check_device(device)
---> 83 self.__init_matrix(matrix, dtype, device)
84 self.__init_vector(vector, dtype, device)
85 self.__init_constant(constant, dtype, device)
[/usr/local/lib/python3.10/dist-packages/simulated_bifurcation/polynomial/base_multivariate_polynomial.py](https://localhost:8080/#) in __init_matrix(self, matrix, dtype, device)
189 ) -> None:
190 tensor_matrix = self._cast_matrix_to_tensor(matrix, dtype, device)
--> 191 self.__check_square_matrix(tensor_matrix)
192 self.__matrix = tensor_matrix
193 self.__dimension = tensor_matrix.shape[0]
[/usr/local/lib/python3.10/dist-packages/simulated_bifurcation/polynomial/base_multivariate_polynomial.py](https://localhost:8080/#) in __check_square_matrix(matrix)
252 raise ValueError(f"Matrix requires two dimension, got {matrix.ndim}.")
253 if matrix.shape[0] != matrix.shape[1]:
--> 254 raise ValueError("Matrix must be square.")
255
256 def __check_vector_shape(self, vector: torch.Tensor) -> None:
ValueError: Matrix must be square.