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: Get a cached matrix by name and format.
  
  Parameters
  ----------
  name : str
      A descriptive name for the matrix, like "identity2".
  format : str
      The format desired ('sympy', 'numpy', 'scipy.sparse')
docstr_tok: ["Get","a","cached","matrix","by","name","and","format",".","Parameters","--","--","--","--","--","name",":","str","A","descriptive","name","for","the","matrix",",","like","``","identity2","''",".","format",":","str","The","format","desired","(","'sympy","'",",","'numpy","'",",","'scipy.sparse","'",")"]
code: def get_matrix(self, name, format):
      """Get a cached matrix by name and format.
  
      Parameters
      ----------
      name : str
          A descriptive name for the matrix, like "identity2".
      format : str
          The format desired ('sympy', 'numpy', 'scipy.sparse')
      """
      m = self._cache.get((name, format))
      if m is not None:
          return m
      raise NotImplementedError(
          "Matrix with name %s and format %s is not available."
          % (name, format)
      )
  
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 3 for calling the MatrixCache obj's underlying member method code with example usage: obj.get_matrix(name, format) and returns: m