**************************************
Geometric Algebra Module for Sympy
**************************************
:Author: Alan Bromborsky
.. |release| replace:: 0.10
.. % Complete documentation on the extended LaTeX markup used for Python
.. % documentation is available in ``Documenting Python'', which is part
.. % of the standard documentation for Python. It may be found online
.. % at:
.. %
.. % http://www.python.org/doc/current/doc/doc.html
.. % \lstset{language=Python}
.. % \input{macros}
.. % This is a template for short or medium-size Python-related documents,
.. % mostly notably the series of HOWTOs, but it can be used for any
.. % document you like.
.. % The title should be descriptive enough for people to be able to find
.. % the relevant document.
.. % Increment the release number whenever significant changes are made.
.. % The author and/or editor can define 'significant' however they like.
.. % At minimum, give your name and an email address. You can include a
.. % snail-mail address if you like.
.. % This makes the Abstract go on a separate page in the HTML version;
.. % if a copyright notice is used, it should go immediately after this.
.. %
.. % \ifhtml
.. % \chapter*{Front Matter\label{front}}
.. % \fi
.. % Copyright statement should go here, if needed.
.. % ...
.. % The abstract should be a paragraph or two long, and describe the
.. % scope of the document.
.. topic:: Abstract
This document describes the implementation of a geometric algebra module in
python that utilizes the :mod:`sympy` symbolic algebra library. The python
module :mod:`GA` has been developed for coordinate free calculations using
the operations (geometric, outer, and inner products etc.) of geometric algebra.
The operations can be defined using a completely arbitrary pseudometric defined
by the inner products of a set of arbitrary vectors or the pseudometric can be
restricted to enforce orthogonality and signature constraints on the set of
vectors. In addition the module includes the geometric, outer (curl) and inner
(div) derivatives and the ability to define a curvilinear coordinate system.
The module requires the numpy and the sympy modules.
What is Geometric Algebra?
==========================
Geometric algebra is the Clifford algebra of a real finite dimensional vector
space or the algebra that results when a real finite dimensional vector space
is extended with a product of vectors (geometric product) that is associative,
left and right distributive, and yields a real number for the square (geometric
product) of any vector [Hestenes,Lasenby]. The elements of the geometric
algebra are called multivectors and consist of the linear combination of
scalars, vectros, and the geometric product of two or more vectors. The
additional axioms for the geometric algebra are that for any vectors :math:`a`,
:math:`b`, and :math:`c` in the base vector space:
.. math::
:nowrap:
\begin{equation*}
\begin{array}{c}
a\lp bc \rp = \lp ab \rp c \\
a\lp b+c \rp = ab+ac \\
\lp a + b \rp c = ac+bc \\
aa = a^{2} \in \Re
\end{array}
\end{equation*}
By induction these also apply to any multivectors.
Several software packages for numerical geometric algebra calculations are
available from Doran-Lazenby group and the Dorst group. Symbolic packages for
Clifford algebra using orthongonal bases such as
:math:`e_{i}e_{j}+e_{j}e_{i} = 2\eta_{ij}`, where :math:`\eta_{ij}` is a numeric
array are available from the Doran-Lazenby group. The symbolic algebra module,
:mod:`GA`, developed for python does not depend on an orthogonal basis
representation, but rather is generated from a set of :math:`n` arbitrary
symbolic vectors, :math:`a_{1},a_{2},\dots,a_{n}` and a symbolic pseudo-metric
tensor :math:`g_{ij} = a_{i}\cdot a_{j}`.
In order not to reinvent the wheel all scalar symbolic algebra is handled by the
python module :mod:`sympy`.
The basic geometic algebra operations will be implemented in python by defining
a multivector class, MV, and overloading the python operators in Table
:ref:`1 <table1>` where ``A`` and ``B`` are any two multivectors.
.. _table1:
+-----------+-----------------------------------------------+
| Operation | Result |
+===========+===============================================+
| ``A+B`` | sum of multivectors or multivector and scalar |
+-----------+-----------------------------------------------+
| ``A-B`` | difference of multivectors or multivector |
| | and scalar |
+-----------+-----------------------------------------------+
| ``A*B`` | geometric product or multiplication by scalar |
+-----------+-----------------------------------------------+
| ``A^B`` | outer product of multivectors |
+-----------+-----------------------------------------------+
| ``A|B`` | inner product of multivectors |
+-----------+-----------------------------------------------+
Table :ref:`1 <table1>`. Multivector operations for symbolicGA
Note that the operator order precedence is determined by python and is not
neccessarily that used by geometric algebra. Always use parenthesis in python
expressions containing ``:math:`\W``` and/or ``|``.
.. _vbm:
Vector Basis and Metric
=======================
The two structures that define the :class:`MV` (multivector) class are the
symbolic basis vectors and the symbolic pseudometric. The symbolic basis
vectors are input as a string with the symbol name separated by spaces. For
example if we are calculating the geometric algebra of a system with three
vectors that we wish to denote as ``a0``, ``a1``, and ``a2`` we would define the
string variable:
``basis = 'a0 a1 a2'``
that would be input into the multivector setup function. The next step would be
to define the symbolic pseudometric for the geometric algebra of the basis we
have defined. The default pseudometric is the most general and is the matrix of
the following symbols
.. _eq1:
.. math::
:label: 1
:nowrap:
\begin{equation*}
g = \lbrk
\begin{array}{ccc}
a0**2 & (a0.a1) & (a0.a2) \\
(a0.a1) & a1**2 & (a1.a2) \\
(a0.a2) & (a1.a2) & a2**2 \\
\end{array}
\rbrk
\end{equation*}
where each of the :math:`g_{ij}` is a symbol representing all of the dot
products of the basis vectors. Note that the symbols are named so that
:math:`g_{ij} = g_{ji}` since for the symbol function
:math:`(a0.a1) \ne (a1.a0)`.
Note that the strings shown in equation :ref:`1 <eq1>` are only used when the values
of :math:`g_{ij}` are output (printed). In the :mod:`GA` module (library)
the :math:`g_{ij}` symbols are stored in a static member list of the multivector
class :class:`MV` as the double list *MV.metric* (:math:`g_{ij} = `
*MV.metric[i][j]*).
The default definition of :math:`g` can be overwritten by specifying a string
that will define :math:`g`. As an example consider a symbolic representation
for conformal geometry. Define for a basis
``basis = 'a0 a1 a2 n nbar'``
and for a metric
``metric = '# # # 0 0, # # # 0 0, # # # 0 0, 0 0 0 0 2, 0 0 0 2 0'``
then calling :func:`MV.setup(basis,metric)` would initialize
.. math::
:nowrap:
\begin{equation*}
g = \lbrk
\begin{array}{ccccc}
a0**2 & (a0.a1) & (a0.a2) & 0 & 0\\
(a0.a1) & a1**2 & (a1.a2) & 0 & 0\\
(a0.a2) & (a1.a2) & a2**2 & 0 & 0 \\
0 & 0 & 0 & 0 & 2 \\
0 & 0 & 0 & 2 & 0
\end{array}
\rbrk
\end{equation*}
Here we have specified that :math:`n` and :math:`nbar` are orthonal to all the
:math:`a`'s, :math:`n**2 = nbar**2 = 0`, and :math:`(n.nbar) = 2`. Using
:math:`\#` in the metric definition string just tells the program to use the
default symbol for that value.
When ``MV.setup`` is called multivector representations of the basis local to
the program are instantiated. For our first example that means that the
symbolic vectors named ``a0``, ``a1``, and ``a2`` are c
没有合适的资源?快使用搜索试试~ 我知道了~
sympy-0.6.4.tar.gz
0 下载量 29 浏览量
2024-03-20
00:42:03
上传
评论
收藏 2.11MB GZ 举报
温馨提示
共522个文件
py:422个
txt:39个
png:31个
GNU项目是一个自由软件集体协作项目,由理查德·斯托曼于1983年发起,旨在创建一个完全自由的操作系统,称为GNU操作系统。该项目强调软件的自由,即用户能够自由地运行、复制、分发、学习、改变和改进软件。GNU项目产生了许多重要的软件,例如GNU编译器集合(GCC)和GNU通用公共许可证(GPL),后者为开源软件提供了法律基础。 Python库是一组预先编写的代码模块,旨在帮助开发者实现特定的编程任务,无需从零开始编写代码。这些库可以包括各种功能,如数学运算、文件操作、数据分析和网络编程等。Python社区提供了大量的第三方库,如NumPy、Pandas和Requests,极大地丰富了Python的应用领域,从数据科学到Web开发。
资源推荐
资源详情
资源评论
收起资源包目录
sympy-0.6.4.tar.gz (522个子文件)
isympy.1 2KB
AUTHORS 2KB
py.bench 462B
apidoc.conf 233B
multable.dat 2KB
ipythonrc-sympy 1KB
isympy 4KB
LICENSE 1KB
LICENSE 1KB
Makefile 3KB
3.patch 3KB
2.patch 2KB
4.patch 2KB
1.patch 2KB
xobj-fix-even-height.patch 2KB
pprint-fix-old-classes.patch 1KB
printer-fix-typos.patch 1KB
5.patch 1004B
PKG-INFO 230B
winpdb2.png 92KB
19.png 76KB
winpdb1.png 65KB
17.png 52KB
14.png 52KB
13.png 50KB
12.png 47KB
11.png 46KB
16.png 37KB
15.png 34KB
2.png 24KB
1c.png 22KB
sympy-160px.png 20KB
5.png 16KB
10.png 14KB
8.png 13KB
18.png 12KB
7.png 12KB
4.png 10KB
4b.png 10KB
9.png 9KB
1b.png 9KB
6.png 9KB
sympylogo.png 8KB
5b.png 6KB
3.png 5KB
3b.png 5KB
featured-downloads.png 4KB
pngview1.png 3KB
1a.png 3KB
admon-note.png 2KB
glext_nv.py 568KB
glext_arb.py 517KB
asound.py 407KB
xlib.py 297KB
functions.py 163KB
constants.py 117KB
gl.py 101KB
GA.py 79KB
wglext_nv.py 70KB
basic.py 68KB
__init__.py 68KB
polynomial.py 66KB
calculus.py 62KB
integerpolys.py 60KB
wglext_arb.py 60KB
matrices.py 57KB
__init__.py 56KB
libelefun.py 50KB
__init__.py 49KB
libmpf.py 47KB
__init__.py 47KB
elliptic.py 46KB
glxext_nv.py 44KB
test_integerpolys.py 43KB
numbers.py 43KB
latex_ex.py 41KB
test_polynomial.py 41KB
__init__.py 41KB
pypng.py 40KB
__init__.py 40KB
gammazeta.py 40KB
mptypes.py 37KB
simplify.py 36KB
evalf.py 36KB
glxext_arb.py 35KB
quadrature.py 35KB
trigonometric.py 33KB
optimization.py 29KB
facts.py 29KB
agl.py 28KB
test_arit.py 28KB
identification.py 27KB
solvers.py 27KB
lib_openal.py 27KB
test_matrices.py 27KB
galoispolys.py 27KB
glx.py 27KB
test_functions_mpmath.py 26KB
libhyper.py 26KB
algorithms.py 25KB
共 522 条
- 1
- 2
- 3
- 4
- 5
- 6
资源评论
程序员Chino的日记
- 粉丝: 2907
- 资源: 4万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功