How to decide bias in Hamiltonian Ising model? python

155 views Asked by At

I am trying to code finance portfolio optimisation problem into a quantum annealer, using the Hamiltonian Ising model. I am using the dwave module

neal.sampler.SimulatedAnnealingSampler.sample_ising

I was wondering how one gets to decide what the bias is? I don't really get how that works. On the documentation of Dwave it says the following:

enter image description here

There also was this example code:

import neal
>>> sampler = neal.SimulatedAnnealingSampler()
h = {'a': 0.0, 'b': 0.0, 'c': 0.0}
J = {('a', 'b'): 1.0, ('b', 'c'): 1.0, ('a', 'c'): 1.0}
sampleset = sampler.sample_ising(h, J, num_reads=10)
print(sampleset.first.energy)
1

There are 1 answers

1
Futurologist On BEST ANSWER

If you are familiar with the physics of the Ising model (e.g. just look it up on wikipedia), you will find out that the term "linear bias" h is used instead of the physics term external constant magnetic field and the term "quadratic bias" J is used instead of the physics term of interaction between a pair of (neighbouring in the case of the Ising model) spins. My guess is that the h and J coefficients must be learned from some given data. Your job is to cast (interpret) the data available to you into an Ising model configuration (state) and then use some sort of optimization with unknown h and J that minimizes the difference between the model's solutions (theoretical Ising model configuration) and the observed data.