class_docstr: Tests for the (reduced) density matrix for QNodes returning states.
docstr: Test that an error is raised if a device or device wires are given
  to the reduced_dm transform manually.
docstr_tok: ["Test","that","an","error","is","raised","if","a","device","or","device","wires","are","given","to","the","reduced_dm","transform","manually","."]
code: def test_reduced_dm_cannot_specify_device(self):
      """Test that an error is raised if a device or device wires are given
      to the reduced_dm transform manually."""
      dev = qml.device("default.qubit", wires=2)
  
      @qml.qnode(dev)
      def circuit(params):
          qml.RY(params, wires=0)
          qml.CNOT(wires=[0, 1])
          return qml.state()
  
      with pytest.raises(
          ValueError, match="Cannot provide a 'device' value"
      ):
          _ = qml.qinfo.reduced_dm(circuit, wires=[0], device=dev)
  
      with pytest.raises(
          ValueError, match="Cannot provide a 'device_wires' value"
      ):
          _ = qml.qinfo.reduced_dm(
              circuit, wires=[0], device_wires=dev.wires
          )
  
file_path: pennylane/tests/qinfo/test_reduced_dm.py
imports: import pytest
  import pennylane
  from pennylane import numpy
label_desc: Use image node_id 1 for calling the TestDensityMatrixQNode obj's underlying member method code with example usage: obj.test_reduced_dm_cannot_specify_device() and returns: qml