class_docstr: A cache for small matrices in different formats.
  
  This class takes small matrices in the standard ``sympy.Matrix`` format,
  and then converts these to both ``numpy.matrix`` and
  ``scipy.sparse.csr_matrix`` matrices. These matrices are then stored for
  future recovery.
class_docstr_tok: ["A","cache","for","small","matrices","in","different","formats",".","This","class","takes","small","matrices","in","the","standard","``","sympy.Matrix","``","format",",","and","then","converts","these","to","both","``","numpy.matrix","``","and","``","scipy.sparse.csr_matrix","``","matrices",".","These","matrices","are","then","stored","for","future","recovery","."]
code: def __init__(self, dtype="complex"):
      self._cache = {}
      self.dtype = dtype
  
file_path: sympy/sympy/physics/quantum/matrixcache.py
imports: from sympy.core.numbers import I, Rational, pi
  from sympy.core.power import Pow
  from sympy.functions.elementary.exponential import exp
  from sympy.matrices.dense import Matrix
  from sympy.physics.quantum.matrixutils import to_sympy, to_numpy, to_scipy_sparse
label_desc: Use image node_id 1 to create a new MatrixCache object  with example: obj = MatrixCache(dtype)