SKModel#

class SKModel(num_sites, rng_or_seed=None)[ソース]#

ベースクラス: OptimizationApplication

Optimization application of the 「Sherrington Kirkpatrick (SK) model」 [1].

The SK Hamiltonian over n spins is given as: \(H(x)=-1/\sqrt{n} \sum_{i<j} w_{i,j}x_ix_j\), where \(x_i\in\{\pm 1\}\) is the configuration of spins and \(w_{i,j}\in\{\pm 1\}\) is a disorder chosen independently and uniformly at random. Notice that there are other variants of disorders e.g., with \(w_{i,j}\) chosen from the normal distribution with mean 0 and variance 1.

参照

[1]: Dmitry Panchenko. 「The Sherrington-Kirkpatrick model: an overview」, https://arxiv.org/abs/1211.1094

パラメータ:
  • num_sites (int) – number of sites

  • rng_or_seed (Generator | int | None) – NumPy pseudo-random number generator or seed for np.random.default_rng(<seed>) or None. None results in usage of np.random.default_rng().

Attributes

graph#

Getter of the graph representation. :returns: A graph for a problem.

num_sites#

Getter of the number of sites. :returns: Number of sites.

Methods

disorder()[ソース]#

Generate a new disorder of the SK model.

interpret(result)[ソース]#

Interpret a result as configuration of spins.

パラメータ:

result (OptimizationResult | ndarray) – The calculated result of the problem.

戻り値:

configuration of spins

戻り値の型:

List[int]

static sample_most_likely(state_vector)#

Compute the most likely binary string from state vector.

パラメータ:

state_vector (QuasiDistribution | Statevector | ndarray | Dict) – state vector or counts or quasi-probabilities.

戻り値:

binary string as numpy.ndarray of ints.

例外:

ValueError – if state_vector is not QuasiDistribution, Statevector, np.ndarray, or dict.

戻り値の型:

ndarray

to_quadratic_program()[ソース]#

Convert an SK model problem instance into a QuadraticProgram.

戻り値:

The QuadraticProgram created from the SK problem instance.

戻り値の型:

QuadraticProgram