class_docstr: Tests for the expand_matrix helper function.
class_docstr_tok: ["Tests","for","the","expand_matrix","helper","function","."]
docstr: Tests the case where the original matrix is expanded
docstr_tok: ["Tests","the","case","where","the","original","matrix","is","expanded"]
code: def test_expansion(self):
      """Tests the case where the original matrix is expanded"""
      res = qml.math.expand_matrix(
          self.base_matrix_1, wires=[2], wire_order=[0, 2]
      )
      expected = np.array(
          [[1, 2, 0, 0], [3, 4, 0, 0], [0, 0, 1, 2], [0, 0, 3, 4]]
      )
      assert np.allclose(expected, res)
  
      res = qml.math.expand_matrix(
          self.base_matrix_1, wires=[2], wire_order=[2, 0]
      )
      expected = np.array(
          [[1, 0, 2, 0], [0, 1, 0, 2], [3, 0, 4, 0], [0, 3, 0, 4]]
      )
      assert np.allclose(expected, res)
  
imports: from functools import reduce
  import numpy
  import pytest
  from gate_data import CNOT, II, SWAP, I, Toffoli
  from scipy.sparse import csr_matrix
  import pennylane
  from pennylane import numpy
label_desc: Use image node_id 6 for calling the TestExpandMatrix obj's underlying member method code with example usage: obj.test_expansion() without return types