sk_generator

Contents

sk_generator#

iqm.applications.sk.sk_generator(n, n_instances, distribution='gaussian', seed=1337)[source]#

The generator function for generating random SK model problem instances.

The generator yields SherringtonKirkpatrick model problem instances using random interaction_matrix, created according to the input parameters.

  • ‘gaussian’ -> Gaussian distribution with mean 0 and standard deviation 1.

  • ‘rademacher’ -> Value +1 with probability 0.5 and value -1 with probability 0.5.

  • ‘uniform’ -> Uniform distribution between 0 and 1.

Parameters:
  • n (int) – The number of qubits in the problem instance, also the intraction_matrix dimensions.

  • n_instances (int) – The number of SK model instances to generate.

  • distribution (str) – A string describing the distribution of the elements in the interaction_matrix. Possible distributions include ‘gaussian’ (also known as ‘normal’), ‘rademacher’ and ‘uniform’.

  • seed (int) – Optional random seed for generating the problem instances.

Returns:

An iterator of SherringtonKirkpatrick objects, corresponding to randomly-generated instances of the model.

Return type:

Iterator[SherringtonKirkpatrick]