class_docstr: Tests for the density matrix function
class_docstr_tok: ["Tests","for","the","density","matrix","function"]
docstr: Test that the density matrix is of correct size and dtype for a
  trivial circuit
docstr_tok: ["Test","that","the","density","matrix","is","of","correct","size","and","dtype","for","a","trivial","circuit"]
code: def test_density_matrix_shape_and_dtype(self, dev_name, wires):
      """Test that the density matrix is of correct size and dtype for a
      trivial circuit"""
  
      dev = qml.device(dev_name, wires=wires)
  
      @qml.qnode(dev)
      def circuit():
          return density_matrix([0])
  
      state_val = circuit()
  
      assert state_val.shape == (2, 2)
      assert state_val.dtype == np.complex128
  
imports: import numpy
  import pytest
  import pennylane
  from pennylane import numpy
  from pennylane.devices import DefaultQubitLegacy
  from pennylane.measurements import State, Shots, density_matrix, expval, state
label_desc: Use image node_id 1 for calling the TestDensityMatrix obj's underlying member method code with example usage: obj.test_density_matrix_shape_and_dtype(dev_name, wires) and returns: density_matrix