class_docstr: Test that broadcasting works as expected for the reduced_dm functions
class_docstr_tok: ["Test","that","broadcasting","works","as","expected","for","the","reduced_dm","functions"]
docstr: Test that broadcasting works for state vectors and full wires
docstr_tok: ["Test","that","broadcasting","works","for","state","vectors","and","full","wires"]
code: def test_reduced_dm_with_state_vector_full_wires(
      self, wires, array_func
  ):
      """Test that broadcasting works for state vectors and full wires"""
      state_vector = array_func([sv[0] for sv in state_vectors])
  
      if wires == [0, 1]:
          expected_density_matrices = array_func(
              [sv[1][2] for sv in state_vectors]
          )
      else:
          expected_density_matrices = array_func(
              [permute_two_qubit_dm(sv[1][2]) for sv in state_vectors]
          )
  
      _density_matrices = fn.reduce_statevector(
          state_vector, indices=wires
      )
      assert np.allclose(_density_matrices, expected_density_matrices)
  
imports: import numpy
  import pytest
  from pennylane import numpy
  from pennylane import math
label_desc: Use image node_id 2 for calling the TestDensityMatrixBroadcasting obj's underlying member method code with example usage: obj.test_reduced_dm_with_state_vector_full_wires(wires, array_func) without return types