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","."]
docstr: Cache a matrix by its name.
  
  Parameters
  ----------
  name : str
      A descriptive name for the matrix, like "identity2".
  m : list of lists
      The raw matrix data as a SymPy Matrix.
docstr_tok: ["Cache","a","matrix","by","its","name",".","Parameters","--","--","--","--","--","name",":","str","A","descriptive","name","for","the","matrix",",","like","``","identity2","''",".","m",":","list","of","lists","The","raw","matrix","data","as","a","SymPy","Matrix","."]
code: def cache_matrix(self, name, m):
      """Cache a matrix by its name.
  
      Parameters
      ----------
      name : str
          A descriptive name for the matrix, like "identity2".
      m : list of lists
          The raw matrix data as a SymPy Matrix.
      """
      try:
          self._sympy_matrix(name, m)
      except ImportError:
          pass
      try:
          self._numpy_matrix(name, m)
      except ImportError:
          pass
      try:
          self._scipy_sparse_matrix(name, m)
      except ImportError:
          pass
  
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 2 for calling the MatrixCache obj's underlying member method code with example usage: obj.cache_matrix(name, m) without return types