class_docstr: Test the special cases on a two qubit state.  Also tests the special cases for einsum and tensor application methods
  for additional testing of these generic matrix application methods.
class_docstr_tok: ["Test","the","special","cases","on","a","two","qubit","state",".","Also","tests","the","special","cases","for","einsum","and","tensor","application","methods","for","additional","testing","of","these","generic","matrix","application","methods","."]
docstr: Test the application of a GlobalPhase gate on a two qubit state.
docstr_tok: ["Test","the","application","of","a","GlobalPhase","gate","on","a","two","qubit","state","."]
code: def test_globalphase(self, method, wire, ml_framework):
      """Test the application of a GlobalPhase gate on a two qubit state."""
  
      initial_state = np.array(
          [
              [0.04624539 + 0.3895457j, 0.22399401 + 0.53870339j],
              [-0.483054 + 0.2468498j, -0.02772249 - 0.45901669j],
          ]
      )
      initial_state = qml.math.asarray(initial_state, like=ml_framework)
  
      phase = qml.math.asarray(-2.3, like=ml_framework)
      shift = qml.math.exp(-1j * qml.math.cast(phase, np.complex128))
  
      new_state_with_wire = method(
          qml.GlobalPhase(phase, wire), initial_state
      )
      new_state_no_wire = method(qml.GlobalPhase(phase), initial_state)
  
      assert qml.math.allclose(
          shift * initial_state, new_state_with_wire
      )
      assert qml.math.allclose(shift * initial_state, new_state_no_wire)
  
imports: from functools import reduce
  import pytest
  import numpy
  from scipy.stats import unitary_group
  import pennylane
  from pennylane.operation import _UNSET_BATCH_SIZE, Operation
  from pennylane.devices.qubit.apply_operation import apply_operation, apply_operation_einsum, apply_operation_tensordot
label_desc: Use image node_id 9 for calling the TestTwoQubitStateSpecialCases obj's underlying member method code with example usage: obj.test_globalphase(method, wire, ml_framework) without return types