class_docstr: Test the functions in initialize_state.py
class_docstr_tok: ["Test","the","functions","in","initialize_state.py"]
docstr: Tests that create_initial_state works with a broadcasted StatePrep
  operator.
docstr_tok: ["Tests","that","create_initial_state","works","with","a","broadcasted","StatePrep","operator","."]
code: def test_create_initial_state_with_StatePrep_broadcasted(
      self, prep_op_cls
  ):
      """Tests that create_initial_state works with a broadcasted StatePrep
      operator."""
      prep_op = prep_op_cls(
          np.array([[0, 1, 0, 0], [0, 0, 0, 1], [0, 0, 1, 0]]),
          wires=[0, 1],
      )
      state = create_initial_state([0, 1], prep_operation=prep_op)
      expected = np.zeros((3, 2, 2))
      expected[0, 0, 1] = expected[1, 1, 1] = expected[2, 1, 0] = 1
      assert np.array_equal(state, expected)
  
file_path: pennylane/tests/devices/qubit/test_initialize_state.py
imports: import pytest
  import pennylane
  from pennylane import numpy
  from pennylane.devices.qubit import create_initial_state
  from pennylane.operation import StatePrepBase
label_desc: Use image node_id 5 for calling the TestInitializeState obj's underlying member method code with example usage: obj.test_create_initial_state_with_StatePrep_broadcasted(prep_op_cls) without return types