class_docstr: Test qubit-based devices' probability vector after application of gates.
class_docstr_tok: ["Test","qubit-based","devices","'","probability","vector","after","application","of","gates","."]
docstr: Test basis state initialization.
docstr_tok: ["Test","basis","state","initialization","."]
code: def test_basis_state(self, device, basis_state, tol, skip_if):
      """Test basis state initialization."""
      n_wires = 4
      dev = device(n_wires)
      skip_if(dev, {"returns_probs": False})
  
      @qml.qnode(dev)
      def circuit():
          qml.BasisState(basis_state, wires=range(n_wires))
          return qml.probs(wires=range(n_wires))
  
      res = circuit()
  
      expected = np.zeros([2**n_wires])
      expected[np.ravel_multi_index(basis_state, [2] * n_wires)] = 1
      assert np.allclose(res, expected, atol=tol(dev.shots))
  
imports: from cmath import exp
  from math import cos, sin, sqrt
  import pytest
  import numpy
  from scipy.linalg import block_diag
  from flaky import flaky
  import pennylane
label_desc: Use image node_id 1 for calling the TestGatesQubit obj's underlying member method code with example usage: obj.test_basis_state(device, basis_state, tol, skip_if) and returns: qml