class_docstr: Test that the sample_state function works as expected
class_docstr_tok: ["Test","that","the","sample_state","function","works","as","expected"]
docstr: Tests that a custom RNG can be used with sample_state.
docstr_tok: ["Tests","that","a","custom","RNG","can","be","used","with","sample_state","."]
code: def test_sample_state_custom_rng(self):
      """Tests that a custom RNG can be used with sample_state."""
      custom_rng = np.random.default_rng(12345)
      samples = sample_state(two_qubit_state, 4, rng=custom_rng)
      expected = [[0, 1], [0, 1], [1, 0], [1, 0]]
      assert qml.math.allequal(samples, expected)
  
imports: from random import shuffle
  import pytest
  import numpy
  import pennylane
  from pennylane.devices.qubit import simulate
  from pennylane.devices.qubit.simulate import _FlexShots
  from pennylane.devices.qubit import sample_state, measure_with_samples
  from pennylane.devices.qubit.sampling import _sample_state_jax
  from pennylane.measurements import Shots
label_desc: Use image node_id 6 for calling the TestSampleState obj's underlying member method code with example usage: obj.test_sample_state_custom_rng() without return types