class_docstr: A base class for all quantum object like operators and states.
class_docstr_tok: ["A","base","class","for","all","quantum","object","like","operators","and","states","."]
docstr: Represent this object in a given basis.
  
  This method dispatches to the actual methods that perform the
  representation. Subclases of QExpr should define various methods to
  determine how the object will be represented in various bases. The
  format of these methods is::
  
      def _represent_BasisName(self, basis, **options):
  
  Thus to define how a quantum object is represented in the basis of
  the operator Position, you would define::
  
      def _represent_Position(self, basis, **options):
  
  Usually, basis object will be instances of Operator subclasses, but
  there is a chance we will relax this in the future to accommodate other
  types of basis sets that are not associated with an operator.
  
  If the ``format`` option is given it can be ("sympy", "numpy",
  "scipy.sparse"). This will ensure that any matrices that result from
  representing the object are returned in the appropriate matrix format.
  
  Parameters
  ==========
  
  basis : Operator
      The Operator whose basis functions will be used as the basis for
      representation.
  options : dict
      A dictionary of key/value pairs that give options and hints for
      the representation, such as the number of basis functions to
      be used.
docstr_tok: ["Represent","this","object","in","a","given","basis",".","This","method","dispatches","to","the","actual","methods","that","perform","the","representation",".","Subclases","of","QExpr","should","define","various","methods","to","determine","how","the","object","will","be","represented","in","various","bases",".","The","format","of","these","methods","is",":",":","def","_represent_BasisName","(","self",",","basis",",","*","*","options",")",":","Thus","to","define","how","a","quantum","object","is","represented","in","the","basis","of","the","operator","Position",",","you","would","define",":",":","def","_represent_Position","(","self",",","basis",",","*","*","options",")",":","Usually",",","basis","object","will","be","instances","of","Operator","subclasses",",","but","there","is","a","chance","we","will","relax","this","in","the","future","to","accommodate","other","types","of","basis","sets","that","are","not","associated","with","an","operator",".","If","the","``","format","``","option","is","given","it","can","be","(","``","sympy","''",",","``","numpy","''",",","''","scipy.sparse","''",")",".","This","will","ensure","that","any","matrices","that","result","from","representing","the","object","are","returned","in","the","appropriate","matrix","format",".","Parameters","==========","basis",":","Operator","The","Operator","whose","basis","functions","will","be","used","as","the","basis","for","representation",".","options",":","dict","A","dictionary","of","key\/value","pairs","that","give","options","and","hints","for","the","representation",",","such","as","the","number","of","basis","functions","to","be","used","."]
code: def _represent(self, *, basis=None, **options):
      """Represent this object in a given basis.
  
      This method dispatches to the actual methods that perform the
      representation. Subclases of QExpr should define various methods to
      determine how the object will be represented in various bases. The
      format of these methods is::
  
          def _represent_BasisName(self, basis, **options):
  
      Thus to define how a quantum object is represented in the basis of
      the operator Position, you would define::
  
          def _represent_Position(self, basis, **options):
  
      Usually, basis object will be instances of Operator subclasses, but
      there is a chance we will relax this in the future to accommodate other
      types of basis sets that are not associated with an operator.
  
      If the ``format`` option is given it can be ("sympy", "numpy",
      "scipy.sparse"). This will ensure that any matrices that result from
      representing the object are returned in the appropriate matrix format.
  
      Parameters
      ==========
  
      basis : Operator
          The Operator whose basis functions will be used as the basis for
          representation.
      options : dict
          A dictionary of key/value pairs that give options and hints for
          the representation, such as the number of basis functions to
          be used.
      """
      if basis is None:
          result = self._represent_default_basis(**options)
      else:
          result = dispatch_method(self, "_represent", basis, **options)
  
      # If we get a matrix representation, convert it to the right format.
      format = options.get("format", "sympy")
      result = self._format_represent(result, format)
      return result
  
imports: from sympy.core.expr import Expr
  from sympy.core.symbol import Symbol
  from sympy.core.sympify import sympify
  from sympy.matrices.dense import Matrix
  from sympy.printing.pretty.stringpict import prettyForm
  from sympy.core.containers import Tuple
  from sympy.utilities.iterables import is_sequence
  from sympy.physics.quantum.dagger import Dagger
  from sympy.physics.quantum.matrixutils import numpy_ndarray, scipy_sparse_matrix, to_sympy, to_numpy, to_scipy_sparse
label_desc: Use image node_id 27 for calling the QExpr obj's underlying member method code with example usage: obj._represent() and returns: result