class_docstr: Tests for purity transform
docstr: Test that the QNode of reduced_dm function must return state.
docstr_tok: ["Test","that","the","QNode","of","reduced_dm","function","must","return","state","."]
code: def test_qnode_not_returning_state(self):
      """Test that the QNode of reduced_dm function must return state."""
  
      dev = qml.device("default.qubit", wires=1)
  
      @qml.qnode(dev)
      def circuit():
          qml.RZ(0, wires=[0])
          return qml.expval(qml.PauliX(wires=0))
  
      with pytest.raises(
          ValueError, match="The qfunc return type needs to be a state"
      ):
          qml.qinfo.purity(circuit, wires=[0])()
  
imports: import pytest
  import pennylane
  from pennylane import numpy
label_desc: Use image node_id 2 for calling the TestPurity obj's underlying member method code with example usage: obj.test_qnode_not_returning_state() and returns: qml