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 permuted
docstr_tok: ["Tests","the","case","where","the","original","matrix","is","permuted"]
code: def test_permutation(self):
      """Tests the case where the original matrix is permuted"""
      res = qml.math.expand_matrix(
          self.base_matrix_2, wires=[0, 2], wire_order=[2, 0]
      )
  
      expected = np.array(
          [
              [1, 3, 2, 4],
              [9, 11, 10, 12],
              [5, 7, 6, 8],
              [13, 15, 14, 16],
          ]
      )
      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 4 for calling the TestExpandMatrix obj's underlying member method code with example usage: obj.test_permutation() without return types