예제 #1
0
파일: state.py 프로젝트: asmeurer/sympy
    def _eval_innerproduct(self, bra, **hints):
        """Evaluate the inner product between this ket and a bra.

        This is called to compute <bra|ket>, where the ket is ``self``.

        This method will dispatch to sub-methods having the format::

            ``def _eval_innerproduct_BraClass(self, **hints):``

        Subclasses should define these methods (one for each BraClass) to
        teach the ket how to take inner products with bras.
        """
        return dispatch_method(self, '_eval_innerproduct', bra, **hints)
예제 #2
0
    def _eval_innerproduct(self, bra, **hints):
        """Evaluate the inner product betweeen this ket and a bra.

        This is called to compute <bra|ket>, where the ket is ``self``.

        This method will dispatch to sub-methods having the format::

            ``def _eval_innerproduct_BraClass(self, **hints):``

        Subclasses should define these methods (one for each BraClass) to
        teach the ket how to take inner products with bras.
        """
        return dispatch_method(self, '_eval_innerproduct', bra, **hints)
예제 #3
0
파일: state.py 프로젝트: lazovich/sympy
    def _apply_operator(self, op, **options):
        """Apply an Operator to this Ket.

        This method will dispatch to methods having the format::

            def _apply_operator_OperatorName(op, **options):

        Subclasses should define these methods (one for each OperatorName) to
        teach the Ket how operators act on it.

        Parameters
        ==========
        op : Operator
            The Operator that is acting on the Ket.
        options : dict
            A dict of key/value pairs that control how the operator is applied
            to the Ket.
        """
        return dispatch_method(self, '_apply_operator', op, **options)
예제 #4
0
    def _apply_operator(self, op, **options):
        """Apply an Operator to this Ket.

        This method will dispatch to methods having the format::

            def _apply_operator_OperatorName(op, **options):

        Subclasses should define these methods (one for each OperatorName) to
        teach the Ket how operators act on it.

        Parameters
        ==========
        op : Operator
            The Operator that is acting on the Ket.
        options : dict
            A dict of key/value pairs that control how the operator is applied
            to the Ket.
        """
        return dispatch_method(self, '_apply_operator', op, **options)
예제 #5
0
파일: operator.py 프로젝트: ALGHeArT/sympy
 def _apply_operator(self, ket, **options):
     return dispatch_method(self, '_apply_operator', ket, **options)
예제 #6
0
파일: operator.py 프로젝트: ALGHeArT/sympy
 def _eval_anticommutator(self, other, **options):
     """Evaluate [self, other] if known."""
     return dispatch_method(self, '_eval_anticommutator', other, **options)
예제 #7
0
 def _apply_operator(self, ket, **options):
     return dispatch_method(self, '_apply_operator', ket, **options)
예제 #8
0
 def _eval_anticommutator(self, other, **options):
     """Evaluate [self, other] if known."""
     return dispatch_method(self, '_eval_anticommutator', other, **options)
예제 #9
0
파일: operator.py 프로젝트: msgoff/sympy
 def _eval_commutator(self, other, **options):
     """Evaluate [self, other] if known, return None if not known."""
     return dispatch_method(self, "_eval_commutator", other, **options)