mindquantum.algorithm.qaia.LQA

View Source On Gitee
class mindquantum.algorithm.qaia.LQA(J, h=None, x=None, n_iter=1000, batch_size=1, gamma=0.1, dt=1.0, momentum=0.99)[source]

Local quantum annealing algorithm.

Reference: Quadratic Unconstrained Binary Optimization via Quantum-Inspired Annealing.

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.

  • gamma (float) – The coupling strength. Default: 0.1.

  • momentum (float) – Momentum factor. Default: 0.99.

initialize()[source]

Initialize spin values.

update(beta1=0.9, beta2=0.999, epsilon=10e-8)[source]

Dynamical evolution with Adam.

Parameters
  • beta1 (float) – Beta1 parameter. Default: 0.9.

  • beta2 (float) – Beta2 parameter. Default: 0.999.

  • epsilon (float) – Epsilon parameter. Default: 10e-8.