sample_integers

qujax.sample_integers(random_key, statetensor, n_samps=1)

Generate random integer samples according to statetensor.

Parameters:
  • random_key (jax.random.PRNGKeyArray) – JAX random key to seed samples.

  • statetensor (ndarray) – Statetensor encoding sampling probabilities (in the form of amplitudes).

  • n_samps (int | None) – Number of samples to generate. Defaults to 1.

Returns:

Array with sampled integers, shape=(n_samps,).

Return type:

ndarray