mindquantum.algorithm.qaia.DSB
- class mindquantum.algorithm.qaia.DSB(J, h=None, x=None, n_iter=1000, batch_size=1, dt=1, xi=None, device='cpu', precision='float32')[source]
Discrete SB algorithm.
Reference: High-performance combinatorial optimization based on classical mechanics.
- Parameters
J (Union[numpy.array, csr_matrix]) – The coupling matrix with shape \((N x N)\).
h (numpy.array) – The external field with shape \((N, )\).
x (numpy.array) – The initialized spin value with shape \((N x batch_size)\). Default:
None
.n_iter (int) – The number of iterations. Default:
1000
.batch_size (int) – The number of sampling. Default:
1
.dt (float) – The step size. Default:
1
.xi (float) – positive constant with the dimension of frequency. Default:
None
.device (str) – The device to use for computation ('cpu' or 'gpu'). Default:
'cpu'
.precision (str) – Precision type when using GPU ('float32', 'float16', 'int8'). Default:
'float32'
.