class_docstr: Tests for creating a density matrix from state vectors.
class_docstr_tok: ["Tests","for","creating","a","density","matrix","from","state","vectors","."]
docstr: Test jitting the density matrix from state vector function with Tf.
docstr_tok: ["Test","jitting","the","density","matrix","from","state","vector","function","with","Tf","."]
code: def test_density_matrix_tf_jit(self):
      """Test jitting the density matrix from state vector function with Tf."""
      from functools import partial
  
      state_vector = tf.Variable([1, 0, 0, 0], dtype=tf.complex128)
  
      density_matrix = partial(fn.reduce_statevector, indices=[0])
  
      density_matrix = tf.function(
          density_matrix,
          jit_compile=True,
          input_signature=(
              tf.TensorSpec(shape=(4,), dtype=tf.complex128),
          ),
      )
      density_matrix = density_matrix(state_vector)
      assert np.allclose(density_matrix, [[1, 0], [0, 0]])
  
imports: import numpy
  import pytest
  from pennylane import numpy
  from pennylane import math
label_desc: Use image node_id 10 for calling the TestDensityMatrixFromStateVectors obj's underlying member method code with example usage: obj.test_density_matrix_tf_jit() without return types