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 broadcasted original matrix is permuted
docstr_tok: ["Tests","the","case","where","the","broadcasted","original","matrix","is","permuted"]
code: def test_permutation_broadcasted(self):
      """Tests the case where the broadcasted original matrix is permuted"""
      res = qml.math.expand_matrix(
          self.base_matrix_2_broadcasted,
          wires=[0, 2],
          wire_order=[2, 0],
      )
  
      perm = [0, 2, 1, 3]
      expected = self.base_matrix_2_broadcasted[:, perm][:, :, perm]
      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 5 for calling the TestExpandMatrix obj's underlying member method code with example usage: obj.test_permutation_broadcasted() without return types