class_docstr: Test the functions in qutrit_mixed/initialize_state.py
class_docstr_tok: ["Test","the","functions","in","qutrit_mixed\/initialize_state.py"]
docstr: Tests that create_initial_state works with a real state-prep operator.
docstr_tok: ["Tests","that","create_initial_state","works","with","a","real","state-prep","operator","."]
code: def test_create_initial_state_with_BasisState(self):
      """Tests that create_initial_state works with a real state-prep operator."""
      prep_op = QutritBasisState([1, 2, 0], wires=[0, 1, 2])
      state = create_initial_state([0, 1, 2], prep_operation=prep_op)
      assert state[1, 2, 0, 1, 2, 0] == 1
      state[
          1, 2, 0, 1, 2, 0
      ] = 0  # set to zero to make test below simple
      assert qml.math.allequal(state, np.zeros(([3] * 6)))
  
file_path: pennylane/tests/devices/qutrit_mixed/test_qutrit_mixed_initialize_state.py
imports: import pytest
  import pennylane
  from pennylane import numpy
  from pennylane.devices.qutrit_mixed import create_initial_state
  from pennylane import QutritBasisState
  from pennylane.operation import StatePrepBase
label_desc: Use image node_id 3 for calling the TestInitializeState obj's underlying member method code with example usage: obj.test_create_initial_state_with_BasisState() without return types