qat.qpus.SimulatedAnnealing
- class qat.qpus.SimulatedAnnealing(temp_t, n_steps, seed=None)
A Simulated Annealing solver interfaced as a Quantum Processing Unit (QPU)
- Parameters
temp_t (
ArithExpression
) – temperature-time dependence. It needs to be specified using a variablet
instantiated with the classVariable
.n_steps (int) – number of annealing time steps in Temp(t) evolution.
seed (int, optional) – Randomness seed.
- qat.simulated_annealing.service.extract_j_and_h_from_obs(obs)
A function to extract the \(J\) coupling matrix, magnetic field \(h\) and Ising energy offset \(E_I\) from the Hamiltonian of an Ising problem. The Hamiltonian should be of the form
\[H = - \sum_{ij} J_{ij} s_i s_j - \sum_i h_i s_i - E_I\]with \(s_i, s_j \in \{-1,1\}\).
- Parameters
obs (
Observable
) – an observable for an Ising problem- Returns
3-element tuple containing
J (2D numpy array) - an array with the coupling between each two spins - it represents the \(J\) matrix from the Hamiltonian of the problem
h (1D numpy array) - an array with the magnetic field acting on each of the spins, coming from the Hamiltonian of the problem
offset_i (double) - the value of the Ising offset energy in the respective Hamiltonian