class_docstr: Test some expectation values obtained from qubit-based devices after
  application of gates.
class_docstr_tok: ["Test","some","expectation","values","obtained","from","qubit-based","devices","after","application","of","gates","."]
docstr: Tests qubit basis state preparation on subsets of qubits
docstr_tok: ["Tests","qubit","basis","state","preparation","on","subsets","of","qubits"]
code: def test_basis_state_2_qubit_subset(
      self, device, tol, par, wires, expected_output
  ):
      """Tests qubit basis state preparation on subsets of qubits"""
      n_wires = 2
      dev = device(n_wires)
  
      @qml.qnode(dev)
      def circuit():
          qml.BasisState(np.array(par), wires=wires)
          return qml.expval(qml.PauliZ(0)), qml.expval(qml.PauliZ(1))
  
      assert np.allclose(
          circuit(), expected_output, atol=tol(dev.shots)
      )
  
file_path: pennylane/pennylane/devices/tests/test_gates_with_expval.py
imports: from math import sqrt, pi
  import pytest
  import numpy
  from flaky import flaky
  import pennylane
label_desc: Use image node_id 1 for calling the TestGatesQubitExpval obj's underlying member method code with example usage: obj.test_basis_state_2_qubit_subset(device, tol, par, wires, expected_output) and returns: qml,  qml