You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Merge some docstrings from module-components and the api (#303)
This picks off most of the very easy docstrings, include the wrapper functions that just forward to a multivector method.
A couple of methods in printer.py got proper `sphinx.ext.napoleon` docstrings, and a few others got docstrings for the first time.
If ``v1`` and ``v2`` are 3-dimensional Euclidean vectors the vector cross product is returned, :math:`v_{1}\times v_{2} = -I{\lp {v_{1}{\wedge}v_{2}} \rp }`.
This is used with the ``GAeval()`` function to evaluate a string representing a multivector expression with a revised operator precedence. ``def_prec()`` redefines the operator precedence for multivectors. ``def_prec()`` must be called in the main program an the argument ``gd`` must be ``globals()``. The argument ``op_ord`` defines the order of operator precedence from high to low with groups of equal precedence separated by commas. the default precedence ``op_ord='<>|,^,\*'`` is that used by
492
-
Hestenes (:cite:`Hestenes`,p7,:cite:`Doran`,p38).
493
-
494
-
.. function:: dual(A,mode='I+')
478
+
.. autofunction:: galgebra.mv.dual
495
479
:noindex:
496
480
497
-
Return the dual of the multivector ``A``. The default operation is :math:`AI`. For other modes see member function ``Mv.dual(mode)``
498
-
499
-
.. function:: even(A)
481
+
.. autofunction:: galgebra.mv.even
500
482
:noindex:
501
483
502
-
Return even part of :math:`A`.
503
-
504
-
.. function:: exp(A,hint='-')
484
+
.. autofunction:: galgebra.mv.exp
505
485
:noindex:
506
486
507
-
If :math:`A` is a multivector then ``A.exp(hint)`` is returned. If :math:`A` is a *sympy* expression the *sympy* expression :math:`e^{A}` is returned (see ``sympy.exp(A)`` member function).
508
-
509
-
.. function:: printer.GAeval(s,pstr=False)
487
+
.. autofunction:: galgebra.printer.GAeval
510
488
:noindex:
511
489
512
-
Returns multivector expression for string ``s`` with operator precedence for string ``s`` defined by inputs to function ``def_prec()``. if ``pstr=True`` ``s`` and ``s`` with parenthesis added to enforce operator precedence are printed.
513
-
514
-
.. function:: grade(A,r=0)
490
+
.. autofunction:: galgebra.mv.grade
515
491
:noindex:
516
492
517
-
If :math:`A` is a multivector :math:`{\left < {A} \right >}_{r}` is returned.
518
-
519
-
.. function:: inv(A)
493
+
.. autofunction:: galgebra.mv.inv
520
494
:noindex:
521
495
522
-
If :math:`A` is a multivector and :math:`AA^{{\dagger}}` is a non-zero scalar then :math:`A^{-1} = A^{{\dagger}}/(AA^{{\dagger}})` is returned otherwise an exception is returned.
523
-
524
-
.. function:: Nga(x,prec=5)
496
+
.. autofunction:: galgebra.mv.Nga
525
497
:noindex:
526
498
527
-
If ``x`` is a multivector with coefficients that contain floating point numbers, ``Nga()`` rounds all these numbers to a precision of ``prec`` and returns the rounded multivector.
528
-
529
-
.. function:: norm(A,hint='-')
499
+
.. autofunction:: galgebra.mv.norm
530
500
:noindex:
531
501
532
-
If :math:`A` is a multivector and :math:`AA^{{\dagger}}` is a number (not a scalar function) then :math:`\sqrt{{\left |{AA^{{\dagger}}}\right |}}` is returned. If :math:`AA^{{\dagger}}` is a scalar *sympy* expression, but not a number, and ``hint='-'`` then return :math:`\sqrt{-AA^{{\dagger}}}` otherwise return :math:`\sqrt{AA^{{\dagger}}}`.
533
-
534
-
.. function:: norm2(A)
502
+
.. autofunction:: galgebra.mv.norm2
535
503
:noindex:
536
504
537
-
If :math:`A` is a multivector and :math:`AA^{{\dagger}}` is a scalar return :math:`{\left |{AA^{{\dagger}}}\right |}`.
If ``basis`` is a list/tuple of vectors, ``ReciprocalFrame()`` returns a tuple of reciprocal vectors. If ``mode=norm`` the vectors are normalized. If ``mode`` is anything other than ``norm`` the vectors are unnormalized and the normalization coefficient is added to the end of the tuple. One must divide by this coefficient to normalize the vectors.
553
-
554
-
.. function:: refl(B,A)
514
+
.. autofunction:: galgebra.mv.refl(B,A)
555
515
:noindex:
556
516
557
-
Reflect multivector :math:`A` in blade :math:`B`. If :math:`s` is grade of :math:`B` returns :math:`\sum_{r}(-1)^{s(r+1)}B{\left < {A} \right >}_{r}B^{-1}`.
558
-
559
-
.. function:: rev(A)
517
+
.. autofunction:: galgebra.mv.rev(A)
560
518
:noindex:
561
519
562
-
If :math:`A` is a multivector return :math:`A^{{\dagger}}`.
If ``A`` is a multivector return ``A.rotate_multivector(itheta,hint)`` where ``itheta`` is the bi-vector blade defining the rotation. For the use of ``hint`` see the member function ``Mv.rotate_multivector(self,itheta,hint)``.
0 commit comments