class_docstr: Tests for the _sparse_expand_matrix function.
class_docstr_tok: ["Tests","for","the","_sparse_expand_matrix","function","."]
docstr: Tests the case wires is a tuple
docstr_tok: ["Tests","the","case","wires","is","a","tuple"]
code: def test_wires_tuple(self):
      """Tests the case wires is a tuple"""
      mat = csr_matrix([[0, 1], [1, 0]])
      res = qml.math.expand_matrix(mat, wires=(0,), wire_order=[0, 1])
      res.sort_indices()
      expected = csr_matrix(
          np.array(
              [[0, 0, 1, 0], [0, 0, 0, 1], [1, 0, 0, 0], [0, 1, 0, 0]]
          )
      )
      expected.sort_indices()
  
      assert isinstance(res, type(expected))
      assert all(res.data == expected.data)
      assert all(res.indices == expected.indices)
  
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 2 for calling the TestExpandMatrixSparse obj's underlying member method code with example usage: obj.test_wires_tuple() without return types