class_docstr: Tests for the (reduced) density matrix for matrix.
class_docstr_tok: ["Tests","for","the","(","reduced",")","density","matrix","for","matrix","."]
docstr: Test jitting the density matrix from state vector with wrong shape.
docstr_tok: ["Test","jitting","the","density","matrix","from","state","vector","with","wrong","shape","."]
code: def test_wrong_shape_jax_jit(self):
      """Test jitting the density matrix from state vector with wrong shape."""
      # pylint: disable=protected-access
      from jax import jit
  
      state_vector = jnp.array([[1, 0, 0], [0, 0, 0], [0, 0, 0]])
  
      jitted_dens_matrix_func = jit(
          fn.quantum.reduce_dm, static_argnums=[1, 2]
      )
  
      with pytest.raises(
          ValueError, match="Density matrix must be of shape"
      ):
          jitted_dens_matrix_func(
              state_vector, indices=(0, 1), check_state=True
          )
  
imports: import numpy
  import pytest
  from pennylane import numpy
  from pennylane import math
label_desc: Use image node_id 9 for calling the TestDensityMatrixFromMatrix obj's underlying member method code with example usage: obj.test_wrong_shape_jax_jit() without return types