diff --git a/.circleci/config.yml b/.circleci/config.yml index cd66e704..dfdb5f62 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -7,24 +7,44 @@ defaults: &defaults - run: name: Install command: | - sudo pip install pytest - sudo pip install sympy==1.3 + sudo pip install -r test_requirements.txt sudo pip install -e . - sudo pip install pytest-cov - if [[ "$CIRCLE_JOB" == "python-2.7" ]]; then sudo pip install ipython==5.8.0 ; fi - sudo pip install nbval - sudo pip install pytest-xdist + if [ -n "$PIP_EXTRA_INSTALLATION" ]; then + # deliberately not quoted + sudo pip install $PIP_EXTRA_INSTALLATION + fi + sudo pip check - run: name: Test command: | - pytest -n 2 --dist loadscope --cov=galgebra --nbval examples/ipython/ test --current-env --sanitize-with test/.nbval_sanitize.cfg + mkdir test-reports + pytest -n 2 --dist loadscope --cov=galgebra --nbval examples/ipython/ test --current-env --sanitize-with test/.nbval_sanitize.cfg --junitxml=test-reports/junit.xml - run: name: Coverage when: on_success command: | sudo pip install codecov codecov + + - store_test_results: + path: test-reports + - store_artifacts: + path: test-reports + jobs: + "python-3.7-symengine": + <<: *defaults + environment: + PIP_EXTRA_INSTALLATION: numpy symengine==0.5.0 + USE_SYMENGINE: 1 + docker: + - image: circleci/python:3.7 + "python-3.7-sympy-1.5": + <<: *defaults + environment: + PIP_EXTRA_INSTALLATION: sympy==1.5 + docker: + - image: circleci/python:3.7 "python-3.7": <<: *defaults docker: @@ -37,10 +57,6 @@ jobs: <<: *defaults docker: - image: circleci/python:3.5 - "python-3.4": - <<: *defaults - docker: - - image: circleci/python:3.4 "python-2.7": <<: *defaults docker: @@ -50,7 +66,9 @@ workflows: version: 2 build: jobs: + - "python-3.7-symengine" + - "python-3.7-sympy-1.5" - "python-3.7" - "python-3.6" - - "python-3.4" + - "python-3.5" - "python-2.7" diff --git a/.mailmap b/.mailmap new file mode 100644 index 00000000..1041f2d0 --- /dev/null +++ b/.mailmap @@ -0,0 +1,12 @@ +# Prevent git from showing duplicate names with commands like "git shortlog" +# See the manpage of git-shortlog for details. +# The syntax is: +# Name that should be used Bad name +# +# You can skip Bad name if it is the same as the one that should be used, and is unique. +# +# This file is up-to-date if the command git log --format="%aN <%aE>" | sort -u +# gives no duplicates. + +Alan Bromborsky brombo +Alan Bromborsky diff --git a/.travis.yml b/.travis.yml index 380547b2..c8f6145c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,12 +11,9 @@ matrix: before_install: - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then lsb_release -a ; fi install: -- pip install sympy==1.3 +- pip install -r test_requirements.txt - pip install -e . -- pip install pytest-cov -- if [[ "$TRAVIS_PYTHON_VERSION" == 2.7 ]]; then pip install ipython==5.8.0 ; fi -- pip install nbval -- pip install pytest-xdist +- pip check script: - pytest -n 2 --dist loadscope --cov=galgebra --nbval examples/ipython/ test --current-env --sanitize-with test/.nbval_sanitize.cfg after_success: diff --git a/README.md b/README.md index 19acf14a..5b719001 100644 --- a/README.md +++ b/README.md @@ -108,7 +108,7 @@ Installing GAlgebra ### Prerequisites - Works on Linux, Windows, Mac OSX -- [Python](https://www.python.org/) 2.7 or 3 +- [Python](https://www.python.org/) 2.7 or >=3.5 - [SymPy](https://www.sympy.org) Note: diff --git a/doc/changelog.rst b/doc/changelog.rst index 79acfc25..da90a1e4 100644 --- a/doc/changelog.rst +++ b/doc/changelog.rst @@ -2,8 +2,23 @@ Changelog ========= +- :bug:`151` ``Dop([], ga=ga)`` and ``Sdop([], ga=ga)`` now evaluate to multiplication by zero, not by one. + Multiplication by one can as always be spelt ``Dop([(S(1), ga.Pdop_identity)], ga=ga)``. +- :bug:`177` :class:`~galgebra.mv.Dop` objects that evaluate to ``0`` no longer raise cryptic ``ValueError``\ s when operated on. +- :support:`175` ``Dop.flatten_one_level`` has been removed, use ``itertools.chain.from_iterable`` for this functionality. +- :feature:`172` :data:`galgebra.__version__` has been added, which contains the version string. +- :feature:`164` (and :issue:`169`, :issue:`170`) Sympy 1.5 is officially supported and tested. +- :support:`167` Python 3.4 is no longer supported. +- :bug:`165` :func:`galgebra.metric.linear_expand` no longer accepts a mode argument, as this did not work properly. + For the old behavior of ``linear_expand(x, mode=True)``, use ``linear_expand_terms(x)`` instead. +- :bug:`151` (also :issue:`150`) :class:`~galgebra.mv.Dop`, :class:`~galgebra.mv.Sdop`, and :class:`~galgebra.mv.Pdop` no longer have mutating methods. + This fixed issues where not only would the laplacian be sometimes calculated incorrectly, but its correctness would vary depending on whether it had been printed! +- :bug:`134` :attr:`~galgebra.ga.Ga.dot_table_dict` now contains correct values (zero) for scalar keys +- :bug:`90` :attr:`~galgebra.ga.Ga.blades`, :attr:`~galgebra.ga.Ga.bases`, and :attr:`~galgebra.ga.Ga.indices` now reference the scalar ``S(0)`` as the single grade-0 object. Previously they listed no grade 0 objects. +- :bug:`81` (also :issue:`180`) Passing coefficients as ``Mv(coefs, 'odd', ga=ga)`` is forbidden. +- :bug:`80` (also :issue:`57`, :issue:`58`, :issue:`97`) The :class:`galgebra.mv.Mv` constructor no longer silently accepts illegal arguments, and produces better error messages. - :feature:`78` :meth:`~galgebra.ga.Ga.grads` now raises a better error when it fails, and is faster. -- :support:`72` Other internal cleanup +- :support:`72` Other internal cleanup. - :feature:`66` (also :issue:`67`, :issue:`71`) Remove unused code in the public API: * ``Ga.mul_table``, ``Ga.wedge_table``, ``Ga.dot_table``, ``Ga.left_contract_table``, @@ -16,10 +31,20 @@ Changelog - :bug:`61` Make contraction and Hestenes dot products thread-safe. Previously these relied on the :attr:`~galgebra.ga.Ga.dot_mode` setting not being changed mid-operation. The :meth:`~galgebra.ga.Ga.dot` method still respects this setting, but is no longer used internally. -- :bug:`60` Make :meth:`~galgebra.mv.Mv.blade_rep` and :meth:`~galgebra.mv.Mv.base_rep` not mutate the object they are called on. - Any code relying on this behavior will need to change from ``x.base_rep()`` to ``x = x.base_rep()``. +- :bug:`60` (also :issue:`141`) Make the following operations on :class:`galgebra.mv.Mv` non-mutating: + + * :meth:`~galgebra.mv.Mv.blade_rep` + * :meth:`~galgebra.mv.Mv.base_rep` + * :meth:`~galgebra.mv.Mv.diff` + * :meth:`~galgebra.mv.Mv.simplify` + * :meth:`~galgebra.mv.Mv.expand` + * :meth:`~galgebra.mv.Mv.collect` + * ``print(mv)`` + + Any code relying on this behavior will need to change from ``x.method()`` to ``x = x.method()``. + Note that the latter syntax was always supported even before this change. + - :support:`59` (also :issue:`65`) Make internal helper functions private. -- :support:`57` (also :issue:`58`) Clean up the ``Mv(name, 'category')`` constructors to produce better error messages. - :support:`55` Rename ``*kargs`` to ``*args`` internally, to match convention. This has no effect on callers, but makes the docs and source easier to read. - :feature:`50` (also :issue:`51`, :issue:`56`) Improve documentation formatting: diff --git a/examples/LaTeX/groups.tex b/examples/LaTeX/groups.tex deleted file mode 100644 index 88156dbd..00000000 --- a/examples/LaTeX/groups.tex +++ /dev/null @@ -1,141 +0,0 @@ - -\documentclass[10pt,fleqn]{report} -\usepackage[vcentering]{geometry} -\geometry{papersize={8.5in,11in},total={7.5in,10in}} - -\pagestyle{empty} -\usepackage[latin1]{inputenc} -\usepackage{amsmath} -\usepackage{amsfonts} -\usepackage{amssymb} -\usepackage{amsbsy} -\usepackage{tensor} -\usepackage{listings} -\usepackage{color} -\usepackage{xcolor} -\usepackage{bm} -\usepackage{breqn} -\definecolor{gray}{rgb}{0.95,0.95,0.95} -\setlength{\parindent}{0pt} -\DeclareMathOperator{\Tr}{Tr} -\DeclareMathOperator{\Adj}{Adj} -\newcommand{\bfrac}[2]{\displaystyle\frac{#1}{#2}} -\newcommand{\lp}{\left (} -\newcommand{\rp}{\right )} -\newcommand{\paren}[1]{\lp {#1} \rp} -\newcommand{\half}{\frac{1}{2}} -\newcommand{\llt}{\left <} -\newcommand{\rgt}{\right >} -\newcommand{\abs}[1]{\left |{#1}\right | } -\newcommand{\pdiff}[2]{\bfrac{\partial {#1}}{\partial {#2}}} -\newcommand{\lbrc}{\left \{} -\newcommand{\rbrc}{\right \}} -\newcommand{\W}{\wedge} -\newcommand{\prm}[1]{{#1}'} -\newcommand{\ddt}[1]{\bfrac{d{#1}}{dt}} -\newcommand{\R}{\dagger} -\newcommand{\deriv}[3]{\bfrac{d^{#3}#1}{d{#2}^{#3}}} -\newcommand{\grade}[1]{\left < {#1} \right >} -\newcommand{\f}[2]{{#1}\lp{#2}\rp} -\newcommand{\eval}[2]{\left . {#1} \right |_{#2}} -\newcommand{\Nabla}{\boldsymbol{\nabla}} -\newcommand{\eb}{\boldsymbol{e}} -\usepackage{float} -\floatstyle{plain} % optionally change the style of the new float -\newfloat{Code}{H}{myc} -\lstloadlanguages{Python} - -\begin{document} -\\begin{lstlisting}[language=Python,showspaces=false,showstringspaces=false,backgroundcolor=\color{gray},frame=single] -def Product_of_Rotors(): - Print_Function() - (na,nb,nm,alpha,th,th_a,th_b) = symbols('n_a n_b n_m alpha theta theta_a theta_b',\ - real = True) - g = [[na, 0, alpha],[0, nm, 0],[alpha, 0, nb]] #metric tensor - """ - Values of metric tensor components - [na,nm,nb] = [+1/-1,+1/-1,+1/-1] alpha = ea|eb - """ - (g3d, ea, em, eb) = Ga.build('e_a e_m e_b', g=g) - print('g =',g3d.g) - print(r'%n_{a} = \bm{e}_{a}^{2}\;\;n_{b} = \bm{e}_{b}^{2}\;\;n_{m} = \bm{e}_{m}^{2}'+\ - r'\;\;\alpha = \bm{e}_{a}\cdot\bm{e}_{b}') - (ca,cb,sa,sb) = symbols('c_a c_b s_a s_b',real=True) - Ra = ca + sa*ea*em # Rotor for ea^em plane - Rb = cb + sb*em*eb # Rotor for em^eb plane - print(r'%\mbox{Rotor in }\bm{e}_{a}\bm{e}_{m}\mbox{ plane } R_{a} =',Ra) - print(r'%\mbox{Rotor in }\bm{e}_{m}\bm{e}_{b}\mbox{ plane } R_{b} =',Rb) - Rab = Ra*Rb # Compound Rotor - """ - Show that compound rotor is scalar plus bivector - """ - print(r'%R_{a}R_{b} = S+\bm{B} =', Rab) - Rab2 = Rab.get_grade(2) - print(r'%\bm{B} =',Rab2) - Rab2sq = Rab2*Rab2 # Square of compound rotor bivector part - Ssq = (Rab.scalar())**2 # Square of compound rotor scalar part - Bsq = Rab2sq.scalar() - print(r'%S^{2} =',Ssq) - print(r'%\bm{B}^{2} =',Bsq) - Dsq = (Ssq-Bsq).expand().simplify() - print('%S^{2}-B^{2} =', Dsq) - Dsq = Dsq.subs(nm**2,S(1)) # (e_m)**4 = 1 - print('%S^{2}-B^{2} =', Dsq) - Cases = [S(-1),S(1)] # -1/+1 squares for each basis vector - print(r'#Consider all combinations of $\bm{e}_{a}^{2}$, $\bm{e}_{b}^{2}$'+\ - r' and $\bm{e}_{m}^2$:') - for Na in Cases: - for Nb in Cases: - for Nm in Cases: - Ba_sq = -Na*Nm - Bb_sq = -Nb*Nm - if Ba_sq < 0: - Ca_th = cos(th_a) - Sa_th = sin(th_a) - else: - Ca_th = cosh(th_a) - Sa_th = sinh(th_a) - if Bb_sq < 0: - Cb_th = cos(th_b) - Sb_th = sin(th_b) - else: - Cb_th = cosh(th_b) - Sb_th = sinh(th_b) - print(r'%\left [ \bm{e}_{a}^{2},\bm{e}_{b}^{2},\bm{e}_{m}^2\right ] =',\ - [Na,Nb,Nm]) - Dsq_tmp = Dsq.subs({ca:Ca_th,sa:Sa_th,cb:Cb_th,sb:Sb_th,na:Na,nb:Nb,nm:Nm}) - print(r'%S^{2}-\bm{B}^{2} =',Dsq_tmp,' =',trigsimp(Dsq_tmp)) - print(r'#Thus we have shown that $R_{a}R_{b} = S+\bm{D} = e^{\bm{C}}$ where $\bm{C}$'+\ - r' is a bivector blade.') - return -\end{lstlisting} -Code Output: -\begin{equation*} g = \left [ \begin{array}{ccc} n_{a} & 0 & \alpha \\ 0 & n_{m} & 0 \\ \alpha & 0 & n_{b} \end{array}\right ] \end{equation*} -\begin{equation*} n_{a} = \bm{e}_{a}^{2}\;\;n_{b} = \bm{e}_{b}^{2}\;\;n_{m} = \bm{e}_{m}^{2}\;\;\alpha = \bm{e}_{a}\cdot\bm{e}_{b} \end{equation*} -\begin{equation*} \mbox{Rotor in }\bm{e}_{a}\bm{e}_{m}\mbox{ plane } R_{a} = c_{a} + s_{a} \boldsymbol{e}_{a}\wedge \boldsymbol{e}_{m} \end{equation*} -\begin{equation*} \mbox{Rotor in }\bm{e}_{m}\bm{e}_{b}\mbox{ plane } R_{b} = c_{b} + s_{b} \boldsymbol{e}_{m}\wedge \boldsymbol{e}_{b} \end{equation*} -\begin{equation*} R_{a}R_{b} = S+\bm{B} = \left ( \alpha n_{m} s_{a} s_{b} + c_{a} c_{b}\right ) + c_{b} s_{a} \boldsymbol{e}_{a}\wedge \boldsymbol{e}_{m} + n_{m} s_{a} s_{b} \boldsymbol{e}_{a}\wedge \boldsymbol{e}_{b} + c_{a} s_{b} \boldsymbol{e}_{m}\wedge \boldsymbol{e}_{b} \end{equation*} -\begin{equation*} \bm{B} = c_{b} s_{a} \boldsymbol{e}_{a}\wedge \boldsymbol{e}_{m} + n_{m} s_{a} s_{b} \boldsymbol{e}_{a}\wedge \boldsymbol{e}_{b} + c_{a} s_{b} \boldsymbol{e}_{m}\wedge \boldsymbol{e}_{b} \end{equation*} -\begin{equation*} S^{2} = \left(\alpha n_{m} s_{a} s_{b} + c_{a} c_{b}\right)^{2} \end{equation*} -\begin{equation*} \bm{B}^{2} = \alpha ^{2} {\left ( n_{m} \right )}^{2} {\left ( s_{a} \right )}^{2} {\left ( s_{b} \right )}^{2} + 2 \alpha c_{a} c_{b} n_{m} s_{a} s_{b} - {\left ( c_{a} \right )}^{2} n_{b} n_{m} {\left ( s_{b} \right )}^{2} - {\left ( c_{b} \right )}^{2} n_{a} n_{m} {\left ( s_{a} \right )}^{2} - n_{a} n_{b} {\left ( n_{m} \right )}^{2} {\left ( s_{a} \right )}^{2} {\left ( s_{b} \right )}^{2} \end{equation*} -\begin{equation*} S^{2}-B^{2} = {\left ( c_{a} \right )}^{2} {\left ( c_{b} \right )}^{2} + {\left ( c_{a} \right )}^{2} n_{b} n_{m} {\left ( s_{b} \right )}^{2} + {\left ( c_{b} \right )}^{2} n_{a} n_{m} {\left ( s_{a} \right )}^{2} + n_{a} n_{b} {\left ( n_{m} \right )}^{2} {\left ( s_{a} \right )}^{2} {\left ( s_{b} \right )}^{2} \end{equation*} -\begin{equation*} S^{2}-B^{2} = {\left ( c_{a} \right )}^{2} {\left ( c_{b} \right )}^{2} + {\left ( c_{a} \right )}^{2} n_{b} n_{m} {\left ( s_{b} \right )}^{2} + {\left ( c_{b} \right )}^{2} n_{a} n_{m} {\left ( s_{a} \right )}^{2} + n_{a} n_{b} {\left ( s_{a} \right )}^{2} {\left ( s_{b} \right )}^{2} \end{equation*} -Consider all combinations of $\bm{e}_{a}^{2}$, $\bm{e}_{b}^{2}$ and $\bm{e}_{m}^2$: -\begin{equation*} \left [ \bm{e}_{a}^{2},\bm{e}_{b}^{2},\bm{e}_{m}^2\right ] = [-1, -1, -1] \end{equation*} -\begin{equation*} S^{2}-\bm{B}^{2} = {\sin{\left (\theta _{a} \right )}}^{2} {\sin{\left (\theta _{b} \right )}}^{2} + {\sin{\left (\theta _{a} \right )}}^{2} {\cos{\left (\theta _{b} \right )}}^{2} + {\sin{\left (\theta _{b} \right )}}^{2} {\cos{\left (\theta _{a} \right )}}^{2} + {\cos{\left (\theta _{a} \right )}}^{2} {\cos{\left (\theta _{b} \right )}}^{2} = 1 \end{equation*} -\begin{equation*} \left [ \bm{e}_{a}^{2},\bm{e}_{b}^{2},\bm{e}_{m}^2\right ] = [-1, -1, 1] \end{equation*} -\begin{equation*} S^{2}-\bm{B}^{2} = {\sinh{\left (\theta _{a} \right )}}^{2} {\sinh{\left (\theta _{b} \right )}}^{2} - {\sinh{\left (\theta _{a} \right )}}^{2} {\cosh{\left (\theta _{b} \right )}}^{2} - {\sinh{\left (\theta _{b} \right )}}^{2} {\cosh{\left (\theta _{a} \right )}}^{2} + {\cosh{\left (\theta _{a} \right )}}^{2} {\cosh{\left (\theta _{b} \right )}}^{2} = 1 \end{equation*} -\begin{equation*} \left [ \bm{e}_{a}^{2},\bm{e}_{b}^{2},\bm{e}_{m}^2\right ] = [-1, 1, -1] \end{equation*} -\begin{equation*} S^{2}-\bm{B}^{2} = - {\sin{\left (\theta _{a} \right )}}^{2} {\sinh{\left (\theta _{b} \right )}}^{2} + {\sin{\left (\theta _{a} \right )}}^{2} {\cosh{\left (\theta _{b} \right )}}^{2} - {\cos{\left (\theta _{a} \right )}}^{2} {\sinh{\left (\theta _{b} \right )}}^{2} + {\cos{\left (\theta _{a} \right )}}^{2} {\cosh{\left (\theta _{b} \right )}}^{2} = 1 \end{equation*} -\begin{equation*} \left [ \bm{e}_{a}^{2},\bm{e}_{b}^{2},\bm{e}_{m}^2\right ] = [-1, 1, 1] \end{equation*} -\begin{equation*} S^{2}-\bm{B}^{2} = - {\sin{\left (\theta _{b} \right )}}^{2} {\sinh{\left (\theta _{a} \right )}}^{2} + {\sin{\left (\theta _{b} \right )}}^{2} {\cosh{\left (\theta _{a} \right )}}^{2} - {\cos{\left (\theta _{b} \right )}}^{2} {\sinh{\left (\theta _{a} \right )}}^{2} + {\cos{\left (\theta _{b} \right )}}^{2} {\cosh{\left (\theta _{a} \right )}}^{2} = 1 \end{equation*} -\begin{equation*} \left [ \bm{e}_{a}^{2},\bm{e}_{b}^{2},\bm{e}_{m}^2\right ] = [1, -1, -1] \end{equation*} -\begin{equation*} S^{2}-\bm{B}^{2} = - {\sin{\left (\theta _{b} \right )}}^{2} {\sinh{\left (\theta _{a} \right )}}^{2} + {\sin{\left (\theta _{b} \right )}}^{2} {\cosh{\left (\theta _{a} \right )}}^{2} - {\cos{\left (\theta _{b} \right )}}^{2} {\sinh{\left (\theta _{a} \right )}}^{2} + {\cos{\left (\theta _{b} \right )}}^{2} {\cosh{\left (\theta _{a} \right )}}^{2} = 1 \end{equation*} -\begin{equation*} \left [ \bm{e}_{a}^{2},\bm{e}_{b}^{2},\bm{e}_{m}^2\right ] = [1, -1, 1] \end{equation*} -\begin{equation*} S^{2}-\bm{B}^{2} = - {\sin{\left (\theta _{a} \right )}}^{2} {\sinh{\left (\theta _{b} \right )}}^{2} + {\sin{\left (\theta _{a} \right )}}^{2} {\cosh{\left (\theta _{b} \right )}}^{2} - {\cos{\left (\theta _{a} \right )}}^{2} {\sinh{\left (\theta _{b} \right )}}^{2} + {\cos{\left (\theta _{a} \right )}}^{2} {\cosh{\left (\theta _{b} \right )}}^{2} = 1 \end{equation*} -\begin{equation*} \left [ \bm{e}_{a}^{2},\bm{e}_{b}^{2},\bm{e}_{m}^2\right ] = [1, 1, -1] \end{equation*} -\begin{equation*} S^{2}-\bm{B}^{2} = {\sinh{\left (\theta _{a} \right )}}^{2} {\sinh{\left (\theta _{b} \right )}}^{2} - {\sinh{\left (\theta _{a} \right )}}^{2} {\cosh{\left (\theta _{b} \right )}}^{2} - {\sinh{\left (\theta _{b} \right )}}^{2} {\cosh{\left (\theta _{a} \right )}}^{2} + {\cosh{\left (\theta _{a} \right )}}^{2} {\cosh{\left (\theta _{b} \right )}}^{2} = 1 \end{equation*} -\begin{equation*} \left [ \bm{e}_{a}^{2},\bm{e}_{b}^{2},\bm{e}_{m}^2\right ] = [1, 1, 1] \end{equation*} -\begin{equation*} S^{2}-\bm{B}^{2} = {\sin{\left (\theta _{a} \right )}}^{2} {\sin{\left (\theta _{b} \right )}}^{2} + {\sin{\left (\theta _{a} \right )}}^{2} {\cos{\left (\theta _{b} \right )}}^{2} + {\sin{\left (\theta _{b} \right )}}^{2} {\cos{\left (\theta _{a} \right )}}^{2} + {\cos{\left (\theta _{a} \right )}}^{2} {\cos{\left (\theta _{b} \right )}}^{2} = 1 \end{equation*} -Thus we have shown that $R_{a}R_{b} = S+\bm{D} = e^{\bm{C}}$ where $\bm{C}$ is a bivector blade. -\end{document} diff --git a/examples/LaTeX/latex_check.py b/examples/LaTeX/latex_check.py index 448cdf0f..34c33ef7 100644 --- a/examples/LaTeX/latex_check.py +++ b/examples/LaTeX/latex_check.py @@ -231,7 +231,7 @@ def noneuclidian_distance_calculation(): W = W.subs(c**2,(C+1)/2) W = W.subs(s**2,(C-1)/2) W = simplify(W) - W = W.subs(1/Binv,Bmag) + W = W.subs(Binv,1/Bmag) W = expand(W) print('#%S = \\f{\\sinh}{\\alpha} \\text{ and } C = \\f{\\cosh}{\\alpha}') diff --git a/examples/LaTeX/simple_check_latex.py b/examples/LaTeX/simple_check_latex.py index 866ee775..50946077 100644 --- a/examples/LaTeX/simple_check_latex.py +++ b/examples/LaTeX/simple_check_latex.py @@ -58,7 +58,7 @@ def main(): basic_multivector_operations_2D() # xpdf('simple_test_latex.tex') - xpdf('simple_test_latex.tex', pdfprog=None) + xpdf('simple_check_latex.tex', pdfprog=None) return if __name__ == "__main__": diff --git a/examples/Old Format/latex_check.py b/examples/Old Format/latex_check.py index 9fe312e3..3d2ec70b 100644 --- a/examples/Old Format/latex_check.py +++ b/examples/Old Format/latex_check.py @@ -219,7 +219,7 @@ def noneuclidian_distance_calculation(): W = W.subs(c**2,(C+1)/2) W = W.subs(s**2,(C-1)/2) W = simplify(W) - W = W.subs(1/Binv,Bmag) + W = W.subs(Binv,1/Bmag) W = expand(W) print('#%S = \\f{\\sinh}{\\alpha} \\text{ and } C = \\f{\\cosh}{\\alpha}') diff --git a/examples/Terminal/rotations.py b/examples/Terminal/rotations.py index c732e2be..e4536515 100644 --- a/examples/Terminal/rotations.py +++ b/examples/Terminal/rotations.py @@ -53,8 +53,8 @@ def main(): R_th = cos(th/2)+I*e_phi*sin(th/2) R_th_rev = R_th.rev() - print(R_th) - print(R_th_rev) + print(R_th.trigsimp()) + print(R_th_rev.trigsimp()) e_r = (R_th*R_phi*ex*R_phi_rev*R_th_rev).trigsimp() diff --git a/examples/Terminal/terminal_check.py b/examples/Terminal/terminal_check.py index f4b360f0..55a051ac 100755 --- a/examples/Terminal/terminal_check.py +++ b/examples/Terminal/terminal_check.py @@ -228,7 +228,7 @@ def noneuclidian_distance_calculation(): W = W.subs(c**2,(C+1)/2) W = W.subs(s**2,(C-1)/2) W = simplify(W) - W = W.subs(1/Binv,Bmag) + W = W.subs(Binv,1/Bmag) W = expand(W) print('S = sinh(alpha) and C = cosh(alpha)') diff --git a/examples/ipython/LaTeX.ipynb b/examples/ipython/LaTeX.ipynb index 2bc8dfe4..1411aa61 100644 --- a/examples/ipython/LaTeX.ipynb +++ b/examples/ipython/LaTeX.ipynb @@ -6,2769 +6,2612 @@ "metadata": {}, "outputs": [], "source": [ - "%cd -q ../LaTeX" + "import subprocess\n", + "import sys\n", + "import os\n", + "from IPython.display import display_pretty\n", + "\n", + "os.chdir('../LaTeX')\n", + "\n", + "def check(name):\n", + " # todo: use subprocess.run once we drop Python 2.7\n", + " p = subprocess.Popen([sys.executable, name + '.py'], stderr=subprocess.PIPE, universal_newlines=True)\n", + " try:\n", + " stdout, stderr = p.communicate()\n", + " except:\n", + " p.kill()\n", + " if p.poll():\n", + " raise RuntimeError(\"The script raised an exception:\\n\\n\" + stderr)\n", + "\n", + " with open(name + '.tex', 'r') as f:\n", + " # can't use display.Latex here, it would result in CSS comparisons in the output.\n", + " \n", + " # using `display` forces this to be a separate output to any stdout from above.\n", + " display_pretty(f.read(), raw=True)" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, - "outputs": [], - "source": [ - "!python 4Derr.py" - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "metadata": {}, "outputs": [ { - "name": "stdout", - "output_type": "stream", - "text": [ - "\r\n", - "\\documentclass[10pt,fleqn]{report}\r\n", - "\\usepackage[vcentering]{geometry}\r\n", - "\\geometry{papersize={14in,11in},total={13in,10in}}\r\n", - "\r\n", - "\\pagestyle{empty}\r\n", - "\\usepackage[latin1]{inputenc}\r\n", - "\\usepackage{amsmath}\r\n", - "\\usepackage{amsfonts}\r\n", - "\\usepackage{amssymb}\r\n", - "\\usepackage{amsbsy}\r\n", - "\\usepackage{tensor}\r\n", - "\\usepackage{listings}\r\n", - "\\usepackage{color}\r\n", - "\\usepackage{xcolor}\r\n", - "\\usepackage{bm}\r\n", - "\\usepackage{breqn}\r\n", - "\\definecolor{gray}{rgb}{0.95,0.95,0.95}\r\n", - "\\setlength{\\parindent}{0pt}\r\n", - "\\DeclareMathOperator{\\Tr}{Tr}\r\n", - "\\DeclareMathOperator{\\Adj}{Adj}\r\n", - "\\newcommand{\\bfrac}[2]{\\displaystyle\\frac{#1}{#2}}\r\n", - "\\newcommand{\\lp}{\\left (}\r\n", - "\\newcommand{\\rp}{\\right )}\r\n", - "\\newcommand{\\paren}[1]{\\lp {#1} \\rp}\r\n", - "\\newcommand{\\half}{\\frac{1}{2}}\r\n", - "\\newcommand{\\llt}{\\left <}\r\n", - "\\newcommand{\\rgt}{\\right >}\r\n", - "\\newcommand{\\abs}[1]{\\left |{#1}\\right | }\r\n", - "\\newcommand{\\pdiff}[2]{\\bfrac{\\partial {#1}}{\\partial {#2}}}\r\n", - "\\newcommand{\\lbrc}{\\left \\{}\r\n", - "\\newcommand{\\rbrc}{\\right \\}}\r\n", - "\\newcommand{\\W}{\\wedge}\r\n", - "\\newcommand{\\prm}[1]{{#1}'}\r\n", - "\\newcommand{\\ddt}[1]{\\bfrac{d{#1}}{dt}}\r\n", - "\\newcommand{\\R}{\\dagger}\r\n", - "\\newcommand{\\deriv}[3]{\\bfrac{d^{#3}#1}{d{#2}^{#3}}}\r\n", - "\\newcommand{\\grade}[1]{\\left < {#1} \\right >}\r\n", - "\\newcommand{\\f}[2]{{#1}\\lp{#2}\\rp}\r\n", - "\\newcommand{\\eval}[2]{\\left . {#1} \\right |_{#2}}\r\n", - "\\newcommand{\\Nabla}{\\boldsymbol{\\nabla}}\r\n", - "\\newcommand{\\eb}{\\boldsymbol{e}}\r\n", - "\\usepackage{float}\r\n", - "\\floatstyle{plain} % optionally change the style of the new float\r\n", - "\\newfloat{Code}{H}{myc}\r\n", - "\\lstloadlanguages{Python}\r\n", - "\r\n", - "\\begin{document}\r\n", - "\\begin{equation*} g_{ii} = \\left [ \\begin{array}{cccc} 0 & 0 & 1 & 0 \\\\ 0 & 0 & 0 & 1 \\\\ 1 & 0 & 0 & 0 \\\\ 0 & 1 & 0 & 0 \\end{array}\\right ] \\end{equation*}\r\n", - "\\begin{equation*} x_1\\rfloor x_1== 1 \\end{equation*}\r\n", - "\\begin{equation*} x_1\\rfloor x_2== 0 \\end{equation*}\r\n", - "\\begin{equation*} x_2\\rfloor x_1== 0 \\end{equation*}\r\n", - "\\begin{equation*} x_2\\rfloor x_2== 1 \\end{equation*}\r\n", - "$-\\infty < v < \\infty$\r\n", - "\\begin{equation*} (-v (x_1\\W x_2)/2) \\cdot exp()== \\cos{\\left (\\frac{\\left|{v}\\right|}{2} \\right )} - \\frac{v \\sin{\\left (\\frac{\\left|{v}\\right|}{2} \\right )}}{2 \\left|{v}\\right|} \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{2} - \\frac{v \\sin{\\left (\\frac{\\left|{v}\\right|}{2} \\right )}}{2 \\left|{v}\\right|} \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{4} + \\frac{v \\sin{\\left (\\frac{\\left|{v}\\right|}{2} \\right )}}{2 \\left|{v}\\right|} \\boldsymbol{e}_{2}\\wedge \\boldsymbol{e}_{3} - \\frac{v \\sin{\\left (\\frac{\\left|{v}\\right|}{2} \\right )}}{2 \\left|{v}\\right|} \\boldsymbol{e}_{3}\\wedge \\boldsymbol{e}_{4} \\end{equation*}\r\n", - "$0\\le v < \\infty$\r\n", - "\\begin{equation*} (-v (x_1\\W x_2)/2) \\cdot exp()== \\cos{\\left (\\frac{v}{2} \\right )} - \\frac{\\sin{\\left (\\frac{v}{2} \\right )}}{2} \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{2} - \\frac{\\sin{\\left (\\frac{v}{2} \\right )}}{2} \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{4} + \\frac{\\sin{\\left (\\frac{v}{2} \\right )}}{2} \\boldsymbol{e}_{2}\\wedge \\boldsymbol{e}_{3} - \\frac{\\sin{\\left (\\frac{v}{2} \\right )}}{2} \\boldsymbol{e}_{3}\\wedge \\boldsymbol{e}_{4} \\end{equation*}\r\n", - "\\end{document}\r\n" - ] + "data": { + "text/plain": [ + "\n", + "\\documentclass[10pt,fleqn]{report}\n", + "\\usepackage[vcentering]{geometry}\n", + "\\geometry{papersize={14in,11in},total={13in,10in}}\n", + "\n", + "\\pagestyle{empty}\n", + "\\usepackage[latin1]{inputenc}\n", + "\\usepackage{amsmath}\n", + "\\usepackage{amsfonts}\n", + "\\usepackage{amssymb}\n", + "\\usepackage{amsbsy}\n", + "\\usepackage{tensor}\n", + "\\usepackage{listings}\n", + "\\usepackage{color}\n", + "\\usepackage{xcolor}\n", + "\\usepackage{bm}\n", + "\\usepackage{breqn}\n", + "\\definecolor{gray}{rgb}{0.95,0.95,0.95}\n", + "\\setlength{\\parindent}{0pt}\n", + "\\DeclareMathOperator{\\Tr}{Tr}\n", + "\\DeclareMathOperator{\\Adj}{Adj}\n", + "\\newcommand{\\bfrac}[2]{\\displaystyle\\frac{#1}{#2}}\n", + "\\newcommand{\\lp}{\\left (}\n", + "\\newcommand{\\rp}{\\right )}\n", + "\\newcommand{\\paren}[1]{\\lp {#1} \\rp}\n", + "\\newcommand{\\half}{\\frac{1}{2}}\n", + "\\newcommand{\\llt}{\\left <}\n", + "\\newcommand{\\rgt}{\\right >}\n", + "\\newcommand{\\abs}[1]{\\left |{#1}\\right | }\n", + "\\newcommand{\\pdiff}[2]{\\bfrac{\\partial {#1}}{\\partial {#2}}}\n", + "\\newcommand{\\lbrc}{\\left \\{}\n", + "\\newcommand{\\rbrc}{\\right \\}}\n", + "\\newcommand{\\W}{\\wedge}\n", + "\\newcommand{\\prm}[1]{{#1}'}\n", + "\\newcommand{\\ddt}[1]{\\bfrac{d{#1}}{dt}}\n", + "\\newcommand{\\R}{\\dagger}\n", + "\\newcommand{\\deriv}[3]{\\bfrac{d^{#3}#1}{d{#2}^{#3}}}\n", + "\\newcommand{\\grade}[1]{\\left < {#1} \\right >}\n", + "\\newcommand{\\f}[2]{{#1}\\lp{#2}\\rp}\n", + "\\newcommand{\\eval}[2]{\\left . {#1} \\right |_{#2}}\n", + "\\newcommand{\\Nabla}{\\boldsymbol{\\nabla}}\n", + "\\newcommand{\\eb}{\\boldsymbol{e}}\n", + "\\usepackage{float}\n", + "\\floatstyle{plain} % optionally change the style of the new float\n", + "\\newfloat{Code}{H}{myc}\n", + "\\lstloadlanguages{Python}\n", + "\n", + "\\begin{document}\n", + "\\begin{equation*} g_{ii} = \\left [ \\begin{array}{cccc} 0 & 0 & 1 & 0 \\\\ 0 & 0 & 0 & 1 \\\\ 1 & 0 & 0 & 0 \\\\ 0 & 1 & 0 & 0 \\end{array}\\right ] \\end{equation*}\n", + "\\begin{equation*} x_1\\rfloor x_1== 1 \\end{equation*}\n", + "\\begin{equation*} x_1\\rfloor x_2== 0 \\end{equation*}\n", + "\\begin{equation*} x_2\\rfloor x_1== 0 \\end{equation*}\n", + "\\begin{equation*} x_2\\rfloor x_2== 1 \\end{equation*}\n", + "$-\\infty < v < \\infty$\n", + "\\begin{equation*} (-v (x_1\\W x_2)/2) \\cdot exp()== \\cos{\\left (\\frac{\\left|{v}\\right|}{2} \\right )} - \\frac{v \\sin{\\left (\\frac{\\left|{v}\\right|}{2} \\right )}}{2 \\left|{v}\\right|} \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{2} - \\frac{v \\sin{\\left (\\frac{\\left|{v}\\right|}{2} \\right )}}{2 \\left|{v}\\right|} \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{4} + \\frac{v \\sin{\\left (\\frac{\\left|{v}\\right|}{2} \\right )}}{2 \\left|{v}\\right|} \\boldsymbol{e}_{2}\\wedge \\boldsymbol{e}_{3} - \\frac{v \\sin{\\left (\\frac{\\left|{v}\\right|}{2} \\right )}}{2 \\left|{v}\\right|} \\boldsymbol{e}_{3}\\wedge \\boldsymbol{e}_{4} \\end{equation*}\n", + "$0\\le v < \\infty$\n", + "\\begin{equation*} (-v (x_1\\W x_2)/2) \\cdot exp()== \\cos{\\left (\\frac{v}{2} \\right )} - \\frac{\\sin{\\left (\\frac{v}{2} \\right )}}{2} \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{2} - \\frac{\\sin{\\left (\\frac{v}{2} \\right )}}{2} \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{4} + \\frac{\\sin{\\left (\\frac{v}{2} \\right )}}{2} \\boldsymbol{e}_{2}\\wedge \\boldsymbol{e}_{3} - \\frac{\\sin{\\left (\\frac{v}{2} \\right )}}{2} \\boldsymbol{e}_{3}\\wedge \\boldsymbol{e}_{4} \\end{equation*}\n", + "\\end{document}\n" + ] + }, + "metadata": {}, + "output_type": "display_data" } ], "source": [ - "!cat 4Derr.tex" + "check('4Derr')" ] }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 3, "metadata": {}, - "outputs": [], - "source": [ - "!python curvi_linear_latex.py" - ] - }, - { - "cell_type": "code", - "execution_count": 5, - "metadata": { - "collapsed": false, - "scrolled": false - }, "outputs": [ { - "name": "stdout", - "output_type": "stream", - "text": [ - "\r\n", - "\\documentclass[10pt,fleqn]{report}\r\n", - "\\usepackage[vcentering]{geometry}\r\n", - "\\geometry{papersize={14in,11in},total={13in,10in}}\r\n", - "\r\n", - "\\pagestyle{empty}\r\n", - "\\usepackage[latin1]{inputenc}\r\n", - "\\usepackage{amsmath}\r\n", - "\\usepackage{amsfonts}\r\n", - "\\usepackage{amssymb}\r\n", - "\\usepackage{amsbsy}\r\n", - "\\usepackage{tensor}\r\n", - "\\usepackage{listings}\r\n", - "\\usepackage{color}\r\n", - "\\usepackage{xcolor}\r\n", - "\\usepackage{bm}\r\n", - "\\usepackage{breqn}\r\n", - "\\definecolor{gray}{rgb}{0.95,0.95,0.95}\r\n", - "\\setlength{\\parindent}{0pt}\r\n", - "\\DeclareMathOperator{\\Tr}{Tr}\r\n", - "\\DeclareMathOperator{\\Adj}{Adj}\r\n", - "\\newcommand{\\bfrac}[2]{\\displaystyle\\frac{#1}{#2}}\r\n", - "\\newcommand{\\lp}{\\left (}\r\n", - "\\newcommand{\\rp}{\\right )}\r\n", - "\\newcommand{\\paren}[1]{\\lp {#1} \\rp}\r\n", - "\\newcommand{\\half}{\\frac{1}{2}}\r\n", - "\\newcommand{\\llt}{\\left <}\r\n", - "\\newcommand{\\rgt}{\\right >}\r\n", - "\\newcommand{\\abs}[1]{\\left |{#1}\\right | }\r\n", - "\\newcommand{\\pdiff}[2]{\\bfrac{\\partial {#1}}{\\partial {#2}}}\r\n", - "\\newcommand{\\lbrc}{\\left \\{}\r\n", - "\\newcommand{\\rbrc}{\\right \\}}\r\n", - "\\newcommand{\\W}{\\wedge}\r\n", - "\\newcommand{\\prm}[1]{{#1}'}\r\n", - "\\newcommand{\\ddt}[1]{\\bfrac{d{#1}}{dt}}\r\n", - "\\newcommand{\\R}{\\dagger}\r\n", - "\\newcommand{\\deriv}[3]{\\bfrac{d^{#3}#1}{d{#2}^{#3}}}\r\n", - "\\newcommand{\\grade}[1]{\\left < {#1} \\right >}\r\n", - "\\newcommand{\\f}[2]{{#1}\\lp{#2}\\rp}\r\n", - "\\newcommand{\\eval}[2]{\\left . {#1} \\right |_{#2}}\r\n", - "\\newcommand{\\Nabla}{\\boldsymbol{\\nabla}}\r\n", - "\\newcommand{\\eb}{\\boldsymbol{e}}\r\n", - "\\usepackage{float}\r\n", - "\\floatstyle{plain} % optionally change the style of the new float\r\n", - "\\newfloat{Code}{H}{myc}\r\n", - "\\lstloadlanguages{Python}\r\n", - "\r\n", - "\\begin{document}\r\n", - "\\begin{equation*} f = f \\end{equation*}\r\n", - "\\begin{equation*} A = A^{r} \\boldsymbol{e}_{r} + A^{\\theta } \\boldsymbol{e}_{\\theta } + A^{\\phi } \\boldsymbol{e}_{\\phi } \\end{equation*}\r\n", - "\\begin{equation*} B = B^{r\\theta } \\boldsymbol{e}_{r}\\wedge \\boldsymbol{e}_{\\theta } + B^{r\\phi } \\boldsymbol{e}_{r}\\wedge \\boldsymbol{e}_{\\phi } + B^{\\theta \\phi } \\boldsymbol{e}_{\\theta }\\wedge \\boldsymbol{e}_{\\phi } \\end{equation*}\r\n", - "\\begin{equation*} \\boldsymbol{\\nabla} f = \\partial_{r} f \\boldsymbol{e}_{r} + \\frac{\\partial_{\\theta } f }{r^{2}} \\boldsymbol{e}_{\\theta } + \\frac{\\partial_{\\phi } f }{r^{2} {\\sin{\\left (\\theta \\right )}}^{2}} \\boldsymbol{e}_{\\phi } \\end{equation*}\r\n", - "\\begin{equation*} \\boldsymbol{\\nabla} \\cdot A = \\frac{A^{\\theta } }{\\tan{\\left (\\theta \\right )}} + \\partial_{\\phi } A^{\\phi } + \\partial_{r} A^{r} + \\partial_{\\theta } A^{\\theta } + \\frac{2 A^{r} }{r} \\end{equation*}\r\n", - "\\begin{equation*} \\boldsymbol{\\nabla} \\times A = -I (\\boldsymbol{\\nabla} \\W A) = \\left(\\frac{2 A^{\\phi } }{\\tan{\\left (\\theta \\right )}} + \\partial_{\\theta } A^{\\phi } - \\frac{\\partial_{\\phi } A^{\\theta } }{{\\sin{\\left (\\theta \\right )}}^{2}}\\right) \\left|{\\sin{\\left (\\theta \\right )}}\\right| \\boldsymbol{e}_{r} + \\frac{- r^{2} {\\sin{\\left (\\theta \\right )}}^{2} \\partial_{r} A^{\\phi } - 2 r A^{\\phi } {\\sin{\\left (\\theta \\right )}}^{2} + \\partial_{\\phi } A^{r} }{r^{2} \\left|{\\sin{\\left (\\theta \\right )}}\\right|} \\boldsymbol{e}_{\\theta } + \\frac{r^{2} \\partial_{r} A^{\\theta } + 2 r A^{\\theta } - \\partial_{\\theta } A^{r} }{r^{2} \\left|{\\sin{\\left (\\theta \\right )}}\\right|} \\boldsymbol{e}_{\\phi } \\end{equation*}\r\n", - "\\begin{equation*} \\nabla^{2}f = \\frac{r^{2} \\partial^{2}_{r} f + 2 r \\partial_{r} f + \\partial^{2}_{\\theta } f + \\frac{\\partial_{\\theta } f }{\\tan{\\left (\\theta \\right )}} + \\frac{\\partial^{2}_{\\phi } f }{{\\sin{\\left (\\theta \\right )}}^{2}}}{r^{2}} \\end{equation*}\r\n", - "\\begin{equation*} \\boldsymbol{\\nabla} \\W B = \\frac{r^{2} \\partial_{r} B^{\\theta \\phi } + 4 r B^{\\theta \\phi } - \\frac{2 B^{r\\phi } }{\\tan{\\left (\\theta \\right )}} - \\partial_{\\theta } B^{r\\phi } + \\frac{\\partial_{\\phi } B^{r\\theta } }{{\\sin{\\left (\\theta \\right )}}^{2}}}{r^{2}} \\boldsymbol{e}_{r}\\wedge \\boldsymbol{e}_{\\theta }\\wedge \\boldsymbol{e}_{\\phi } \\end{equation*}\r\n", - "Derivatives in Paraboloidal Coordinates\r\n", - "\\begin{equation*} f = f \\end{equation*}\r\n", - "\\begin{equation*} A = A^{u} \\boldsymbol{e}_{u} + A^{v} \\boldsymbol{e}_{v} + A^{\\phi } \\boldsymbol{e}_{\\phi } \\end{equation*}\r\n", - "\\begin{equation*} B = B^{uv} \\boldsymbol{e}_{u}\\wedge \\boldsymbol{e}_{v} + B^{u\\phi } \\boldsymbol{e}_{u}\\wedge \\boldsymbol{e}_{\\phi } + B^{v\\phi } \\boldsymbol{e}_{v}\\wedge \\boldsymbol{e}_{\\phi } \\end{equation*}\r\n", - "\\begin{equation*} \\boldsymbol{\\nabla} f = \\frac{\\partial_{u} f }{\\sqrt{u^{2} + v^{2}}} \\boldsymbol{e}_{u} + \\frac{\\partial_{v} f }{\\sqrt{u^{2} + v^{2}}} \\boldsymbol{e}_{v} + \\frac{\\partial_{\\phi } f }{u v} \\boldsymbol{e}_{\\phi } \\end{equation*}\r\n", - "\\begin{equation*} \\boldsymbol{\\nabla} \\cdot A = \\frac{u A^{u} }{\\left(u^{2} + v^{2}\\right)^{\\frac{3}{2}}} + \\frac{v A^{v} }{\\left(u^{2} + v^{2}\\right)^{\\frac{3}{2}}} + \\frac{\\partial_{u} A^{u} }{\\sqrt{u^{2} + v^{2}}} + \\frac{\\partial_{v} A^{v} }{\\sqrt{u^{2} + v^{2}}} + \\frac{A^{v} }{v \\sqrt{u^{2} + v^{2}}} + \\frac{A^{u} }{u \\sqrt{u^{2} + v^{2}}} + \\frac{\\partial_{\\phi } A^{\\phi } }{u v} \\end{equation*}\r\n", - "\\begin{equation*} \\boldsymbol{\\nabla} \\W B = \\left ( \\frac{u B^{v\\phi } }{\\left(u^{2} + v^{2}\\right)^{\\frac{3}{2}}} - \\frac{v B^{u\\phi } }{\\left(u^{2} + v^{2}\\right)^{\\frac{3}{2}}} - \\frac{\\partial_{v} B^{u\\phi } }{\\sqrt{u^{2} + v^{2}}} + \\frac{\\partial_{u} B^{v\\phi } }{\\sqrt{u^{2} + v^{2}}} - \\frac{B^{u\\phi } }{v \\sqrt{u^{2} + v^{2}}} + \\frac{B^{v\\phi } }{u \\sqrt{u^{2} + v^{2}}} + \\frac{\\partial_{\\phi } B^{uv} }{u v}\\right ) \\boldsymbol{e}_{u}\\wedge \\boldsymbol{e}_{v}\\wedge \\boldsymbol{e}_{\\phi } \\end{equation*}\r\n", - "\\begin{equation*} f = f \\end{equation*}\r\n", - " \\begin{align*} A = & A^{\\xi } \\boldsymbol{e}_{\\xi } \\\\ & + A^{\\eta } \\boldsymbol{e}_{\\eta } \\\\ & + A^{\\phi } \\boldsymbol{e}_{\\phi } \\end{align*} \r\n", - " \\begin{align*} B = & B^{\\xi \\eta } \\boldsymbol{e}_{\\xi }\\wedge \\boldsymbol{e}_{\\eta } \\\\ & + B^{\\xi \\phi } \\boldsymbol{e}_{\\xi }\\wedge \\boldsymbol{e}_{\\phi } \\\\ & + B^{\\eta \\phi } \\boldsymbol{e}_{\\eta }\\wedge \\boldsymbol{e}_{\\phi } \\end{align*} \r\n", - " \\begin{align*} \\boldsymbol{\\nabla} f = & \\frac{\\partial_{\\xi } f }{\\sqrt{{\\sin{\\left (\\eta \\right )}}^{2} + {\\sinh{\\left (\\xi \\right )}}^{2}} \\left|{a}\\right|} \\boldsymbol{e}_{\\xi } \\\\ & + \\frac{\\partial_{\\eta } f }{\\sqrt{{\\sin{\\left (\\eta \\right )}}^{2} + {\\sinh{\\left (\\xi \\right )}}^{2}} \\left|{a}\\right|} \\boldsymbol{e}_{\\eta } \\\\ & + \\frac{\\partial_{\\phi } f }{a \\sin{\\left (\\eta \\right )} \\sinh{\\left (\\xi \\right )}} \\boldsymbol{e}_{\\phi } \\end{align*} \r\n", - "\\begin{equation*} \\boldsymbol{\\nabla} \\cdot A = \\frac{a \\left({\\sin{\\left (\\eta \\right )}}^{2} + {\\sinh{\\left (\\xi \\right )}}^{2}\\right)^{3} \\partial_{\\phi } A^{\\phi } + \\frac{\\left(A^{\\eta } \\sin{\\left (2 \\eta \\right )} + A^{\\xi } \\sinh{\\left (2 \\xi \\right )}\\right) \\left({\\sin{\\left (\\eta \\right )}}^{2} + {\\sinh{\\left (\\xi \\right )}}^{2}\\right)^{\\frac{3}{2}} \\sin{\\left (\\eta \\right )} \\sinh{\\left (\\xi \\right )} \\left|{a}\\right|}{2} + \\left({\\sin{\\left (\\eta \\right )}}^{2} + {\\sinh{\\left (\\xi \\right )}}^{2}\\right)^{\\frac{5}{2}} \\left(\\partial_{\\eta } A^{\\eta } + \\partial_{\\xi } A^{\\xi } \\right) \\sin{\\left (\\eta \\right )} \\sinh{\\left (\\xi \\right )} \\left|{a}\\right| + \\left({\\sin{\\left (\\eta \\right )}}^{2} + {\\sinh{\\left (\\xi \\right )}}^{2}\\right)^{\\frac{5}{2}} A^{\\eta } \\cos{\\left (\\eta \\right )} \\sinh{\\left (\\xi \\right )} \\left|{a}\\right| + \\left({\\sin{\\left (\\eta \\right )}}^{2} + {\\sinh{\\left (\\xi \\right )}}^{2}\\right)^{\\frac{5}{2}} A^{\\xi } \\sin{\\left (\\eta \\right )} \\cosh{\\left (\\xi \\right )} \\left|{a}\\right|}{a^{2} \\left({\\sin{\\left (\\eta \\right )}}^{2} + {\\sinh{\\left (\\xi \\right )}}^{2}\\right)^{3} \\sin{\\left (\\eta \\right )} \\sinh{\\left (\\xi \\right )}} \\end{equation*}\r\n", - "\\end{document}\r\n" - ] + "data": { + "text/plain": [ + "\n", + "\\documentclass[10pt,fleqn]{report}\n", + "\\usepackage[vcentering]{geometry}\n", + "\\geometry{papersize={14in,11in},total={13in,10in}}\n", + "\n", + "\\pagestyle{empty}\n", + "\\usepackage[latin1]{inputenc}\n", + "\\usepackage{amsmath}\n", + "\\usepackage{amsfonts}\n", + "\\usepackage{amssymb}\n", + "\\usepackage{amsbsy}\n", + "\\usepackage{tensor}\n", + "\\usepackage{listings}\n", + "\\usepackage{color}\n", + "\\usepackage{xcolor}\n", + "\\usepackage{bm}\n", + "\\usepackage{breqn}\n", + "\\definecolor{gray}{rgb}{0.95,0.95,0.95}\n", + "\\setlength{\\parindent}{0pt}\n", + "\\DeclareMathOperator{\\Tr}{Tr}\n", + "\\DeclareMathOperator{\\Adj}{Adj}\n", + "\\newcommand{\\bfrac}[2]{\\displaystyle\\frac{#1}{#2}}\n", + "\\newcommand{\\lp}{\\left (}\n", + "\\newcommand{\\rp}{\\right )}\n", + "\\newcommand{\\paren}[1]{\\lp {#1} \\rp}\n", + "\\newcommand{\\half}{\\frac{1}{2}}\n", + "\\newcommand{\\llt}{\\left <}\n", + "\\newcommand{\\rgt}{\\right >}\n", + "\\newcommand{\\abs}[1]{\\left |{#1}\\right | }\n", + "\\newcommand{\\pdiff}[2]{\\bfrac{\\partial {#1}}{\\partial {#2}}}\n", + "\\newcommand{\\lbrc}{\\left \\{}\n", + "\\newcommand{\\rbrc}{\\right \\}}\n", + "\\newcommand{\\W}{\\wedge}\n", + "\\newcommand{\\prm}[1]{{#1}'}\n", + "\\newcommand{\\ddt}[1]{\\bfrac{d{#1}}{dt}}\n", + "\\newcommand{\\R}{\\dagger}\n", + "\\newcommand{\\deriv}[3]{\\bfrac{d^{#3}#1}{d{#2}^{#3}}}\n", + "\\newcommand{\\grade}[1]{\\left < {#1} \\right >}\n", + "\\newcommand{\\f}[2]{{#1}\\lp{#2}\\rp}\n", + "\\newcommand{\\eval}[2]{\\left . {#1} \\right |_{#2}}\n", + "\\newcommand{\\Nabla}{\\boldsymbol{\\nabla}}\n", + "\\newcommand{\\eb}{\\boldsymbol{e}}\n", + "\\usepackage{float}\n", + "\\floatstyle{plain} % optionally change the style of the new float\n", + "\\newfloat{Code}{H}{myc}\n", + "\\lstloadlanguages{Python}\n", + "\n", + "\\begin{document}\n", + "\\begin{equation*} f = f \\end{equation*}\n", + "\\begin{equation*} A = A^{r} \\boldsymbol{e}_{r} + A^{\\theta } \\boldsymbol{e}_{\\theta } + A^{\\phi } \\boldsymbol{e}_{\\phi } \\end{equation*}\n", + "\\begin{equation*} B = B^{r\\theta } \\boldsymbol{e}_{r}\\wedge \\boldsymbol{e}_{\\theta } + B^{r\\phi } \\boldsymbol{e}_{r}\\wedge \\boldsymbol{e}_{\\phi } + B^{\\theta \\phi } \\boldsymbol{e}_{\\theta }\\wedge \\boldsymbol{e}_{\\phi } \\end{equation*}\n", + "\\begin{equation*} \\boldsymbol{\\nabla} f = \\partial_{r} f \\boldsymbol{e}_{r} + \\frac{\\partial_{\\theta } f }{r^{2}} \\boldsymbol{e}_{\\theta } + \\frac{\\partial_{\\phi } f }{r^{2} {\\sin{\\left (\\theta \\right )}}^{2}} \\boldsymbol{e}_{\\phi } \\end{equation*}\n", + "\\begin{equation*} \\boldsymbol{\\nabla} \\cdot A = \\frac{A^{\\theta } }{\\tan{\\left (\\theta \\right )}} + \\partial_{\\phi } A^{\\phi } + \\partial_{r} A^{r} + \\partial_{\\theta } A^{\\theta } + \\frac{2 A^{r} }{r} \\end{equation*}\n", + "\\begin{equation*} \\boldsymbol{\\nabla} \\times A = -I (\\boldsymbol{\\nabla} \\W A) = \\left(\\frac{2 A^{\\phi } }{\\tan{\\left (\\theta \\right )}} + \\partial_{\\theta } A^{\\phi } - \\frac{\\partial_{\\phi } A^{\\theta } }{{\\sin{\\left (\\theta \\right )}}^{2}}\\right) \\left|{\\sin{\\left (\\theta \\right )}}\\right| \\boldsymbol{e}_{r} + \\frac{- r^{2} {\\sin{\\left (\\theta \\right )}}^{2} \\partial_{r} A^{\\phi } - 2 r A^{\\phi } {\\sin{\\left (\\theta \\right )}}^{2} + \\partial_{\\phi } A^{r} }{r^{2} \\left|{\\sin{\\left (\\theta \\right )}}\\right|} \\boldsymbol{e}_{\\theta } + \\frac{r^{2} \\partial_{r} A^{\\theta } + 2 r A^{\\theta } - \\partial_{\\theta } A^{r} }{r^{2} \\left|{\\sin{\\left (\\theta \\right )}}\\right|} \\boldsymbol{e}_{\\phi } \\end{equation*}\n", + "\\begin{equation*} \\nabla^{2}f = \\frac{r^{2} \\partial^{2}_{r} f + 2 r \\partial_{r} f + \\partial^{2}_{\\theta } f + \\frac{\\partial_{\\theta } f }{\\tan{\\left (\\theta \\right )}} + \\frac{\\partial^{2}_{\\phi } f }{{\\sin{\\left (\\theta \\right )}}^{2}}}{r^{2}} \\end{equation*}\n", + "\\begin{equation*} \\boldsymbol{\\nabla} \\W B = \\frac{r^{2} \\partial_{r} B^{\\theta \\phi } + 4 r B^{\\theta \\phi } - \\frac{2 B^{r\\phi } }{\\tan{\\left (\\theta \\right )}} - \\partial_{\\theta } B^{r\\phi } + \\frac{\\partial_{\\phi } B^{r\\theta } }{{\\sin{\\left (\\theta \\right )}}^{2}}}{r^{2}} \\boldsymbol{e}_{r}\\wedge \\boldsymbol{e}_{\\theta }\\wedge \\boldsymbol{e}_{\\phi } \\end{equation*}\n", + "Derivatives in Paraboloidal Coordinates\n", + "\\begin{equation*} f = f \\end{equation*}\n", + "\\begin{equation*} A = A^{u} \\boldsymbol{e}_{u} + A^{v} \\boldsymbol{e}_{v} + A^{\\phi } \\boldsymbol{e}_{\\phi } \\end{equation*}\n", + "\\begin{equation*} B = B^{uv} \\boldsymbol{e}_{u}\\wedge \\boldsymbol{e}_{v} + B^{u\\phi } \\boldsymbol{e}_{u}\\wedge \\boldsymbol{e}_{\\phi } + B^{v\\phi } \\boldsymbol{e}_{v}\\wedge \\boldsymbol{e}_{\\phi } \\end{equation*}\n", + "\\begin{equation*} \\boldsymbol{\\nabla} f = \\frac{\\partial_{u} f }{\\sqrt{u^{2} + v^{2}}} \\boldsymbol{e}_{u} + \\frac{\\partial_{v} f }{\\sqrt{u^{2} + v^{2}}} \\boldsymbol{e}_{v} + \\frac{\\partial_{\\phi } f }{u v} \\boldsymbol{e}_{\\phi } \\end{equation*}\n", + "\\begin{equation*} \\boldsymbol{\\nabla} \\cdot A = \\frac{u A^{u} }{\\left(u^{2} + v^{2}\\right)^{\\frac{3}{2}}} + \\frac{v A^{v} }{\\left(u^{2} + v^{2}\\right)^{\\frac{3}{2}}} + \\frac{\\partial_{u} A^{u} }{\\sqrt{u^{2} + v^{2}}} + \\frac{\\partial_{v} A^{v} }{\\sqrt{u^{2} + v^{2}}} + \\frac{A^{v} }{v \\sqrt{u^{2} + v^{2}}} + \\frac{A^{u} }{u \\sqrt{u^{2} + v^{2}}} + \\frac{\\partial_{\\phi } A^{\\phi } }{u v} \\end{equation*}\n", + "\\begin{equation*} \\boldsymbol{\\nabla} \\W B = \\left ( \\frac{u B^{v\\phi } }{\\left(u^{2} + v^{2}\\right)^{\\frac{3}{2}}} - \\frac{v B^{u\\phi } }{\\left(u^{2} + v^{2}\\right)^{\\frac{3}{2}}} - \\frac{\\partial_{v} B^{u\\phi } }{\\sqrt{u^{2} + v^{2}}} + \\frac{\\partial_{u} B^{v\\phi } }{\\sqrt{u^{2} + v^{2}}} - \\frac{B^{u\\phi } }{v \\sqrt{u^{2} + v^{2}}} + \\frac{B^{v\\phi } }{u \\sqrt{u^{2} + v^{2}}} + \\frac{\\partial_{\\phi } B^{uv} }{u v}\\right ) \\boldsymbol{e}_{u}\\wedge \\boldsymbol{e}_{v}\\wedge \\boldsymbol{e}_{\\phi } \\end{equation*}\n", + "\\begin{equation*} f = f \\end{equation*}\n", + " \\begin{align*} A = & A^{\\xi } \\boldsymbol{e}_{\\xi } \\\\ & + A^{\\eta } \\boldsymbol{e}_{\\eta } \\\\ & + A^{\\phi } \\boldsymbol{e}_{\\phi } \\end{align*} \n", + " \\begin{align*} B = & B^{\\xi \\eta } \\boldsymbol{e}_{\\xi }\\wedge \\boldsymbol{e}_{\\eta } \\\\ & + B^{\\xi \\phi } \\boldsymbol{e}_{\\xi }\\wedge \\boldsymbol{e}_{\\phi } \\\\ & + B^{\\eta \\phi } \\boldsymbol{e}_{\\eta }\\wedge \\boldsymbol{e}_{\\phi } \\end{align*} \n", + " \\begin{align*} \\boldsymbol{\\nabla} f = & \\frac{\\partial_{\\xi } f }{\\sqrt{{\\sin{\\left (\\eta \\right )}}^{2} + {\\sinh{\\left (\\xi \\right )}}^{2}} \\left|{a}\\right|} \\boldsymbol{e}_{\\xi } \\\\ & + \\frac{\\partial_{\\eta } f }{\\sqrt{{\\sin{\\left (\\eta \\right )}}^{2} + {\\sinh{\\left (\\xi \\right )}}^{2}} \\left|{a}\\right|} \\boldsymbol{e}_{\\eta } \\\\ & + \\frac{\\partial_{\\phi } f }{a \\sin{\\left (\\eta \\right )} \\sinh{\\left (\\xi \\right )}} \\boldsymbol{e}_{\\phi } \\end{align*} \n", + "\\begin{equation*} \\boldsymbol{\\nabla} \\cdot A = \\frac{a \\left({\\sin{\\left (\\eta \\right )}}^{2} + {\\sinh{\\left (\\xi \\right )}}^{2}\\right)^{3} \\partial_{\\phi } A^{\\phi } + \\frac{\\left(A^{\\eta } \\sin{\\left (2 \\eta \\right )} + A^{\\xi } \\sinh{\\left (2 \\xi \\right )}\\right) \\left({\\sin{\\left (\\eta \\right )}}^{2} + {\\sinh{\\left (\\xi \\right )}}^{2}\\right)^{\\frac{3}{2}} \\sin{\\left (\\eta \\right )} \\sinh{\\left (\\xi \\right )} \\left|{a}\\right|}{2} + \\left({\\sin{\\left (\\eta \\right )}}^{2} + {\\sinh{\\left (\\xi \\right )}}^{2}\\right)^{\\frac{5}{2}} \\left(\\partial_{\\eta } A^{\\eta } + \\partial_{\\xi } A^{\\xi } \\right) \\sin{\\left (\\eta \\right )} \\sinh{\\left (\\xi \\right )} \\left|{a}\\right| + \\left({\\sin{\\left (\\eta \\right )}}^{2} + {\\sinh{\\left (\\xi \\right )}}^{2}\\right)^{\\frac{5}{2}} A^{\\eta } \\cos{\\left (\\eta \\right )} \\sinh{\\left (\\xi \\right )} \\left|{a}\\right| + \\left({\\sin{\\left (\\eta \\right )}}^{2} + {\\sinh{\\left (\\xi \\right )}}^{2}\\right)^{\\frac{5}{2}} A^{\\xi } \\sin{\\left (\\eta \\right )} \\cosh{\\left (\\xi \\right )} \\left|{a}\\right|}{a^{2} \\left({\\sin{\\left (\\eta \\right )}}^{2} + {\\sinh{\\left (\\xi \\right )}}^{2}\\right)^{3} \\sin{\\left (\\eta \\right )} \\sinh{\\left (\\xi \\right )}} \\end{equation*}\n", + "\\end{document}\n" + ] + }, + "metadata": {}, + "output_type": "display_data" } ], "source": [ - "!cat curvi_linear_latex.tex" + "check('curvi_linear_latex')" ] }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 4, "metadata": {}, - "outputs": [], - "source": [ - "!python dchk.py" - ] - }, - { - "cell_type": "code", - "execution_count": 7, - "metadata": { - "collapsed": false, - "scrolled": false - }, "outputs": [ { - "name": "stdout", - "output_type": "stream", - "text": [ - "\r\n", - "\\documentclass[10pt,fleqn]{report}\r\n", - "\\usepackage[vcentering]{geometry}\r\n", - "\\geometry{papersize={14in,11in},total={13in,10in}}\r\n", - "\r\n", - "\\pagestyle{empty}\r\n", - "\\usepackage[latin1]{inputenc}\r\n", - "\\usepackage{amsmath}\r\n", - "\\usepackage{amsfonts}\r\n", - "\\usepackage{amssymb}\r\n", - "\\usepackage{amsbsy}\r\n", - "\\usepackage{tensor}\r\n", - "\\usepackage{listings}\r\n", - "\\usepackage{color}\r\n", - "\\usepackage{xcolor}\r\n", - "\\usepackage{bm}\r\n", - "\\usepackage{breqn}\r\n", - "\\definecolor{gray}{rgb}{0.95,0.95,0.95}\r\n", - "\\setlength{\\parindent}{0pt}\r\n", - "\\DeclareMathOperator{\\Tr}{Tr}\r\n", - "\\DeclareMathOperator{\\Adj}{Adj}\r\n", - "\\newcommand{\\bfrac}[2]{\\displaystyle\\frac{#1}{#2}}\r\n", - "\\newcommand{\\lp}{\\left (}\r\n", - "\\newcommand{\\rp}{\\right )}\r\n", - "\\newcommand{\\paren}[1]{\\lp {#1} \\rp}\r\n", - "\\newcommand{\\half}{\\frac{1}{2}}\r\n", - "\\newcommand{\\llt}{\\left <}\r\n", - "\\newcommand{\\rgt}{\\right >}\r\n", - "\\newcommand{\\abs}[1]{\\left |{#1}\\right | }\r\n", - "\\newcommand{\\pdiff}[2]{\\bfrac{\\partial {#1}}{\\partial {#2}}}\r\n", - "\\newcommand{\\lbrc}{\\left \\{}\r\n", - "\\newcommand{\\rbrc}{\\right \\}}\r\n", - "\\newcommand{\\W}{\\wedge}\r\n", - "\\newcommand{\\prm}[1]{{#1}'}\r\n", - "\\newcommand{\\ddt}[1]{\\bfrac{d{#1}}{dt}}\r\n", - "\\newcommand{\\R}{\\dagger}\r\n", - "\\newcommand{\\deriv}[3]{\\bfrac{d^{#3}#1}{d{#2}^{#3}}}\r\n", - "\\newcommand{\\grade}[1]{\\left < {#1} \\right >}\r\n", - "\\newcommand{\\f}[2]{{#1}\\lp{#2}\\rp}\r\n", - "\\newcommand{\\eval}[2]{\\left . {#1} \\right |_{#2}}\r\n", - "\\newcommand{\\Nabla}{\\boldsymbol{\\nabla}}\r\n", - "\\newcommand{\\eb}{\\boldsymbol{e}}\r\n", - "\\usepackage{float}\r\n", - "\\floatstyle{plain} % optionally change the style of the new float\r\n", - "\\newfloat{Code}{H}{myc}\r\n", - "\\lstloadlanguages{Python}\r\n", - "\r\n", - "\\begin{document}\r\n", - "\\begin{equation*} \\left [ \\begin{array}{ccc} \\left ( e_{a}\\cdot e_{a}\\right ) & 0 & \\left ( e_{a}\\cdot e_{b}\\right ) \\\\ 0 & \\left ( e_{ab}\\cdot e_{ab}\\right ) & 0 \\\\ \\left ( e_{a}\\cdot e_{b}\\right ) & 0 & \\left ( e_{b}\\cdot e_{b}\\right ) \\end{array}\\right ] \\end{equation*}\r\n", - "\\begin{equation*} v^{a} \\boldsymbol{e}_{a} + v^{ab} \\boldsymbol{e}_{ab} + v^{b} \\boldsymbol{e}_{b} \\end{equation*}\r\n", - "\\begin{equation*} B^{aab} \\boldsymbol{e}_{a}\\wedge \\boldsymbol{e}_{ab} + B^{ab} \\boldsymbol{e}_{a}\\wedge \\boldsymbol{e}_{b} + B^{abb} \\boldsymbol{e}_{ab}\\wedge \\boldsymbol{e}_{b} \\end{equation*}\r\n", - "\\end{document}\r\n" - ] + "data": { + "text/plain": [ + "\n", + "\\documentclass[10pt,fleqn]{report}\n", + "\\usepackage[vcentering]{geometry}\n", + "\\geometry{papersize={14in,11in},total={13in,10in}}\n", + "\n", + "\\pagestyle{empty}\n", + "\\usepackage[latin1]{inputenc}\n", + "\\usepackage{amsmath}\n", + "\\usepackage{amsfonts}\n", + "\\usepackage{amssymb}\n", + "\\usepackage{amsbsy}\n", + "\\usepackage{tensor}\n", + "\\usepackage{listings}\n", + "\\usepackage{color}\n", + "\\usepackage{xcolor}\n", + "\\usepackage{bm}\n", + "\\usepackage{breqn}\n", + "\\definecolor{gray}{rgb}{0.95,0.95,0.95}\n", + "\\setlength{\\parindent}{0pt}\n", + "\\DeclareMathOperator{\\Tr}{Tr}\n", + "\\DeclareMathOperator{\\Adj}{Adj}\n", + "\\newcommand{\\bfrac}[2]{\\displaystyle\\frac{#1}{#2}}\n", + "\\newcommand{\\lp}{\\left (}\n", + "\\newcommand{\\rp}{\\right )}\n", + "\\newcommand{\\paren}[1]{\\lp {#1} \\rp}\n", + "\\newcommand{\\half}{\\frac{1}{2}}\n", + "\\newcommand{\\llt}{\\left <}\n", + "\\newcommand{\\rgt}{\\right >}\n", + "\\newcommand{\\abs}[1]{\\left |{#1}\\right | }\n", + "\\newcommand{\\pdiff}[2]{\\bfrac{\\partial {#1}}{\\partial {#2}}}\n", + "\\newcommand{\\lbrc}{\\left \\{}\n", + "\\newcommand{\\rbrc}{\\right \\}}\n", + "\\newcommand{\\W}{\\wedge}\n", + "\\newcommand{\\prm}[1]{{#1}'}\n", + "\\newcommand{\\ddt}[1]{\\bfrac{d{#1}}{dt}}\n", + "\\newcommand{\\R}{\\dagger}\n", + "\\newcommand{\\deriv}[3]{\\bfrac{d^{#3}#1}{d{#2}^{#3}}}\n", + "\\newcommand{\\grade}[1]{\\left < {#1} \\right >}\n", + "\\newcommand{\\f}[2]{{#1}\\lp{#2}\\rp}\n", + "\\newcommand{\\eval}[2]{\\left . {#1} \\right |_{#2}}\n", + "\\newcommand{\\Nabla}{\\boldsymbol{\\nabla}}\n", + "\\newcommand{\\eb}{\\boldsymbol{e}}\n", + "\\usepackage{float}\n", + "\\floatstyle{plain} % optionally change the style of the new float\n", + "\\newfloat{Code}{H}{myc}\n", + "\\lstloadlanguages{Python}\n", + "\n", + "\\begin{document}\n", + "\\begin{equation*} \\left [ \\begin{array}{ccc} \\left ( e_{a}\\cdot e_{a}\\right ) & 0 & \\left ( e_{a}\\cdot e_{b}\\right ) \\\\ 0 & \\left ( e_{ab}\\cdot e_{ab}\\right ) & 0 \\\\ \\left ( e_{a}\\cdot e_{b}\\right ) & 0 & \\left ( e_{b}\\cdot e_{b}\\right ) \\end{array}\\right ] \\end{equation*}\n", + "\\begin{equation*} v^{a} \\boldsymbol{e}_{a} + v^{ab} \\boldsymbol{e}_{ab} + v^{b} \\boldsymbol{e}_{b} \\end{equation*}\n", + "\\begin{equation*} B^{aab} \\boldsymbol{e}_{a}\\wedge \\boldsymbol{e}_{ab} + B^{ab} \\boldsymbol{e}_{a}\\wedge \\boldsymbol{e}_{b} + B^{abb} \\boldsymbol{e}_{ab}\\wedge \\boldsymbol{e}_{b} \\end{equation*}\n", + "\\end{document}\n" + ] + }, + "metadata": {}, + "output_type": "display_data" } ], "source": [ - "!cat dchk.tex" - ] - }, - { - "cell_type": "code", - "execution_count": 8, - "metadata": {}, - "outputs": [], - "source": [ - "!python diffeq_sys.py" + "check('dchk')" ] }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 5, "metadata": {}, "outputs": [ { - "name": "stdout", - "output_type": "stream", - "text": [ - "\r\n", - "\\documentclass[10pt,fleqn]{report}\r\n", - "\\usepackage[vcentering]{geometry}\r\n", - "\\geometry{papersize={14in,11in},total={13in,10in}}\r\n", - "\r\n", - "\\pagestyle{empty}\r\n", - "\\usepackage[latin1]{inputenc}\r\n", - "\\usepackage{amsmath}\r\n", - "\\usepackage{amsfonts}\r\n", - "\\usepackage{amssymb}\r\n", - "\\usepackage{amsbsy}\r\n", - "\\usepackage{tensor}\r\n", - "\\usepackage{listings}\r\n", - "\\usepackage{color}\r\n", - "\\usepackage{xcolor}\r\n", - "\\usepackage{bm}\r\n", - "\\usepackage{breqn}\r\n", - "\\definecolor{gray}{rgb}{0.95,0.95,0.95}\r\n", - "\\setlength{\\parindent}{0pt}\r\n", - "\\DeclareMathOperator{\\Tr}{Tr}\r\n", - "\\DeclareMathOperator{\\Adj}{Adj}\r\n", - "\\newcommand{\\bfrac}[2]{\\displaystyle\\frac{#1}{#2}}\r\n", - "\\newcommand{\\lp}{\\left (}\r\n", - "\\newcommand{\\rp}{\\right )}\r\n", - "\\newcommand{\\paren}[1]{\\lp {#1} \\rp}\r\n", - "\\newcommand{\\half}{\\frac{1}{2}}\r\n", - "\\newcommand{\\llt}{\\left <}\r\n", - "\\newcommand{\\rgt}{\\right >}\r\n", - "\\newcommand{\\abs}[1]{\\left |{#1}\\right | }\r\n", - "\\newcommand{\\pdiff}[2]{\\bfrac{\\partial {#1}}{\\partial {#2}}}\r\n", - "\\newcommand{\\lbrc}{\\left \\{}\r\n", - "\\newcommand{\\rbrc}{\\right \\}}\r\n", - "\\newcommand{\\W}{\\wedge}\r\n", - "\\newcommand{\\prm}[1]{{#1}'}\r\n", - "\\newcommand{\\ddt}[1]{\\bfrac{d{#1}}{dt}}\r\n", - "\\newcommand{\\R}{\\dagger}\r\n", - "\\newcommand{\\deriv}[3]{\\bfrac{d^{#3}#1}{d{#2}^{#3}}}\r\n", - "\\newcommand{\\grade}[1]{\\left < {#1} \\right >}\r\n", - "\\newcommand{\\f}[2]{{#1}\\lp{#2}\\rp}\r\n", - "\\newcommand{\\eval}[2]{\\left . {#1} \\right |_{#2}}\r\n", - "\\newcommand{\\Nabla}{\\boldsymbol{\\nabla}}\r\n", - "\\newcommand{\\eb}{\\boldsymbol{e}}\r\n", - "\\usepackage{float}\r\n", - "\\floatstyle{plain} % optionally change the style of the new float\r\n", - "\\newfloat{Code}{H}{myc}\r\n", - "\\lstloadlanguages{Python}\r\n", - "\r\n", - "\\begin{document}\r\n", - "\\\\begin{lstlisting}[language=Python,showspaces=false,showstringspaces=false,backgroundcolor=\\color{gray},frame=single]\r\n", - "def main():\r\n", - " Print_Function()\r\n", - " (a, b, c) = abc = symbols('a,b,c',real=True)\r\n", - " (o3d, ea, eb, ec) = Ga.build('e_a e_b e_c', g=[1, 1, 1], coords=abc)\r\n", - " grad = o3d.grad\r\n", - " x = symbols('x',real=True)\r\n", - " A = o3d.lt([[x*a*c**2,x**2*a*b*c,x**2*a**3*b**5],\\\r\n", - " [x**3*a**2*b*c,x**4*a*b**2*c**5,5*x**4*a*b**2*c],\\\r\n", - " [x**4*a*b**2*c**4,4*x**4*a*b**2*c**2,4*x**4*a**5*b**2*c]])\r\n", - " print('A =',A)\r\n", - " v = a*ea+b*eb+c*ec\r\n", - " print('v =',v)\r\n", - " f = v|A(v)\r\n", - " print(r'%f = v\\cdot \\f{A}{v} =',f)\r\n", - " (grad * f).Fmt(3,r'%\\nabla f')\r\n", - " Av = A(v)\r\n", - " print(r'%\\f{A}{v} =', Av)\r\n", - " (grad * Av).Fmt(3,r'%\\nabla \\f{A}{v}')\r\n", - " return\r\n", - "\\end{lstlisting}\r\n", - "Code Output:\r\n", - "\\begin{equation*} A = \\left \\{ \\begin{array}{ll} L \\left ( \\boldsymbol{e}_{a}\\right ) =& a c^{2} x \\boldsymbol{e}_{a} + a b c x^{2} \\boldsymbol{e}_{b} + a^{3} b^{5} x^{2} \\boldsymbol{e}_{c} \\\\ L \\left ( \\boldsymbol{e}_{b}\\right ) =& a^{2} b c x^{3} \\boldsymbol{e}_{a} + a b^{2} c^{5} x^{4} \\boldsymbol{e}_{b} + 5 a b^{2} c x^{4} \\boldsymbol{e}_{c} \\\\ L \\left ( \\boldsymbol{e}_{c}\\right ) =& a b^{2} c^{4} x^{4} \\boldsymbol{e}_{a} + 4 a b^{2} c^{2} x^{4} \\boldsymbol{e}_{b} + 4 a^{5} b^{2} c x^{4} \\boldsymbol{e}_{c} \\end{array} \\right \\} \\end{equation*}\r\n", - "\\begin{equation*} v = a \\boldsymbol{e}_{a} + b \\boldsymbol{e}_{b} + c \\boldsymbol{e}_{c} \\end{equation*}\r\n", - "\\begin{equation*} f = v\\cdot \\f{A}{v} = a c x \\left(4 a^{4} b^{2} c^{2} x^{3} + a^{3} b^{5} x + a^{2} b^{2} x^{2} + a^{2} c + a b^{2} c^{4} x^{3} + a b^{2} x + b^{4} c^{4} x^{3} + 4 b^{3} c^{2} x^{3} + 5 b^{3} c x^{3}\\right) \\end{equation*}\r\n", - " \\begin{align*} \\f{A}{v} = & a c x \\left(a b^{2} x^{2} + a c + b^{2} c^{4} x^{3}\\right) \\boldsymbol{e}_{a} \\\\ & + a b c x^{2} \\left(a + b^{2} c^{4} x^{2} + 4 b c^{2} x^{2}\\right) \\boldsymbol{e}_{b} \\\\ & + a b^{2} x^{2} \\left(4 a^{4} c^{2} x^{2} + a^{3} b^{3} + 5 b c x^{2}\\right) \\boldsymbol{e}_{c} \\end{align*} \r\n", - "\r\n", - "\\end{document}\r\n" - ] + "data": { + "text/plain": [ + "\n", + "\\documentclass[10pt,fleqn]{report}\n", + "\\usepackage[vcentering]{geometry}\n", + "\\geometry{papersize={14in,11in},total={13in,10in}}\n", + "\n", + "\\pagestyle{empty}\n", + "\\usepackage[latin1]{inputenc}\n", + "\\usepackage{amsmath}\n", + "\\usepackage{amsfonts}\n", + "\\usepackage{amssymb}\n", + "\\usepackage{amsbsy}\n", + "\\usepackage{tensor}\n", + "\\usepackage{listings}\n", + "\\usepackage{color}\n", + "\\usepackage{xcolor}\n", + "\\usepackage{bm}\n", + "\\usepackage{breqn}\n", + "\\definecolor{gray}{rgb}{0.95,0.95,0.95}\n", + "\\setlength{\\parindent}{0pt}\n", + "\\DeclareMathOperator{\\Tr}{Tr}\n", + "\\DeclareMathOperator{\\Adj}{Adj}\n", + "\\newcommand{\\bfrac}[2]{\\displaystyle\\frac{#1}{#2}}\n", + "\\newcommand{\\lp}{\\left (}\n", + "\\newcommand{\\rp}{\\right )}\n", + "\\newcommand{\\paren}[1]{\\lp {#1} \\rp}\n", + "\\newcommand{\\half}{\\frac{1}{2}}\n", + "\\newcommand{\\llt}{\\left <}\n", + "\\newcommand{\\rgt}{\\right >}\n", + "\\newcommand{\\abs}[1]{\\left |{#1}\\right | }\n", + "\\newcommand{\\pdiff}[2]{\\bfrac{\\partial {#1}}{\\partial {#2}}}\n", + "\\newcommand{\\lbrc}{\\left \\{}\n", + "\\newcommand{\\rbrc}{\\right \\}}\n", + "\\newcommand{\\W}{\\wedge}\n", + "\\newcommand{\\prm}[1]{{#1}'}\n", + "\\newcommand{\\ddt}[1]{\\bfrac{d{#1}}{dt}}\n", + "\\newcommand{\\R}{\\dagger}\n", + "\\newcommand{\\deriv}[3]{\\bfrac{d^{#3}#1}{d{#2}^{#3}}}\n", + "\\newcommand{\\grade}[1]{\\left < {#1} \\right >}\n", + "\\newcommand{\\f}[2]{{#1}\\lp{#2}\\rp}\n", + "\\newcommand{\\eval}[2]{\\left . {#1} \\right |_{#2}}\n", + "\\newcommand{\\Nabla}{\\boldsymbol{\\nabla}}\n", + "\\newcommand{\\eb}{\\boldsymbol{e}}\n", + "\\usepackage{float}\n", + "\\floatstyle{plain} % optionally change the style of the new float\n", + "\\newfloat{Code}{H}{myc}\n", + "\\lstloadlanguages{Python}\n", + "\n", + "\\begin{document}\n", + "\\\\begin{lstlisting}[language=Python,showspaces=false,showstringspaces=false,backgroundcolor=\\color{gray},frame=single]\n", + "def main():\n", + " Print_Function()\n", + " (a, b, c) = abc = symbols('a,b,c',real=True)\n", + " (o3d, ea, eb, ec) = Ga.build('e_a e_b e_c', g=[1, 1, 1], coords=abc)\n", + " grad = o3d.grad\n", + " x = symbols('x',real=True)\n", + " A = o3d.lt([[x*a*c**2,x**2*a*b*c,x**2*a**3*b**5],\\\n", + " [x**3*a**2*b*c,x**4*a*b**2*c**5,5*x**4*a*b**2*c],\\\n", + " [x**4*a*b**2*c**4,4*x**4*a*b**2*c**2,4*x**4*a**5*b**2*c]])\n", + " print('A =',A)\n", + " v = a*ea+b*eb+c*ec\n", + " print('v =',v)\n", + " f = v|A(v)\n", + " print(r'%f = v\\cdot \\f{A}{v} =',f)\n", + " (grad * f).Fmt(3,r'%\\nabla f')\n", + " Av = A(v)\n", + " print(r'%\\f{A}{v} =', Av)\n", + " (grad * Av).Fmt(3,r'%\\nabla \\f{A}{v}')\n", + " return\n", + "\\end{lstlisting}\n", + "Code Output:\n", + "\\begin{equation*} A = \\left \\{ \\begin{array}{ll} L \\left ( \\boldsymbol{e}_{a}\\right ) =& a c^{2} x \\boldsymbol{e}_{a} + a b c x^{2} \\boldsymbol{e}_{b} + a^{3} b^{5} x^{2} \\boldsymbol{e}_{c} \\\\ L \\left ( \\boldsymbol{e}_{b}\\right ) =& a^{2} b c x^{3} \\boldsymbol{e}_{a} + a b^{2} c^{5} x^{4} \\boldsymbol{e}_{b} + 5 a b^{2} c x^{4} \\boldsymbol{e}_{c} \\\\ L \\left ( \\boldsymbol{e}_{c}\\right ) =& a b^{2} c^{4} x^{4} \\boldsymbol{e}_{a} + 4 a b^{2} c^{2} x^{4} \\boldsymbol{e}_{b} + 4 a^{5} b^{2} c x^{4} \\boldsymbol{e}_{c} \\end{array} \\right \\} \\end{equation*}\n", + "\\begin{equation*} v = a \\boldsymbol{e}_{a} + b \\boldsymbol{e}_{b} + c \\boldsymbol{e}_{c} \\end{equation*}\n", + "\\begin{equation*} f = v\\cdot \\f{A}{v} = a c x \\left(4 a^{4} b^{2} c^{2} x^{3} + a^{3} b^{5} x + a^{2} b^{2} x^{2} + a^{2} c + a b^{2} c^{4} x^{3} + a b^{2} x + b^{4} c^{4} x^{3} + 4 b^{3} c^{2} x^{3} + 5 b^{3} c x^{3}\\right) \\end{equation*}\n", + " \\begin{align*} \\f{A}{v} = & a c x \\left(a b^{2} x^{2} + a c + b^{2} c^{4} x^{3}\\right) \\boldsymbol{e}_{a} \\\\ & + a b c x^{2} \\left(a + b^{2} c^{4} x^{2} + 4 b c^{2} x^{2}\\right) \\boldsymbol{e}_{b} \\\\ & + a b^{2} x^{2} \\left(4 a^{4} c^{2} x^{2} + a^{3} b^{3} + 5 b c x^{2}\\right) \\boldsymbol{e}_{c} \\end{align*} \n", + "\n", + "\\end{document}\n" + ] + }, + "metadata": {}, + "output_type": "display_data" } ], "source": [ - "!cat diffeq_sys.tex" - ] - }, - { - "cell_type": "code", - "execution_count": 10, - "metadata": {}, - "outputs": [], - "source": [ - "!python dirac_derive.py" + "check('diffeq_sys')" ] }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 6, "metadata": {}, "outputs": [ { - "name": "stdout", - "output_type": "stream", - "text": [ - "\r\n", - "\\documentclass[10pt,fleqn]{report}\r\n", - "\\usepackage[vcentering]{geometry}\r\n", - "\\geometry{papersize={14in,11in},total={13in,10in}}\r\n", - "\r\n", - "\\pagestyle{empty}\r\n", - "\\usepackage[latin1]{inputenc}\r\n", - "\\usepackage{amsmath}\r\n", - "\\usepackage{amsfonts}\r\n", - "\\usepackage{amssymb}\r\n", - "\\usepackage{amsbsy}\r\n", - "\\usepackage{tensor}\r\n", - "\\usepackage{listings}\r\n", - "\\usepackage{color}\r\n", - "\\usepackage{xcolor}\r\n", - "\\usepackage{bm}\r\n", - "\\usepackage{breqn}\r\n", - "\\definecolor{gray}{rgb}{0.95,0.95,0.95}\r\n", - "\\setlength{\\parindent}{0pt}\r\n", - "\\DeclareMathOperator{\\Tr}{Tr}\r\n", - "\\DeclareMathOperator{\\Adj}{Adj}\r\n", - "\\newcommand{\\bfrac}[2]{\\displaystyle\\frac{#1}{#2}}\r\n", - "\\newcommand{\\lp}{\\left (}\r\n", - "\\newcommand{\\rp}{\\right )}\r\n", - "\\newcommand{\\paren}[1]{\\lp {#1} \\rp}\r\n", - "\\newcommand{\\half}{\\frac{1}{2}}\r\n", - "\\newcommand{\\llt}{\\left <}\r\n", - "\\newcommand{\\rgt}{\\right >}\r\n", - "\\newcommand{\\abs}[1]{\\left |{#1}\\right | }\r\n", - "\\newcommand{\\pdiff}[2]{\\bfrac{\\partial {#1}}{\\partial {#2}}}\r\n", - "\\newcommand{\\lbrc}{\\left \\{}\r\n", - "\\newcommand{\\rbrc}{\\right \\}}\r\n", - "\\newcommand{\\W}{\\wedge}\r\n", - "\\newcommand{\\prm}[1]{{#1}'}\r\n", - "\\newcommand{\\ddt}[1]{\\bfrac{d{#1}}{dt}}\r\n", - "\\newcommand{\\R}{\\dagger}\r\n", - "\\newcommand{\\deriv}[3]{\\bfrac{d^{#3}#1}{d{#2}^{#3}}}\r\n", - "\\newcommand{\\grade}[1]{\\left < {#1} \\right >}\r\n", - "\\newcommand{\\f}[2]{{#1}\\lp{#2}\\rp}\r\n", - "\\newcommand{\\eval}[2]{\\left . {#1} \\right |_{#2}}\r\n", - "\\newcommand{\\Nabla}{\\boldsymbol{\\nabla}}\r\n", - "\\newcommand{\\eb}{\\boldsymbol{e}}\r\n", - "\\usepackage{float}\r\n", - "\\floatstyle{plain} % optionally change the style of the new float\r\n", - "\\newfloat{Code}{H}{myc}\r\n", - "\\lstloadlanguages{Python}\r\n", - "\r\n", - "\\begin{document}\r\n", - "\\begin{equation*} \\psi + \\psi ^{01} \\boldsymbol{\\gamma }_{0}\\wedge \\boldsymbol{\\gamma }_{1} + \\psi ^{02} \\boldsymbol{\\gamma }_{0}\\wedge \\boldsymbol{\\gamma }_{2} + \\psi ^{03} \\boldsymbol{\\gamma }_{0}\\wedge \\boldsymbol{\\gamma }_{3} + \\psi ^{12} \\boldsymbol{\\gamma }_{1}\\wedge \\boldsymbol{\\gamma }_{2} + \\psi ^{13} \\boldsymbol{\\gamma }_{1}\\wedge \\boldsymbol{\\gamma }_{3} + \\psi ^{23} \\boldsymbol{\\gamma }_{2}\\wedge \\boldsymbol{\\gamma }_{3} + \\psi ^{0123} \\boldsymbol{\\gamma }_{0}\\wedge \\boldsymbol{\\gamma }_{1}\\wedge \\boldsymbol{\\gamma }_{2}\\wedge \\boldsymbol{\\gamma }_{3} \\end{equation*}\r\n", - "\\begin{equation*} B^{01} \\boldsymbol{\\gamma }_{0}\\wedge \\boldsymbol{\\gamma }_{1} + B^{02} \\boldsymbol{\\gamma }_{0}\\wedge \\boldsymbol{\\gamma }_{2} + B^{03} \\boldsymbol{\\gamma }_{0}\\wedge \\boldsymbol{\\gamma }_{3} + B^{12} \\boldsymbol{\\gamma }_{1}\\wedge \\boldsymbol{\\gamma }_{2} + B^{13} \\boldsymbol{\\gamma }_{1}\\wedge \\boldsymbol{\\gamma }_{3} + B^{23} \\boldsymbol{\\gamma }_{2}\\wedge \\boldsymbol{\\gamma }_{3} \\end{equation*}\r\n", - "\\begin{equation*} \\left ( - 2 \\left ( \\gamma _{2}\\cdot \\gamma _{2}\\right ) B^{02} \\psi ^{12} + 2 \\left ( \\gamma _{2}\\cdot \\gamma _{2}\\right ) B^{12} \\psi ^{02} - 2 \\left ( \\gamma _{3}\\cdot \\gamma _{3}\\right ) B^{03} \\psi ^{13} + 2 \\left ( \\gamma _{3}\\cdot \\gamma _{3}\\right ) B^{13} \\psi ^{03}\\right ) \\boldsymbol{\\gamma }_{0}\\wedge \\boldsymbol{\\gamma }_{1} + \\left ( 2 \\left ( \\gamma _{1}\\cdot \\gamma _{1}\\right ) B^{01} \\psi ^{12} - 2 \\left ( \\gamma _{1}\\cdot \\gamma _{1}\\right ) B^{12} \\psi ^{01} - 2 \\left ( \\gamma _{3}\\cdot \\gamma _{3}\\right ) B^{03} \\psi ^{23} + 2 \\left ( \\gamma _{3}\\cdot \\gamma _{3}\\right ) B^{23} \\psi ^{03}\\right ) \\boldsymbol{\\gamma }_{0}\\wedge \\boldsymbol{\\gamma }_{2} + \\left ( 2 \\left ( \\gamma _{1}\\cdot \\gamma _{1}\\right ) B^{01} \\psi ^{13} - 2 \\left ( \\gamma _{1}\\cdot \\gamma _{1}\\right ) B^{13} \\psi ^{01} + 2 \\left ( \\gamma _{2}\\cdot \\gamma _{2}\\right ) B^{02} \\psi ^{23} - 2 \\left ( \\gamma _{2}\\cdot \\gamma _{2}\\right ) B^{23} \\psi ^{02}\\right ) \\boldsymbol{\\gamma }_{0}\\wedge \\boldsymbol{\\gamma }_{3} + \\left ( - 2 \\left ( \\gamma _{0}\\cdot \\gamma _{0}\\right ) B^{01} \\psi ^{02} + 2 \\left ( \\gamma _{0}\\cdot \\gamma _{0}\\right ) B^{02} \\psi ^{01} - 2 \\left ( \\gamma _{3}\\cdot \\gamma _{3}\\right ) B^{13} \\psi ^{23} + 2 \\left ( \\gamma _{3}\\cdot \\gamma _{3}\\right ) B^{23} \\psi ^{13}\\right ) \\boldsymbol{\\gamma }_{1}\\wedge \\boldsymbol{\\gamma }_{2} + \\left ( - 2 \\left ( \\gamma _{0}\\cdot \\gamma _{0}\\right ) B^{01} \\psi ^{03} + 2 \\left ( \\gamma _{0}\\cdot \\gamma _{0}\\right ) B^{03} \\psi ^{01} + 2 \\left ( \\gamma _{2}\\cdot \\gamma _{2}\\right ) B^{12} \\psi ^{23} - 2 \\left ( \\gamma _{2}\\cdot \\gamma _{2}\\right ) B^{23} \\psi ^{12}\\right ) \\boldsymbol{\\gamma }_{1}\\wedge \\boldsymbol{\\gamma }_{3} + \\left ( - 2 \\left ( \\gamma _{0}\\cdot \\gamma _{0}\\right ) B^{02} \\psi ^{03} + 2 \\left ( \\gamma _{0}\\cdot \\gamma _{0}\\right ) B^{03} \\psi ^{02} - 2 \\left ( \\gamma _{1}\\cdot \\gamma _{1}\\right ) B^{12} \\psi ^{13} + 2 \\left ( \\gamma _{1}\\cdot \\gamma _{1}\\right ) B^{13} \\psi ^{12}\\right ) \\boldsymbol{\\gamma }_{2}\\wedge \\boldsymbol{\\gamma }_{3} \\end{equation*}\r\n", - "\\end{document}\r\n" - ] + "data": { + "text/plain": [ + "\n", + "\\documentclass[10pt,fleqn]{report}\n", + "\\usepackage[vcentering]{geometry}\n", + "\\geometry{papersize={14in,11in},total={13in,10in}}\n", + "\n", + "\\pagestyle{empty}\n", + "\\usepackage[latin1]{inputenc}\n", + "\\usepackage{amsmath}\n", + "\\usepackage{amsfonts}\n", + "\\usepackage{amssymb}\n", + "\\usepackage{amsbsy}\n", + "\\usepackage{tensor}\n", + "\\usepackage{listings}\n", + "\\usepackage{color}\n", + "\\usepackage{xcolor}\n", + "\\usepackage{bm}\n", + "\\usepackage{breqn}\n", + "\\definecolor{gray}{rgb}{0.95,0.95,0.95}\n", + "\\setlength{\\parindent}{0pt}\n", + "\\DeclareMathOperator{\\Tr}{Tr}\n", + "\\DeclareMathOperator{\\Adj}{Adj}\n", + "\\newcommand{\\bfrac}[2]{\\displaystyle\\frac{#1}{#2}}\n", + "\\newcommand{\\lp}{\\left (}\n", + "\\newcommand{\\rp}{\\right )}\n", + "\\newcommand{\\paren}[1]{\\lp {#1} \\rp}\n", + "\\newcommand{\\half}{\\frac{1}{2}}\n", + "\\newcommand{\\llt}{\\left <}\n", + "\\newcommand{\\rgt}{\\right >}\n", + "\\newcommand{\\abs}[1]{\\left |{#1}\\right | }\n", + "\\newcommand{\\pdiff}[2]{\\bfrac{\\partial {#1}}{\\partial {#2}}}\n", + "\\newcommand{\\lbrc}{\\left \\{}\n", + "\\newcommand{\\rbrc}{\\right \\}}\n", + "\\newcommand{\\W}{\\wedge}\n", + "\\newcommand{\\prm}[1]{{#1}'}\n", + "\\newcommand{\\ddt}[1]{\\bfrac{d{#1}}{dt}}\n", + "\\newcommand{\\R}{\\dagger}\n", + "\\newcommand{\\deriv}[3]{\\bfrac{d^{#3}#1}{d{#2}^{#3}}}\n", + "\\newcommand{\\grade}[1]{\\left < {#1} \\right >}\n", + "\\newcommand{\\f}[2]{{#1}\\lp{#2}\\rp}\n", + "\\newcommand{\\eval}[2]{\\left . {#1} \\right |_{#2}}\n", + "\\newcommand{\\Nabla}{\\boldsymbol{\\nabla}}\n", + "\\newcommand{\\eb}{\\boldsymbol{e}}\n", + "\\usepackage{float}\n", + "\\floatstyle{plain} % optionally change the style of the new float\n", + "\\newfloat{Code}{H}{myc}\n", + "\\lstloadlanguages{Python}\n", + "\n", + "\\begin{document}\n", + "\\begin{equation*} \\psi + \\psi ^{01} \\boldsymbol{\\gamma }_{0}\\wedge \\boldsymbol{\\gamma }_{1} + \\psi ^{02} \\boldsymbol{\\gamma }_{0}\\wedge \\boldsymbol{\\gamma }_{2} + \\psi ^{03} \\boldsymbol{\\gamma }_{0}\\wedge \\boldsymbol{\\gamma }_{3} + \\psi ^{12} \\boldsymbol{\\gamma }_{1}\\wedge \\boldsymbol{\\gamma }_{2} + \\psi ^{13} \\boldsymbol{\\gamma }_{1}\\wedge \\boldsymbol{\\gamma }_{3} + \\psi ^{23} \\boldsymbol{\\gamma }_{2}\\wedge \\boldsymbol{\\gamma }_{3} + \\psi ^{0123} \\boldsymbol{\\gamma }_{0}\\wedge \\boldsymbol{\\gamma }_{1}\\wedge \\boldsymbol{\\gamma }_{2}\\wedge \\boldsymbol{\\gamma }_{3} \\end{equation*}\n", + "\\begin{equation*} B^{01} \\boldsymbol{\\gamma }_{0}\\wedge \\boldsymbol{\\gamma }_{1} + B^{02} \\boldsymbol{\\gamma }_{0}\\wedge \\boldsymbol{\\gamma }_{2} + B^{03} \\boldsymbol{\\gamma }_{0}\\wedge \\boldsymbol{\\gamma }_{3} + B^{12} \\boldsymbol{\\gamma }_{1}\\wedge \\boldsymbol{\\gamma }_{2} + B^{13} \\boldsymbol{\\gamma }_{1}\\wedge \\boldsymbol{\\gamma }_{3} + B^{23} \\boldsymbol{\\gamma }_{2}\\wedge \\boldsymbol{\\gamma }_{3} \\end{equation*}\n", + "\\begin{equation*} \\left ( - 2 \\left ( \\gamma _{2}\\cdot \\gamma _{2}\\right ) B^{02} \\psi ^{12} + 2 \\left ( \\gamma _{2}\\cdot \\gamma _{2}\\right ) B^{12} \\psi ^{02} - 2 \\left ( \\gamma _{3}\\cdot \\gamma _{3}\\right ) B^{03} \\psi ^{13} + 2 \\left ( \\gamma _{3}\\cdot \\gamma _{3}\\right ) B^{13} \\psi ^{03}\\right ) \\boldsymbol{\\gamma }_{0}\\wedge \\boldsymbol{\\gamma }_{1} + \\left ( 2 \\left ( \\gamma _{1}\\cdot \\gamma _{1}\\right ) B^{01} \\psi ^{12} - 2 \\left ( \\gamma _{1}\\cdot \\gamma _{1}\\right ) B^{12} \\psi ^{01} - 2 \\left ( \\gamma _{3}\\cdot \\gamma _{3}\\right ) B^{03} \\psi ^{23} + 2 \\left ( \\gamma _{3}\\cdot \\gamma _{3}\\right ) B^{23} \\psi ^{03}\\right ) \\boldsymbol{\\gamma }_{0}\\wedge \\boldsymbol{\\gamma }_{2} + \\left ( 2 \\left ( \\gamma _{1}\\cdot \\gamma _{1}\\right ) B^{01} \\psi ^{13} - 2 \\left ( \\gamma _{1}\\cdot \\gamma _{1}\\right ) B^{13} \\psi ^{01} + 2 \\left ( \\gamma _{2}\\cdot \\gamma _{2}\\right ) B^{02} \\psi ^{23} - 2 \\left ( \\gamma _{2}\\cdot \\gamma _{2}\\right ) B^{23} \\psi ^{02}\\right ) \\boldsymbol{\\gamma }_{0}\\wedge \\boldsymbol{\\gamma }_{3} + \\left ( - 2 \\left ( \\gamma _{0}\\cdot \\gamma _{0}\\right ) B^{01} \\psi ^{02} + 2 \\left ( \\gamma _{0}\\cdot \\gamma _{0}\\right ) B^{02} \\psi ^{01} - 2 \\left ( \\gamma _{3}\\cdot \\gamma _{3}\\right ) B^{13} \\psi ^{23} + 2 \\left ( \\gamma _{3}\\cdot \\gamma _{3}\\right ) B^{23} \\psi ^{13}\\right ) \\boldsymbol{\\gamma }_{1}\\wedge \\boldsymbol{\\gamma }_{2} + \\left ( - 2 \\left ( \\gamma _{0}\\cdot \\gamma _{0}\\right ) B^{01} \\psi ^{03} + 2 \\left ( \\gamma _{0}\\cdot \\gamma _{0}\\right ) B^{03} \\psi ^{01} + 2 \\left ( \\gamma _{2}\\cdot \\gamma _{2}\\right ) B^{12} \\psi ^{23} - 2 \\left ( \\gamma _{2}\\cdot \\gamma _{2}\\right ) B^{23} \\psi ^{12}\\right ) \\boldsymbol{\\gamma }_{1}\\wedge \\boldsymbol{\\gamma }_{3} + \\left ( - 2 \\left ( \\gamma _{0}\\cdot \\gamma _{0}\\right ) B^{02} \\psi ^{03} + 2 \\left ( \\gamma _{0}\\cdot \\gamma _{0}\\right ) B^{03} \\psi ^{02} - 2 \\left ( \\gamma _{1}\\cdot \\gamma _{1}\\right ) B^{12} \\psi ^{13} + 2 \\left ( \\gamma _{1}\\cdot \\gamma _{1}\\right ) B^{13} \\psi ^{12}\\right ) \\boldsymbol{\\gamma }_{2}\\wedge \\boldsymbol{\\gamma }_{3} \\end{equation*}\n", + "\\end{document}\n" + ] + }, + "metadata": {}, + "output_type": "display_data" } ], "source": [ - "!cat dirac_derive.tex" + "check('dirac_derive')" ] }, { "cell_type": "code", - "execution_count": 12, - "metadata": {}, - "outputs": [], - "source": [ - "!python Dop.py" - ] - }, - { - "cell_type": "code", - "execution_count": 13, + "execution_count": 7, "metadata": {}, "outputs": [ { - "name": "stdout", - "output_type": "stream", - "text": [ - "\r\n", - "\\documentclass[10pt,fleqn]{report}\r\n", - "\\usepackage[vcentering]{geometry}\r\n", - "\\geometry{papersize={6in,7in},total={5in,6in}}\r\n", - "\r\n", - "\\pagestyle{empty}\r\n", - "\\usepackage[latin1]{inputenc}\r\n", - "\\usepackage{amsmath}\r\n", - "\\usepackage{amsfonts}\r\n", - "\\usepackage{amssymb}\r\n", - "\\usepackage{amsbsy}\r\n", - "\\usepackage{tensor}\r\n", - "\\usepackage{listings}\r\n", - "\\usepackage{color}\r\n", - "\\usepackage{xcolor}\r\n", - "\\usepackage{bm}\r\n", - "\\usepackage{breqn}\r\n", - "\\definecolor{gray}{rgb}{0.95,0.95,0.95}\r\n", - "\\setlength{\\parindent}{0pt}\r\n", - "\\DeclareMathOperator{\\Tr}{Tr}\r\n", - "\\DeclareMathOperator{\\Adj}{Adj}\r\n", - "\\newcommand{\\bfrac}[2]{\\displaystyle\\frac{#1}{#2}}\r\n", - "\\newcommand{\\lp}{\\left (}\r\n", - "\\newcommand{\\rp}{\\right )}\r\n", - "\\newcommand{\\paren}[1]{\\lp {#1} \\rp}\r\n", - "\\newcommand{\\half}{\\frac{1}{2}}\r\n", - "\\newcommand{\\llt}{\\left <}\r\n", - "\\newcommand{\\rgt}{\\right >}\r\n", - "\\newcommand{\\abs}[1]{\\left |{#1}\\right | }\r\n", - "\\newcommand{\\pdiff}[2]{\\bfrac{\\partial {#1}}{\\partial {#2}}}\r\n", - "\\newcommand{\\lbrc}{\\left \\{}\r\n", - "\\newcommand{\\rbrc}{\\right \\}}\r\n", - "\\newcommand{\\W}{\\wedge}\r\n", - "\\newcommand{\\prm}[1]{{#1}'}\r\n", - "\\newcommand{\\ddt}[1]{\\bfrac{d{#1}}{dt}}\r\n", - "\\newcommand{\\R}{\\dagger}\r\n", - "\\newcommand{\\deriv}[3]{\\bfrac{d^{#3}#1}{d{#2}^{#3}}}\r\n", - "\\newcommand{\\grade}[1]{\\left < {#1} \\right >}\r\n", - "\\newcommand{\\f}[2]{{#1}\\lp{#2}\\rp}\r\n", - "\\newcommand{\\eval}[2]{\\left . {#1} \\right |_{#2}}\r\n", - "\\newcommand{\\Nabla}{\\boldsymbol{\\nabla}}\r\n", - "\\newcommand{\\eb}{\\boldsymbol{e}}\r\n", - "\\usepackage{float}\r\n", - "\\floatstyle{plain} % optionally change the style of the new float\r\n", - "\\newfloat{Code}{H}{myc}\r\n", - "\\lstloadlanguages{Python}\r\n", - "\r\n", - "\\begin{document}\r\n", - "\\begin{equation*} \\nabla = \\boldsymbol{e}_{x} \\frac{\\partial}{\\partial x} + \\boldsymbol{e}_{y} \\frac{\\partial}{\\partial y} + \\boldsymbol{e}_{z} \\frac{\\partial}{\\partial z} \\end{equation*}\r\n", - "\\begin{equation*} \\nabla^{2} = \\nabla \\cdot \\nabla = \\frac{\\partial^{2}}{\\partial x^{2}} + \\frac{\\partial^{2}}{\\partial y^{2}} + \\frac{\\partial^{2}}{\\partial z^{2}} \\end{equation*}\r\n", - "\\begin{equation*} \\lp\\nabla^{2}\\rp f = \\partial^{2}_{y} f + \\partial^{2}_{z} f \\end{equation*}\r\n", - "\\begin{equation*} \\nabla\\cdot\\lp\\nabla f\\rp = \\partial^{2}_{x} f + \\partial^{2}_{y} f + \\partial^{2}_{z} f \\end{equation*}\r\n", - "\\begin{equation*} \\nabla^{2} = \\nabla\\cdot\\nabla = \\frac{2}{r} \\frac{\\partial}{\\partial r} + \\frac{1}{r^{2} \\tan{\\left (\\theta \\right )}} \\frac{\\partial}{\\partial \\theta } + \\frac{\\partial^{2}}{\\partial r^{2}} + r^{-2} \\frac{\\partial^{2}}{\\partial \\theta ^{2}} + \\frac{1}{r^{2} {\\sin{\\left (\\theta \\right )}}^{2}} \\frac{\\partial^{2}}{\\partial \\phi ^{2}} \\end{equation*}\r\n", - "\\begin{equation*} \\lp\\nabla^{2}\\rp f = \\frac{r^{2} \\partial^{2}_{r} f + 2 r \\partial_{r} f + \\partial^{2}_{\\theta } f + \\frac{\\partial_{\\theta } f }{\\tan{\\left (\\theta \\right )}} + \\frac{\\partial^{2}_{\\phi } f }{{\\sin{\\left (\\theta \\right )}}^{2}}}{r^{2}} \\end{equation*}\r\n", - "\\begin{equation*} \\nabla\\cdot\\lp\\nabla f\\rp = \\frac{r^{2} \\partial^{2}_{r} f + 2 r \\partial_{r} f + \\partial^{2}_{\\theta } f + \\frac{\\partial_{\\theta } f }{\\tan{\\left (\\theta \\right )}} + \\frac{\\partial^{2}_{\\phi } f }{{\\sin{\\left (\\theta \\right )}}^{2}}}{r^{2}} \\end{equation*}\r\n", - "\\begin{equation*} \\begin{array}{c} \\left [ \\boldsymbol{e}_{x} \\frac{\\partial}{\\partial x} + \\boldsymbol{e}_{y} \\frac{\\partial}{\\partial y} + \\boldsymbol{e}_{z} \\frac{\\partial}{\\partial z}, \\right. \\\\ \\left. \\boldsymbol{e}_{x} \\frac{\\partial}{\\partial x} + \\boldsymbol{e}_{y} \\frac{\\partial}{\\partial y} + \\boldsymbol{e}_{z} \\frac{\\partial}{\\partial z}\\right ] \\\\ \\end{array} \\end{equation*}\r\n", - "\\begin{equation*} F \\end{equation*}\r\n", - "\\begin{equation*} F^{r} \\boldsymbol{e}_{r} + F^{\\theta } \\boldsymbol{e}_{\\theta } + F^{\\phi } \\boldsymbol{e}_{\\phi } \\end{equation*}\r\n", - "\\begin{equation*} F \\end{equation*}\r\n", - "\\begin{equation*} F^{r} \\boldsymbol{e}_{r} + F^{\\theta } \\boldsymbol{e}_{\\theta } + F^{\\phi } \\boldsymbol{e}_{\\phi } \\end{equation*}\r\n", - "\\begin{equation*} F \\end{equation*}\r\n", - "\\begin{equation*} \\begin{array}{c} \\left ( F^{r} \\boldsymbol{e}_{r} + F^{\\theta } \\boldsymbol{e}_{\\theta } + F^{\\phi } \\boldsymbol{e}_{\\phi }, \\right. \\\\ \\left. F^{r} \\boldsymbol{e}_{r} + F^{\\theta } \\boldsymbol{e}_{\\theta } + F^{\\phi } \\boldsymbol{e}_{\\phi }\\right ) \\\\ \\end{array} \\end{equation*}\r\n", - "\\end{document}\r\n" - ] + "data": { + "text/plain": [ + "\n", + "\\documentclass[10pt,fleqn]{report}\n", + "\\usepackage[vcentering]{geometry}\n", + "\\geometry{papersize={6in,7in},total={5in,6in}}\n", + "\n", + "\\pagestyle{empty}\n", + "\\usepackage[latin1]{inputenc}\n", + "\\usepackage{amsmath}\n", + "\\usepackage{amsfonts}\n", + "\\usepackage{amssymb}\n", + "\\usepackage{amsbsy}\n", + "\\usepackage{tensor}\n", + "\\usepackage{listings}\n", + "\\usepackage{color}\n", + "\\usepackage{xcolor}\n", + "\\usepackage{bm}\n", + "\\usepackage{breqn}\n", + "\\definecolor{gray}{rgb}{0.95,0.95,0.95}\n", + "\\setlength{\\parindent}{0pt}\n", + "\\DeclareMathOperator{\\Tr}{Tr}\n", + "\\DeclareMathOperator{\\Adj}{Adj}\n", + "\\newcommand{\\bfrac}[2]{\\displaystyle\\frac{#1}{#2}}\n", + "\\newcommand{\\lp}{\\left (}\n", + "\\newcommand{\\rp}{\\right )}\n", + "\\newcommand{\\paren}[1]{\\lp {#1} \\rp}\n", + "\\newcommand{\\half}{\\frac{1}{2}}\n", + "\\newcommand{\\llt}{\\left <}\n", + "\\newcommand{\\rgt}{\\right >}\n", + "\\newcommand{\\abs}[1]{\\left |{#1}\\right | }\n", + "\\newcommand{\\pdiff}[2]{\\bfrac{\\partial {#1}}{\\partial {#2}}}\n", + "\\newcommand{\\lbrc}{\\left \\{}\n", + "\\newcommand{\\rbrc}{\\right \\}}\n", + "\\newcommand{\\W}{\\wedge}\n", + "\\newcommand{\\prm}[1]{{#1}'}\n", + "\\newcommand{\\ddt}[1]{\\bfrac{d{#1}}{dt}}\n", + "\\newcommand{\\R}{\\dagger}\n", + "\\newcommand{\\deriv}[3]{\\bfrac{d^{#3}#1}{d{#2}^{#3}}}\n", + "\\newcommand{\\grade}[1]{\\left < {#1} \\right >}\n", + "\\newcommand{\\f}[2]{{#1}\\lp{#2}\\rp}\n", + "\\newcommand{\\eval}[2]{\\left . {#1} \\right |_{#2}}\n", + "\\newcommand{\\Nabla}{\\boldsymbol{\\nabla}}\n", + "\\newcommand{\\eb}{\\boldsymbol{e}}\n", + "\\usepackage{float}\n", + "\\floatstyle{plain} % optionally change the style of the new float\n", + "\\newfloat{Code}{H}{myc}\n", + "\\lstloadlanguages{Python}\n", + "\n", + "\\begin{document}\n", + "\\begin{equation*} \\nabla = \\boldsymbol{e}_{x} \\frac{\\partial}{\\partial x} + \\boldsymbol{e}_{y} \\frac{\\partial}{\\partial y} + \\boldsymbol{e}_{z} \\frac{\\partial}{\\partial z} \\end{equation*}\n", + "\\begin{equation*} \\nabla^{2} = \\nabla \\cdot \\nabla = \\frac{\\partial^{2}}{\\partial x^{2}} + \\frac{\\partial^{2}}{\\partial y^{2}} + \\frac{\\partial^{2}}{\\partial z^{2}} \\end{equation*}\n", + "\\begin{equation*} \\lp\\nabla^{2}\\rp f = \\partial^{2}_{x} f + \\partial^{2}_{y} f + \\partial^{2}_{z} f \\end{equation*}\n", + "\\begin{equation*} \\nabla\\cdot\\lp\\nabla f\\rp = \\partial^{2}_{x} f + \\partial^{2}_{y} f + \\partial^{2}_{z} f \\end{equation*}\n", + "\\begin{equation*} \\nabla^{2} = \\nabla\\cdot\\nabla = \\frac{2}{r} \\frac{\\partial}{\\partial r} + \\frac{1}{r^{2} \\tan{\\left (\\theta \\right )}} \\frac{\\partial}{\\partial \\theta } + \\frac{\\partial^{2}}{\\partial r^{2}} + r^{-2} \\frac{\\partial^{2}}{\\partial \\theta ^{2}} + \\frac{1}{r^{2} {\\sin{\\left (\\theta \\right )}}^{2}} \\frac{\\partial^{2}}{\\partial \\phi ^{2}} \\end{equation*}\n", + "\\begin{equation*} \\lp\\nabla^{2}\\rp f = \\frac{r^{2} \\partial^{2}_{r} f + 2 r \\partial_{r} f + \\partial^{2}_{\\theta } f + \\frac{\\partial_{\\theta } f }{\\tan{\\left (\\theta \\right )}} + \\frac{\\partial^{2}_{\\phi } f }{{\\sin{\\left (\\theta \\right )}}^{2}}}{r^{2}} \\end{equation*}\n", + "\\begin{equation*} \\nabla\\cdot\\lp\\nabla f\\rp = \\frac{r^{2} \\partial^{2}_{r} f + 2 r \\partial_{r} f + \\partial^{2}_{\\theta } f + \\frac{\\partial_{\\theta } f }{\\tan{\\left (\\theta \\right )}} + \\frac{\\partial^{2}_{\\phi } f }{{\\sin{\\left (\\theta \\right )}}^{2}}}{r^{2}} \\end{equation*}\n", + "\\begin{equation*} \\begin{array}{c} \\left [ \\boldsymbol{e}_{x} \\frac{\\partial}{\\partial x} + \\boldsymbol{e}_{y} \\frac{\\partial}{\\partial y} + \\boldsymbol{e}_{z} \\frac{\\partial}{\\partial z}, \\right. \\\\ \\left. \\boldsymbol{e}_{x} \\frac{\\partial}{\\partial x} + \\boldsymbol{e}_{y} \\frac{\\partial}{\\partial y} + \\boldsymbol{e}_{z} \\frac{\\partial}{\\partial z}\\right ] \\\\ \\end{array} \\end{equation*}\n", + "\\begin{equation*} F \\end{equation*}\n", + "\\begin{equation*} F^{r} \\boldsymbol{e}_{r} + F^{\\theta } \\boldsymbol{e}_{\\theta } + F^{\\phi } \\boldsymbol{e}_{\\phi } \\end{equation*}\n", + "\\begin{equation*} F \\end{equation*}\n", + "\\begin{equation*} F^{r} \\boldsymbol{e}_{r} + F^{\\theta } \\boldsymbol{e}_{\\theta } + F^{\\phi } \\boldsymbol{e}_{\\phi } \\end{equation*}\n", + "\\begin{equation*} F \\end{equation*}\n", + "\\begin{equation*} \\begin{array}{c} \\left ( F^{r} \\boldsymbol{e}_{r} + F^{\\theta } \\boldsymbol{e}_{\\theta } + F^{\\phi } \\boldsymbol{e}_{\\phi }, \\right. \\\\ \\left. F^{r} \\boldsymbol{e}_{r} + F^{\\theta } \\boldsymbol{e}_{\\theta } + F^{\\phi } \\boldsymbol{e}_{\\phi }\\right ) \\\\ \\end{array} \\end{equation*}\n", + "\\end{document}\n" + ] + }, + "metadata": {}, + "output_type": "display_data" } ], "source": [ - "!cat Dop.tex" + "check('Dop')" ] }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 8, "metadata": {}, - "outputs": [], - "source": [ - "!python em_waves_latex.py" - ] - }, - { - "cell_type": "code", - "execution_count": 15, - "metadata": { - "collapsed": false, - "scrolled": false - }, "outputs": [ { - "name": "stdout", - "output_type": "stream", - "text": [ - "\r\n", - "\\documentclass[10pt,fleqn]{report}\r\n", - "\\usepackage[vcentering]{geometry}\r\n", - "\\geometry{papersize={14in,11in},total={13in,10in}}\r\n", - "\r\n", - "\\pagestyle{empty}\r\n", - "\\usepackage[latin1]{inputenc}\r\n", - "\\usepackage{amsmath}\r\n", - "\\usepackage{amsfonts}\r\n", - "\\usepackage{amssymb}\r\n", - "\\usepackage{amsbsy}\r\n", - "\\usepackage{tensor}\r\n", - "\\usepackage{listings}\r\n", - "\\usepackage{color}\r\n", - "\\usepackage{xcolor}\r\n", - "\\usepackage{bm}\r\n", - "\\usepackage{breqn}\r\n", - "\\definecolor{gray}{rgb}{0.95,0.95,0.95}\r\n", - "\\setlength{\\parindent}{0pt}\r\n", - "\\DeclareMathOperator{\\Tr}{Tr}\r\n", - "\\DeclareMathOperator{\\Adj}{Adj}\r\n", - "\\newcommand{\\bfrac}[2]{\\displaystyle\\frac{#1}{#2}}\r\n", - "\\newcommand{\\lp}{\\left (}\r\n", - "\\newcommand{\\rp}{\\right )}\r\n", - "\\newcommand{\\paren}[1]{\\lp {#1} \\rp}\r\n", - "\\newcommand{\\half}{\\frac{1}{2}}\r\n", - "\\newcommand{\\llt}{\\left <}\r\n", - "\\newcommand{\\rgt}{\\right >}\r\n", - "\\newcommand{\\abs}[1]{\\left |{#1}\\right | }\r\n", - "\\newcommand{\\pdiff}[2]{\\bfrac{\\partial {#1}}{\\partial {#2}}}\r\n", - "\\newcommand{\\lbrc}{\\left \\{}\r\n", - "\\newcommand{\\rbrc}{\\right \\}}\r\n", - "\\newcommand{\\W}{\\wedge}\r\n", - "\\newcommand{\\prm}[1]{{#1}'}\r\n", - "\\newcommand{\\ddt}[1]{\\bfrac{d{#1}}{dt}}\r\n", - "\\newcommand{\\R}{\\dagger}\r\n", - "\\newcommand{\\deriv}[3]{\\bfrac{d^{#3}#1}{d{#2}^{#3}}}\r\n", - "\\newcommand{\\grade}[1]{\\left < {#1} \\right >}\r\n", - "\\newcommand{\\f}[2]{{#1}\\lp{#2}\\rp}\r\n", - "\\newcommand{\\eval}[2]{\\left . {#1} \\right |_{#2}}\r\n", - "\\newcommand{\\Nabla}{\\boldsymbol{\\nabla}}\r\n", - "\\newcommand{\\eb}{\\boldsymbol{e}}\r\n", - "\\usepackage{float}\r\n", - "\\floatstyle{plain} % optionally change the style of the new float\r\n", - "\\newfloat{Code}{H}{myc}\r\n", - "\\lstloadlanguages{Python}\r\n", - "\r\n", - "\\begin{document}\r\n", - "\\begin{equation*} \\text{Pseudo Scalar\\;\\;}I = \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{x}\\wedge \\boldsymbol{\\gamma }_{y}\\wedge \\boldsymbol{\\gamma }_{z} \\end{equation*}\r\n", - "\\begin{equation*} I_{xyz} = \\boldsymbol{\\gamma }_{x}\\wedge \\boldsymbol{\\gamma }_{y}\\wedge \\boldsymbol{\\gamma }_{z} \\end{equation*}\r\n", - " \\begin{align*} \\text{Electromagnetic Field Bi-Vector\\;\\;} F = & - E^{x} e^{- i \\left(- \\omega t + k_{x} x + k_{y} y + k_{z} z\\right)} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{x} \\\\ & - E^{y} e^{- i \\left(- \\omega t + k_{x} x + k_{y} y + k_{z} z\\right)} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{y} \\\\ & - E^{z} e^{- i \\left(- \\omega t + k_{x} x + k_{y} y + k_{z} z\\right)} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{z} \\\\ & - B^{z} e^{- i \\left(- \\omega t + k_{x} x + k_{y} y + k_{z} z\\right)} \\boldsymbol{\\gamma }_{x}\\wedge \\boldsymbol{\\gamma }_{y} \\\\ & + B^{y} e^{i \\left(\\omega t - k_{x} x - k_{y} y - k_{z} z\\right)} \\boldsymbol{\\gamma }_{x}\\wedge \\boldsymbol{\\gamma }_{z} \\\\ & - B^{x} e^{- i \\left(- \\omega t + k_{x} x + k_{y} y + k_{z} z\\right)} \\boldsymbol{\\gamma }_{y}\\wedge \\boldsymbol{\\gamma }_{z} \\end{align*} \r\n", - "Geom Derivative of Electomagnetic Field Bi-Vector\r\n", - " \\begin{align*} \\boldsymbol{\\nabla} F = 0 = & - i \\left(E^{x} k_{x} + E^{y} k_{y} + E^{z} k_{z}\\right) e^{- i \\left(- \\omega t + k_{x} x + k_{y} y + k_{z} z\\right)} \\boldsymbol{\\gamma }_{t} \\\\ & + i \\left(B^{y} k_{z} - B^{z} k_{y} - E^{x} \\omega \\right) e^{i \\left(\\omega t - k_{x} x - k_{y} y - k_{z} z\\right)} \\boldsymbol{\\gamma }_{x} \\\\ & + i \\left(- B^{x} k_{z} + B^{z} k_{x} - E^{y} \\omega \\right) e^{i \\left(\\omega t - k_{x} x - k_{y} y - k_{z} z\\right)} \\boldsymbol{\\gamma }_{y} \\\\ & + i \\left(B^{x} k_{y} - B^{y} k_{x} - E^{z} \\omega \\right) e^{i \\left(\\omega t - k_{x} x - k_{y} y - k_{z} z\\right)} \\boldsymbol{\\gamma }_{z} \\\\ & + i \\left(- B^{z} \\omega - E^{x} k_{y} + E^{y} k_{x}\\right) e^{i \\left(\\omega t - k_{x} x - k_{y} y - k_{z} z\\right)} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{x}\\wedge \\boldsymbol{\\gamma }_{y} \\\\ & + i \\left(B^{y} \\omega - E^{x} k_{z} + E^{z} k_{x}\\right) e^{i \\left(\\omega t - k_{x} x - k_{y} y - k_{z} z\\right)} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{x}\\wedge \\boldsymbol{\\gamma }_{z} \\\\ & + i \\left(- B^{x} \\omega - E^{y} k_{z} + E^{z} k_{y}\\right) e^{i \\left(\\omega t - k_{x} x - k_{y} y - k_{z} z\\right)} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{y}\\wedge \\boldsymbol{\\gamma }_{z} \\\\ & - i \\left(B^{x} k_{x} + B^{y} k_{y} + B^{z} k_{z}\\right) e^{- i \\left(- \\omega t + k_{x} x + k_{y} y + k_{z} z\\right)} \\boldsymbol{\\gamma }_{x}\\wedge \\boldsymbol{\\gamma }_{y}\\wedge \\boldsymbol{\\gamma }_{z} \\end{align*} \r\n", - " \\begin{align*} \\lp\\bm{\\nabla}F\\rp /\\lp i e^{iK\\cdot X}\\rp = 0 = & \\left ( - E^{x} k_{x} - E^{y} k_{y} - E^{z} k_{z}\\right ) \\boldsymbol{\\gamma }_{t} \\\\ & + \\left ( B^{y} k_{z} - B^{z} k_{y} - E^{x} \\omega \\right ) \\boldsymbol{\\gamma }_{x} \\\\ & + \\left ( - B^{x} k_{z} + B^{z} k_{x} - E^{y} \\omega \\right ) \\boldsymbol{\\gamma }_{y} \\\\ & + \\left ( B^{x} k_{y} - B^{y} k_{x} - E^{z} \\omega \\right ) \\boldsymbol{\\gamma }_{z} \\\\ & + \\left ( - B^{z} \\omega - E^{x} k_{y} + E^{y} k_{x}\\right ) \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{x}\\wedge \\boldsymbol{\\gamma }_{y} \\\\ & + \\left ( B^{y} \\omega - E^{x} k_{z} + E^{z} k_{x}\\right ) \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{x}\\wedge \\boldsymbol{\\gamma }_{z} \\\\ & + \\left ( - B^{x} \\omega - E^{y} k_{z} + E^{z} k_{y}\\right ) \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{y}\\wedge \\boldsymbol{\\gamma }_{z} \\\\ & + \\left ( - B^{x} k_{x} - B^{y} k_{y} - B^{z} k_{z}\\right ) \\boldsymbol{\\gamma }_{x}\\wedge \\boldsymbol{\\gamma }_{y}\\wedge \\boldsymbol{\\gamma }_{z} \\end{align*} \r\n", - "\\begin{equation*} \\mbox{set } e_{E}\\cdot e_{k} = e_{B}\\cdot e_{k} = 0\\mbox{ and } e_{E}\\cdot e_{E} = e_{B}\\cdot e_{B} = e_{k}\\cdot e_{k} = -e_{t}\\cdot e_{t} = 1 \\end{equation*}\r\n", - "\\begin{equation*} g = \\left [ \\begin{array}{cccc} -1 & \\left ( e_{E}\\cdot e_{B}\\right ) & 0 & 0 \\\\ \\left ( e_{E}\\cdot e_{B}\\right ) & -1 & 0 & 0 \\\\ 0 & 0 & -1 & 0 \\\\ 0 & 0 & 0 & 1 \\end{array}\\right ] \\end{equation*}\r\n", - "\\begin{equation*} K\\cdot X = \\omega t - k x_{k} \\end{equation*}\r\n", - " \\begin{align*} F = & - \\frac{B e^{i \\left(\\omega t - k x_{k}\\right)}}{\\sqrt{- \\left ( e_{E}\\cdot e_{B}\\right ) ^{2} + 1}} \\boldsymbol{e}_{E}\\wedge \\boldsymbol{e}_{k} \\\\ & + E e^{i \\left(\\omega t - k x_{k}\\right)} \\boldsymbol{e}_{E}\\wedge \\boldsymbol{t} \\\\ & - \\frac{\\left ( e_{E}\\cdot e_{B}\\right ) B e^{i \\left(\\omega t - k x_{k}\\right)}}{\\sqrt{- \\left ( e_{E}\\cdot e_{B}\\right ) ^{2} + 1}} \\boldsymbol{e}_{B}\\wedge \\boldsymbol{e}_{k} \\end{align*} \r\n", - " \\begin{align*} \\lp\\bm{\\nabla}F\\rp/\\lp ie^{iK\\cdot X} \\rp = 0 = & \\left ( - \\frac{B k}{\\sqrt{- \\left ( e_{E}\\cdot e_{B}\\right ) ^{2} + 1}} - E \\omega \\right ) \\boldsymbol{e}_{E} \\\\ & - \\frac{\\left ( e_{E}\\cdot e_{B}\\right ) B k}{\\sqrt{- \\left ( e_{E}\\cdot e_{B}\\right ) ^{2} + 1}} \\boldsymbol{e}_{B} \\\\ & + \\left ( - \\frac{B \\omega }{\\sqrt{- \\left ( e_{E}\\cdot e_{B}\\right ) ^{2} + 1}} - E k\\right ) \\boldsymbol{e}_{E}\\wedge \\boldsymbol{e}_{k}\\wedge \\boldsymbol{t} \\\\ & - \\frac{\\left ( e_{E}\\cdot e_{B}\\right ) B \\omega }{\\sqrt{- \\left ( e_{E}\\cdot e_{B}\\right ) ^{2} + 1}} \\boldsymbol{e}_{B}\\wedge \\boldsymbol{e}_{k}\\wedge \\boldsymbol{t} \\end{align*} \r\n", - "\\begin{equation*} \\mbox{Previous equation requires that: }e_{E}\\cdot e_{B} = 0\\mbox{ if }B\\ne 0\\mbox{ and }k\\ne 0 \\end{equation*}\r\n", - " \\begin{align*} \\lp\\bm{\\nabla}F\\rp/\\lp ie^{iK\\cdot X} \\rp = 0 = & \\left ( - B k - E \\omega \\right ) \\boldsymbol{e}_{E} \\\\ & + \\left ( - B \\omega - E k\\right ) \\boldsymbol{e}_{E}\\wedge \\boldsymbol{e}_{k}\\wedge \\boldsymbol{t} \\end{align*} \r\n", - "\\begin{equation*} 0 = - B k - E \\omega \\end{equation*}\r\n", - "\\begin{equation*} 0 = - B \\omega - E k \\end{equation*}\r\n", - "\\begin{equation*} \\mbox{eq3 = eq1-eq2: }0 = - \\frac{E \\omega }{k} + \\frac{E k}{\\omega } \\end{equation*}\r\n", - "\\begin{equation*} \\mbox{eq3 = (eq1-eq2)/E: }0 = - \\frac{\\omega }{k} + \\frac{k}{\\omega } \\end{equation*}\r\n", - "\\begin{equation*} k = \\left [ \\begin{array}{c} - \\omega \\\\ \\omega \\end{array}\\right ] \\end{equation*}\r\n", - "\\begin{equation*} B = \\left [ \\begin{array}{c} - E \\\\ E \\end{array}\\right ] \\end{equation*}\r\n", - "\\end{document}\r\n" - ] + "data": { + "text/plain": [ + "\n", + "\\documentclass[10pt,fleqn]{report}\n", + "\\usepackage[vcentering]{geometry}\n", + "\\geometry{papersize={14in,11in},total={13in,10in}}\n", + "\n", + "\\pagestyle{empty}\n", + "\\usepackage[latin1]{inputenc}\n", + "\\usepackage{amsmath}\n", + "\\usepackage{amsfonts}\n", + "\\usepackage{amssymb}\n", + "\\usepackage{amsbsy}\n", + "\\usepackage{tensor}\n", + "\\usepackage{listings}\n", + "\\usepackage{color}\n", + "\\usepackage{xcolor}\n", + "\\usepackage{bm}\n", + "\\usepackage{breqn}\n", + "\\definecolor{gray}{rgb}{0.95,0.95,0.95}\n", + "\\setlength{\\parindent}{0pt}\n", + "\\DeclareMathOperator{\\Tr}{Tr}\n", + "\\DeclareMathOperator{\\Adj}{Adj}\n", + "\\newcommand{\\bfrac}[2]{\\displaystyle\\frac{#1}{#2}}\n", + "\\newcommand{\\lp}{\\left (}\n", + "\\newcommand{\\rp}{\\right )}\n", + "\\newcommand{\\paren}[1]{\\lp {#1} \\rp}\n", + "\\newcommand{\\half}{\\frac{1}{2}}\n", + "\\newcommand{\\llt}{\\left <}\n", + "\\newcommand{\\rgt}{\\right >}\n", + "\\newcommand{\\abs}[1]{\\left |{#1}\\right | }\n", + "\\newcommand{\\pdiff}[2]{\\bfrac{\\partial {#1}}{\\partial {#2}}}\n", + "\\newcommand{\\lbrc}{\\left \\{}\n", + "\\newcommand{\\rbrc}{\\right \\}}\n", + "\\newcommand{\\W}{\\wedge}\n", + "\\newcommand{\\prm}[1]{{#1}'}\n", + "\\newcommand{\\ddt}[1]{\\bfrac{d{#1}}{dt}}\n", + "\\newcommand{\\R}{\\dagger}\n", + "\\newcommand{\\deriv}[3]{\\bfrac{d^{#3}#1}{d{#2}^{#3}}}\n", + "\\newcommand{\\grade}[1]{\\left < {#1} \\right >}\n", + "\\newcommand{\\f}[2]{{#1}\\lp{#2}\\rp}\n", + "\\newcommand{\\eval}[2]{\\left . {#1} \\right |_{#2}}\n", + "\\newcommand{\\Nabla}{\\boldsymbol{\\nabla}}\n", + "\\newcommand{\\eb}{\\boldsymbol{e}}\n", + "\\usepackage{float}\n", + "\\floatstyle{plain} % optionally change the style of the new float\n", + "\\newfloat{Code}{H}{myc}\n", + "\\lstloadlanguages{Python}\n", + "\n", + "\\begin{document}\n", + "\\begin{equation*} \\text{Pseudo Scalar\\;\\;}I = \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{x}\\wedge \\boldsymbol{\\gamma }_{y}\\wedge \\boldsymbol{\\gamma }_{z} \\end{equation*}\n", + "\\begin{equation*} I_{xyz} = \\boldsymbol{\\gamma }_{x}\\wedge \\boldsymbol{\\gamma }_{y}\\wedge \\boldsymbol{\\gamma }_{z} \\end{equation*}\n", + " \\begin{align*} \\text{Electromagnetic Field Bi-Vector\\;\\;} F = & - E^{x} e^{- i \\left(- \\omega t + k_{x} x + k_{y} y + k_{z} z\\right)} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{x} \\\\ & - E^{y} e^{- i \\left(- \\omega t + k_{x} x + k_{y} y + k_{z} z\\right)} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{y} \\\\ & - E^{z} e^{- i \\left(- \\omega t + k_{x} x + k_{y} y + k_{z} z\\right)} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{z} \\\\ & - B^{z} e^{- i \\left(- \\omega t + k_{x} x + k_{y} y + k_{z} z\\right)} \\boldsymbol{\\gamma }_{x}\\wedge \\boldsymbol{\\gamma }_{y} \\\\ & + B^{y} e^{i \\left(\\omega t - k_{x} x - k_{y} y - k_{z} z\\right)} \\boldsymbol{\\gamma }_{x}\\wedge \\boldsymbol{\\gamma }_{z} \\\\ & - B^{x} e^{- i \\left(- \\omega t + k_{x} x + k_{y} y + k_{z} z\\right)} \\boldsymbol{\\gamma }_{y}\\wedge \\boldsymbol{\\gamma }_{z} \\end{align*} \n", + "Geom Derivative of Electomagnetic Field Bi-Vector\n", + " \\begin{align*} \\boldsymbol{\\nabla} F = 0 = & - i \\left(E^{x} k_{x} + E^{y} k_{y} + E^{z} k_{z}\\right) e^{- i \\left(- \\omega t + k_{x} x + k_{y} y + k_{z} z\\right)} \\boldsymbol{\\gamma }_{t} \\\\ & + i \\left(B^{y} k_{z} - B^{z} k_{y} - E^{x} \\omega \\right) e^{i \\left(\\omega t - k_{x} x - k_{y} y - k_{z} z\\right)} \\boldsymbol{\\gamma }_{x} \\\\ & + i \\left(- B^{x} k_{z} + B^{z} k_{x} - E^{y} \\omega \\right) e^{i \\left(\\omega t - k_{x} x - k_{y} y - k_{z} z\\right)} \\boldsymbol{\\gamma }_{y} \\\\ & + i \\left(B^{x} k_{y} - B^{y} k_{x} - E^{z} \\omega \\right) e^{i \\left(\\omega t - k_{x} x - k_{y} y - k_{z} z\\right)} \\boldsymbol{\\gamma }_{z} \\\\ & + i \\left(- B^{z} \\omega - E^{x} k_{y} + E^{y} k_{x}\\right) e^{i \\left(\\omega t - k_{x} x - k_{y} y - k_{z} z\\right)} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{x}\\wedge \\boldsymbol{\\gamma }_{y} \\\\ & + i \\left(B^{y} \\omega - E^{x} k_{z} + E^{z} k_{x}\\right) e^{i \\left(\\omega t - k_{x} x - k_{y} y - k_{z} z\\right)} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{x}\\wedge \\boldsymbol{\\gamma }_{z} \\\\ & + i \\left(- B^{x} \\omega - E^{y} k_{z} + E^{z} k_{y}\\right) e^{i \\left(\\omega t - k_{x} x - k_{y} y - k_{z} z\\right)} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{y}\\wedge \\boldsymbol{\\gamma }_{z} \\\\ & - i \\left(B^{x} k_{x} + B^{y} k_{y} + B^{z} k_{z}\\right) e^{- i \\left(- \\omega t + k_{x} x + k_{y} y + k_{z} z\\right)} \\boldsymbol{\\gamma }_{x}\\wedge \\boldsymbol{\\gamma }_{y}\\wedge \\boldsymbol{\\gamma }_{z} \\end{align*} \n", + " \\begin{align*} \\lp\\bm{\\nabla}F\\rp /\\lp i e^{iK\\cdot X}\\rp = 0 = & \\left ( - E^{x} k_{x} - E^{y} k_{y} - E^{z} k_{z}\\right ) \\boldsymbol{\\gamma }_{t} \\\\ & + \\left ( B^{y} k_{z} - B^{z} k_{y} - E^{x} \\omega \\right ) \\boldsymbol{\\gamma }_{x} \\\\ & + \\left ( - B^{x} k_{z} + B^{z} k_{x} - E^{y} \\omega \\right ) \\boldsymbol{\\gamma }_{y} \\\\ & + \\left ( B^{x} k_{y} - B^{y} k_{x} - E^{z} \\omega \\right ) \\boldsymbol{\\gamma }_{z} \\\\ & + \\left ( - B^{z} \\omega - E^{x} k_{y} + E^{y} k_{x}\\right ) \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{x}\\wedge \\boldsymbol{\\gamma }_{y} \\\\ & + \\left ( B^{y} \\omega - E^{x} k_{z} + E^{z} k_{x}\\right ) \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{x}\\wedge \\boldsymbol{\\gamma }_{z} \\\\ & + \\left ( - B^{x} \\omega - E^{y} k_{z} + E^{z} k_{y}\\right ) \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{y}\\wedge \\boldsymbol{\\gamma }_{z} \\\\ & + \\left ( - B^{x} k_{x} - B^{y} k_{y} - B^{z} k_{z}\\right ) \\boldsymbol{\\gamma }_{x}\\wedge \\boldsymbol{\\gamma }_{y}\\wedge \\boldsymbol{\\gamma }_{z} \\end{align*} \n", + "\\begin{equation*} \\mbox{set } e_{E}\\cdot e_{k} = e_{B}\\cdot e_{k} = 0\\mbox{ and } e_{E}\\cdot e_{E} = e_{B}\\cdot e_{B} = e_{k}\\cdot e_{k} = -e_{t}\\cdot e_{t} = 1 \\end{equation*}\n", + "\\begin{equation*} g = \\left [ \\begin{array}{cccc} -1 & \\left ( e_{E}\\cdot e_{B}\\right ) & 0 & 0 \\\\ \\left ( e_{E}\\cdot e_{B}\\right ) & -1 & 0 & 0 \\\\ 0 & 0 & -1 & 0 \\\\ 0 & 0 & 0 & 1 \\end{array}\\right ] \\end{equation*}\n", + "\\begin{equation*} K\\cdot X = \\omega t - k x_{k} \\end{equation*}\n", + " \\begin{align*} F = & - \\frac{B e^{i \\left(\\omega t - k x_{k}\\right)}}{\\sqrt{- \\left ( e_{E}\\cdot e_{B}\\right ) ^{2} + 1}} \\boldsymbol{e}_{E}\\wedge \\boldsymbol{e}_{k} \\\\ & + E e^{i \\left(\\omega t - k x_{k}\\right)} \\boldsymbol{e}_{E}\\wedge \\boldsymbol{t} \\\\ & - \\frac{\\left ( e_{E}\\cdot e_{B}\\right ) B e^{i \\left(\\omega t - k x_{k}\\right)}}{\\sqrt{- \\left ( e_{E}\\cdot e_{B}\\right ) ^{2} + 1}} \\boldsymbol{e}_{B}\\wedge \\boldsymbol{e}_{k} \\end{align*} \n", + " \\begin{align*} \\lp\\bm{\\nabla}F\\rp/\\lp ie^{iK\\cdot X} \\rp = 0 = & \\left ( - \\frac{B k}{\\sqrt{- \\left ( e_{E}\\cdot e_{B}\\right ) ^{2} + 1}} - E \\omega \\right ) \\boldsymbol{e}_{E} \\\\ & - \\frac{\\left ( e_{E}\\cdot e_{B}\\right ) B k}{\\sqrt{- \\left ( e_{E}\\cdot e_{B}\\right ) ^{2} + 1}} \\boldsymbol{e}_{B} \\\\ & + \\left ( - \\frac{B \\omega }{\\sqrt{- \\left ( e_{E}\\cdot e_{B}\\right ) ^{2} + 1}} - E k\\right ) \\boldsymbol{e}_{E}\\wedge \\boldsymbol{e}_{k}\\wedge \\boldsymbol{t} \\\\ & - \\frac{\\left ( e_{E}\\cdot e_{B}\\right ) B \\omega }{\\sqrt{- \\left ( e_{E}\\cdot e_{B}\\right ) ^{2} + 1}} \\boldsymbol{e}_{B}\\wedge \\boldsymbol{e}_{k}\\wedge \\boldsymbol{t} \\end{align*} \n", + "\\begin{equation*} \\mbox{Previous equation requires that: }e_{E}\\cdot e_{B} = 0\\mbox{ if }B\\ne 0\\mbox{ and }k\\ne 0 \\end{equation*}\n", + " \\begin{align*} \\lp\\bm{\\nabla}F\\rp/\\lp ie^{iK\\cdot X} \\rp = 0 = & \\left ( - B k - E \\omega \\right ) \\boldsymbol{e}_{E} \\\\ & + \\left ( - B \\omega - E k\\right ) \\boldsymbol{e}_{E}\\wedge \\boldsymbol{e}_{k}\\wedge \\boldsymbol{t} \\end{align*} \n", + "\\begin{equation*} 0 = - B k - E \\omega \\end{equation*}\n", + "\\begin{equation*} 0 = - B \\omega - E k \\end{equation*}\n", + "\\begin{equation*} \\mbox{eq3 = eq1-eq2: }0 = - \\frac{E \\omega }{k} + \\frac{E k}{\\omega } \\end{equation*}\n", + "\\begin{equation*} \\mbox{eq3 = (eq1-eq2)/E: }0 = - \\frac{\\omega }{k} + \\frac{k}{\\omega } \\end{equation*}\n", + "\\begin{equation*} k = \\left [ \\begin{array}{c} - \\omega \\\\ \\omega \\end{array}\\right ] \\end{equation*}\n", + "\\begin{equation*} B = \\left [ \\begin{array}{c} - E \\\\ E \\end{array}\\right ] \\end{equation*}\n", + "\\end{document}\n" + ] + }, + "metadata": {}, + "output_type": "display_data" } ], "source": [ - "!cat em_waves_latex.tex" - ] - }, - { - "cell_type": "code", - "execution_count": 16, - "metadata": {}, - "outputs": [], - "source": [ - "!python FmtChk.py" + "check('em_waves_latex')" ] }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 9, "metadata": {}, "outputs": [ { - "name": "stdout", - "output_type": "stream", - "text": [ - "\r\n", - "\\documentclass[10pt,fleqn]{report}\r\n", - "\\usepackage[vcentering]{geometry}\r\n", - "\\geometry{papersize={6in,7in},total={5in,6in}}\r\n", - "\r\n", - "\\pagestyle{empty}\r\n", - "\\usepackage[latin1]{inputenc}\r\n", - "\\usepackage{amsmath}\r\n", - "\\usepackage{amsfonts}\r\n", - "\\usepackage{amssymb}\r\n", - "\\usepackage{amsbsy}\r\n", - "\\usepackage{tensor}\r\n", - "\\usepackage{listings}\r\n", - "\\usepackage{color}\r\n", - "\\usepackage{xcolor}\r\n", - "\\usepackage{bm}\r\n", - "\\usepackage{breqn}\r\n", - "\\definecolor{gray}{rgb}{0.95,0.95,0.95}\r\n", - "\\setlength{\\parindent}{0pt}\r\n", - "\\DeclareMathOperator{\\Tr}{Tr}\r\n", - "\\DeclareMathOperator{\\Adj}{Adj}\r\n", - "\\newcommand{\\bfrac}[2]{\\displaystyle\\frac{#1}{#2}}\r\n", - "\\newcommand{\\lp}{\\left (}\r\n", - "\\newcommand{\\rp}{\\right )}\r\n", - "\\newcommand{\\paren}[1]{\\lp {#1} \\rp}\r\n", - "\\newcommand{\\half}{\\frac{1}{2}}\r\n", - "\\newcommand{\\llt}{\\left <}\r\n", - "\\newcommand{\\rgt}{\\right >}\r\n", - "\\newcommand{\\abs}[1]{\\left |{#1}\\right | }\r\n", - "\\newcommand{\\pdiff}[2]{\\bfrac{\\partial {#1}}{\\partial {#2}}}\r\n", - "\\newcommand{\\lbrc}{\\left \\{}\r\n", - "\\newcommand{\\rbrc}{\\right \\}}\r\n", - "\\newcommand{\\W}{\\wedge}\r\n", - "\\newcommand{\\prm}[1]{{#1}'}\r\n", - "\\newcommand{\\ddt}[1]{\\bfrac{d{#1}}{dt}}\r\n", - "\\newcommand{\\R}{\\dagger}\r\n", - "\\newcommand{\\deriv}[3]{\\bfrac{d^{#3}#1}{d{#2}^{#3}}}\r\n", - "\\newcommand{\\grade}[1]{\\left < {#1} \\right >}\r\n", - "\\newcommand{\\f}[2]{{#1}\\lp{#2}\\rp}\r\n", - "\\newcommand{\\eval}[2]{\\left . {#1} \\right |_{#2}}\r\n", - "\\newcommand{\\Nabla}{\\boldsymbol{\\nabla}}\r\n", - "\\newcommand{\\eb}{\\boldsymbol{e}}\r\n", - "\\usepackage{float}\r\n", - "\\floatstyle{plain} % optionally change the style of the new float\r\n", - "\\newfloat{Code}{H}{myc}\r\n", - "\\lstloadlanguages{Python}\r\n", - "\r\n", - "\\begin{document}\r\n", - "\\begin{equation*} \\begin{array}{c} \\left [ f , \\right. \\\\ F^{x} \\boldsymbol{e}_{x} + F^{y} \\boldsymbol{e}_{y} + F^{z} \\boldsymbol{e}_{z}, \\\\ \\left. B^{xy} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + B^{xz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + B^{yz} \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z}\\right ] \\\\ \\end{array} \\end{equation*}\r\n", - "\\begin{equation*} \\left [ \\begin{array}{ccc} f , & F^{x} \\boldsymbol{e}_{x} + F^{y} \\boldsymbol{e}_{y} + F^{z} \\boldsymbol{e}_{z}, & B^{xy} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + B^{xz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + B^{yz} \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z}\\\\ \\end{array} \\right ] \\end{equation*}\r\n", - " \\begin{align*} & F^{x} \\boldsymbol{e}_{x} \\\\ & + F^{y} \\boldsymbol{e}_{y} \\\\ & + F^{z} \\boldsymbol{e}_{z} \\end{align*} \r\n", - " \\begin{align*} & B^{xy} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} \\\\ & + B^{xz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} \\\\ & + B^{yz} \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{align*} \r\n", - "\\begin{equation*} \\nabla^{2} = \\nabla\\cdot\\nabla = \\frac{\\partial^{2}}{\\partial x^{2}} + \\frac{\\partial^{2}}{\\partial y^{2}} + \\frac{\\partial^{2}}{\\partial z^{2}} \\end{equation*}\r\n", - "\\begin{equation*} \\frac{\\partial^{2}}{\\partial x^{2}} + \\frac{\\partial^{2}}{\\partial y^{2}} + \\frac{\\partial^{2}}{\\partial z^{2}} + \\boldsymbol{e}_{x} \\frac{\\partial}{\\partial x} + \\boldsymbol{e}_{y} \\frac{\\partial}{\\partial y} + \\boldsymbol{e}_{z} \\frac{\\partial}{\\partial z} \\end{equation*}\r\n", - "\\end{document}\r\n" - ] + "data": { + "text/plain": [ + "\n", + "\\documentclass[10pt,fleqn]{report}\n", + "\\usepackage[vcentering]{geometry}\n", + "\\geometry{papersize={6in,7in},total={5in,6in}}\n", + "\n", + "\\pagestyle{empty}\n", + "\\usepackage[latin1]{inputenc}\n", + "\\usepackage{amsmath}\n", + "\\usepackage{amsfonts}\n", + "\\usepackage{amssymb}\n", + "\\usepackage{amsbsy}\n", + "\\usepackage{tensor}\n", + "\\usepackage{listings}\n", + "\\usepackage{color}\n", + "\\usepackage{xcolor}\n", + "\\usepackage{bm}\n", + "\\usepackage{breqn}\n", + "\\definecolor{gray}{rgb}{0.95,0.95,0.95}\n", + "\\setlength{\\parindent}{0pt}\n", + "\\DeclareMathOperator{\\Tr}{Tr}\n", + "\\DeclareMathOperator{\\Adj}{Adj}\n", + "\\newcommand{\\bfrac}[2]{\\displaystyle\\frac{#1}{#2}}\n", + "\\newcommand{\\lp}{\\left (}\n", + "\\newcommand{\\rp}{\\right )}\n", + "\\newcommand{\\paren}[1]{\\lp {#1} \\rp}\n", + "\\newcommand{\\half}{\\frac{1}{2}}\n", + "\\newcommand{\\llt}{\\left <}\n", + "\\newcommand{\\rgt}{\\right >}\n", + "\\newcommand{\\abs}[1]{\\left |{#1}\\right | }\n", + "\\newcommand{\\pdiff}[2]{\\bfrac{\\partial {#1}}{\\partial {#2}}}\n", + "\\newcommand{\\lbrc}{\\left \\{}\n", + "\\newcommand{\\rbrc}{\\right \\}}\n", + "\\newcommand{\\W}{\\wedge}\n", + "\\newcommand{\\prm}[1]{{#1}'}\n", + "\\newcommand{\\ddt}[1]{\\bfrac{d{#1}}{dt}}\n", + "\\newcommand{\\R}{\\dagger}\n", + "\\newcommand{\\deriv}[3]{\\bfrac{d^{#3}#1}{d{#2}^{#3}}}\n", + "\\newcommand{\\grade}[1]{\\left < {#1} \\right >}\n", + "\\newcommand{\\f}[2]{{#1}\\lp{#2}\\rp}\n", + "\\newcommand{\\eval}[2]{\\left . {#1} \\right |_{#2}}\n", + "\\newcommand{\\Nabla}{\\boldsymbol{\\nabla}}\n", + "\\newcommand{\\eb}{\\boldsymbol{e}}\n", + "\\usepackage{float}\n", + "\\floatstyle{plain} % optionally change the style of the new float\n", + "\\newfloat{Code}{H}{myc}\n", + "\\lstloadlanguages{Python}\n", + "\n", + "\\begin{document}\n", + "\\begin{equation*} \\begin{array}{c} \\left [ f , \\right. \\\\ F^{x} \\boldsymbol{e}_{x} + F^{y} \\boldsymbol{e}_{y} + F^{z} \\boldsymbol{e}_{z}, \\\\ \\left. B^{xy} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + B^{xz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + B^{yz} \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z}\\right ] \\\\ \\end{array} \\end{equation*}\n", + "\\begin{equation*} \\left [ \\begin{array}{ccc} f , & F^{x} \\boldsymbol{e}_{x} + F^{y} \\boldsymbol{e}_{y} + F^{z} \\boldsymbol{e}_{z}, & B^{xy} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + B^{xz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + B^{yz} \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z}\\\\ \\end{array} \\right ] \\end{equation*}\n", + " \\begin{align*} & F^{x} \\boldsymbol{e}_{x} \\\\ & + F^{y} \\boldsymbol{e}_{y} \\\\ & + F^{z} \\boldsymbol{e}_{z} \\end{align*} \n", + " \\begin{align*} & B^{xy} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} \\\\ & + B^{xz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} \\\\ & + B^{yz} \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{align*} \n", + "\\begin{equation*} \\nabla^{2} = \\nabla\\cdot\\nabla = \\frac{\\partial^{2}}{\\partial x^{2}} + \\frac{\\partial^{2}}{\\partial y^{2}} + \\frac{\\partial^{2}}{\\partial z^{2}} \\end{equation*}\n", + "\\begin{equation*} \\frac{\\partial^{2}}{\\partial x^{2}} + \\frac{\\partial^{2}}{\\partial y^{2}} + \\frac{\\partial^{2}}{\\partial z^{2}} + \\boldsymbol{e}_{x} \\frac{\\partial}{\\partial x} + \\boldsymbol{e}_{y} \\frac{\\partial}{\\partial y} + \\boldsymbol{e}_{z} \\frac{\\partial}{\\partial z} \\end{equation*}\n", + "\\end{document}\n" + ] + }, + "metadata": {}, + "output_type": "display_data" } ], "source": [ - "!cat FmtChk.tex" + "check('FmtChk')" ] }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 10, "metadata": {}, - "outputs": [], - "source": [ - "!python groups.py" - ] - }, - { - "cell_type": "code", - "execution_count": 19, - "metadata": { - "collapsed": false, - "scrolled": false - }, "outputs": [ { - "name": "stdout", - "output_type": "stream", - "text": [ - "\r\n", - "\\documentclass[10pt,fleqn]{report}\r\n", - "\\usepackage[vcentering]{geometry}\r\n", - "\\geometry{papersize={8.5in,11in},total={7.5in,10in}}\r\n", - "\r\n", - "\\pagestyle{empty}\r\n", - "\\usepackage[latin1]{inputenc}\r\n", - "\\usepackage{amsmath}\r\n", - "\\usepackage{amsfonts}\r\n", - "\\usepackage{amssymb}\r\n", - "\\usepackage{amsbsy}\r\n", - "\\usepackage{tensor}\r\n", - "\\usepackage{listings}\r\n", - "\\usepackage{color}\r\n", - "\\usepackage{xcolor}\r\n", - "\\usepackage{bm}\r\n", - "\\usepackage{breqn}\r\n", - "\\definecolor{gray}{rgb}{0.95,0.95,0.95}\r\n", - "\\setlength{\\parindent}{0pt}\r\n", - "\\DeclareMathOperator{\\Tr}{Tr}\r\n", - "\\DeclareMathOperator{\\Adj}{Adj}\r\n", - "\\newcommand{\\bfrac}[2]{\\displaystyle\\frac{#1}{#2}}\r\n", - "\\newcommand{\\lp}{\\left (}\r\n", - "\\newcommand{\\rp}{\\right )}\r\n", - "\\newcommand{\\paren}[1]{\\lp {#1} \\rp}\r\n", - "\\newcommand{\\half}{\\frac{1}{2}}\r\n", - "\\newcommand{\\llt}{\\left <}\r\n", - "\\newcommand{\\rgt}{\\right >}\r\n", - "\\newcommand{\\abs}[1]{\\left |{#1}\\right | }\r\n", - "\\newcommand{\\pdiff}[2]{\\bfrac{\\partial {#1}}{\\partial {#2}}}\r\n", - "\\newcommand{\\lbrc}{\\left \\{}\r\n", - "\\newcommand{\\rbrc}{\\right \\}}\r\n", - "\\newcommand{\\W}{\\wedge}\r\n", - "\\newcommand{\\prm}[1]{{#1}'}\r\n", - "\\newcommand{\\ddt}[1]{\\bfrac{d{#1}}{dt}}\r\n", - "\\newcommand{\\R}{\\dagger}\r\n", - "\\newcommand{\\deriv}[3]{\\bfrac{d^{#3}#1}{d{#2}^{#3}}}\r\n", - "\\newcommand{\\grade}[1]{\\left < {#1} \\right >}\r\n", - "\\newcommand{\\f}[2]{{#1}\\lp{#2}\\rp}\r\n", - "\\newcommand{\\eval}[2]{\\left . {#1} \\right |_{#2}}\r\n", - "\\newcommand{\\Nabla}{\\boldsymbol{\\nabla}}\r\n", - "\\newcommand{\\eb}{\\boldsymbol{e}}\r\n", - "\\usepackage{float}\r\n", - "\\floatstyle{plain} % optionally change the style of the new float\r\n", - "\\newfloat{Code}{H}{myc}\r\n", - "\\lstloadlanguages{Python}\r\n", - "\r\n", - "\\begin{document}\r\n", - "\\\\begin{lstlisting}[language=Python,showspaces=false,showstringspaces=false,backgroundcolor=\\color{gray},frame=single]\r\n", - "def Product_of_Rotors():\r\n", - " Print_Function()\r\n", - " (na,nb,nm,alpha,th,th_a,th_b) = symbols('n_a n_b n_m alpha theta theta_a theta_b',\\\r\n", - " real = True)\r\n", - " g = [[na, 0, alpha],[0, nm, 0],[alpha, 0, nb]] #metric tensor\r\n", - " \"\"\"\r\n", - " Values of metric tensor components\r\n", - " [na,nm,nb] = [+1/-1,+1/-1,+1/-1] alpha = ea|eb\r\n", - " \"\"\"\r\n", - " (g3d, ea, em, eb) = Ga.build('e_a e_m e_b', g=g)\r\n", - " print('g =',g3d.g)\r\n", - " print(r'%n_{a} = \\bm{e}_{a}^{2}\\;\\;n_{b} = \\bm{e}_{b}^{2}\\;\\;n_{m} = \\bm{e}_{m}^{2}'+\\\r\n", - " r'\\;\\;\\alpha = \\bm{e}_{a}\\cdot\\bm{e}_{b}')\r\n", - " (ca,cb,sa,sb) = symbols('c_a c_b s_a s_b',real=True)\r\n", - " Ra = ca + sa*ea*em # Rotor for ea^em plane\r\n", - " Rb = cb + sb*em*eb # Rotor for em^eb plane\r\n", - " print(r'%\\mbox{Rotor in }\\bm{e}_{a}\\bm{e}_{m}\\mbox{ plane } R_{a} =',Ra)\r\n", - " print(r'%\\mbox{Rotor in }\\bm{e}_{m}\\bm{e}_{b}\\mbox{ plane } R_{b} =',Rb)\r\n", - " Rab = Ra*Rb # Compound Rotor\r\n", - " \"\"\"\r\n", - " Show that compound rotor is scalar plus bivector\r\n", - " \"\"\"\r\n", - " print(r'%R_{a}R_{b} = S+\\bm{B} =', Rab)\r\n", - " Rab2 = Rab.get_grade(2)\r\n", - " print(r'%\\bm{B} =',Rab2)\r\n", - " Rab2sq = Rab2*Rab2 # Square of compound rotor bivector part\r\n", - " Ssq = (Rab.scalar())**2 # Square of compound rotor scalar part\r\n", - " Bsq = Rab2sq.scalar()\r\n", - " print(r'%S^{2} =',Ssq)\r\n", - " print(r'%\\bm{B}^{2} =',Bsq)\r\n", - " Dsq = (Ssq-Bsq).expand().simplify()\r\n", - " print('%S^{2}-B^{2} =', Dsq)\r\n", - " Dsq = Dsq.subs(nm**2,S(1)) # (e_m)**4 = 1\r\n", - " print('%S^{2}-B^{2} =', Dsq)\r\n", - " Cases = [S(-1),S(1)] # -1/+1 squares for each basis vector\r\n", - " print(r'#Consider all combinations of $\\bm{e}_{a}^{2}$, $\\bm{e}_{b}^{2}$'+\\\r\n", - " r' and $\\bm{e}_{m}^2$:')\r\n", - " for Na in Cases:\r\n", - " for Nb in Cases:\r\n", - " for Nm in Cases:\r\n", - " Ba_sq = -Na*Nm\r\n", - " Bb_sq = -Nb*Nm\r\n", - " if Ba_sq < 0:\r\n", - " Ca_th = cos(th_a)\r\n", - " Sa_th = sin(th_a)\r\n", - " else:\r\n", - " Ca_th = cosh(th_a)\r\n", - " Sa_th = sinh(th_a)\r\n", - " if Bb_sq < 0:\r\n", - " Cb_th = cos(th_b)\r\n", - " Sb_th = sin(th_b)\r\n", - " else:\r\n", - " Cb_th = cosh(th_b)\r\n", - " Sb_th = sinh(th_b)\r\n", - " print(r'%\\left [ \\bm{e}_{a}^{2},\\bm{e}_{b}^{2},\\bm{e}_{m}^2\\right ] =',\\\r\n", - " [Na,Nb,Nm])\r\n", - " Dsq_tmp = Dsq.subs({ca:Ca_th,sa:Sa_th,cb:Cb_th,sb:Sb_th,na:Na,nb:Nb,nm:Nm})\r\n", - " print(r'%S^{2}-\\bm{B}^{2} =',Dsq_tmp,' =',trigsimp(Dsq_tmp))\r\n", - " print(r'#Thus we have shown that $R_{a}R_{b} = S+\\bm{D} = e^{\\bm{C}}$ where $\\bm{C}$'+\\\r\n", - " r' is a bivector blade.')\r\n", - " return\r\n", - "\\end{lstlisting}\r\n", - "Code Output:\r\n", - "\\begin{equation*} g = \\left [ \\begin{array}{ccc} n_{a} & 0 & \\alpha \\\\ 0 & n_{m} & 0 \\\\ \\alpha & 0 & n_{b} \\end{array}\\right ] \\end{equation*}\r\n", - "\\begin{equation*} n_{a} = \\bm{e}_{a}^{2}\\;\\;n_{b} = \\bm{e}_{b}^{2}\\;\\;n_{m} = \\bm{e}_{m}^{2}\\;\\;\\alpha = \\bm{e}_{a}\\cdot\\bm{e}_{b} \\end{equation*}\r\n", - "\\begin{equation*} \\mbox{Rotor in }\\bm{e}_{a}\\bm{e}_{m}\\mbox{ plane } R_{a} = c_{a} + s_{a} \\boldsymbol{e}_{a}\\wedge \\boldsymbol{e}_{m} \\end{equation*}\r\n", - "\\begin{equation*} \\mbox{Rotor in }\\bm{e}_{m}\\bm{e}_{b}\\mbox{ plane } R_{b} = c_{b} + s_{b} \\boldsymbol{e}_{m}\\wedge \\boldsymbol{e}_{b} \\end{equation*}\r\n", - "\\begin{equation*} R_{a}R_{b} = S+\\bm{B} = \\left ( \\alpha n_{m} s_{a} s_{b} + c_{a} c_{b}\\right ) + c_{b} s_{a} \\boldsymbol{e}_{a}\\wedge \\boldsymbol{e}_{m} + n_{m} s_{a} s_{b} \\boldsymbol{e}_{a}\\wedge \\boldsymbol{e}_{b} + c_{a} s_{b} \\boldsymbol{e}_{m}\\wedge \\boldsymbol{e}_{b} \\end{equation*}\r\n", - "\\begin{equation*} \\bm{B} = c_{b} s_{a} \\boldsymbol{e}_{a}\\wedge \\boldsymbol{e}_{m} + n_{m} s_{a} s_{b} \\boldsymbol{e}_{a}\\wedge \\boldsymbol{e}_{b} + c_{a} s_{b} \\boldsymbol{e}_{m}\\wedge \\boldsymbol{e}_{b} \\end{equation*}\r\n", - "\\begin{equation*} S^{2} = \\left(\\alpha n_{m} s_{a} s_{b} + c_{a} c_{b}\\right)^{2} \\end{equation*}\r\n", - "\\begin{equation*} \\bm{B}^{2} = \\alpha ^{2} {\\left ( n_{m} \\right )}^{2} {\\left ( s_{a} \\right )}^{2} {\\left ( s_{b} \\right )}^{2} + 2 \\alpha c_{a} c_{b} n_{m} s_{a} s_{b} - {\\left ( c_{a} \\right )}^{2} n_{b} n_{m} {\\left ( s_{b} \\right )}^{2} - {\\left ( c_{b} \\right )}^{2} n_{a} n_{m} {\\left ( s_{a} \\right )}^{2} - n_{a} n_{b} {\\left ( n_{m} \\right )}^{2} {\\left ( s_{a} \\right )}^{2} {\\left ( s_{b} \\right )}^{2} \\end{equation*}\r\n", - "\\begin{equation*} S^{2}-B^{2} = {\\left ( c_{a} \\right )}^{2} {\\left ( c_{b} \\right )}^{2} + {\\left ( c_{a} \\right )}^{2} n_{b} n_{m} {\\left ( s_{b} \\right )}^{2} + {\\left ( c_{b} \\right )}^{2} n_{a} n_{m} {\\left ( s_{a} \\right )}^{2} + n_{a} n_{b} {\\left ( n_{m} \\right )}^{2} {\\left ( s_{a} \\right )}^{2} {\\left ( s_{b} \\right )}^{2} \\end{equation*}\r\n", - "\\begin{equation*} S^{2}-B^{2} = {\\left ( c_{a} \\right )}^{2} {\\left ( c_{b} \\right )}^{2} + {\\left ( c_{a} \\right )}^{2} n_{b} n_{m} {\\left ( s_{b} \\right )}^{2} + {\\left ( c_{b} \\right )}^{2} n_{a} n_{m} {\\left ( s_{a} \\right )}^{2} + n_{a} n_{b} {\\left ( s_{a} \\right )}^{2} {\\left ( s_{b} \\right )}^{2} \\end{equation*}\r\n", - "Consider all combinations of $\\bm{e}_{a}^{2}$, $\\bm{e}_{b}^{2}$ and $\\bm{e}_{m}^2$:\r\n", - "\\begin{equation*} \\left [ \\bm{e}_{a}^{2},\\bm{e}_{b}^{2},\\bm{e}_{m}^2\\right ] = [-1, -1, -1] \\end{equation*}\r\n", - "\\begin{equation*} S^{2}-\\bm{B}^{2} = {\\sin{\\left (\\theta _{a} \\right )}}^{2} {\\sin{\\left (\\theta _{b} \\right )}}^{2} + {\\sin{\\left (\\theta _{a} \\right )}}^{2} {\\cos{\\left (\\theta _{b} \\right )}}^{2} + {\\sin{\\left (\\theta _{b} \\right )}}^{2} {\\cos{\\left (\\theta _{a} \\right )}}^{2} + {\\cos{\\left (\\theta _{a} \\right )}}^{2} {\\cos{\\left (\\theta _{b} \\right )}}^{2} = 1 \\end{equation*}\r\n", - "\\begin{equation*} \\left [ \\bm{e}_{a}^{2},\\bm{e}_{b}^{2},\\bm{e}_{m}^2\\right ] = [-1, -1, 1] \\end{equation*}\r\n", - "\\begin{equation*} S^{2}-\\bm{B}^{2} = {\\sinh{\\left (\\theta _{a} \\right )}}^{2} {\\sinh{\\left (\\theta _{b} \\right )}}^{2} - {\\sinh{\\left (\\theta _{a} \\right )}}^{2} {\\cosh{\\left (\\theta _{b} \\right )}}^{2} - {\\sinh{\\left (\\theta _{b} \\right )}}^{2} {\\cosh{\\left (\\theta _{a} \\right )}}^{2} + {\\cosh{\\left (\\theta _{a} \\right )}}^{2} {\\cosh{\\left (\\theta _{b} \\right )}}^{2} = 1 \\end{equation*}\r\n", - "\\begin{equation*} \\left [ \\bm{e}_{a}^{2},\\bm{e}_{b}^{2},\\bm{e}_{m}^2\\right ] = [-1, 1, -1] \\end{equation*}\r\n", - "\\begin{equation*} S^{2}-\\bm{B}^{2} = - {\\sin{\\left (\\theta _{a} \\right )}}^{2} {\\sinh{\\left (\\theta _{b} \\right )}}^{2} + {\\sin{\\left (\\theta _{a} \\right )}}^{2} {\\cosh{\\left (\\theta _{b} \\right )}}^{2} - {\\cos{\\left (\\theta _{a} \\right )}}^{2} {\\sinh{\\left (\\theta _{b} \\right )}}^{2} + {\\cos{\\left (\\theta _{a} \\right )}}^{2} {\\cosh{\\left (\\theta _{b} \\right )}}^{2} = 1 \\end{equation*}\r\n", - "\\begin{equation*} \\left [ \\bm{e}_{a}^{2},\\bm{e}_{b}^{2},\\bm{e}_{m}^2\\right ] = [-1, 1, 1] \\end{equation*}\r\n", - "\\begin{equation*} S^{2}-\\bm{B}^{2} = - {\\sin{\\left (\\theta _{b} \\right )}}^{2} {\\sinh{\\left (\\theta _{a} \\right )}}^{2} + {\\sin{\\left (\\theta _{b} \\right )}}^{2} {\\cosh{\\left (\\theta _{a} \\right )}}^{2} - {\\cos{\\left (\\theta _{b} \\right )}}^{2} {\\sinh{\\left (\\theta _{a} \\right )}}^{2} + {\\cos{\\left (\\theta _{b} \\right )}}^{2} {\\cosh{\\left (\\theta _{a} \\right )}}^{2} = 1 \\end{equation*}\r\n", - "\\begin{equation*} \\left [ \\bm{e}_{a}^{2},\\bm{e}_{b}^{2},\\bm{e}_{m}^2\\right ] = [1, -1, -1] \\end{equation*}\r\n", - "\\begin{equation*} S^{2}-\\bm{B}^{2} = - {\\sin{\\left (\\theta _{b} \\right )}}^{2} {\\sinh{\\left (\\theta _{a} \\right )}}^{2} + {\\sin{\\left (\\theta _{b} \\right )}}^{2} {\\cosh{\\left (\\theta _{a} \\right )}}^{2} - {\\cos{\\left (\\theta _{b} \\right )}}^{2} {\\sinh{\\left (\\theta _{a} \\right )}}^{2} + {\\cos{\\left (\\theta _{b} \\right )}}^{2} {\\cosh{\\left (\\theta _{a} \\right )}}^{2} = 1 \\end{equation*}\r\n", - "\\begin{equation*} \\left [ \\bm{e}_{a}^{2},\\bm{e}_{b}^{2},\\bm{e}_{m}^2\\right ] = [1, -1, 1] \\end{equation*}\r\n", - "\\begin{equation*} S^{2}-\\bm{B}^{2} = - {\\sin{\\left (\\theta _{a} \\right )}}^{2} {\\sinh{\\left (\\theta _{b} \\right )}}^{2} + {\\sin{\\left (\\theta _{a} \\right )}}^{2} {\\cosh{\\left (\\theta _{b} \\right )}}^{2} - {\\cos{\\left (\\theta _{a} \\right )}}^{2} {\\sinh{\\left (\\theta _{b} \\right )}}^{2} + {\\cos{\\left (\\theta _{a} \\right )}}^{2} {\\cosh{\\left (\\theta _{b} \\right )}}^{2} = 1 \\end{equation*}\r\n", - "\\begin{equation*} \\left [ \\bm{e}_{a}^{2},\\bm{e}_{b}^{2},\\bm{e}_{m}^2\\right ] = [1, 1, -1] \\end{equation*}\r\n", - "\\begin{equation*} S^{2}-\\bm{B}^{2} = {\\sinh{\\left (\\theta _{a} \\right )}}^{2} {\\sinh{\\left (\\theta _{b} \\right )}}^{2} - {\\sinh{\\left (\\theta _{a} \\right )}}^{2} {\\cosh{\\left (\\theta _{b} \\right )}}^{2} - {\\sinh{\\left (\\theta _{b} \\right )}}^{2} {\\cosh{\\left (\\theta _{a} \\right )}}^{2} + {\\cosh{\\left (\\theta _{a} \\right )}}^{2} {\\cosh{\\left (\\theta _{b} \\right )}}^{2} = 1 \\end{equation*}\r\n", - "\\begin{equation*} \\left [ \\bm{e}_{a}^{2},\\bm{e}_{b}^{2},\\bm{e}_{m}^2\\right ] = [1, 1, 1] \\end{equation*}\r\n", - "\\begin{equation*} S^{2}-\\bm{B}^{2} = {\\sin{\\left (\\theta _{a} \\right )}}^{2} {\\sin{\\left (\\theta _{b} \\right )}}^{2} + {\\sin{\\left (\\theta _{a} \\right )}}^{2} {\\cos{\\left (\\theta _{b} \\right )}}^{2} + {\\sin{\\left (\\theta _{b} \\right )}}^{2} {\\cos{\\left (\\theta _{a} \\right )}}^{2} + {\\cos{\\left (\\theta _{a} \\right )}}^{2} {\\cos{\\left (\\theta _{b} \\right )}}^{2} = 1 \\end{equation*}\r\n", - "Thus we have shown that $R_{a}R_{b} = S+\\bm{D} = e^{\\bm{C}}$ where $\\bm{C}$ is a bivector blade.\r\n", - "\\end{document}\r\n" - ] + "data": { + "text/plain": [ + "\n", + "\\documentclass[10pt,fleqn]{report}\n", + "\\usepackage[vcentering]{geometry}\n", + "\\geometry{papersize={8.5in,11in},total={7.5in,10in}}\n", + "\n", + "\\pagestyle{empty}\n", + "\\usepackage[latin1]{inputenc}\n", + "\\usepackage{amsmath}\n", + "\\usepackage{amsfonts}\n", + "\\usepackage{amssymb}\n", + "\\usepackage{amsbsy}\n", + "\\usepackage{tensor}\n", + "\\usepackage{listings}\n", + "\\usepackage{color}\n", + "\\usepackage{xcolor}\n", + "\\usepackage{bm}\n", + "\\usepackage{breqn}\n", + "\\definecolor{gray}{rgb}{0.95,0.95,0.95}\n", + "\\setlength{\\parindent}{0pt}\n", + "\\DeclareMathOperator{\\Tr}{Tr}\n", + "\\DeclareMathOperator{\\Adj}{Adj}\n", + "\\newcommand{\\bfrac}[2]{\\displaystyle\\frac{#1}{#2}}\n", + "\\newcommand{\\lp}{\\left (}\n", + "\\newcommand{\\rp}{\\right )}\n", + "\\newcommand{\\paren}[1]{\\lp {#1} \\rp}\n", + "\\newcommand{\\half}{\\frac{1}{2}}\n", + "\\newcommand{\\llt}{\\left <}\n", + "\\newcommand{\\rgt}{\\right >}\n", + "\\newcommand{\\abs}[1]{\\left |{#1}\\right | }\n", + "\\newcommand{\\pdiff}[2]{\\bfrac{\\partial {#1}}{\\partial {#2}}}\n", + "\\newcommand{\\lbrc}{\\left \\{}\n", + "\\newcommand{\\rbrc}{\\right \\}}\n", + "\\newcommand{\\W}{\\wedge}\n", + "\\newcommand{\\prm}[1]{{#1}'}\n", + "\\newcommand{\\ddt}[1]{\\bfrac{d{#1}}{dt}}\n", + "\\newcommand{\\R}{\\dagger}\n", + "\\newcommand{\\deriv}[3]{\\bfrac{d^{#3}#1}{d{#2}^{#3}}}\n", + "\\newcommand{\\grade}[1]{\\left < {#1} \\right >}\n", + "\\newcommand{\\f}[2]{{#1}\\lp{#2}\\rp}\n", + "\\newcommand{\\eval}[2]{\\left . {#1} \\right |_{#2}}\n", + "\\newcommand{\\Nabla}{\\boldsymbol{\\nabla}}\n", + "\\newcommand{\\eb}{\\boldsymbol{e}}\n", + "\\usepackage{float}\n", + "\\floatstyle{plain} % optionally change the style of the new float\n", + "\\newfloat{Code}{H}{myc}\n", + "\\lstloadlanguages{Python}\n", + "\n", + "\\begin{document}\n", + "\\\\begin{lstlisting}[language=Python,showspaces=false,showstringspaces=false,backgroundcolor=\\color{gray},frame=single]\n", + "def Product_of_Rotors():\n", + " Print_Function()\n", + " (na,nb,nm,alpha,th,th_a,th_b) = symbols('n_a n_b n_m alpha theta theta_a theta_b',\\\n", + " real = True)\n", + " g = [[na, 0, alpha],[0, nm, 0],[alpha, 0, nb]] #metric tensor\n", + " \"\"\"\n", + " Values of metric tensor components\n", + " [na,nm,nb] = [+1/-1,+1/-1,+1/-1] alpha = ea|eb\n", + " \"\"\"\n", + " (g3d, ea, em, eb) = Ga.build('e_a e_m e_b', g=g)\n", + " print('g =',g3d.g)\n", + " print(r'%n_{a} = \\bm{e}_{a}^{2}\\;\\;n_{b} = \\bm{e}_{b}^{2}\\;\\;n_{m} = \\bm{e}_{m}^{2}'+\\\n", + " r'\\;\\;\\alpha = \\bm{e}_{a}\\cdot\\bm{e}_{b}')\n", + " (ca,cb,sa,sb) = symbols('c_a c_b s_a s_b',real=True)\n", + " Ra = ca + sa*ea*em # Rotor for ea^em plane\n", + " Rb = cb + sb*em*eb # Rotor for em^eb plane\n", + " print(r'%\\mbox{Rotor in }\\bm{e}_{a}\\bm{e}_{m}\\mbox{ plane } R_{a} =',Ra)\n", + " print(r'%\\mbox{Rotor in }\\bm{e}_{m}\\bm{e}_{b}\\mbox{ plane } R_{b} =',Rb)\n", + " Rab = Ra*Rb # Compound Rotor\n", + " \"\"\"\n", + " Show that compound rotor is scalar plus bivector\n", + " \"\"\"\n", + " print(r'%R_{a}R_{b} = S+\\bm{B} =', Rab)\n", + " Rab2 = Rab.get_grade(2)\n", + " print(r'%\\bm{B} =',Rab2)\n", + " Rab2sq = Rab2*Rab2 # Square of compound rotor bivector part\n", + " Ssq = (Rab.scalar())**2 # Square of compound rotor scalar part\n", + " Bsq = Rab2sq.scalar()\n", + " print(r'%S^{2} =',Ssq)\n", + " print(r'%\\bm{B}^{2} =',Bsq)\n", + " Dsq = (Ssq-Bsq).expand().simplify()\n", + " print('%S^{2}-B^{2} =', Dsq)\n", + " Dsq = Dsq.subs(nm**2,S(1)) # (e_m)**4 = 1\n", + " print('%S^{2}-B^{2} =', Dsq)\n", + " Cases = [S(-1),S(1)] # -1/+1 squares for each basis vector\n", + " print(r'#Consider all combinations of $\\bm{e}_{a}^{2}$, $\\bm{e}_{b}^{2}$'+\\\n", + " r' and $\\bm{e}_{m}^2$:')\n", + " for Na in Cases:\n", + " for Nb in Cases:\n", + " for Nm in Cases:\n", + " Ba_sq = -Na*Nm\n", + " Bb_sq = -Nb*Nm\n", + " if Ba_sq < 0:\n", + " Ca_th = cos(th_a)\n", + " Sa_th = sin(th_a)\n", + " else:\n", + " Ca_th = cosh(th_a)\n", + " Sa_th = sinh(th_a)\n", + " if Bb_sq < 0:\n", + " Cb_th = cos(th_b)\n", + " Sb_th = sin(th_b)\n", + " else:\n", + " Cb_th = cosh(th_b)\n", + " Sb_th = sinh(th_b)\n", + " print(r'%\\left [ \\bm{e}_{a}^{2},\\bm{e}_{b}^{2},\\bm{e}_{m}^2\\right ] =',\\\n", + " [Na,Nb,Nm])\n", + " Dsq_tmp = Dsq.subs({ca:Ca_th,sa:Sa_th,cb:Cb_th,sb:Sb_th,na:Na,nb:Nb,nm:Nm})\n", + " print(r'%S^{2}-\\bm{B}^{2} =',Dsq_tmp,' =',trigsimp(Dsq_tmp))\n", + " print(r'#Thus we have shown that $R_{a}R_{b} = S+\\bm{D} = e^{\\bm{C}}$ where $\\bm{C}$'+\\\n", + " r' is a bivector blade.')\n", + " return\n", + "\\end{lstlisting}\n", + "Code Output:\n", + "\\begin{equation*} g = \\left [ \\begin{array}{ccc} n_{a} & 0 & \\alpha \\\\ 0 & n_{m} & 0 \\\\ \\alpha & 0 & n_{b} \\end{array}\\right ] \\end{equation*}\n", + "\\begin{equation*} n_{a} = \\bm{e}_{a}^{2}\\;\\;n_{b} = \\bm{e}_{b}^{2}\\;\\;n_{m} = \\bm{e}_{m}^{2}\\;\\;\\alpha = \\bm{e}_{a}\\cdot\\bm{e}_{b} \\end{equation*}\n", + "\\begin{equation*} \\mbox{Rotor in }\\bm{e}_{a}\\bm{e}_{m}\\mbox{ plane } R_{a} = c_{a} + s_{a} \\boldsymbol{e}_{a}\\wedge \\boldsymbol{e}_{m} \\end{equation*}\n", + "\\begin{equation*} \\mbox{Rotor in }\\bm{e}_{m}\\bm{e}_{b}\\mbox{ plane } R_{b} = c_{b} + s_{b} \\boldsymbol{e}_{m}\\wedge \\boldsymbol{e}_{b} \\end{equation*}\n", + "\\begin{equation*} R_{a}R_{b} = S+\\bm{B} = \\left ( \\alpha n_{m} s_{a} s_{b} + c_{a} c_{b}\\right ) + c_{b} s_{a} \\boldsymbol{e}_{a}\\wedge \\boldsymbol{e}_{m} + n_{m} s_{a} s_{b} \\boldsymbol{e}_{a}\\wedge \\boldsymbol{e}_{b} + c_{a} s_{b} \\boldsymbol{e}_{m}\\wedge \\boldsymbol{e}_{b} \\end{equation*}\n", + "\\begin{equation*} \\bm{B} = c_{b} s_{a} \\boldsymbol{e}_{a}\\wedge \\boldsymbol{e}_{m} + n_{m} s_{a} s_{b} \\boldsymbol{e}_{a}\\wedge \\boldsymbol{e}_{b} + c_{a} s_{b} \\boldsymbol{e}_{m}\\wedge \\boldsymbol{e}_{b} \\end{equation*}\n", + "\\begin{equation*} S^{2} = \\left(\\alpha n_{m} s_{a} s_{b} + c_{a} c_{b}\\right)^{2} \\end{equation*}\n", + "\\begin{equation*} \\bm{B}^{2} = \\alpha ^{2} {\\left ( n_{m} \\right )}^{2} {\\left ( s_{a} \\right )}^{2} {\\left ( s_{b} \\right )}^{2} + 2 \\alpha c_{a} c_{b} n_{m} s_{a} s_{b} - {\\left ( c_{a} \\right )}^{2} n_{b} n_{m} {\\left ( s_{b} \\right )}^{2} - {\\left ( c_{b} \\right )}^{2} n_{a} n_{m} {\\left ( s_{a} \\right )}^{2} - n_{a} n_{b} {\\left ( n_{m} \\right )}^{2} {\\left ( s_{a} \\right )}^{2} {\\left ( s_{b} \\right )}^{2} \\end{equation*}\n", + "\\begin{equation*} S^{2}-B^{2} = {\\left ( c_{a} \\right )}^{2} {\\left ( c_{b} \\right )}^{2} + {\\left ( c_{a} \\right )}^{2} n_{b} n_{m} {\\left ( s_{b} \\right )}^{2} + {\\left ( c_{b} \\right )}^{2} n_{a} n_{m} {\\left ( s_{a} \\right )}^{2} + n_{a} n_{b} {\\left ( n_{m} \\right )}^{2} {\\left ( s_{a} \\right )}^{2} {\\left ( s_{b} \\right )}^{2} \\end{equation*}\n", + "\\begin{equation*} S^{2}-B^{2} = {\\left ( c_{a} \\right )}^{2} {\\left ( c_{b} \\right )}^{2} + {\\left ( c_{a} \\right )}^{2} n_{b} n_{m} {\\left ( s_{b} \\right )}^{2} + {\\left ( c_{b} \\right )}^{2} n_{a} n_{m} {\\left ( s_{a} \\right )}^{2} + n_{a} n_{b} {\\left ( s_{a} \\right )}^{2} {\\left ( s_{b} \\right )}^{2} \\end{equation*}\n", + "Consider all combinations of $\\bm{e}_{a}^{2}$, $\\bm{e}_{b}^{2}$ and $\\bm{e}_{m}^2$:\n", + "\\begin{equation*} \\left [ \\bm{e}_{a}^{2},\\bm{e}_{b}^{2},\\bm{e}_{m}^2\\right ] = [-1, -1, -1] \\end{equation*}\n", + "\\begin{equation*} S^{2}-\\bm{B}^{2} = {\\sin{\\left (\\theta _{a} \\right )}}^{2} {\\sin{\\left (\\theta _{b} \\right )}}^{2} + {\\sin{\\left (\\theta _{a} \\right )}}^{2} {\\cos{\\left (\\theta _{b} \\right )}}^{2} + {\\sin{\\left (\\theta _{b} \\right )}}^{2} {\\cos{\\left (\\theta _{a} \\right )}}^{2} + {\\cos{\\left (\\theta _{a} \\right )}}^{2} {\\cos{\\left (\\theta _{b} \\right )}}^{2} = 1 \\end{equation*}\n", + "\\begin{equation*} \\left [ \\bm{e}_{a}^{2},\\bm{e}_{b}^{2},\\bm{e}_{m}^2\\right ] = [-1, -1, 1] \\end{equation*}\n", + "\\begin{equation*} S^{2}-\\bm{B}^{2} = {\\sinh{\\left (\\theta _{a} \\right )}}^{2} {\\sinh{\\left (\\theta _{b} \\right )}}^{2} - {\\sinh{\\left (\\theta _{a} \\right )}}^{2} {\\cosh{\\left (\\theta _{b} \\right )}}^{2} - {\\sinh{\\left (\\theta _{b} \\right )}}^{2} {\\cosh{\\left (\\theta _{a} \\right )}}^{2} + {\\cosh{\\left (\\theta _{a} \\right )}}^{2} {\\cosh{\\left (\\theta _{b} \\right )}}^{2} = 1 \\end{equation*}\n", + "\\begin{equation*} \\left [ \\bm{e}_{a}^{2},\\bm{e}_{b}^{2},\\bm{e}_{m}^2\\right ] = [-1, 1, -1] \\end{equation*}\n", + "\\begin{equation*} S^{2}-\\bm{B}^{2} = - {\\sin{\\left (\\theta _{a} \\right )}}^{2} {\\sinh{\\left (\\theta _{b} \\right )}}^{2} + {\\sin{\\left (\\theta _{a} \\right )}}^{2} {\\cosh{\\left (\\theta _{b} \\right )}}^{2} - {\\cos{\\left (\\theta _{a} \\right )}}^{2} {\\sinh{\\left (\\theta _{b} \\right )}}^{2} + {\\cos{\\left (\\theta _{a} \\right )}}^{2} {\\cosh{\\left (\\theta _{b} \\right )}}^{2} = 1 \\end{equation*}\n", + "\\begin{equation*} \\left [ \\bm{e}_{a}^{2},\\bm{e}_{b}^{2},\\bm{e}_{m}^2\\right ] = [-1, 1, 1] \\end{equation*}\n", + "\\begin{equation*} S^{2}-\\bm{B}^{2} = - {\\sin{\\left (\\theta _{b} \\right )}}^{2} {\\sinh{\\left (\\theta _{a} \\right )}}^{2} + {\\sin{\\left (\\theta _{b} \\right )}}^{2} {\\cosh{\\left (\\theta _{a} \\right )}}^{2} - {\\cos{\\left (\\theta _{b} \\right )}}^{2} {\\sinh{\\left (\\theta _{a} \\right )}}^{2} + {\\cos{\\left (\\theta _{b} \\right )}}^{2} {\\cosh{\\left (\\theta _{a} \\right )}}^{2} = 1 \\end{equation*}\n", + "\\begin{equation*} \\left [ \\bm{e}_{a}^{2},\\bm{e}_{b}^{2},\\bm{e}_{m}^2\\right ] = [1, -1, -1] \\end{equation*}\n", + "\\begin{equation*} S^{2}-\\bm{B}^{2} = - {\\sin{\\left (\\theta _{b} \\right )}}^{2} {\\sinh{\\left (\\theta _{a} \\right )}}^{2} + {\\sin{\\left (\\theta _{b} \\right )}}^{2} {\\cosh{\\left (\\theta _{a} \\right )}}^{2} - {\\cos{\\left (\\theta _{b} \\right )}}^{2} {\\sinh{\\left (\\theta _{a} \\right )}}^{2} + {\\cos{\\left (\\theta _{b} \\right )}}^{2} {\\cosh{\\left (\\theta _{a} \\right )}}^{2} = 1 \\end{equation*}\n", + "\\begin{equation*} \\left [ \\bm{e}_{a}^{2},\\bm{e}_{b}^{2},\\bm{e}_{m}^2\\right ] = [1, -1, 1] \\end{equation*}\n", + "\\begin{equation*} S^{2}-\\bm{B}^{2} = - {\\sin{\\left (\\theta _{a} \\right )}}^{2} {\\sinh{\\left (\\theta _{b} \\right )}}^{2} + {\\sin{\\left (\\theta _{a} \\right )}}^{2} {\\cosh{\\left (\\theta _{b} \\right )}}^{2} - {\\cos{\\left (\\theta _{a} \\right )}}^{2} {\\sinh{\\left (\\theta _{b} \\right )}}^{2} + {\\cos{\\left (\\theta _{a} \\right )}}^{2} {\\cosh{\\left (\\theta _{b} \\right )}}^{2} = 1 \\end{equation*}\n", + "\\begin{equation*} \\left [ \\bm{e}_{a}^{2},\\bm{e}_{b}^{2},\\bm{e}_{m}^2\\right ] = [1, 1, -1] \\end{equation*}\n", + "\\begin{equation*} S^{2}-\\bm{B}^{2} = {\\sinh{\\left (\\theta _{a} \\right )}}^{2} {\\sinh{\\left (\\theta _{b} \\right )}}^{2} - {\\sinh{\\left (\\theta _{a} \\right )}}^{2} {\\cosh{\\left (\\theta _{b} \\right )}}^{2} - {\\sinh{\\left (\\theta _{b} \\right )}}^{2} {\\cosh{\\left (\\theta _{a} \\right )}}^{2} + {\\cosh{\\left (\\theta _{a} \\right )}}^{2} {\\cosh{\\left (\\theta _{b} \\right )}}^{2} = 1 \\end{equation*}\n", + "\\begin{equation*} \\left [ \\bm{e}_{a}^{2},\\bm{e}_{b}^{2},\\bm{e}_{m}^2\\right ] = [1, 1, 1] \\end{equation*}\n", + "\\begin{equation*} S^{2}-\\bm{B}^{2} = {\\sin{\\left (\\theta _{a} \\right )}}^{2} {\\sin{\\left (\\theta _{b} \\right )}}^{2} + {\\sin{\\left (\\theta _{a} \\right )}}^{2} {\\cos{\\left (\\theta _{b} \\right )}}^{2} + {\\sin{\\left (\\theta _{b} \\right )}}^{2} {\\cos{\\left (\\theta _{a} \\right )}}^{2} + {\\cos{\\left (\\theta _{a} \\right )}}^{2} {\\cos{\\left (\\theta _{b} \\right )}}^{2} = 1 \\end{equation*}\n", + "Thus we have shown that $R_{a}R_{b} = S+\\bm{D} = e^{\\bm{C}}$ where $\\bm{C}$ is a bivector blade.\n", + "\\end{document}\n" + ] + }, + "metadata": {}, + "output_type": "display_data" } ], "source": [ - "!cat groups.tex" + "check('groups')" ] }, { "cell_type": "code", - "execution_count": 20, + "execution_count": 11, "metadata": {}, - "outputs": [], - "source": [ - "!python latex_check.py" - ] - }, - { - "cell_type": "code", - "execution_count": 21, - "metadata": { - "collapsed": false, - "scrolled": false - }, "outputs": [ { - "name": "stdout", - "output_type": "stream", - "text": [ - "\r\n", - "\\documentclass[10pt,fleqn]{report}\r\n", - "\\usepackage[vcentering]{geometry}\r\n", - "\\geometry{papersize={14in,11in},total={13in,10in}}\r\n", - "\r\n", - "\\pagestyle{empty}\r\n", - "\\usepackage[latin1]{inputenc}\r\n", - "\\usepackage{amsmath}\r\n", - "\\usepackage{amsfonts}\r\n", - "\\usepackage{amssymb}\r\n", - "\\usepackage{amsbsy}\r\n", - "\\usepackage{tensor}\r\n", - "\\usepackage{listings}\r\n", - "\\usepackage{color}\r\n", - "\\usepackage{xcolor}\r\n", - "\\usepackage{bm}\r\n", - "\\usepackage{breqn}\r\n", - "\\definecolor{gray}{rgb}{0.95,0.95,0.95}\r\n", - "\\setlength{\\parindent}{0pt}\r\n", - "\\DeclareMathOperator{\\Tr}{Tr}\r\n", - "\\DeclareMathOperator{\\Adj}{Adj}\r\n", - "\\newcommand{\\bfrac}[2]{\\displaystyle\\frac{#1}{#2}}\r\n", - "\\newcommand{\\lp}{\\left (}\r\n", - "\\newcommand{\\rp}{\\right )}\r\n", - "\\newcommand{\\paren}[1]{\\lp {#1} \\rp}\r\n", - "\\newcommand{\\half}{\\frac{1}{2}}\r\n", - "\\newcommand{\\llt}{\\left <}\r\n", - "\\newcommand{\\rgt}{\\right >}\r\n", - "\\newcommand{\\abs}[1]{\\left |{#1}\\right | }\r\n", - "\\newcommand{\\pdiff}[2]{\\bfrac{\\partial {#1}}{\\partial {#2}}}\r\n", - "\\newcommand{\\lbrc}{\\left \\{}\r\n", - "\\newcommand{\\rbrc}{\\right \\}}\r\n", - "\\newcommand{\\W}{\\wedge}\r\n", - "\\newcommand{\\prm}[1]{{#1}'}\r\n", - "\\newcommand{\\ddt}[1]{\\bfrac{d{#1}}{dt}}\r\n", - "\\newcommand{\\R}{\\dagger}\r\n", - "\\newcommand{\\deriv}[3]{\\bfrac{d^{#3}#1}{d{#2}^{#3}}}\r\n", - "\\newcommand{\\grade}[1]{\\left < {#1} \\right >}\r\n", - "\\newcommand{\\f}[2]{{#1}\\lp{#2}\\rp}\r\n", - "\\newcommand{\\eval}[2]{\\left . {#1} \\right |_{#2}}\r\n", - "\\newcommand{\\Nabla}{\\boldsymbol{\\nabla}}\r\n", - "\\newcommand{\\eb}{\\boldsymbol{e}}\r\n", - "\\usepackage{float}\r\n", - "\\floatstyle{plain} % optionally change the style of the new float\r\n", - "\\newfloat{Code}{H}{myc}\r\n", - "\\lstloadlanguages{Python}\r\n", - "\r\n", - "\\begin{document}\r\n", - "\\\\begin{lstlisting}[language=Python,showspaces=false,showstringspaces=false,backgroundcolor=\\color{gray},frame=single]\r\n", - "def basic_multivector_operations_3D():\r\n", - " Print_Function()\r\n", - " g3d = Ga('e*x|y|z')\r\n", - " (ex,ey,ez) = g3d.mv()\r\n", - " A = g3d.mv('A','mv')\r\n", - " print(A.Fmt(1,'A'))\r\n", - " print(A.Fmt(2,'A'))\r\n", - " print(A.Fmt(3,'A'))\r\n", - " print(A.even().Fmt(1,'%A_{+}'))\r\n", - " print(A.odd().Fmt(1,'%A_{-}'))\r\n", - " X = g3d.mv('X','vector')\r\n", - " Y = g3d.mv('Y','vector')\r\n", - " print('g_{ij} = ',g3d.g)\r\n", - " print(X.Fmt(1,'X'))\r\n", - " print(Y.Fmt(1,'Y'))\r\n", - " print((X*Y).Fmt(2,'X*Y'))\r\n", - " print((X^Y).Fmt(2,'X^Y'))\r\n", - " print((X|Y).Fmt(2,'X|Y'))\r\n", - " print(cross(X,Y).Fmt(1,r'X\\times Y'))\r\n", - " return\r\n", - "\\end{lstlisting}\r\n", - "Code Output:\r\n", - "\\begin{equation*} A = A + A^{x} \\boldsymbol{e}_{x} + A^{y} \\boldsymbol{e}_{y} + A^{z} \\boldsymbol{e}_{z} + A^{xy} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + A^{xz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + A^{yz} \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} + A^{xyz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\r\n", - " \\begin{align*} A = & A \\\\ & + A^{x} \\boldsymbol{e}_{x} + A^{y} \\boldsymbol{e}_{y} + A^{z} \\boldsymbol{e}_{z} \\\\ & + A^{xy} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + A^{xz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + A^{yz} \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\\\ & + A^{xyz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{align*} \r\n", - " \\begin{align*} A = & A \\\\ & + A^{x} \\boldsymbol{e}_{x} \\\\ & + A^{y} \\boldsymbol{e}_{y} \\\\ & + A^{z} \\boldsymbol{e}_{z} \\\\ & + A^{xy} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} \\\\ & + A^{xz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} \\\\ & + A^{yz} \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\\\ & + A^{xyz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{align*} \r\n", - "\\begin{equation*} A_{+} = A + A^{xy} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + A^{xz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + A^{yz} \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} A_{-} = A^{x} \\boldsymbol{e}_{x} + A^{y} \\boldsymbol{e}_{y} + A^{z} \\boldsymbol{e}_{z} + A^{xyz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} g_{ij} = \\left [ \\begin{array}{ccc} \\left ( e_{x}\\cdot e_{x}\\right ) & \\left ( e_{x}\\cdot e_{y}\\right ) & \\left ( e_{x}\\cdot e_{z}\\right ) \\\\ \\left ( e_{x}\\cdot e_{y}\\right ) & \\left ( e_{y}\\cdot e_{y}\\right ) & \\left ( e_{y}\\cdot e_{z}\\right ) \\\\ \\left ( e_{x}\\cdot e_{z}\\right ) & \\left ( e_{y}\\cdot e_{z}\\right ) & \\left ( e_{z}\\cdot e_{z}\\right ) \\end{array}\\right ] \\end{equation*}\r\n", - "\\begin{equation*} X = X^{x} \\boldsymbol{e}_{x} + X^{y} \\boldsymbol{e}_{y} + X^{z} \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} Y = Y^{x} \\boldsymbol{e}_{x} + Y^{y} \\boldsymbol{e}_{y} + Y^{z} \\boldsymbol{e}_{z} \\end{equation*}\r\n", - " \\begin{align*} X Y = & \\left ( \\left ( e_{x}\\cdot e_{x}\\right ) X^{x} Y^{x} + \\left ( e_{x}\\cdot e_{y}\\right ) X^{x} Y^{y} + \\left ( e_{x}\\cdot e_{y}\\right ) X^{y} Y^{x} + \\left ( e_{x}\\cdot e_{z}\\right ) X^{x} Y^{z} + \\left ( e_{x}\\cdot e_{z}\\right ) X^{z} Y^{x} + \\left ( e_{y}\\cdot e_{y}\\right ) X^{y} Y^{y} + \\left ( e_{y}\\cdot e_{z}\\right ) X^{y} Y^{z} + \\left ( e_{y}\\cdot e_{z}\\right ) X^{z} Y^{y} + \\left ( e_{z}\\cdot e_{z}\\right ) X^{z} Y^{z}\\right ) \\\\ & + \\left ( X^{x} Y^{y} - X^{y} Y^{x}\\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + \\left ( X^{x} Y^{z} - X^{z} Y^{x}\\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + \\left ( X^{y} Y^{z} - X^{z} Y^{y}\\right ) \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{align*} \r\n", - "\\begin{equation*} X\\W Y = \\left ( X^{x} Y^{y} - X^{y} Y^{x}\\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + \\left ( X^{x} Y^{z} - X^{z} Y^{x}\\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + \\left ( X^{y} Y^{z} - X^{z} Y^{y}\\right ) \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} X\\cdot Y = \\left ( e_{x}\\cdot e_{x}\\right ) X^{x} Y^{x} + \\left ( e_{x}\\cdot e_{y}\\right ) X^{x} Y^{y} + \\left ( e_{x}\\cdot e_{y}\\right ) X^{y} Y^{x} + \\left ( e_{x}\\cdot e_{z}\\right ) X^{x} Y^{z} + \\left ( e_{x}\\cdot e_{z}\\right ) X^{z} Y^{x} + \\left ( e_{y}\\cdot e_{y}\\right ) X^{y} Y^{y} + \\left ( e_{y}\\cdot e_{z}\\right ) X^{y} Y^{z} + \\left ( e_{y}\\cdot e_{z}\\right ) X^{z} Y^{y} + \\left ( e_{z}\\cdot e_{z}\\right ) X^{z} Y^{z} \\end{equation*}\r\n", - "\\begin{equation*} X\\times Y = \\frac{\\left ( e_{x}\\cdot e_{y}\\right ) \\left ( e_{y}\\cdot e_{z}\\right ) X^{x} Y^{y} - \\left ( e_{x}\\cdot e_{y}\\right ) \\left ( e_{y}\\cdot e_{z}\\right ) X^{y} Y^{x} + \\left ( e_{x}\\cdot e_{y}\\right ) \\left ( e_{z}\\cdot e_{z}\\right ) X^{x} Y^{z} - \\left ( e_{x}\\cdot e_{y}\\right ) \\left ( e_{z}\\cdot e_{z}\\right ) X^{z} Y^{x} - \\left ( e_{x}\\cdot e_{z}\\right ) \\left ( e_{y}\\cdot e_{y}\\right ) X^{x} Y^{y} + \\left ( e_{x}\\cdot e_{z}\\right ) \\left ( e_{y}\\cdot e_{y}\\right ) X^{y} Y^{x} - \\left ( e_{x}\\cdot e_{z}\\right ) \\left ( e_{y}\\cdot e_{z}\\right ) X^{x} Y^{z} + \\left ( e_{x}\\cdot e_{z}\\right ) \\left ( e_{y}\\cdot e_{z}\\right ) X^{z} Y^{x} + \\left ( e_{y}\\cdot e_{y}\\right ) \\left ( e_{z}\\cdot e_{z}\\right ) X^{y} Y^{z} - \\left ( e_{y}\\cdot e_{y}\\right ) \\left ( e_{z}\\cdot e_{z}\\right ) X^{z} Y^{y} - \\left ( e_{y}\\cdot e_{z}\\right ) ^{2} X^{y} Y^{z} + \\left ( e_{y}\\cdot e_{z}\\right ) ^{2} X^{z} Y^{y}}{\\sqrt{\\left ( e_{x}\\cdot e_{x}\\right ) \\left ( e_{y}\\cdot e_{y}\\right ) \\left ( e_{z}\\cdot e_{z}\\right ) - \\left ( e_{x}\\cdot e_{x}\\right ) \\left ( e_{y}\\cdot e_{z}\\right ) ^{2} - \\left ( e_{x}\\cdot e_{y}\\right ) ^{2} \\left ( e_{z}\\cdot e_{z}\\right ) + 2 \\left ( e_{x}\\cdot e_{y}\\right ) \\left ( e_{x}\\cdot e_{z}\\right ) \\left ( e_{y}\\cdot e_{z}\\right ) - \\left ( e_{x}\\cdot e_{z}\\right ) ^{2} \\left ( e_{y}\\cdot e_{y}\\right ) }} \\boldsymbol{e}_{x} + \\frac{- \\left ( e_{x}\\cdot e_{x}\\right ) \\left ( e_{y}\\cdot e_{z}\\right ) X^{x} Y^{y} + \\left ( e_{x}\\cdot e_{x}\\right ) \\left ( e_{y}\\cdot e_{z}\\right ) X^{y} Y^{x} - \\left ( e_{x}\\cdot e_{x}\\right ) \\left ( e_{z}\\cdot e_{z}\\right ) X^{x} Y^{z} + \\left ( e_{x}\\cdot e_{x}\\right ) \\left ( e_{z}\\cdot e_{z}\\right ) X^{z} Y^{x} + \\left ( e_{x}\\cdot e_{y}\\right ) \\left ( e_{x}\\cdot e_{z}\\right ) X^{x} Y^{y} - \\left ( e_{x}\\cdot e_{y}\\right ) \\left ( e_{x}\\cdot e_{z}\\right ) X^{y} Y^{x} - \\left ( e_{x}\\cdot e_{y}\\right ) \\left ( e_{z}\\cdot e_{z}\\right ) X^{y} Y^{z} + \\left ( e_{x}\\cdot e_{y}\\right ) \\left ( e_{z}\\cdot e_{z}\\right ) X^{z} Y^{y} + \\left ( e_{x}\\cdot e_{z}\\right ) ^{2} X^{x} Y^{z} - \\left ( e_{x}\\cdot e_{z}\\right ) ^{2} X^{z} Y^{x} + \\left ( e_{x}\\cdot e_{z}\\right ) \\left ( e_{y}\\cdot e_{z}\\right ) X^{y} Y^{z} - \\left ( e_{x}\\cdot e_{z}\\right ) \\left ( e_{y}\\cdot e_{z}\\right ) X^{z} Y^{y}}{\\sqrt{\\left ( e_{x}\\cdot e_{x}\\right ) \\left ( e_{y}\\cdot e_{y}\\right ) \\left ( e_{z}\\cdot e_{z}\\right ) - \\left ( e_{x}\\cdot e_{x}\\right ) \\left ( e_{y}\\cdot e_{z}\\right ) ^{2} - \\left ( e_{x}\\cdot e_{y}\\right ) ^{2} \\left ( e_{z}\\cdot e_{z}\\right ) + 2 \\left ( e_{x}\\cdot e_{y}\\right ) \\left ( e_{x}\\cdot e_{z}\\right ) \\left ( e_{y}\\cdot e_{z}\\right ) - \\left ( e_{x}\\cdot e_{z}\\right ) ^{2} \\left ( e_{y}\\cdot e_{y}\\right ) }} \\boldsymbol{e}_{y} + \\frac{\\left ( e_{x}\\cdot e_{x}\\right ) \\left ( e_{y}\\cdot e_{y}\\right ) X^{x} Y^{y} - \\left ( e_{x}\\cdot e_{x}\\right ) \\left ( e_{y}\\cdot e_{y}\\right ) X^{y} Y^{x} + \\left ( e_{x}\\cdot e_{x}\\right ) \\left ( e_{y}\\cdot e_{z}\\right ) X^{x} Y^{z} - \\left ( e_{x}\\cdot e_{x}\\right ) \\left ( e_{y}\\cdot e_{z}\\right ) X^{z} Y^{x} - \\left ( e_{x}\\cdot e_{y}\\right ) ^{2} X^{x} Y^{y} + \\left ( e_{x}\\cdot e_{y}\\right ) ^{2} X^{y} Y^{x} - \\left ( e_{x}\\cdot e_{y}\\right ) \\left ( e_{x}\\cdot e_{z}\\right ) X^{x} Y^{z} + \\left ( e_{x}\\cdot e_{y}\\right ) \\left ( e_{x}\\cdot e_{z}\\right ) X^{z} Y^{x} + \\left ( e_{x}\\cdot e_{y}\\right ) \\left ( e_{y}\\cdot e_{z}\\right ) X^{y} Y^{z} - \\left ( e_{x}\\cdot e_{y}\\right ) \\left ( e_{y}\\cdot e_{z}\\right ) X^{z} Y^{y} - \\left ( e_{x}\\cdot e_{z}\\right ) \\left ( e_{y}\\cdot e_{y}\\right ) X^{y} Y^{z} + \\left ( e_{x}\\cdot e_{z}\\right ) \\left ( e_{y}\\cdot e_{y}\\right ) X^{z} Y^{y}}{\\sqrt{\\left ( e_{x}\\cdot e_{x}\\right ) \\left ( e_{y}\\cdot e_{y}\\right ) \\left ( e_{z}\\cdot e_{z}\\right ) - \\left ( e_{x}\\cdot e_{x}\\right ) \\left ( e_{y}\\cdot e_{z}\\right ) ^{2} - \\left ( e_{x}\\cdot e_{y}\\right ) ^{2} \\left ( e_{z}\\cdot e_{z}\\right ) + 2 \\left ( e_{x}\\cdot e_{y}\\right ) \\left ( e_{x}\\cdot e_{z}\\right ) \\left ( e_{y}\\cdot e_{z}\\right ) - \\left ( e_{x}\\cdot e_{z}\\right ) ^{2} \\left ( e_{y}\\cdot e_{y}\\right ) }} \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\\\begin{lstlisting}[language=Python,showspaces=false,showstringspaces=false,backgroundcolor=\\color{gray},frame=single]\r\n", - "def basic_multivector_operations_2D():\r\n", - " Print_Function()\r\n", - " g2d = Ga('e*x|y')\r\n", - " (ex,ey) = g2d.mv()\r\n", - " print('g_{ij} =',g2d.g)\r\n", - " X = g2d.mv('X','vector')\r\n", - " A = g2d.mv('A','spinor')\r\n", - " print(X.Fmt(1,'X'))\r\n", - " print(A.Fmt(1,'A'))\r\n", - " print((X|A).Fmt(2,'X|A'))\r\n", - " print((XX).Fmt(2,'A>X'))\r\n", - " return\r\n", - "\\end{lstlisting}\r\n", - "Code Output:\r\n", - "\\begin{equation*} g_{ij} = \\left [ \\begin{array}{cc} \\left ( e_{x}\\cdot e_{x}\\right ) & \\left ( e_{x}\\cdot e_{y}\\right ) \\\\ \\left ( e_{x}\\cdot e_{y}\\right ) & \\left ( e_{y}\\cdot e_{y}\\right ) \\end{array}\\right ] \\end{equation*}\r\n", - "\\begin{equation*} X = X^{x} \\boldsymbol{e}_{x} + X^{y} \\boldsymbol{e}_{y} \\end{equation*}\r\n", - "\\begin{equation*} A = A + A^{xy} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} \\end{equation*}\r\n", - "\\begin{equation*} X\\cdot A = - A^{xy} \\left(\\left ( e_{x}\\cdot e_{y}\\right ) X^{x} + \\left ( e_{y}\\cdot e_{y}\\right ) X^{y}\\right) \\boldsymbol{e}_{x} + A^{xy} \\left(\\left ( e_{x}\\cdot e_{x}\\right ) X^{x} + \\left ( e_{x}\\cdot e_{y}\\right ) X^{y}\\right) \\boldsymbol{e}_{y} \\end{equation*}\r\n", - "\\begin{equation*} X\\rfloor A = - A^{xy} \\left(\\left ( e_{x}\\cdot e_{y}\\right ) X^{x} + \\left ( e_{y}\\cdot e_{y}\\right ) X^{y}\\right) \\boldsymbol{e}_{x} + A^{xy} \\left(\\left ( e_{x}\\cdot e_{x}\\right ) X^{x} + \\left ( e_{x}\\cdot e_{y}\\right ) X^{y}\\right) \\boldsymbol{e}_{y} \\end{equation*}\r\n", - "\\begin{equation*} A\\lfloor X = A^{xy} \\left(\\left ( e_{x}\\cdot e_{y}\\right ) X^{x} + \\left ( e_{y}\\cdot e_{y}\\right ) X^{y}\\right) \\boldsymbol{e}_{x} - A^{xy} \\left(\\left ( e_{x}\\cdot e_{x}\\right ) X^{x} + \\left ( e_{x}\\cdot e_{y}\\right ) X^{y}\\right) \\boldsymbol{e}_{y} \\end{equation*}\r\n", - "\\\\begin{lstlisting}[language=Python,showspaces=false,showstringspaces=false,backgroundcolor=\\color{gray},frame=single]\r\n", - "def basic_multivector_operations_2D_orthogonal():\r\n", - " Print_Function()\r\n", - " o2d = Ga('e*x|y',g=[1,1])\r\n", - " (ex,ey) = o2d.mv()\r\n", - " print('g_{ii} =',o2d.g)\r\n", - " X = o2d.mv('X','vector')\r\n", - " A = o2d.mv('A','spinor')\r\n", - " print(X.Fmt(1,'X'))\r\n", - " print(A.Fmt(1,'A'))\r\n", - " print((X*A).Fmt(2,'X*A'))\r\n", - " print((X|A).Fmt(2,'X|A'))\r\n", - " print((XA).Fmt(2,'X>A'))\r\n", - " print((A*X).Fmt(2,'A*X'))\r\n", - " print((A|X).Fmt(2,'A|X'))\r\n", - " print((AX).Fmt(2,'A>X'))\r\n", - " return\r\n", - "\\end{lstlisting}\r\n", - "Code Output:\r\n", - "\\begin{equation*} g_{ii} = \\left [ \\begin{array}{cc} 1 & 0 \\\\ 0 & 1 \\end{array}\\right ] \\end{equation*}\r\n", - "\\begin{equation*} X = X^{x} \\boldsymbol{e}_{x} + X^{y} \\boldsymbol{e}_{y} \\end{equation*}\r\n", - "\\begin{equation*} A = A + A^{xy} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} \\end{equation*}\r\n", - "\\begin{equation*} X A = \\left ( A X^{x} - A^{xy} X^{y}\\right ) \\boldsymbol{e}_{x} + \\left ( A X^{y} + A^{xy} X^{x}\\right ) \\boldsymbol{e}_{y} \\end{equation*}\r\n", - "\\begin{equation*} X\\cdot A = - A^{xy} X^{y} \\boldsymbol{e}_{x} + A^{xy} X^{x} \\boldsymbol{e}_{y} \\end{equation*}\r\n", - "\\begin{equation*} X\\rfloor A = - A^{xy} X^{y} \\boldsymbol{e}_{x} + A^{xy} X^{x} \\boldsymbol{e}_{y} \\end{equation*}\r\n", - "\\begin{equation*} X\\lfloor A = A X^{x} \\boldsymbol{e}_{x} + A X^{y} \\boldsymbol{e}_{y} \\end{equation*}\r\n", - "\\begin{equation*} A X = \\left ( A X^{x} + A^{xy} X^{y}\\right ) \\boldsymbol{e}_{x} + \\left ( A X^{y} - A^{xy} X^{x}\\right ) \\boldsymbol{e}_{y} \\end{equation*}\r\n", - "\\begin{equation*} A\\cdot X = A^{xy} X^{y} \\boldsymbol{e}_{x} - A^{xy} X^{x} \\boldsymbol{e}_{y} \\end{equation*}\r\n", - "\\begin{equation*} A\\rfloor X = A X^{x} \\boldsymbol{e}_{x} + A X^{y} \\boldsymbol{e}_{y} \\end{equation*}\r\n", - "\\begin{equation*} A\\lfloor X = A^{xy} X^{y} \\boldsymbol{e}_{x} - A^{xy} X^{x} \\boldsymbol{e}_{y} \\end{equation*}\r\n", - "\\\\begin{lstlisting}[language=Python,showspaces=false,showstringspaces=false,backgroundcolor=\\color{gray},frame=single]\r\n", - "def check_generalized_BAC_CAB_formulas():\r\n", - " Print_Function()\r\n", - " g4d = Ga('a b c d e')\r\n", - " (a,b,c,d,e) = g4d.mv()\r\n", - " print('g_{ij} =',g4d.g)\r\n", - " print('\\\\bm{a|(b*c)} =',a|(b*c))\r\n", - " print('\\\\bm{a|(b^c)} =',a|(b^c))\r\n", - " print('\\\\bm{a|(b^c^d)} =',a|(b^c^d))\r\n", - " print('\\\\bm{a|(b^c)+c|(a^b)+b|(c^a)} =',(a|(b^c))+(c|(a^b))+(b|(c^a)))\r\n", - " print('\\\\bm{a*(b^c)-b*(a^c)+c*(a^b)} =',a*(b^c)-b*(a^c)+c*(a^b))\r\n", - " print('\\\\bm{a*(b^c^d)-b*(a^c^d)+c*(a^b^d)-d*(a^b^c)} =',a*(b^c^d)-b*(a^c^d)+c*(a^b^d)-d*(a^b^c))\r\n", - " print('\\\\bm{(a^b)|(c^d)} =',(a^b)|(c^d))\r\n", - " print('\\\\bm{((a^b)|c)|d} =',((a^b)|c)|d)\r\n", - " print('\\\\bm{(a^b)\\\\times (c^d)} =',Ga.com(a^b,c^d))\r\n", - " print('\\\\bm{(a^b^c)(d^e)} =',((a^b^c)*(d^e)).Fmt(2))\r\n", - " return\r\n", - "\\end{lstlisting}\r\n", - "Code Output:\r\n", - "\\begin{equation*} g_{ij} = \\left [ \\begin{array}{ccccc} \\left ( a\\cdot a\\right ) & \\left ( a\\cdot b\\right ) & \\left ( a\\cdot c\\right ) & \\left ( a\\cdot d\\right ) & \\left ( a\\cdot e\\right ) \\\\ \\left ( a\\cdot b\\right ) & \\left ( b\\cdot b\\right ) & \\left ( b\\cdot c\\right ) & \\left ( b\\cdot d\\right ) & \\left ( b\\cdot e\\right ) \\\\ \\left ( a\\cdot c\\right ) & \\left ( b\\cdot c\\right ) & \\left ( c\\cdot c\\right ) & \\left ( c\\cdot d\\right ) & \\left ( c\\cdot e\\right ) \\\\ \\left ( a\\cdot d\\right ) & \\left ( b\\cdot d\\right ) & \\left ( c\\cdot d\\right ) & \\left ( d\\cdot d\\right ) & \\left ( d\\cdot e\\right ) \\\\ \\left ( a\\cdot e\\right ) & \\left ( b\\cdot e\\right ) & \\left ( c\\cdot e\\right ) & \\left ( d\\cdot e\\right ) & \\left ( e\\cdot e\\right ) \\end{array}\\right ] \\end{equation*}\r\n", - "\\begin{equation*} \\bm{a\\cdot (b c)} = - \\left ( a\\cdot c\\right ) \\boldsymbol{b} + \\left ( a\\cdot b\\right ) \\boldsymbol{c} \\end{equation*}\r\n", - "\\begin{equation*} \\bm{a\\cdot (b\\W c)} = - \\left ( a\\cdot c\\right ) \\boldsymbol{b} + \\left ( a\\cdot b\\right ) \\boldsymbol{c} \\end{equation*}\r\n", - "\\begin{equation*} \\bm{a\\cdot (b\\W c\\W d)} = \\left ( a\\cdot d\\right ) \\boldsymbol{b}\\wedge \\boldsymbol{c} - \\left ( a\\cdot c\\right ) \\boldsymbol{b}\\wedge \\boldsymbol{d} + \\left ( a\\cdot b\\right ) \\boldsymbol{c}\\wedge \\boldsymbol{d} \\end{equation*}\r\n", - "\\begin{equation*} \\bm{a\\cdot (b\\W c)+c\\cdot (a\\W b)+b\\cdot (c\\W a)} = 0 \\end{equation*}\r\n", - "\\begin{equation*} \\bm{a (b\\W c)-b (a\\W c)+c (a\\W b)} = 3 \\boldsymbol{a}\\wedge \\boldsymbol{b}\\wedge \\boldsymbol{c} \\end{equation*}\r\n", - "\\begin{equation*} \\bm{a (b\\W c\\W d)-b (a\\W c\\W d)+c (a\\W b\\W d)-d (a\\W b\\W c)} = 4 \\boldsymbol{a}\\wedge \\boldsymbol{b}\\wedge \\boldsymbol{c}\\wedge \\boldsymbol{d} \\end{equation*}\r\n", - "\\begin{equation*} \\bm{(a\\W b)\\cdot (c\\W d)} = - \\left ( a\\cdot c\\right ) \\left ( b\\cdot d\\right ) + \\left ( a\\cdot d\\right ) \\left ( b\\cdot c\\right ) \\end{equation*}\r\n", - "\\begin{equation*} \\bm{((a\\W b)\\cdot c)\\cdot d} = - \\left ( a\\cdot c\\right ) \\left ( b\\cdot d\\right ) + \\left ( a\\cdot d\\right ) \\left ( b\\cdot c\\right ) \\end{equation*}\r\n", - "\\begin{equation*} \\bm{(a\\W b)\\times (c\\W d)} = - \\left ( b\\cdot d\\right ) \\boldsymbol{a}\\wedge \\boldsymbol{c} + \\left ( b\\cdot c\\right ) \\boldsymbol{a}\\wedge \\boldsymbol{d} + \\left ( a\\cdot d\\right ) \\boldsymbol{b}\\wedge \\boldsymbol{c} - \\left ( a\\cdot c\\right ) \\boldsymbol{b}\\wedge \\boldsymbol{d} \\end{equation*}\r\n", - " \\begin{align*} \\bm{(a\\W b\\W c)(d\\W e)} = & \\left ( - \\left ( b\\cdot d\\right ) \\left ( c\\cdot e\\right ) + \\left ( b\\cdot e\\right ) \\left ( c\\cdot d\\right ) \\right ) \\boldsymbol{a} + \\left ( \\left ( a\\cdot d\\right ) \\left ( c\\cdot e\\right ) - \\left ( a\\cdot e\\right ) \\left ( c\\cdot d\\right ) \\right ) \\boldsymbol{b} + \\left ( - \\left ( a\\cdot d\\right ) \\left ( b\\cdot e\\right ) + \\left ( a\\cdot e\\right ) \\left ( b\\cdot d\\right ) \\right ) \\boldsymbol{c} \\\\ & - \\left ( c\\cdot e\\right ) \\boldsymbol{a}\\wedge \\boldsymbol{b}\\wedge \\boldsymbol{d} + \\left ( c\\cdot d\\right ) \\boldsymbol{a}\\wedge \\boldsymbol{b}\\wedge \\boldsymbol{e} + \\left ( b\\cdot e\\right ) \\boldsymbol{a}\\wedge \\boldsymbol{c}\\wedge \\boldsymbol{d} - \\left ( b\\cdot d\\right ) \\boldsymbol{a}\\wedge \\boldsymbol{c}\\wedge \\boldsymbol{e} - \\left ( a\\cdot e\\right ) \\boldsymbol{b}\\wedge \\boldsymbol{c}\\wedge \\boldsymbol{d} + \\left ( a\\cdot d\\right ) \\boldsymbol{b}\\wedge \\boldsymbol{c}\\wedge \\boldsymbol{e} \\\\ & + \\boldsymbol{a}\\wedge \\boldsymbol{b}\\wedge \\boldsymbol{c}\\wedge \\boldsymbol{d}\\wedge \\boldsymbol{e} \\end{align*} \r\n", - "\\\\begin{lstlisting}[language=Python,showspaces=false,showstringspaces=false,backgroundcolor=\\color{gray},frame=single]\r\n", - "def rounding_numerical_components():\r\n", - " Print_Function()\r\n", - " o3d = Ga('e_x e_y e_z',g=[1,1,1])\r\n", - " (ex,ey,ez) = o3d.mv()\r\n", - " X = 1.2*ex+2.34*ey+0.555*ez\r\n", - " Y = 0.333*ex+4*ey+5.3*ez\r\n", - " print('X =',X)\r\n", - " print('Nga(X,2) =',Nga(X,2))\r\n", - " print('X*Y =',X*Y)\r\n", - " print('Nga(X*Y,2) =',Nga(X*Y,2))\r\n", - " return\r\n", - "\\end{lstlisting}\r\n", - "Code Output:\r\n", - "\\begin{equation*} X = 1 \\cdot 2 \\boldsymbol{e}_{x} + 2 \\cdot 34 \\boldsymbol{e}_{y} + 0 \\cdot 555 \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} Nga(X,2) = 1 \\cdot 2 \\boldsymbol{e}_{x} + 2 \\cdot 3 \\boldsymbol{e}_{y} + 0 \\cdot 55 \\boldsymbol{e}_{z} \\end{equation*}\r\n", - " \\begin{align*} X Y = & 12 \\cdot 7011 \\\\ & + 4 \\cdot 02078 \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + 6 \\cdot 175185 \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + 10 \\cdot 182 \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{align*} \r\n", - " \\begin{align*} Nga(X Y,2) = & 13 \\cdot 0 \\\\ & + 4 \\cdot 0 \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + 6 \\cdot 2 \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + 10 \\cdot 0 \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{align*} \r\n", - "\\\\begin{lstlisting}[language=Python,showspaces=false,showstringspaces=false,backgroundcolor=\\color{gray},frame=single]\r\n", - "def derivatives_in_rectangular_coordinates():\r\n", - " Print_Function()\r\n", - " X = (x,y,z) = symbols('x y z')\r\n", - " o3d = Ga('e_x e_y e_z',g=[1,1,1],coords=X)\r\n", - " (ex,ey,ez) = o3d.mv()\r\n", - " grad = o3d.grad\r\n", - " f = o3d.mv('f','scalar',f=True)\r\n", - " A = o3d.mv('A','vector',f=True)\r\n", - " B = o3d.mv('B','bivector',f=True)\r\n", - " C = o3d.mv('C','mv')\r\n", - " print('f =',f)\r\n", - " print('A =',A)\r\n", - " print('B =',B)\r\n", - " print('C =',C)\r\n", - " print('grad*f =',grad*f)\r\n", - " print('grad|A =',grad|A)\r\n", - " print('grad*A =',grad*A)\r\n", - " print('-I*(grad^A) =',-o3d.I()*(grad^A))\r\n", - " print('grad*B =',grad*B)\r\n", - " print('grad^B =',grad^B)\r\n", - " print('grad|B =',grad|B)\r\n", - " return\r\n", - "\\end{lstlisting}\r\n", - "Code Output:\r\n", - "\\begin{equation*} f = f \\end{equation*}\r\n", - "\\begin{equation*} A = A^{x} \\boldsymbol{e}_{x} + A^{y} \\boldsymbol{e}_{y} + A^{z} \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} B = B^{xy} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + B^{xz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + B^{yz} \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\r\n", - " \\begin{align*} C = & C \\\\ & + C^{x} \\boldsymbol{e}_{x} + C^{y} \\boldsymbol{e}_{y} + C^{z} \\boldsymbol{e}_{z} \\\\ & + C^{xy} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + C^{xz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + C^{yz} \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\\\ & + C^{xyz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{align*} \r\n", - "\\begin{equation*} \\boldsymbol{\\nabla} f = \\partial_{x} f \\boldsymbol{e}_{x} + \\partial_{y} f \\boldsymbol{e}_{y} + \\partial_{z} f \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} \\boldsymbol{\\nabla} \\cdot A = \\partial_{x} A^{x} + \\partial_{y} A^{y} + \\partial_{z} A^{z} \\end{equation*}\r\n", - " \\begin{align*} \\boldsymbol{\\nabla} A = & \\left ( \\partial_{x} A^{x} + \\partial_{y} A^{y} + \\partial_{z} A^{z} \\right ) \\\\ & + \\left ( - \\partial_{y} A^{x} + \\partial_{x} A^{y} \\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + \\left ( - \\partial_{z} A^{x} + \\partial_{x} A^{z} \\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + \\left ( - \\partial_{z} A^{y} + \\partial_{y} A^{z} \\right ) \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{align*} \r\n", - "\\begin{equation*} -I (\\boldsymbol{\\nabla} \\W A) = \\left ( - \\partial_{z} A^{y} + \\partial_{y} A^{z} \\right ) \\boldsymbol{e}_{x} + \\left ( \\partial_{z} A^{x} - \\partial_{x} A^{z} \\right ) \\boldsymbol{e}_{y} + \\left ( - \\partial_{y} A^{x} + \\partial_{x} A^{y} \\right ) \\boldsymbol{e}_{z} \\end{equation*}\r\n", - " \\begin{align*} \\boldsymbol{\\nabla} B = & \\left ( - \\partial_{y} B^{xy} - \\partial_{z} B^{xz} \\right ) \\boldsymbol{e}_{x} + \\left ( \\partial_{x} B^{xy} - \\partial_{z} B^{yz} \\right ) \\boldsymbol{e}_{y} + \\left ( \\partial_{x} B^{xz} + \\partial_{y} B^{yz} \\right ) \\boldsymbol{e}_{z} \\\\ & + \\left ( \\partial_{z} B^{xy} - \\partial_{y} B^{xz} + \\partial_{x} B^{yz} \\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{align*} \r\n", - "\\begin{equation*} \\boldsymbol{\\nabla} \\W B = \\left ( \\partial_{z} B^{xy} - \\partial_{y} B^{xz} + \\partial_{x} B^{yz} \\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} \\boldsymbol{\\nabla} \\cdot B = \\left ( - \\partial_{y} B^{xy} - \\partial_{z} B^{xz} \\right ) \\boldsymbol{e}_{x} + \\left ( \\partial_{x} B^{xy} - \\partial_{z} B^{yz} \\right ) \\boldsymbol{e}_{y} + \\left ( \\partial_{x} B^{xz} + \\partial_{y} B^{yz} \\right ) \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\\\begin{lstlisting}[language=Python,showspaces=false,showstringspaces=false,backgroundcolor=\\color{gray},frame=single]\r\n", - "def derivatives_in_spherical_coordinates():\r\n", - " Print_Function()\r\n", - " X = (r,th,phi) = symbols('r theta phi')\r\n", - " s3d = Ga('e_r e_theta e_phi',g=[1,r**2,r**2*sin(th)**2],coords=X,norm=True)\r\n", - " (er,eth,ephi) = s3d.mv()\r\n", - " grad = s3d.grad\r\n", - " f = s3d.mv('f','scalar',f=True)\r\n", - " A = s3d.mv('A','vector',f=True)\r\n", - " B = s3d.mv('B','bivector',f=True)\r\n", - " print('f =',f)\r\n", - " print('A =',A)\r\n", - " print('B =',B)\r\n", - " print('grad*f =',grad*f)\r\n", - " print('grad|A =',grad|A)\r\n", - " print('-I*(grad^A) =',(-s3d.E()*(grad^A)).simplify())\r\n", - " print('grad^B =',grad^B)\r\n", - "\\end{lstlisting}\r\n", - "Code Output:\r\n", - "\\begin{equation*} f = f \\end{equation*}\r\n", - "\\begin{equation*} A = A^{r} \\boldsymbol{e}_{r} + A^{\\theta } \\boldsymbol{e}_{\\theta } + A^{\\phi } \\boldsymbol{e}_{\\phi } \\end{equation*}\r\n", - "\\begin{equation*} B = B^{r\\theta } \\boldsymbol{e}_{r}\\wedge \\boldsymbol{e}_{\\theta } + B^{r\\phi } \\boldsymbol{e}_{r}\\wedge \\boldsymbol{e}_{\\phi } + B^{\\theta \\phi } \\boldsymbol{e}_{\\theta }\\wedge \\boldsymbol{e}_{\\phi } \\end{equation*}\r\n", - "\\begin{equation*} \\boldsymbol{\\nabla} f = \\partial_{r} f \\boldsymbol{e}_{r} + \\frac{\\partial_{\\theta } f }{r} \\boldsymbol{e}_{\\theta } + \\frac{\\partial_{\\phi } f }{r \\sin{\\left (\\theta \\right )}} \\boldsymbol{e}_{\\phi } \\end{equation*}\r\n", - "\\begin{equation*} \\boldsymbol{\\nabla} \\cdot A = \\frac{r \\partial_{r} A^{r} + 2 A^{r} + \\frac{A^{\\theta } }{\\tan{\\left (\\theta \\right )}} + \\partial_{\\theta } A^{\\theta } + \\frac{\\partial_{\\phi } A^{\\phi } }{\\sin{\\left (\\theta \\right )}}}{r} \\end{equation*}\r\n", - "\\begin{equation*} -I (\\boldsymbol{\\nabla} \\W A) = \\frac{\\frac{A^{\\phi } }{\\tan{\\left (\\theta \\right )}} + \\partial_{\\theta } A^{\\phi } - \\frac{\\partial_{\\phi } A^{\\theta } }{\\sin{\\left (\\theta \\right )}}}{r} \\boldsymbol{e}_{r} + \\frac{- r \\partial_{r} A^{\\phi } - A^{\\phi } + \\frac{\\partial_{\\phi } A^{r} }{\\sin{\\left (\\theta \\right )}}}{r} \\boldsymbol{e}_{\\theta } + \\frac{r \\partial_{r} A^{\\theta } + A^{\\theta } - \\partial_{\\theta } A^{r} }{r} \\boldsymbol{e}_{\\phi } \\end{equation*}\r\n", - "\\begin{equation*} \\boldsymbol{\\nabla} \\W B = \\frac{r \\partial_{r} B^{\\theta \\phi } - \\frac{B^{r\\phi } }{\\tan{\\left (\\theta \\right )}} + 2 B^{\\theta \\phi } - \\partial_{\\theta } B^{r\\phi } + \\frac{\\partial_{\\phi } B^{r\\theta } }{\\sin{\\left (\\theta \\right )}}}{r} \\boldsymbol{e}_{r}\\wedge \\boldsymbol{e}_{\\theta }\\wedge \\boldsymbol{e}_{\\phi } \\end{equation*}\r\n", - "\\\\begin{lstlisting}[language=Python,showspaces=false,showstringspaces=false,backgroundcolor=\\color{gray},frame=single]\r\n", - "def noneuclidian_distance_calculation():\r\n", - " Print_Function()\r\n", - " from sympy import solve,sqrt\r\n", - " Fmt(1)\r\n", - " g = '0 # #,# 0 #,# # 1'\r\n", - " nel = Ga('X Y e',g=g)\r\n", - " (X,Y,e) = nel.mv()\r\n", - " print('g_{ij} =',nel.g)\r\n", - " print('%(X\\\\W Y)^{2} =',(X^Y)*(X^Y))\r\n", - " L = X^Y^e\r\n", - " B = L*e # D&L 10.152\r\n", - " Bsq = (B*B).scalar()\r\n", - " print('#%L = X\\\\W Y\\\\W e \\\\text{ is a non-euclidian line}')\r\n", - " print('B = L*e =',B)\r\n", - " BeBr =B*e*B.rev()\r\n", - " print('%BeB^{\\\\dagger} =',BeBr)\r\n", - " print('%B^{2} =',B*B)\r\n", - " print('%L^{2} =',L*L) # D&L 10.153\r\n", - " (s,c,Binv,M,S,C,alpha) = symbols('s c (1/B) M S C alpha')\r\n", - " XdotY = nel.g[0,1]\r\n", - " Xdote = nel.g[0,2]\r\n", - " Ydote = nel.g[1,2]\r\n", - " Bhat = Binv*B # D&L 10.154\r\n", - " R = c+s*Bhat # Rotor R = exp(alpha*Bhat/2)\r\n", - " print('#%s = \\\\f{\\\\sinh}{\\\\alpha/2} \\\\text{ and } c = \\\\f{\\\\cosh}{\\\\alpha/2}')\r\n", - " print('%e^{\\\\alpha B/{2\\\\abs{B}}} =',R)\r\n", - " Z = R*X*R.rev() # D&L 10.155\r\n", - " Z.obj = expand(Z.obj)\r\n", - " Z.obj = Z.obj.collect([Binv,s,c,XdotY])\r\n", - " Z.Fmt(3,'%RXR^{\\\\dagger}')\r\n", - " W = Z|Y # Extract scalar part of multivector\r\n", - " # From this point forward all calculations are with sympy scalars\r\n", - " #print '#Objective is to determine value of C = cosh(alpha) such that W = 0'\r\n", - " W = W.scalar()\r\n", - " print('%W = Z\\\\cdot Y =',W)\r\n", - " W = expand(W)\r\n", - " W = simplify(W)\r\n", - " W = W.collect([s*Binv])\r\n", - " M = 1/Bsq\r\n", - " W = W.subs(Binv**2,M)\r\n", - " W = simplify(W)\r\n", - " Bmag = sqrt(XdotY**2-2*XdotY*Xdote*Ydote)\r\n", - " W = W.collect([Binv*c*s,XdotY])\r\n", - " #Double angle substitutions\r\n", - " W = W.subs(2*XdotY**2-4*XdotY*Xdote*Ydote,2/(Binv**2))\r\n", - " W = W.subs(2*c*s,S)\r\n", - " W = W.subs(c**2,(C+1)/2)\r\n", - " W = W.subs(s**2,(C-1)/2)\r\n", - " W = simplify(W)\r\n", - " W = W.subs(1/Binv,Bmag)\r\n", - " W = expand(W)\r\n", - " print('#%S = \\\\f{\\\\sinh}{\\\\alpha} \\\\text{ and } C = \\\\f{\\\\cosh}{\\\\alpha}')\r\n", - " print('W =',W)\r\n", - " Wd = collect(W,[C,S],exact=True,evaluate=False)\r\n", - " Wd_1 = Wd[one]\r\n", - " Wd_C = Wd[C]\r\n", - " Wd_S = Wd[S]\r\n", - " print('%\\\\text{Scalar Coefficient} =',Wd_1)\r\n", - " print('%\\\\text{Cosh Coefficient} =',Wd_C)\r\n", - " print('%\\\\text{Sinh Coefficient} =',Wd_S)\r\n", - " print('%\\\\abs{B} =',Bmag)\r\n", - " Wd_1 = Wd_1.subs(Bmag,1/Binv)\r\n", - " Wd_C = Wd_C.subs(Bmag,1/Binv)\r\n", - " Wd_S = Wd_S.subs(Bmag,1/Binv)\r\n", - " lhs = Wd_1+Wd_C*C\r\n", - " rhs = -Wd_S*S\r\n", - " lhs = lhs**2\r\n", - " rhs = rhs**2\r\n", - " W = expand(lhs-rhs)\r\n", - " W = expand(W.subs(1/Binv**2,Bmag**2))\r\n", - " W = expand(W.subs(S**2,C**2-1))\r\n", - " W = W.collect([C,C**2],evaluate=False)\r\n", - " a = simplify(W[C**2])\r\n", - " b = simplify(W[C])\r\n", - " c = simplify(W[one])\r\n", - " print('#%\\\\text{Require } aC^{2}+bC+c = 0')\r\n", - " print('a =',a)\r\n", - " print('b =',b)\r\n", - " print('c =',c)\r\n", - " x = Symbol('x')\r\n", - " C = solve(a*x**2+b*x+c,x)[0]\r\n", - " print('%b^{2}-4ac =',simplify(b**2-4*a*c))\r\n", - " print('%\\\\f{\\\\cosh}{\\\\alpha} = C = -b/(2a) =',expand(simplify(expand(C))))\r\n", - " return\r\n", - "\\end{lstlisting}\r\n", - "Code Output:\r\n", - "\\begin{equation*} g_{ij} = \\left [ \\begin{array}{ccc} 0 & \\left ( X\\cdot Y\\right ) & \\left ( X\\cdot e\\right ) \\\\ \\left ( X\\cdot Y\\right ) & 0 & \\left ( Y\\cdot e\\right ) \\\\ \\left ( X\\cdot e\\right ) & \\left ( Y\\cdot e\\right ) & 1 \\end{array}\\right ] \\end{equation*}\r\n", - "\\begin{equation*} (X\\W Y)^{2} = \\left ( X\\cdot Y\\right ) ^{2} \\end{equation*}\r\n", - "\\begin{equation*} L = X\\W Y\\W e \\text{ is a non-euclidian line} \\end{equation*}\r\n", - "\\begin{equation*} B = L e = \\boldsymbol{X}\\wedge \\boldsymbol{Y} - \\left ( Y\\cdot e\\right ) \\boldsymbol{X}\\wedge \\boldsymbol{e} + \\left ( X\\cdot e\\right ) \\boldsymbol{Y}\\wedge \\boldsymbol{e} \\end{equation*}\r\n", - "\\begin{equation*} BeB^{\\dagger} = \\left ( X\\cdot Y\\right ) \\left(- \\left ( X\\cdot Y\\right ) + 2 \\left ( X\\cdot e\\right ) \\left ( Y\\cdot e\\right ) \\right) \\boldsymbol{e} \\end{equation*}\r\n", - "\\begin{equation*} B^{2} = \\left ( X\\cdot Y\\right ) \\left(\\left ( X\\cdot Y\\right ) - 2 \\left ( X\\cdot e\\right ) \\left ( Y\\cdot e\\right ) \\right) \\end{equation*}\r\n", - "\\begin{equation*} L^{2} = \\left ( X\\cdot Y\\right ) \\left(\\left ( X\\cdot Y\\right ) - 2 \\left ( X\\cdot e\\right ) \\left ( Y\\cdot e\\right ) \\right) \\end{equation*}\r\n", - "\\begin{equation*} s = \\f{\\sinh}{\\alpha/2} \\text{ and } c = \\f{\\cosh}{\\alpha/2} \\end{equation*}\r\n", - "\\begin{equation*} e^{\\alpha B/{2\\abs{B}}} = c + (1/B) s \\boldsymbol{X}\\wedge \\boldsymbol{Y} - (1/B) \\left ( Y\\cdot e\\right ) s \\boldsymbol{X}\\wedge \\boldsymbol{e} + (1/B) \\left ( X\\cdot e\\right ) s \\boldsymbol{Y}\\wedge \\boldsymbol{e} \\end{equation*}\r\n", - "\\begin{equation*} W = Z\\cdot Y = (1/B)^{2} \\left ( X\\cdot Y\\right ) ^{3} s^{2} - 4 (1/B)^{2} \\left ( X\\cdot Y\\right ) ^{2} \\left ( X\\cdot e\\right ) \\left ( Y\\cdot e\\right ) s^{2} + 4 (1/B)^{2} \\left ( X\\cdot Y\\right ) \\left ( X\\cdot e\\right ) ^{2} \\left ( Y\\cdot e\\right ) ^{2} s^{2} + 2 (1/B) \\left ( X\\cdot Y\\right ) ^{2} c s - 4 (1/B) \\left ( X\\cdot Y\\right ) \\left ( X\\cdot e\\right ) \\left ( Y\\cdot e\\right ) c s + \\left ( X\\cdot Y\\right ) c^{2} \\end{equation*}\r\n", - "\\begin{equation*} S = \\f{\\sinh}{\\alpha} \\text{ and } C = \\f{\\cosh}{\\alpha} \\end{equation*}\r\n", - "\\begin{equation*} W = (1/B) \\left ( X\\cdot Y\\right ) C \\sqrt{\\left ( X\\cdot Y\\right ) ^{2} - 2 \\left ( X\\cdot Y\\right ) \\left ( X\\cdot e\\right ) \\left ( Y\\cdot e\\right ) } - (1/B) \\left ( X\\cdot e\\right ) \\left ( Y\\cdot e\\right ) C \\sqrt{\\left ( X\\cdot Y\\right ) ^{2} - 2 \\left ( X\\cdot Y\\right ) \\left ( X\\cdot e\\right ) \\left ( Y\\cdot e\\right ) } + (1/B) \\left ( X\\cdot e\\right ) \\left ( Y\\cdot e\\right ) \\sqrt{\\left ( X\\cdot Y\\right ) ^{2} - 2 \\left ( X\\cdot Y\\right ) \\left ( X\\cdot e\\right ) \\left ( Y\\cdot e\\right ) } + S \\sqrt{\\left ( X\\cdot Y\\right ) ^{2} - 2 \\left ( X\\cdot Y\\right ) \\left ( X\\cdot e\\right ) \\left ( Y\\cdot e\\right ) } \\end{equation*}\r\n", - "\\begin{equation*} \\text{Scalar Coefficient} = (1/B) \\left ( X\\cdot e\\right ) \\left ( Y\\cdot e\\right ) \\sqrt{\\left ( X\\cdot Y\\right ) ^{2} - 2 \\left ( X\\cdot Y\\right ) \\left ( X\\cdot e\\right ) \\left ( Y\\cdot e\\right ) } \\end{equation*}\r\n", - "\\begin{equation*} \\text{Cosh Coefficient} = (1/B) \\left ( X\\cdot Y\\right ) \\sqrt{\\left ( X\\cdot Y\\right ) ^{2} - 2 \\left ( X\\cdot Y\\right ) \\left ( X\\cdot e\\right ) \\left ( Y\\cdot e\\right ) } - (1/B) \\left ( X\\cdot e\\right ) \\left ( Y\\cdot e\\right ) \\sqrt{\\left ( X\\cdot Y\\right ) ^{2} - 2 \\left ( X\\cdot Y\\right ) \\left ( X\\cdot e\\right ) \\left ( Y\\cdot e\\right ) } \\end{equation*}\r\n", - "\\begin{equation*} \\text{Sinh Coefficient} = \\sqrt{\\left ( X\\cdot Y\\right ) ^{2} - 2 \\left ( X\\cdot Y\\right ) \\left ( X\\cdot e\\right ) \\left ( Y\\cdot e\\right ) } \\end{equation*}\r\n", - "\\begin{equation*} \\abs{B} = \\sqrt{\\left ( X\\cdot Y\\right ) ^{2} - 2 \\left ( X\\cdot Y\\right ) \\left ( X\\cdot e\\right ) \\left ( Y\\cdot e\\right ) } \\end{equation*}\r\n", - "\\begin{equation*} \\text{Require } aC^{2}+bC+c = 0 \\end{equation*}\r\n", - "\\begin{equation*} a = \\left ( X\\cdot e\\right ) ^{2} \\left ( Y\\cdot e\\right ) ^{2} \\end{equation*}\r\n", - "\\begin{equation*} b = 2 \\left ( X\\cdot e\\right ) \\left ( Y\\cdot e\\right ) \\left(\\left ( X\\cdot Y\\right ) - \\left ( X\\cdot e\\right ) \\left ( Y\\cdot e\\right ) \\right) \\end{equation*}\r\n", - "\\begin{equation*} c = \\left ( X\\cdot Y\\right ) ^{2} - 2 \\left ( X\\cdot Y\\right ) \\left ( X\\cdot e\\right ) \\left ( Y\\cdot e\\right ) + \\left ( X\\cdot e\\right ) ^{2} \\left ( Y\\cdot e\\right ) ^{2} \\end{equation*}\r\n", - "\\begin{equation*} b^{2}-4ac = 0 \\end{equation*}\r\n", - "\\begin{equation*} \\f{\\cosh}{\\alpha} = C = -b/(2a) = - \\frac{\\left ( X\\cdot Y\\right ) }{\\left ( X\\cdot e\\right ) \\left ( Y\\cdot e\\right ) } + 1 \\end{equation*}\r\n", - "\\\\begin{lstlisting}[language=Python,showspaces=false,showstringspaces=false,backgroundcolor=\\color{gray},frame=single]\r\n", - "def conformal_representations_of_circles_lines_spheres_and_planes():\r\n", - " Print_Function()\r\n", - " global n,nbar\r\n", - " Fmt(1)\r\n", - " g = '1 0 0 0 0,0 1 0 0 0,0 0 1 0 0,0 0 0 0 2,0 0 0 2 0'\r\n", - " c3d = Ga('e_1 e_2 e_3 n \\\\bar{n}',g=g)\r\n", - " (e1,e2,e3,n,nbar) = c3d.mv()\r\n", - " print('g_{ij} =',c3d.g)\r\n", - " e = n+nbar\r\n", - " #conformal representation of points\r\n", - " A = make_vector(e1, ga=c3d) # point a = (1,0,0) A = F(a)\r\n", - " B = make_vector(e2, ga=c3d) # point b = (0,1,0) B = F(b)\r\n", - " C = make_vector(-e1, ga=c3d) # point c = (-1,0,0) C = F(c)\r\n", - " D = make_vector(e3, ga=c3d) # point d = (0,0,1) D = F(d)\r\n", - " X = make_vector('x',3, ga=c3d)\r\n", - " print('F(a) =',A)\r\n", - " print('F(b) =',B)\r\n", - " print('F(c) =',C)\r\n", - " print('F(d) =',D)\r\n", - " print('F(x) =',X)\r\n", - " print('#a = e1, b = e2, c = -e1, and d = e3')\r\n", - " print('#A = F(a) = 1/2*(a*a*n+2*a-nbar), etc.')\r\n", - " print('#Circle through a, b, and c')\r\n", - " print('Circle: A^B^C^X = 0 =',(A^B^C^X))\r\n", - " print('#Line through a and b')\r\n", - " print('Line : A^B^n^X = 0 =',(A^B^n^X))\r\n", - " print('#Sphere through a, b, c, and d')\r\n", - " print('Sphere: A^B^C^D^X = 0 =',(((A^B)^C)^D)^X)\r\n", - " print('#Plane through a, b, and d')\r\n", - " print('Plane : A^B^n^D^X = 0 =',(A^B^n^D^X))\r\n", - " L = (A^B^e)^X\r\n", - " L.Fmt(3,'Hyperbolic\\\\;\\\\; Circle: (A^B^e)^X = 0')\r\n", - " return\r\n", - "\\end{lstlisting}\r\n", - "Code Output:\r\n", - "\\begin{equation*} g_{ij} = \\left [ \\begin{array}{ccccc} 1 & 0 & 0 & 0 & 0 \\\\ 0 & 1 & 0 & 0 & 0 \\\\ 0 & 0 & 1 & 0 & 0 \\\\ 0 & 0 & 0 & 0 & 2 \\\\ 0 & 0 & 0 & 2 & 0 \\end{array}\\right ] \\end{equation*}\r\n", - "\\begin{equation*} F(a) = \\boldsymbol{e}_{1} + \\frac{1}{2} \\boldsymbol{n} - \\frac{1}{2} \\boldsymbol{\\bar{n}} \\end{equation*}\r\n", - "\\begin{equation*} F(b) = \\boldsymbol{e}_{2} + \\frac{1}{2} \\boldsymbol{n} - \\frac{1}{2} \\boldsymbol{\\bar{n}} \\end{equation*}\r\n", - "\\begin{equation*} F(c) = - \\boldsymbol{e}_{1} + \\frac{1}{2} \\boldsymbol{n} - \\frac{1}{2} \\boldsymbol{\\bar{n}} \\end{equation*}\r\n", - "\\begin{equation*} F(d) = \\boldsymbol{e}_{3} + \\frac{1}{2} \\boldsymbol{n} - \\frac{1}{2} \\boldsymbol{\\bar{n}} \\end{equation*}\r\n", - "\\begin{equation*} F(x) = x_{1} \\boldsymbol{e}_{1} + x_{2} \\boldsymbol{e}_{2} + x_{3} \\boldsymbol{e}_{3} + \\left ( \\frac{{\\left ( x_{1} \\right )}^{2}}{2} + \\frac{{\\left ( x_{2} \\right )}^{2}}{2} + \\frac{{\\left ( x_{3} \\right )}^{2}}{2}\\right ) \\boldsymbol{n} - \\frac{1}{2} \\boldsymbol{\\bar{n}} \\end{equation*}\r\n", - "a = e1, b = e2, c = -e1, and d = e3\r\n", - "A = F(a) = 1/2*(a*a*n+2*a-nbar), etc.\r\n", - "Circle through a, b, and c\r\n", - "\\begin{equation*} Circle: A\\W B\\W C\\W X = 0 = - x_{3} \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{2}\\wedge \\boldsymbol{e}_{3}\\wedge \\boldsymbol{n} + x_{3} \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{2}\\wedge \\boldsymbol{e}_{3}\\wedge \\boldsymbol{\\bar{n}} + \\left ( \\frac{{\\left ( x_{1} \\right )}^{2}}{2} + \\frac{{\\left ( x_{2} \\right )}^{2}}{2} + \\frac{{\\left ( x_{3} \\right )}^{2}}{2} - \\frac{1}{2}\\right ) \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{2}\\wedge \\boldsymbol{n}\\wedge \\boldsymbol{\\bar{n}} \\end{equation*}\r\n", - "Line through a and b\r\n", - "\\begin{equation*} Line : A\\W B\\W n\\W X = 0 = - x_{3} \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{2}\\wedge \\boldsymbol{e}_{3}\\wedge \\boldsymbol{n} + \\left ( \\frac{x_{1}}{2} + \\frac{x_{2}}{2} - \\frac{1}{2}\\right ) \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{2}\\wedge \\boldsymbol{n}\\wedge \\boldsymbol{\\bar{n}} + \\frac{x_{3}}{2} \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{3}\\wedge \\boldsymbol{n}\\wedge \\boldsymbol{\\bar{n}} - \\frac{x_{3}}{2} \\boldsymbol{e}_{2}\\wedge \\boldsymbol{e}_{3}\\wedge \\boldsymbol{n}\\wedge \\boldsymbol{\\bar{n}} \\end{equation*}\r\n", - "Sphere through a, b, c, and d\r\n", - "\\begin{equation*} Sphere: A\\W B\\W C\\W D\\W X = 0 = \\left ( - \\frac{{\\left ( x_{1} \\right )}^{2}}{2} - \\frac{{\\left ( x_{2} \\right )}^{2}}{2} - \\frac{{\\left ( x_{3} \\right )}^{2}}{2} + \\frac{1}{2}\\right ) \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{2}\\wedge \\boldsymbol{e}_{3}\\wedge \\boldsymbol{n}\\wedge \\boldsymbol{\\bar{n}} \\end{equation*}\r\n", - "Plane through a, b, and d\r\n", - "\\begin{equation*} Plane : A\\W B\\W n\\W D\\W X = 0 = \\left ( - \\frac{x_{1}}{2} - \\frac{x_{2}}{2} - \\frac{x_{3}}{2} + \\frac{1}{2}\\right ) \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{2}\\wedge \\boldsymbol{e}_{3}\\wedge \\boldsymbol{n}\\wedge \\boldsymbol{\\bar{n}} \\end{equation*}\r\n", - "\\\\begin{lstlisting}[language=Python,showspaces=false,showstringspaces=false,backgroundcolor=\\color{gray},frame=single]\r\n", - "def properties_of_geometric_objects():\r\n", - " Print_Function()\r\n", - " global n, nbar\r\n", - " Fmt(1)\r\n", - " g = '# # # 0 0,'+ \\\r\n", - " '# # # 0 0,'+ \\\r\n", - " '# # # 0 0,'+ \\\r\n", - " '0 0 0 0 2,'+ \\\r\n", - " '0 0 0 2 0'\r\n", - " c3d = Ga('p1 p2 p3 n \\\\bar{n}',g=g)\r\n", - " (p1,p2,p3,n,nbar) = c3d.mv()\r\n", - " print('g_{ij} =',c3d.g)\r\n", - " P1 = F(p1)\r\n", - " P2 = F(p2)\r\n", - " P3 = F(p3)\r\n", - " print('\\\\text{Extracting direction of line from }L = P1\\\\W P2\\\\W n')\r\n", - " L = P1^P2^n\r\n", - " delta = (L|n)|nbar\r\n", - " print('(L|n)|\\\\bar{n} =',delta)\r\n", - " print('\\\\text{Extracting plane of circle from }C = P1\\\\W P2\\\\W P3')\r\n", - " C = P1^P2^P3\r\n", - " delta = ((C^n)|n)|nbar\r\n", - " print('((C^n)|n)|\\\\bar{n}=',delta)\r\n", - " print('(p2-p1)^(p3-p1)=',(p2-p1)^(p3-p1))\r\n", - " return\r\n", - "\\end{lstlisting}\r\n", - "Code Output:\r\n", - "\\begin{equation*} g_{ij} = \\left [ \\begin{array}{ccccc} \\left ( p_{1}\\cdot p_{1}\\right ) & \\left ( p_{1}\\cdot p_{2}\\right ) & \\left ( p_{1}\\cdot p_{3}\\right ) & 0 & 0 \\\\ \\left ( p_{1}\\cdot p_{2}\\right ) & \\left ( p_{2}\\cdot p_{2}\\right ) & \\left ( p_{2}\\cdot p_{3}\\right ) & 0 & 0 \\\\ \\left ( p_{1}\\cdot p_{3}\\right ) & \\left ( p_{2}\\cdot p_{3}\\right ) & \\left ( p_{3}\\cdot p_{3}\\right ) & 0 & 0 \\\\ 0 & 0 & 0 & 0 & 2 \\\\ 0 & 0 & 0 & 2 & 0 \\end{array}\\right ] \\end{equation*}\r\n", - "\\begin{equation*} \\text{Extracting direction of line from }L = P1\\W P2\\W n \\end{equation*}\r\n", - "\\begin{equation*} (L\\cdot n)\\cdot \\bar{n} = 2 \\boldsymbol{p}_{1} -2 \\boldsymbol{p}_{2} \\end{equation*}\r\n", - "\\begin{equation*} \\text{Extracting plane of circle from }C = P1\\W P2\\W P3 \\end{equation*}\r\n", - "\\begin{equation*} ((C\\W n)\\cdot n)\\cdot \\bar{n}= 2 \\boldsymbol{p}_{1}\\wedge \\boldsymbol{p}_{2} -2 \\boldsymbol{p}_{1}\\wedge \\boldsymbol{p}_{3} + 2 \\boldsymbol{p}_{2}\\wedge \\boldsymbol{p}_{3} \\end{equation*}\r\n", - "\\begin{equation*} (p2-p1)\\W (p3-p1)= \\boldsymbol{p}_{1}\\wedge \\boldsymbol{p}_{2} - \\boldsymbol{p}_{1}\\wedge \\boldsymbol{p}_{3} + \\boldsymbol{p}_{2}\\wedge \\boldsymbol{p}_{3} \\end{equation*}\r\n", - "\\\\begin{lstlisting}[language=Python,showspaces=false,showstringspaces=false,backgroundcolor=\\color{gray},frame=single]\r\n", - "def extracting_vectors_from_conformal_2_blade():\r\n", - " Print_Function()\r\n", - " Fmt(1)\r\n", - " print(r'B = P1\\W P2')\r\n", - " g = '0 -1 #,'+ \\\r\n", - " '-1 0 #,'+ \\\r\n", - " '# # #'\r\n", - " c2b = Ga('P1 P2 a',g=g)\r\n", - " (P1,P2,a) = c2b.mv()\r\n", - " print('g_{ij} =',c2b.g)\r\n", - " B = P1^P2\r\n", - " Bsq = B*B\r\n", - " print('%B^{2} =',Bsq)\r\n", - " ap = a-(a^B)*B\r\n", - " print(\"a' = a-(a^B)*B =\",ap)\r\n", - " Ap = ap+ap*B\r\n", - " Am = ap-ap*B\r\n", - " print(\"A+ = a'+a'*B =\",Ap)\r\n", - " print(\"A- = a'-a'*B =\",Am)\r\n", - " print('%(A+)^{2} =',Ap*Ap)\r\n", - " print('%(A-)^{2} =',Am*Am)\r\n", - " aB = a|B\r\n", - " print('a|B =',aB)\r\n", - " return\r\n", - "\\end{lstlisting}\r\n", - "Code Output:\r\n", - "\\begin{equation*} B = P1\\W P2 \\end{equation*}\r\n", - "\\begin{equation*} g_{ij} = \\left [ \\begin{array}{ccc} 0 & -1 & \\left ( P_{1}\\cdot a\\right ) \\\\ -1 & 0 & \\left ( P_{2}\\cdot a\\right ) \\\\ \\left ( P_{1}\\cdot a\\right ) & \\left ( P_{2}\\cdot a\\right ) & \\left ( a\\cdot a\\right ) \\end{array}\\right ] \\end{equation*}\r\n", - "\\begin{equation*} B^{2} = 1 \\end{equation*}\r\n", - "\\begin{equation*} a' = a-(a\\W B) B = - \\left ( P_{2}\\cdot a\\right ) \\boldsymbol{P}_{1} - \\left ( P_{1}\\cdot a\\right ) \\boldsymbol{P}_{2} \\end{equation*}\r\n", - "\\begin{equation*} A+ = a'+a' B = - 2 \\left ( P_{2}\\cdot a\\right ) \\boldsymbol{P}_{1} \\end{equation*}\r\n", - "\\begin{equation*} A- = a'-a' B = - 2 \\left ( P_{1}\\cdot a\\right ) \\boldsymbol{P}_{2} \\end{equation*}\r\n", - "\\begin{equation*} (A+)^{2} = 0 \\end{equation*}\r\n", - "\\begin{equation*} (A-)^{2} = 0 \\end{equation*}\r\n", - "\\begin{equation*} a\\cdot B = - \\left ( P_{2}\\cdot a\\right ) \\boldsymbol{P}_{1} + \\left ( P_{1}\\cdot a\\right ) \\boldsymbol{P}_{2} \\end{equation*}\r\n", - "\\\\begin{lstlisting}[language=Python,showspaces=false,showstringspaces=false,backgroundcolor=\\color{gray},frame=single]\r\n", - "def reciprocal_frame_test():\r\n", - " Print_Function()\r\n", - " Fmt(1)\r\n", - " g = '1 # #,'+ \\\r\n", - " '# 1 #,'+ \\\r\n", - " '# # 1'\r\n", - " ng3d = Ga('e1 e2 e3',g=g)\r\n", - " (e1,e2,e3) = ng3d.mv()\r\n", - " print('g_{ij} =',ng3d.g)\r\n", - " E = e1^e2^e3\r\n", - " Esq = (E*E).scalar()\r\n", - " print('E =',E)\r\n", - " print('%E^{2} =',Esq)\r\n", - " Esq_inv = 1/Esq\r\n", - " E1 = (e2^e3)*E\r\n", - " E2 = (-1)*(e1^e3)*E\r\n", - " E3 = (e1^e2)*E\r\n", - " print('E1 = (e2^e3)*E =',E1)\r\n", - " print('E2 =-(e1^e3)*E =',E2)\r\n", - " print('E3 = (e1^e2)*E =',E3)\r\n", - " w = (E1|e2)\r\n", - " w = w.expand()\r\n", - " print('E1|e2 =',w)\r\n", - " w = (E1|e3)\r\n", - " w = w.expand()\r\n", - " print('E1|e3 =',w)\r\n", - " w = (E2|e1)\r\n", - " w = w.expand()\r\n", - " print('E2|e1 =',w)\r\n", - " w = (E2|e3)\r\n", - " w = w.expand()\r\n", - " print('E2|e3 =',w)\r\n", - " w = (E3|e1)\r\n", - " w = w.expand()\r\n", - " print('E3|e1 =',w)\r\n", - " w = (E3|e2)\r\n", - " w = w.expand()\r\n", - " print('E3|e2 =',w)\r\n", - " w = (E1|e1)\r\n", - " w = (w.expand()).scalar()\r\n", - " Esq = expand(Esq)\r\n", - " print('%(E1\\\\cdot e1)/E^{2} =',simplify(w/Esq))\r\n", - " w = (E2|e2)\r\n", - " w = (w.expand()).scalar()\r\n", - " print('%(E2\\\\cdot e2)/E^{2} =',simplify(w/Esq))\r\n", - " w = (E3|e3)\r\n", - " w = (w.expand()).scalar()\r\n", - " print('%(E3\\\\cdot e3)/E^{2} =',simplify(w/Esq))\r\n", - " return\r\n", - "\\end{lstlisting}\r\n", - "Code Output:\r\n", - "\\begin{equation*} g_{ij} = \\left [ \\begin{array}{ccc} 1 & \\left ( e_{1}\\cdot e_{2}\\right ) & \\left ( e_{1}\\cdot e_{3}\\right ) \\\\ \\left ( e_{1}\\cdot e_{2}\\right ) & 1 & \\left ( e_{2}\\cdot e_{3}\\right ) \\\\ \\left ( e_{1}\\cdot e_{3}\\right ) & \\left ( e_{2}\\cdot e_{3}\\right ) & 1 \\end{array}\\right ] \\end{equation*}\r\n", - "\\begin{equation*} E = \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{2}\\wedge \\boldsymbol{e}_{3} \\end{equation*}\r\n", - "\\begin{equation*} E^{2} = \\left ( e_{1}\\cdot e_{2}\\right ) ^{2} - 2 \\left ( e_{1}\\cdot e_{2}\\right ) \\left ( e_{1}\\cdot e_{3}\\right ) \\left ( e_{2}\\cdot e_{3}\\right ) + \\left ( e_{1}\\cdot e_{3}\\right ) ^{2} + \\left ( e_{2}\\cdot e_{3}\\right ) ^{2} - 1 \\end{equation*}\r\n", - "\\begin{equation*} E1 = (e2\\W e3) E = \\left ( \\left ( e_{2}\\cdot e_{3}\\right ) ^{2} - 1\\right ) \\boldsymbol{e}_{1} + \\left ( \\left ( e_{1}\\cdot e_{2}\\right ) - \\left ( e_{1}\\cdot e_{3}\\right ) \\left ( e_{2}\\cdot e_{3}\\right ) \\right ) \\boldsymbol{e}_{2} + \\left ( - \\left ( e_{1}\\cdot e_{2}\\right ) \\left ( e_{2}\\cdot e_{3}\\right ) + \\left ( e_{1}\\cdot e_{3}\\right ) \\right ) \\boldsymbol{e}_{3} \\end{equation*}\r\n", - "\\begin{equation*} E2 =-(e1\\W e3) E = \\left ( \\left ( e_{1}\\cdot e_{2}\\right ) - \\left ( e_{1}\\cdot e_{3}\\right ) \\left ( e_{2}\\cdot e_{3}\\right ) \\right ) \\boldsymbol{e}_{1} + \\left ( \\left ( e_{1}\\cdot e_{3}\\right ) ^{2} - 1\\right ) \\boldsymbol{e}_{2} + \\left ( - \\left ( e_{1}\\cdot e_{2}\\right ) \\left ( e_{1}\\cdot e_{3}\\right ) + \\left ( e_{2}\\cdot e_{3}\\right ) \\right ) \\boldsymbol{e}_{3} \\end{equation*}\r\n", - "\\begin{equation*} E3 = (e1\\W e2) E = \\left ( - \\left ( e_{1}\\cdot e_{2}\\right ) \\left ( e_{2}\\cdot e_{3}\\right ) + \\left ( e_{1}\\cdot e_{3}\\right ) \\right ) \\boldsymbol{e}_{1} + \\left ( - \\left ( e_{1}\\cdot e_{2}\\right ) \\left ( e_{1}\\cdot e_{3}\\right ) + \\left ( e_{2}\\cdot e_{3}\\right ) \\right ) \\boldsymbol{e}_{2} + \\left ( \\left ( e_{1}\\cdot e_{2}\\right ) ^{2} - 1\\right ) \\boldsymbol{e}_{3} \\end{equation*}\r\n", - "\\begin{equation*} E1\\cdot e2 = 0 \\end{equation*}\r\n", - "\\begin{equation*} E1\\cdot e3 = 0 \\end{equation*}\r\n", - "\\begin{equation*} E2\\cdot e1 = 0 \\end{equation*}\r\n", - "\\begin{equation*} E2\\cdot e3 = 0 \\end{equation*}\r\n", - "\\begin{equation*} E3\\cdot e1 = 0 \\end{equation*}\r\n", - "\\begin{equation*} E3\\cdot e2 = 0 \\end{equation*}\r\n", - "\\begin{equation*} (E1\\cdot e1)/E^{2} = 1 \\end{equation*}\r\n", - "\\begin{equation*} (E2\\cdot e2)/E^{2} = 1 \\end{equation*}\r\n", - "\\begin{equation*} (E3\\cdot e3)/E^{2} = 1 \\end{equation*}\r\n", - "\\\\begin{lstlisting}[language=Python,showspaces=false,showstringspaces=false,backgroundcolor=\\color{gray},frame=single]\r\n", - "def signature_test():\r\n", - " Print_Function()\r\n", - " e3d = Ga('e1 e2 e3',g=[1,1,1])\r\n", - " print('g =', e3d.g)\r\n", - " print(r'%Signature = (3,0)\\: I =', e3d.I(),'\\: I^{2} =', e3d.I()*e3d.I())\r\n", - " e3d = Ga('e1 e2 e3',g=[2,2,2])\r\n", - " print('g =', e3d.g)\r\n", - " print(r'%Signature = (3,0)\\: I =', e3d.I(),'|; I^{2} =', e3d.I()*e3d.I())\r\n", - " sp4d = Ga('e1 e2 e3 e4',g=[1,-1,-1,-1])\r\n", - " print('g =', sp4d.g)\r\n", - " print(r'%Signature = (1,3)\\: I =', sp4d.I(),'\\: I^{2} =', sp4d.I()*sp4d.I())\r\n", - " sp4d = Ga('e1 e2 e3 e4',g=[2,-2,-2,-2])\r\n", - " print('g =', sp4d.g)\r\n", - " print(r'%Signature = (1,3)\\: I =', sp4d.I(),'\\: I^{2} =', sp4d.I()*sp4d.I())\r\n", - " e4d = Ga('e1 e2 e3 e4',g=[1,1,1,1])\r\n", - " print('g =', e4d.g)\r\n", - " print(r'%Signature = (4,0)\\: I =', e4d.I(),'\\: I^{2} =', e4d.I()*e4d.I())\r\n", - " cf3d = Ga('e1 e2 e3 e4 e5',g=[1,1,1,1,-1])\r\n", - " print('g =', cf3d.g)\r\n", - " print(r'%Signature = (4,1)\\: I =', cf3d.I(),'\\: I^{2} =', cf3d.I()*cf3d.I())\r\n", - " cf3d = Ga('e1 e2 e3 e4 e5',g=[2,2,2,2,-2])\r\n", - " print('g =', cf3d.g)\r\n", - " print(r'%Signature = (4,1)\\: I =', cf3d.I(),'\\: I^{2} =', cf3d.I()*cf3d.I())\r\n", - " return\r\n", - "\\end{lstlisting}\r\n", - "Code Output:\r\n", - "\\begin{equation*} g = \\left [ \\begin{array}{ccc} 1 & 0 & 0 \\\\ 0 & 1 & 0 \\\\ 0 & 0 & 1 \\end{array}\\right ] \\end{equation*}\r\n", - "\\begin{equation*} Signature = (3,0)\\: I = \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{2}\\wedge \\boldsymbol{e}_{3} \\: I^{2} = -1 \\end{equation*}\r\n", - "\\begin{equation*} g = \\left [ \\begin{array}{ccc} 2 & 0 & 0 \\\\ 0 & 2 & 0 \\\\ 0 & 0 & 2 \\end{array}\\right ] \\end{equation*}\r\n", - "\\begin{equation*} Signature = (3,0)\\: I = \\frac{\\sqrt{2}}{4} \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{2}\\wedge \\boldsymbol{e}_{3} |; I^{2} = -1 \\end{equation*}\r\n", - "\\begin{equation*} g = \\left [ \\begin{array}{cccc} 1 & 0 & 0 & 0 \\\\ 0 & -1 & 0 & 0 \\\\ 0 & 0 & -1 & 0 \\\\ 0 & 0 & 0 & -1 \\end{array}\\right ] \\end{equation*}\r\n", - "\\begin{equation*} Signature = (1,3)\\: I = \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{2}\\wedge \\boldsymbol{e}_{3}\\wedge \\boldsymbol{e}_{4} \\: I^{2} = -1 \\end{equation*}\r\n", - "\\begin{equation*} g = \\left [ \\begin{array}{cccc} 2 & 0 & 0 & 0 \\\\ 0 & -2 & 0 & 0 \\\\ 0 & 0 & -2 & 0 \\\\ 0 & 0 & 0 & -2 \\end{array}\\right ] \\end{equation*}\r\n", - "\\begin{equation*} Signature = (1,3)\\: I = \\frac{1}{4} \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{2}\\wedge \\boldsymbol{e}_{3}\\wedge \\boldsymbol{e}_{4} \\: I^{2} = -1 \\end{equation*}\r\n", - "\\begin{equation*} g = \\left [ \\begin{array}{cccc} 1 & 0 & 0 & 0 \\\\ 0 & 1 & 0 & 0 \\\\ 0 & 0 & 1 & 0 \\\\ 0 & 0 & 0 & 1 \\end{array}\\right ] \\end{equation*}\r\n", - "\\begin{equation*} Signature = (4,0)\\: I = \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{2}\\wedge \\boldsymbol{e}_{3}\\wedge \\boldsymbol{e}_{4} \\: I^{2} = 1 \\end{equation*}\r\n", - "\\begin{equation*} g = \\left [ \\begin{array}{ccccc} 1 & 0 & 0 & 0 & 0 \\\\ 0 & 1 & 0 & 0 & 0 \\\\ 0 & 0 & 1 & 0 & 0 \\\\ 0 & 0 & 0 & 1 & 0 \\\\ 0 & 0 & 0 & 0 & -1 \\end{array}\\right ] \\end{equation*}\r\n", - "\\begin{equation*} Signature = (4,1)\\: I = \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{2}\\wedge \\boldsymbol{e}_{3}\\wedge \\boldsymbol{e}_{4}\\wedge \\boldsymbol{e}_{5} \\: I^{2} = -1 \\end{equation*}\r\n", - "\\begin{equation*} g = \\left [ \\begin{array}{ccccc} 2 & 0 & 0 & 0 & 0 \\\\ 0 & 2 & 0 & 0 & 0 \\\\ 0 & 0 & 2 & 0 & 0 \\\\ 0 & 0 & 0 & 2 & 0 \\\\ 0 & 0 & 0 & 0 & -2 \\end{array}\\right ] \\end{equation*}\r\n", - "\\begin{equation*} Signature = (4,1)\\: I = \\frac{\\sqrt{2}}{8} \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{2}\\wedge \\boldsymbol{e}_{3}\\wedge \\boldsymbol{e}_{4}\\wedge \\boldsymbol{e}_{5} \\: I^{2} = -1 \\end{equation*}\r\n", - "\\\\begin{lstlisting}[language=Python,showspaces=false,showstringspaces=false,backgroundcolor=\\color{gray},frame=single]\r\n", - "def Fmt_test():\r\n", - " Print_Function()\r\n", - " e3d = Ga('e1 e2 e3',g=[1,1,1])\r\n", - " v = e3d.mv('v','vector')\r\n", - " B = e3d.mv('B','bivector')\r\n", - " M = e3d.mv('M','mv')\r\n", - " Fmt(2)\r\n", - " print('#Global $Fmt = 2$')\r\n", - " print('v =',v)\r\n", - " print('B =',B)\r\n", - " print('M =',M)\r\n", - " print('#Using $.Fmt()$ Function')\r\n", - " print('v.Fmt(3) =',v.Fmt(3))\r\n", - " print('B.Fmt(3) =',B.Fmt(3))\r\n", - " print('M.Fmt(2) =',M.Fmt(2))\r\n", - " print('M.Fmt(1) =',M.Fmt(1))\r\n", - " print('#Global $Fmt = 1$')\r\n", - " Fmt(1)\r\n", - " print('v =',v)\r\n", - " print('B =',B)\r\n", - " print('M =',M)\r\n", - " return\r\n", - "\\end{lstlisting}\r\n", - "Code Output:\r\n", - "Global $Fmt = 2$\r\n", - "\\begin{equation*} v = v^{1} \\boldsymbol{e}_{1} + v^{2} \\boldsymbol{e}_{2} + v^{3} \\boldsymbol{e}_{3} \\end{equation*}\r\n", - "\\begin{equation*} B = B^{12} \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{2} + B^{13} \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{3} + B^{23} \\boldsymbol{e}_{2}\\wedge \\boldsymbol{e}_{3} \\end{equation*}\r\n", - " \\begin{align*} M = & M \\\\ & + M^{1} \\boldsymbol{e}_{1} + M^{2} \\boldsymbol{e}_{2} + M^{3} \\boldsymbol{e}_{3} \\\\ & + M^{12} \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{2} + M^{13} \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{3} + M^{23} \\boldsymbol{e}_{2}\\wedge \\boldsymbol{e}_{3} \\\\ & + M^{123} \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{2}\\wedge \\boldsymbol{e}_{3} \\end{align*} \r\n", - "Using $.Fmt()$ Function\r\n", - " \\begin{align*} v \\cdot Fmt(3) = & v^{1} \\boldsymbol{e}_{1} \\\\ & + v^{2} \\boldsymbol{e}_{2} \\\\ & + v^{3} \\boldsymbol{e}_{3} \\end{align*} \r\n", - " \\begin{align*} B \\cdot Fmt(3) = & B^{12} \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{2} \\\\ & + B^{13} \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{3} \\\\ & + B^{23} \\boldsymbol{e}_{2}\\wedge \\boldsymbol{e}_{3} \\end{align*} \r\n", - " \\begin{align*} M \\cdot Fmt(2) = & M \\\\ & + M^{1} \\boldsymbol{e}_{1} + M^{2} \\boldsymbol{e}_{2} + M^{3} \\boldsymbol{e}_{3} \\\\ & + M^{12} \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{2} + M^{13} \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{3} + M^{23} \\boldsymbol{e}_{2}\\wedge \\boldsymbol{e}_{3} \\\\ & + M^{123} \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{2}\\wedge \\boldsymbol{e}_{3} \\end{align*} \r\n", - "\\begin{equation*} M \\cdot Fmt(1) = M + M^{1} \\boldsymbol{e}_{1} + M^{2} \\boldsymbol{e}_{2} + M^{3} \\boldsymbol{e}_{3} + M^{12} \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{2} + M^{13} \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{3} + M^{23} \\boldsymbol{e}_{2}\\wedge \\boldsymbol{e}_{3} + M^{123} \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{2}\\wedge \\boldsymbol{e}_{3} \\end{equation*}\r\n", - "Global $Fmt = 1$\r\n", - "\\begin{equation*} v = v^{1} \\boldsymbol{e}_{1} + v^{2} \\boldsymbol{e}_{2} + v^{3} \\boldsymbol{e}_{3} \\end{equation*}\r\n", - "\\begin{equation*} B = B^{12} \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{2} + B^{13} \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{3} + B^{23} \\boldsymbol{e}_{2}\\wedge \\boldsymbol{e}_{3} \\end{equation*}\r\n", - "\\begin{equation*} M = M + M^{1} \\boldsymbol{e}_{1} + M^{2} \\boldsymbol{e}_{2} + M^{3} \\boldsymbol{e}_{3} + M^{12} \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{2} + M^{13} \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{3} + M^{23} \\boldsymbol{e}_{2}\\wedge \\boldsymbol{e}_{3} + M^{123} \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{2}\\wedge \\boldsymbol{e}_{3} \\end{equation*}\r\n", - "\\end{document}\r\n" - ] + "data": { + "text/plain": [ + "\n", + "\\documentclass[10pt,fleqn]{report}\n", + "\\usepackage[vcentering]{geometry}\n", + "\\geometry{papersize={14in,11in},total={13in,10in}}\n", + "\n", + "\\pagestyle{empty}\n", + "\\usepackage[latin1]{inputenc}\n", + "\\usepackage{amsmath}\n", + "\\usepackage{amsfonts}\n", + "\\usepackage{amssymb}\n", + "\\usepackage{amsbsy}\n", + "\\usepackage{tensor}\n", + "\\usepackage{listings}\n", + "\\usepackage{color}\n", + "\\usepackage{xcolor}\n", + "\\usepackage{bm}\n", + "\\usepackage{breqn}\n", + "\\definecolor{gray}{rgb}{0.95,0.95,0.95}\n", + "\\setlength{\\parindent}{0pt}\n", + "\\DeclareMathOperator{\\Tr}{Tr}\n", + "\\DeclareMathOperator{\\Adj}{Adj}\n", + "\\newcommand{\\bfrac}[2]{\\displaystyle\\frac{#1}{#2}}\n", + "\\newcommand{\\lp}{\\left (}\n", + "\\newcommand{\\rp}{\\right )}\n", + "\\newcommand{\\paren}[1]{\\lp {#1} \\rp}\n", + "\\newcommand{\\half}{\\frac{1}{2}}\n", + "\\newcommand{\\llt}{\\left <}\n", + "\\newcommand{\\rgt}{\\right >}\n", + "\\newcommand{\\abs}[1]{\\left |{#1}\\right | }\n", + "\\newcommand{\\pdiff}[2]{\\bfrac{\\partial {#1}}{\\partial {#2}}}\n", + "\\newcommand{\\lbrc}{\\left \\{}\n", + "\\newcommand{\\rbrc}{\\right \\}}\n", + "\\newcommand{\\W}{\\wedge}\n", + "\\newcommand{\\prm}[1]{{#1}'}\n", + "\\newcommand{\\ddt}[1]{\\bfrac{d{#1}}{dt}}\n", + "\\newcommand{\\R}{\\dagger}\n", + "\\newcommand{\\deriv}[3]{\\bfrac{d^{#3}#1}{d{#2}^{#3}}}\n", + "\\newcommand{\\grade}[1]{\\left < {#1} \\right >}\n", + "\\newcommand{\\f}[2]{{#1}\\lp{#2}\\rp}\n", + "\\newcommand{\\eval}[2]{\\left . {#1} \\right |_{#2}}\n", + "\\newcommand{\\Nabla}{\\boldsymbol{\\nabla}}\n", + "\\newcommand{\\eb}{\\boldsymbol{e}}\n", + "\\usepackage{float}\n", + "\\floatstyle{plain} % optionally change the style of the new float\n", + "\\newfloat{Code}{H}{myc}\n", + "\\lstloadlanguages{Python}\n", + "\n", + "\\begin{document}\n", + "\\\\begin{lstlisting}[language=Python,showspaces=false,showstringspaces=false,backgroundcolor=\\color{gray},frame=single]\n", + "def basic_multivector_operations_3D():\n", + " Print_Function()\n", + " g3d = Ga('e*x|y|z')\n", + " (ex,ey,ez) = g3d.mv()\n", + " A = g3d.mv('A','mv')\n", + " print(A.Fmt(1,'A'))\n", + " print(A.Fmt(2,'A'))\n", + " print(A.Fmt(3,'A'))\n", + " print(A.even().Fmt(1,'%A_{+}'))\n", + " print(A.odd().Fmt(1,'%A_{-}'))\n", + " X = g3d.mv('X','vector')\n", + " Y = g3d.mv('Y','vector')\n", + " print('g_{ij} = ',g3d.g)\n", + " print(X.Fmt(1,'X'))\n", + " print(Y.Fmt(1,'Y'))\n", + " print((X*Y).Fmt(2,'X*Y'))\n", + " print((X^Y).Fmt(2,'X^Y'))\n", + " print((X|Y).Fmt(2,'X|Y'))\n", + " print(cross(X,Y).Fmt(1,r'X\\times Y'))\n", + " return\n", + "\\end{lstlisting}\n", + "Code Output:\n", + "\\begin{equation*} A = A + A^{x} \\boldsymbol{e}_{x} + A^{y} \\boldsymbol{e}_{y} + A^{z} \\boldsymbol{e}_{z} + A^{xy} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + A^{xz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + A^{yz} \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} + A^{xyz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\n", + " \\begin{align*} A = & A \\\\ & + A^{x} \\boldsymbol{e}_{x} + A^{y} \\boldsymbol{e}_{y} + A^{z} \\boldsymbol{e}_{z} \\\\ & + A^{xy} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + A^{xz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + A^{yz} \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\\\ & + A^{xyz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{align*} \n", + " \\begin{align*} A = & A \\\\ & + A^{x} \\boldsymbol{e}_{x} \\\\ & + A^{y} \\boldsymbol{e}_{y} \\\\ & + A^{z} \\boldsymbol{e}_{z} \\\\ & + A^{xy} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} \\\\ & + A^{xz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} \\\\ & + A^{yz} \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\\\ & + A^{xyz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{align*} \n", + "\\begin{equation*} A_{+} = A + A^{xy} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + A^{xz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + A^{yz} \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} A_{-} = A^{x} \\boldsymbol{e}_{x} + A^{y} \\boldsymbol{e}_{y} + A^{z} \\boldsymbol{e}_{z} + A^{xyz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} g_{ij} = \\left [ \\begin{array}{ccc} \\left ( e_{x}\\cdot e_{x}\\right ) & \\left ( e_{x}\\cdot e_{y}\\right ) & \\left ( e_{x}\\cdot e_{z}\\right ) \\\\ \\left ( e_{x}\\cdot e_{y}\\right ) & \\left ( e_{y}\\cdot e_{y}\\right ) & \\left ( e_{y}\\cdot e_{z}\\right ) \\\\ \\left ( e_{x}\\cdot e_{z}\\right ) & \\left ( e_{y}\\cdot e_{z}\\right ) & \\left ( e_{z}\\cdot e_{z}\\right ) \\end{array}\\right ] \\end{equation*}\n", + "\\begin{equation*} X = X^{x} \\boldsymbol{e}_{x} + X^{y} \\boldsymbol{e}_{y} + X^{z} \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} Y = Y^{x} \\boldsymbol{e}_{x} + Y^{y} \\boldsymbol{e}_{y} + Y^{z} \\boldsymbol{e}_{z} \\end{equation*}\n", + " \\begin{align*} X Y = & \\left ( \\left ( e_{x}\\cdot e_{x}\\right ) X^{x} Y^{x} + \\left ( e_{x}\\cdot e_{y}\\right ) X^{x} Y^{y} + \\left ( e_{x}\\cdot e_{y}\\right ) X^{y} Y^{x} + \\left ( e_{x}\\cdot e_{z}\\right ) X^{x} Y^{z} + \\left ( e_{x}\\cdot e_{z}\\right ) X^{z} Y^{x} + \\left ( e_{y}\\cdot e_{y}\\right ) X^{y} Y^{y} + \\left ( e_{y}\\cdot e_{z}\\right ) X^{y} Y^{z} + \\left ( e_{y}\\cdot e_{z}\\right ) X^{z} Y^{y} + \\left ( e_{z}\\cdot e_{z}\\right ) X^{z} Y^{z}\\right ) \\\\ & + \\left ( X^{x} Y^{y} - X^{y} Y^{x}\\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + \\left ( X^{x} Y^{z} - X^{z} Y^{x}\\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + \\left ( X^{y} Y^{z} - X^{z} Y^{y}\\right ) \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{align*} \n", + "\\begin{equation*} X\\W Y = \\left ( X^{x} Y^{y} - X^{y} Y^{x}\\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + \\left ( X^{x} Y^{z} - X^{z} Y^{x}\\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + \\left ( X^{y} Y^{z} - X^{z} Y^{y}\\right ) \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} X\\cdot Y = \\left ( e_{x}\\cdot e_{x}\\right ) X^{x} Y^{x} + \\left ( e_{x}\\cdot e_{y}\\right ) X^{x} Y^{y} + \\left ( e_{x}\\cdot e_{y}\\right ) X^{y} Y^{x} + \\left ( e_{x}\\cdot e_{z}\\right ) X^{x} Y^{z} + \\left ( e_{x}\\cdot e_{z}\\right ) X^{z} Y^{x} + \\left ( e_{y}\\cdot e_{y}\\right ) X^{y} Y^{y} + \\left ( e_{y}\\cdot e_{z}\\right ) X^{y} Y^{z} + \\left ( e_{y}\\cdot e_{z}\\right ) X^{z} Y^{y} + \\left ( e_{z}\\cdot e_{z}\\right ) X^{z} Y^{z} \\end{equation*}\n", + "\\begin{equation*} X\\times Y = \\frac{\\left ( e_{x}\\cdot e_{y}\\right ) \\left ( e_{y}\\cdot e_{z}\\right ) X^{x} Y^{y} - \\left ( e_{x}\\cdot e_{y}\\right ) \\left ( e_{y}\\cdot e_{z}\\right ) X^{y} Y^{x} + \\left ( e_{x}\\cdot e_{y}\\right ) \\left ( e_{z}\\cdot e_{z}\\right ) X^{x} Y^{z} - \\left ( e_{x}\\cdot e_{y}\\right ) \\left ( e_{z}\\cdot e_{z}\\right ) X^{z} Y^{x} - \\left ( e_{x}\\cdot e_{z}\\right ) \\left ( e_{y}\\cdot e_{y}\\right ) X^{x} Y^{y} + \\left ( e_{x}\\cdot e_{z}\\right ) \\left ( e_{y}\\cdot e_{y}\\right ) X^{y} Y^{x} - \\left ( e_{x}\\cdot e_{z}\\right ) \\left ( e_{y}\\cdot e_{z}\\right ) X^{x} Y^{z} + \\left ( e_{x}\\cdot e_{z}\\right ) \\left ( e_{y}\\cdot e_{z}\\right ) X^{z} Y^{x} + \\left ( e_{y}\\cdot e_{y}\\right ) \\left ( e_{z}\\cdot e_{z}\\right ) X^{y} Y^{z} - \\left ( e_{y}\\cdot e_{y}\\right ) \\left ( e_{z}\\cdot e_{z}\\right ) X^{z} Y^{y} - \\left ( e_{y}\\cdot e_{z}\\right ) ^{2} X^{y} Y^{z} + \\left ( e_{y}\\cdot e_{z}\\right ) ^{2} X^{z} Y^{y}}{\\sqrt{\\left ( e_{x}\\cdot e_{x}\\right ) \\left ( e_{y}\\cdot e_{y}\\right ) \\left ( e_{z}\\cdot e_{z}\\right ) - \\left ( e_{x}\\cdot e_{x}\\right ) \\left ( e_{y}\\cdot e_{z}\\right ) ^{2} - \\left ( e_{x}\\cdot e_{y}\\right ) ^{2} \\left ( e_{z}\\cdot e_{z}\\right ) + 2 \\left ( e_{x}\\cdot e_{y}\\right ) \\left ( e_{x}\\cdot e_{z}\\right ) \\left ( e_{y}\\cdot e_{z}\\right ) - \\left ( e_{x}\\cdot e_{z}\\right ) ^{2} \\left ( e_{y}\\cdot e_{y}\\right ) }} \\boldsymbol{e}_{x} + \\frac{- \\left ( e_{x}\\cdot e_{x}\\right ) \\left ( e_{y}\\cdot e_{z}\\right ) X^{x} Y^{y} + \\left ( e_{x}\\cdot e_{x}\\right ) \\left ( e_{y}\\cdot e_{z}\\right ) X^{y} Y^{x} - \\left ( e_{x}\\cdot e_{x}\\right ) \\left ( e_{z}\\cdot e_{z}\\right ) X^{x} Y^{z} + \\left ( e_{x}\\cdot e_{x}\\right ) \\left ( e_{z}\\cdot e_{z}\\right ) X^{z} Y^{x} + \\left ( e_{x}\\cdot e_{y}\\right ) \\left ( e_{x}\\cdot e_{z}\\right ) X^{x} Y^{y} - \\left ( e_{x}\\cdot e_{y}\\right ) \\left ( e_{x}\\cdot e_{z}\\right ) X^{y} Y^{x} - \\left ( e_{x}\\cdot e_{y}\\right ) \\left ( e_{z}\\cdot e_{z}\\right ) X^{y} Y^{z} + \\left ( e_{x}\\cdot e_{y}\\right ) \\left ( e_{z}\\cdot e_{z}\\right ) X^{z} Y^{y} + \\left ( e_{x}\\cdot e_{z}\\right ) ^{2} X^{x} Y^{z} - \\left ( e_{x}\\cdot e_{z}\\right ) ^{2} X^{z} Y^{x} + \\left ( e_{x}\\cdot e_{z}\\right ) \\left ( e_{y}\\cdot e_{z}\\right ) X^{y} Y^{z} - \\left ( e_{x}\\cdot e_{z}\\right ) \\left ( e_{y}\\cdot e_{z}\\right ) X^{z} Y^{y}}{\\sqrt{\\left ( e_{x}\\cdot e_{x}\\right ) \\left ( e_{y}\\cdot e_{y}\\right ) \\left ( e_{z}\\cdot e_{z}\\right ) - \\left ( e_{x}\\cdot e_{x}\\right ) \\left ( e_{y}\\cdot e_{z}\\right ) ^{2} - \\left ( e_{x}\\cdot e_{y}\\right ) ^{2} \\left ( e_{z}\\cdot e_{z}\\right ) + 2 \\left ( e_{x}\\cdot e_{y}\\right ) \\left ( e_{x}\\cdot e_{z}\\right ) \\left ( e_{y}\\cdot e_{z}\\right ) - \\left ( e_{x}\\cdot e_{z}\\right ) ^{2} \\left ( e_{y}\\cdot e_{y}\\right ) }} \\boldsymbol{e}_{y} + \\frac{\\left ( e_{x}\\cdot e_{x}\\right ) \\left ( e_{y}\\cdot e_{y}\\right ) X^{x} Y^{y} - \\left ( e_{x}\\cdot e_{x}\\right ) \\left ( e_{y}\\cdot e_{y}\\right ) X^{y} Y^{x} + \\left ( e_{x}\\cdot e_{x}\\right ) \\left ( e_{y}\\cdot e_{z}\\right ) X^{x} Y^{z} - \\left ( e_{x}\\cdot e_{x}\\right ) \\left ( e_{y}\\cdot e_{z}\\right ) X^{z} Y^{x} - \\left ( e_{x}\\cdot e_{y}\\right ) ^{2} X^{x} Y^{y} + \\left ( e_{x}\\cdot e_{y}\\right ) ^{2} X^{y} Y^{x} - \\left ( e_{x}\\cdot e_{y}\\right ) \\left ( e_{x}\\cdot e_{z}\\right ) X^{x} Y^{z} + \\left ( e_{x}\\cdot e_{y}\\right ) \\left ( e_{x}\\cdot e_{z}\\right ) X^{z} Y^{x} + \\left ( e_{x}\\cdot e_{y}\\right ) \\left ( e_{y}\\cdot e_{z}\\right ) X^{y} Y^{z} - \\left ( e_{x}\\cdot e_{y}\\right ) \\left ( e_{y}\\cdot e_{z}\\right ) X^{z} Y^{y} - \\left ( e_{x}\\cdot e_{z}\\right ) \\left ( e_{y}\\cdot e_{y}\\right ) X^{y} Y^{z} + \\left ( e_{x}\\cdot e_{z}\\right ) \\left ( e_{y}\\cdot e_{y}\\right ) X^{z} Y^{y}}{\\sqrt{\\left ( e_{x}\\cdot e_{x}\\right ) \\left ( e_{y}\\cdot e_{y}\\right ) \\left ( e_{z}\\cdot e_{z}\\right ) - \\left ( e_{x}\\cdot e_{x}\\right ) \\left ( e_{y}\\cdot e_{z}\\right ) ^{2} - \\left ( e_{x}\\cdot e_{y}\\right ) ^{2} \\left ( e_{z}\\cdot e_{z}\\right ) + 2 \\left ( e_{x}\\cdot e_{y}\\right ) \\left ( e_{x}\\cdot e_{z}\\right ) \\left ( e_{y}\\cdot e_{z}\\right ) - \\left ( e_{x}\\cdot e_{z}\\right ) ^{2} \\left ( e_{y}\\cdot e_{y}\\right ) }} \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\\\begin{lstlisting}[language=Python,showspaces=false,showstringspaces=false,backgroundcolor=\\color{gray},frame=single]\n", + "def basic_multivector_operations_2D():\n", + " Print_Function()\n", + " g2d = Ga('e*x|y')\n", + " (ex,ey) = g2d.mv()\n", + " print('g_{ij} =',g2d.g)\n", + " X = g2d.mv('X','vector')\n", + " A = g2d.mv('A','spinor')\n", + " print(X.Fmt(1,'X'))\n", + " print(A.Fmt(1,'A'))\n", + " print((X|A).Fmt(2,'X|A'))\n", + " print((XX).Fmt(2,'A>X'))\n", + " return\n", + "\\end{lstlisting}\n", + "Code Output:\n", + "\\begin{equation*} g_{ij} = \\left [ \\begin{array}{cc} \\left ( e_{x}\\cdot e_{x}\\right ) & \\left ( e_{x}\\cdot e_{y}\\right ) \\\\ \\left ( e_{x}\\cdot e_{y}\\right ) & \\left ( e_{y}\\cdot e_{y}\\right ) \\end{array}\\right ] \\end{equation*}\n", + "\\begin{equation*} X = X^{x} \\boldsymbol{e}_{x} + X^{y} \\boldsymbol{e}_{y} \\end{equation*}\n", + "\\begin{equation*} A = A + A^{xy} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} \\end{equation*}\n", + "\\begin{equation*} X\\cdot A = - A^{xy} \\left(\\left ( e_{x}\\cdot e_{y}\\right ) X^{x} + \\left ( e_{y}\\cdot e_{y}\\right ) X^{y}\\right) \\boldsymbol{e}_{x} + A^{xy} \\left(\\left ( e_{x}\\cdot e_{x}\\right ) X^{x} + \\left ( e_{x}\\cdot e_{y}\\right ) X^{y}\\right) \\boldsymbol{e}_{y} \\end{equation*}\n", + "\\begin{equation*} X\\rfloor A = - A^{xy} \\left(\\left ( e_{x}\\cdot e_{y}\\right ) X^{x} + \\left ( e_{y}\\cdot e_{y}\\right ) X^{y}\\right) \\boldsymbol{e}_{x} + A^{xy} \\left(\\left ( e_{x}\\cdot e_{x}\\right ) X^{x} + \\left ( e_{x}\\cdot e_{y}\\right ) X^{y}\\right) \\boldsymbol{e}_{y} \\end{equation*}\n", + "\\begin{equation*} A\\lfloor X = A^{xy} \\left(\\left ( e_{x}\\cdot e_{y}\\right ) X^{x} + \\left ( e_{y}\\cdot e_{y}\\right ) X^{y}\\right) \\boldsymbol{e}_{x} - A^{xy} \\left(\\left ( e_{x}\\cdot e_{x}\\right ) X^{x} + \\left ( e_{x}\\cdot e_{y}\\right ) X^{y}\\right) \\boldsymbol{e}_{y} \\end{equation*}\n", + "\\\\begin{lstlisting}[language=Python,showspaces=false,showstringspaces=false,backgroundcolor=\\color{gray},frame=single]\n", + "def basic_multivector_operations_2D_orthogonal():\n", + " Print_Function()\n", + " o2d = Ga('e*x|y',g=[1,1])\n", + " (ex,ey) = o2d.mv()\n", + " print('g_{ii} =',o2d.g)\n", + " X = o2d.mv('X','vector')\n", + " A = o2d.mv('A','spinor')\n", + " print(X.Fmt(1,'X'))\n", + " print(A.Fmt(1,'A'))\n", + " print((X*A).Fmt(2,'X*A'))\n", + " print((X|A).Fmt(2,'X|A'))\n", + " print((XA).Fmt(2,'X>A'))\n", + " print((A*X).Fmt(2,'A*X'))\n", + " print((A|X).Fmt(2,'A|X'))\n", + " print((AX).Fmt(2,'A>X'))\n", + " return\n", + "\\end{lstlisting}\n", + "Code Output:\n", + "\\begin{equation*} g_{ii} = \\left [ \\begin{array}{cc} 1 & 0 \\\\ 0 & 1 \\end{array}\\right ] \\end{equation*}\n", + "\\begin{equation*} X = X^{x} \\boldsymbol{e}_{x} + X^{y} \\boldsymbol{e}_{y} \\end{equation*}\n", + "\\begin{equation*} A = A + A^{xy} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} \\end{equation*}\n", + "\\begin{equation*} X A = \\left ( A X^{x} - A^{xy} X^{y}\\right ) \\boldsymbol{e}_{x} + \\left ( A X^{y} + A^{xy} X^{x}\\right ) \\boldsymbol{e}_{y} \\end{equation*}\n", + "\\begin{equation*} X\\cdot A = - A^{xy} X^{y} \\boldsymbol{e}_{x} + A^{xy} X^{x} \\boldsymbol{e}_{y} \\end{equation*}\n", + "\\begin{equation*} X\\rfloor A = - A^{xy} X^{y} \\boldsymbol{e}_{x} + A^{xy} X^{x} \\boldsymbol{e}_{y} \\end{equation*}\n", + "\\begin{equation*} X\\lfloor A = A X^{x} \\boldsymbol{e}_{x} + A X^{y} \\boldsymbol{e}_{y} \\end{equation*}\n", + "\\begin{equation*} A X = \\left ( A X^{x} + A^{xy} X^{y}\\right ) \\boldsymbol{e}_{x} + \\left ( A X^{y} - A^{xy} X^{x}\\right ) \\boldsymbol{e}_{y} \\end{equation*}\n", + "\\begin{equation*} A\\cdot X = A^{xy} X^{y} \\boldsymbol{e}_{x} - A^{xy} X^{x} \\boldsymbol{e}_{y} \\end{equation*}\n", + "\\begin{equation*} A\\rfloor X = A X^{x} \\boldsymbol{e}_{x} + A X^{y} \\boldsymbol{e}_{y} \\end{equation*}\n", + "\\begin{equation*} A\\lfloor X = A^{xy} X^{y} \\boldsymbol{e}_{x} - A^{xy} X^{x} \\boldsymbol{e}_{y} \\end{equation*}\n", + "\\\\begin{lstlisting}[language=Python,showspaces=false,showstringspaces=false,backgroundcolor=\\color{gray},frame=single]\n", + "def check_generalized_BAC_CAB_formulas():\n", + " Print_Function()\n", + " g4d = Ga('a b c d e')\n", + " (a,b,c,d,e) = g4d.mv()\n", + " print('g_{ij} =',g4d.g)\n", + " print('\\\\bm{a|(b*c)} =',a|(b*c))\n", + " print('\\\\bm{a|(b^c)} =',a|(b^c))\n", + " print('\\\\bm{a|(b^c^d)} =',a|(b^c^d))\n", + " print('\\\\bm{a|(b^c)+c|(a^b)+b|(c^a)} =',(a|(b^c))+(c|(a^b))+(b|(c^a)))\n", + " print('\\\\bm{a*(b^c)-b*(a^c)+c*(a^b)} =',a*(b^c)-b*(a^c)+c*(a^b))\n", + " print('\\\\bm{a*(b^c^d)-b*(a^c^d)+c*(a^b^d)-d*(a^b^c)} =',a*(b^c^d)-b*(a^c^d)+c*(a^b^d)-d*(a^b^c))\n", + " print('\\\\bm{(a^b)|(c^d)} =',(a^b)|(c^d))\n", + " print('\\\\bm{((a^b)|c)|d} =',((a^b)|c)|d)\n", + " print('\\\\bm{(a^b)\\\\times (c^d)} =',Ga.com(a^b,c^d))\n", + " print('\\\\bm{(a^b^c)(d^e)} =',((a^b^c)*(d^e)).Fmt(2))\n", + " return\n", + "\\end{lstlisting}\n", + "Code Output:\n", + "\\begin{equation*} g_{ij} = \\left [ \\begin{array}{ccccc} \\left ( a\\cdot a\\right ) & \\left ( a\\cdot b\\right ) & \\left ( a\\cdot c\\right ) & \\left ( a\\cdot d\\right ) & \\left ( a\\cdot e\\right ) \\\\ \\left ( a\\cdot b\\right ) & \\left ( b\\cdot b\\right ) & \\left ( b\\cdot c\\right ) & \\left ( b\\cdot d\\right ) & \\left ( b\\cdot e\\right ) \\\\ \\left ( a\\cdot c\\right ) & \\left ( b\\cdot c\\right ) & \\left ( c\\cdot c\\right ) & \\left ( c\\cdot d\\right ) & \\left ( c\\cdot e\\right ) \\\\ \\left ( a\\cdot d\\right ) & \\left ( b\\cdot d\\right ) & \\left ( c\\cdot d\\right ) & \\left ( d\\cdot d\\right ) & \\left ( d\\cdot e\\right ) \\\\ \\left ( a\\cdot e\\right ) & \\left ( b\\cdot e\\right ) & \\left ( c\\cdot e\\right ) & \\left ( d\\cdot e\\right ) & \\left ( e\\cdot e\\right ) \\end{array}\\right ] \\end{equation*}\n", + "\\begin{equation*} \\bm{a\\cdot (b c)} = - \\left ( a\\cdot c\\right ) \\boldsymbol{b} + \\left ( a\\cdot b\\right ) \\boldsymbol{c} \\end{equation*}\n", + "\\begin{equation*} \\bm{a\\cdot (b\\W c)} = - \\left ( a\\cdot c\\right ) \\boldsymbol{b} + \\left ( a\\cdot b\\right ) \\boldsymbol{c} \\end{equation*}\n", + "\\begin{equation*} \\bm{a\\cdot (b\\W c\\W d)} = \\left ( a\\cdot d\\right ) \\boldsymbol{b}\\wedge \\boldsymbol{c} - \\left ( a\\cdot c\\right ) \\boldsymbol{b}\\wedge \\boldsymbol{d} + \\left ( a\\cdot b\\right ) \\boldsymbol{c}\\wedge \\boldsymbol{d} \\end{equation*}\n", + "\\begin{equation*} \\bm{a\\cdot (b\\W c)+c\\cdot (a\\W b)+b\\cdot (c\\W a)} = 0 \\end{equation*}\n", + "\\begin{equation*} \\bm{a (b\\W c)-b (a\\W c)+c (a\\W b)} = 3 \\boldsymbol{a}\\wedge \\boldsymbol{b}\\wedge \\boldsymbol{c} \\end{equation*}\n", + "\\begin{equation*} \\bm{a (b\\W c\\W d)-b (a\\W c\\W d)+c (a\\W b\\W d)-d (a\\W b\\W c)} = 4 \\boldsymbol{a}\\wedge \\boldsymbol{b}\\wedge \\boldsymbol{c}\\wedge \\boldsymbol{d} \\end{equation*}\n", + "\\begin{equation*} \\bm{(a\\W b)\\cdot (c\\W d)} = - \\left ( a\\cdot c\\right ) \\left ( b\\cdot d\\right ) + \\left ( a\\cdot d\\right ) \\left ( b\\cdot c\\right ) \\end{equation*}\n", + "\\begin{equation*} \\bm{((a\\W b)\\cdot c)\\cdot d} = - \\left ( a\\cdot c\\right ) \\left ( b\\cdot d\\right ) + \\left ( a\\cdot d\\right ) \\left ( b\\cdot c\\right ) \\end{equation*}\n", + "\\begin{equation*} \\bm{(a\\W b)\\times (c\\W d)} = - \\left ( b\\cdot d\\right ) \\boldsymbol{a}\\wedge \\boldsymbol{c} + \\left ( b\\cdot c\\right ) \\boldsymbol{a}\\wedge \\boldsymbol{d} + \\left ( a\\cdot d\\right ) \\boldsymbol{b}\\wedge \\boldsymbol{c} - \\left ( a\\cdot c\\right ) \\boldsymbol{b}\\wedge \\boldsymbol{d} \\end{equation*}\n", + " \\begin{align*} \\bm{(a\\W b\\W c)(d\\W e)} = & \\left ( - \\left ( b\\cdot d\\right ) \\left ( c\\cdot e\\right ) + \\left ( b\\cdot e\\right ) \\left ( c\\cdot d\\right ) \\right ) \\boldsymbol{a} + \\left ( \\left ( a\\cdot d\\right ) \\left ( c\\cdot e\\right ) - \\left ( a\\cdot e\\right ) \\left ( c\\cdot d\\right ) \\right ) \\boldsymbol{b} + \\left ( - \\left ( a\\cdot d\\right ) \\left ( b\\cdot e\\right ) + \\left ( a\\cdot e\\right ) \\left ( b\\cdot d\\right ) \\right ) \\boldsymbol{c} \\\\ & - \\left ( c\\cdot e\\right ) \\boldsymbol{a}\\wedge \\boldsymbol{b}\\wedge \\boldsymbol{d} + \\left ( c\\cdot d\\right ) \\boldsymbol{a}\\wedge \\boldsymbol{b}\\wedge \\boldsymbol{e} + \\left ( b\\cdot e\\right ) \\boldsymbol{a}\\wedge \\boldsymbol{c}\\wedge \\boldsymbol{d} - \\left ( b\\cdot d\\right ) \\boldsymbol{a}\\wedge \\boldsymbol{c}\\wedge \\boldsymbol{e} - \\left ( a\\cdot e\\right ) \\boldsymbol{b}\\wedge \\boldsymbol{c}\\wedge \\boldsymbol{d} + \\left ( a\\cdot d\\right ) \\boldsymbol{b}\\wedge \\boldsymbol{c}\\wedge \\boldsymbol{e} \\\\ & + \\boldsymbol{a}\\wedge \\boldsymbol{b}\\wedge \\boldsymbol{c}\\wedge \\boldsymbol{d}\\wedge \\boldsymbol{e} \\end{align*} \n", + "\\\\begin{lstlisting}[language=Python,showspaces=false,showstringspaces=false,backgroundcolor=\\color{gray},frame=single]\n", + "def rounding_numerical_components():\n", + " Print_Function()\n", + " o3d = Ga('e_x e_y e_z',g=[1,1,1])\n", + " (ex,ey,ez) = o3d.mv()\n", + " X = 1.2*ex+2.34*ey+0.555*ez\n", + " Y = 0.333*ex+4*ey+5.3*ez\n", + " print('X =',X)\n", + " print('Nga(X,2) =',Nga(X,2))\n", + " print('X*Y =',X*Y)\n", + " print('Nga(X*Y,2) =',Nga(X*Y,2))\n", + " return\n", + "\\end{lstlisting}\n", + "Code Output:\n", + "\\begin{equation*} X = 1 \\cdot 2 \\boldsymbol{e}_{x} + 2 \\cdot 34 \\boldsymbol{e}_{y} + 0 \\cdot 555 \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} Nga(X,2) = 1 \\cdot 2 \\boldsymbol{e}_{x} + 2 \\cdot 3 \\boldsymbol{e}_{y} + 0 \\cdot 55 \\boldsymbol{e}_{z} \\end{equation*}\n", + " \\begin{align*} X Y = & 12 \\cdot 7011 \\\\ & + 4 \\cdot 02078 \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + 6 \\cdot 175185 \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + 10 \\cdot 182 \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{align*} \n", + " \\begin{align*} Nga(X Y,2) = & 13 \\cdot 0 \\\\ & + 4 \\cdot 0 \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + 6 \\cdot 2 \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + 10 \\cdot 0 \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{align*} \n", + "\\\\begin{lstlisting}[language=Python,showspaces=false,showstringspaces=false,backgroundcolor=\\color{gray},frame=single]\n", + "def derivatives_in_rectangular_coordinates():\n", + " Print_Function()\n", + " X = (x,y,z) = symbols('x y z')\n", + " o3d = Ga('e_x e_y e_z',g=[1,1,1],coords=X)\n", + " (ex,ey,ez) = o3d.mv()\n", + " grad = o3d.grad\n", + " f = o3d.mv('f','scalar',f=True)\n", + " A = o3d.mv('A','vector',f=True)\n", + " B = o3d.mv('B','bivector',f=True)\n", + " C = o3d.mv('C','mv')\n", + " print('f =',f)\n", + " print('A =',A)\n", + " print('B =',B)\n", + " print('C =',C)\n", + " print('grad*f =',grad*f)\n", + " print('grad|A =',grad|A)\n", + " print('grad*A =',grad*A)\n", + " print('-I*(grad^A) =',-o3d.I()*(grad^A))\n", + " print('grad*B =',grad*B)\n", + " print('grad^B =',grad^B)\n", + " print('grad|B =',grad|B)\n", + " return\n", + "\\end{lstlisting}\n", + "Code Output:\n", + "\\begin{equation*} f = f \\end{equation*}\n", + "\\begin{equation*} A = A^{x} \\boldsymbol{e}_{x} + A^{y} \\boldsymbol{e}_{y} + A^{z} \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} B = B^{xy} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + B^{xz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + B^{yz} \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\n", + " \\begin{align*} C = & C \\\\ & + C^{x} \\boldsymbol{e}_{x} + C^{y} \\boldsymbol{e}_{y} + C^{z} \\boldsymbol{e}_{z} \\\\ & + C^{xy} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + C^{xz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + C^{yz} \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\\\ & + C^{xyz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{align*} \n", + "\\begin{equation*} \\boldsymbol{\\nabla} f = \\partial_{x} f \\boldsymbol{e}_{x} + \\partial_{y} f \\boldsymbol{e}_{y} + \\partial_{z} f \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} \\boldsymbol{\\nabla} \\cdot A = \\partial_{x} A^{x} + \\partial_{y} A^{y} + \\partial_{z} A^{z} \\end{equation*}\n", + " \\begin{align*} \\boldsymbol{\\nabla} A = & \\left ( \\partial_{x} A^{x} + \\partial_{y} A^{y} + \\partial_{z} A^{z} \\right ) \\\\ & + \\left ( - \\partial_{y} A^{x} + \\partial_{x} A^{y} \\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + \\left ( - \\partial_{z} A^{x} + \\partial_{x} A^{z} \\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + \\left ( - \\partial_{z} A^{y} + \\partial_{y} A^{z} \\right ) \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{align*} \n", + "\\begin{equation*} -I (\\boldsymbol{\\nabla} \\W A) = \\left ( - \\partial_{z} A^{y} + \\partial_{y} A^{z} \\right ) \\boldsymbol{e}_{x} + \\left ( \\partial_{z} A^{x} - \\partial_{x} A^{z} \\right ) \\boldsymbol{e}_{y} + \\left ( - \\partial_{y} A^{x} + \\partial_{x} A^{y} \\right ) \\boldsymbol{e}_{z} \\end{equation*}\n", + " \\begin{align*} \\boldsymbol{\\nabla} B = & \\left ( - \\partial_{y} B^{xy} - \\partial_{z} B^{xz} \\right ) \\boldsymbol{e}_{x} + \\left ( \\partial_{x} B^{xy} - \\partial_{z} B^{yz} \\right ) \\boldsymbol{e}_{y} + \\left ( \\partial_{x} B^{xz} + \\partial_{y} B^{yz} \\right ) \\boldsymbol{e}_{z} \\\\ & + \\left ( \\partial_{z} B^{xy} - \\partial_{y} B^{xz} + \\partial_{x} B^{yz} \\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{align*} \n", + "\\begin{equation*} \\boldsymbol{\\nabla} \\W B = \\left ( \\partial_{z} B^{xy} - \\partial_{y} B^{xz} + \\partial_{x} B^{yz} \\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} \\boldsymbol{\\nabla} \\cdot B = \\left ( - \\partial_{y} B^{xy} - \\partial_{z} B^{xz} \\right ) \\boldsymbol{e}_{x} + \\left ( \\partial_{x} B^{xy} - \\partial_{z} B^{yz} \\right ) \\boldsymbol{e}_{y} + \\left ( \\partial_{x} B^{xz} + \\partial_{y} B^{yz} \\right ) \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\\\begin{lstlisting}[language=Python,showspaces=false,showstringspaces=false,backgroundcolor=\\color{gray},frame=single]\n", + "def derivatives_in_spherical_coordinates():\n", + " Print_Function()\n", + " X = (r,th,phi) = symbols('r theta phi')\n", + " s3d = Ga('e_r e_theta e_phi',g=[1,r**2,r**2*sin(th)**2],coords=X,norm=True)\n", + " (er,eth,ephi) = s3d.mv()\n", + " grad = s3d.grad\n", + " f = s3d.mv('f','scalar',f=True)\n", + " A = s3d.mv('A','vector',f=True)\n", + " B = s3d.mv('B','bivector',f=True)\n", + " print('f =',f)\n", + " print('A =',A)\n", + " print('B =',B)\n", + " print('grad*f =',grad*f)\n", + " print('grad|A =',grad|A)\n", + " print('-I*(grad^A) =',(-s3d.E()*(grad^A)).simplify())\n", + " print('grad^B =',grad^B)\n", + "\\end{lstlisting}\n", + "Code Output:\n", + "\\begin{equation*} f = f \\end{equation*}\n", + "\\begin{equation*} A = A^{r} \\boldsymbol{e}_{r} + A^{\\theta } \\boldsymbol{e}_{\\theta } + A^{\\phi } \\boldsymbol{e}_{\\phi } \\end{equation*}\n", + "\\begin{equation*} B = B^{r\\theta } \\boldsymbol{e}_{r}\\wedge \\boldsymbol{e}_{\\theta } + B^{r\\phi } \\boldsymbol{e}_{r}\\wedge \\boldsymbol{e}_{\\phi } + B^{\\theta \\phi } \\boldsymbol{e}_{\\theta }\\wedge \\boldsymbol{e}_{\\phi } \\end{equation*}\n", + "\\begin{equation*} \\boldsymbol{\\nabla} f = \\partial_{r} f \\boldsymbol{e}_{r} + \\frac{\\partial_{\\theta } f }{r} \\boldsymbol{e}_{\\theta } + \\frac{\\partial_{\\phi } f }{r \\sin{\\left (\\theta \\right )}} \\boldsymbol{e}_{\\phi } \\end{equation*}\n", + "\\begin{equation*} \\boldsymbol{\\nabla} \\cdot A = \\frac{r \\partial_{r} A^{r} + 2 A^{r} + \\frac{A^{\\theta } }{\\tan{\\left (\\theta \\right )}} + \\partial_{\\theta } A^{\\theta } + \\frac{\\partial_{\\phi } A^{\\phi } }{\\sin{\\left (\\theta \\right )}}}{r} \\end{equation*}\n", + "\\begin{equation*} -I (\\boldsymbol{\\nabla} \\W A) = \\frac{\\frac{A^{\\phi } }{\\tan{\\left (\\theta \\right )}} + \\partial_{\\theta } A^{\\phi } - \\frac{\\partial_{\\phi } A^{\\theta } }{\\sin{\\left (\\theta \\right )}}}{r} \\boldsymbol{e}_{r} + \\frac{- r \\partial_{r} A^{\\phi } - A^{\\phi } + \\frac{\\partial_{\\phi } A^{r} }{\\sin{\\left (\\theta \\right )}}}{r} \\boldsymbol{e}_{\\theta } + \\frac{r \\partial_{r} A^{\\theta } + A^{\\theta } - \\partial_{\\theta } A^{r} }{r} \\boldsymbol{e}_{\\phi } \\end{equation*}\n", + "\\begin{equation*} \\boldsymbol{\\nabla} \\W B = \\frac{r \\partial_{r} B^{\\theta \\phi } - \\frac{B^{r\\phi } }{\\tan{\\left (\\theta \\right )}} + 2 B^{\\theta \\phi } - \\partial_{\\theta } B^{r\\phi } + \\frac{\\partial_{\\phi } B^{r\\theta } }{\\sin{\\left (\\theta \\right )}}}{r} \\boldsymbol{e}_{r}\\wedge \\boldsymbol{e}_{\\theta }\\wedge \\boldsymbol{e}_{\\phi } \\end{equation*}\n", + "\\\\begin{lstlisting}[language=Python,showspaces=false,showstringspaces=false,backgroundcolor=\\color{gray},frame=single]\n", + "def noneuclidian_distance_calculation():\n", + " Print_Function()\n", + " from sympy import solve,sqrt\n", + " Fmt(1)\n", + " g = '0 # #,# 0 #,# # 1'\n", + " nel = Ga('X Y e',g=g)\n", + " (X,Y,e) = nel.mv()\n", + " print('g_{ij} =',nel.g)\n", + " print('%(X\\\\W Y)^{2} =',(X^Y)*(X^Y))\n", + " L = X^Y^e\n", + " B = L*e # D&L 10.152\n", + " Bsq = (B*B).scalar()\n", + " print('#%L = X\\\\W Y\\\\W e \\\\text{ is a non-euclidian line}')\n", + " print('B = L*e =',B)\n", + " BeBr =B*e*B.rev()\n", + " print('%BeB^{\\\\dagger} =',BeBr)\n", + " print('%B^{2} =',B*B)\n", + " print('%L^{2} =',L*L) # D&L 10.153\n", + " (s,c,Binv,M,S,C,alpha) = symbols('s c (1/B) M S C alpha')\n", + " XdotY = nel.g[0,1]\n", + " Xdote = nel.g[0,2]\n", + " Ydote = nel.g[1,2]\n", + " Bhat = Binv*B # D&L 10.154\n", + " R = c+s*Bhat # Rotor R = exp(alpha*Bhat/2)\n", + " print('#%s = \\\\f{\\\\sinh}{\\\\alpha/2} \\\\text{ and } c = \\\\f{\\\\cosh}{\\\\alpha/2}')\n", + " print('%e^{\\\\alpha B/{2\\\\abs{B}}} =',R)\n", + " Z = R*X*R.rev() # D&L 10.155\n", + " Z.obj = expand(Z.obj)\n", + " Z.obj = Z.obj.collect([Binv,s,c,XdotY])\n", + " Z.Fmt(3,'%RXR^{\\\\dagger}')\n", + " W = Z|Y # Extract scalar part of multivector\n", + " # From this point forward all calculations are with sympy scalars\n", + " #print '#Objective is to determine value of C = cosh(alpha) such that W = 0'\n", + " W = W.scalar()\n", + " print('%W = Z\\\\cdot Y =',W)\n", + " W = expand(W)\n", + " W = simplify(W)\n", + " W = W.collect([s*Binv])\n", + " M = 1/Bsq\n", + " W = W.subs(Binv**2,M)\n", + " W = simplify(W)\n", + " Bmag = sqrt(XdotY**2-2*XdotY*Xdote*Ydote)\n", + " W = W.collect([Binv*c*s,XdotY])\n", + " #Double angle substitutions\n", + " W = W.subs(2*XdotY**2-4*XdotY*Xdote*Ydote,2/(Binv**2))\n", + " W = W.subs(2*c*s,S)\n", + " W = W.subs(c**2,(C+1)/2)\n", + " W = W.subs(s**2,(C-1)/2)\n", + " W = simplify(W)\n", + " W = W.subs(Binv,1/Bmag)\n", + " W = expand(W)\n", + " print('#%S = \\\\f{\\\\sinh}{\\\\alpha} \\\\text{ and } C = \\\\f{\\\\cosh}{\\\\alpha}')\n", + " print('W =',W)\n", + " Wd = collect(W,[C,S],exact=True,evaluate=False)\n", + " Wd_1 = Wd[one]\n", + " Wd_C = Wd[C]\n", + " Wd_S = Wd[S]\n", + " print('%\\\\text{Scalar Coefficient} =',Wd_1)\n", + " print('%\\\\text{Cosh Coefficient} =',Wd_C)\n", + " print('%\\\\text{Sinh Coefficient} =',Wd_S)\n", + " print('%\\\\abs{B} =',Bmag)\n", + " Wd_1 = Wd_1.subs(Bmag,1/Binv)\n", + " Wd_C = Wd_C.subs(Bmag,1/Binv)\n", + " Wd_S = Wd_S.subs(Bmag,1/Binv)\n", + " lhs = Wd_1+Wd_C*C\n", + " rhs = -Wd_S*S\n", + " lhs = lhs**2\n", + " rhs = rhs**2\n", + " W = expand(lhs-rhs)\n", + " W = expand(W.subs(1/Binv**2,Bmag**2))\n", + " W = expand(W.subs(S**2,C**2-1))\n", + " W = W.collect([C,C**2],evaluate=False)\n", + " a = simplify(W[C**2])\n", + " b = simplify(W[C])\n", + " c = simplify(W[one])\n", + " print('#%\\\\text{Require } aC^{2}+bC+c = 0')\n", + " print('a =',a)\n", + " print('b =',b)\n", + " print('c =',c)\n", + " x = Symbol('x')\n", + " C = solve(a*x**2+b*x+c,x)[0]\n", + " print('%b^{2}-4ac =',simplify(b**2-4*a*c))\n", + " print('%\\\\f{\\\\cosh}{\\\\alpha} = C = -b/(2a) =',expand(simplify(expand(C))))\n", + " return\n", + "\\end{lstlisting}\n", + "Code Output:\n", + "\\begin{equation*} g_{ij} = \\left [ \\begin{array}{ccc} 0 & \\left ( X\\cdot Y\\right ) & \\left ( X\\cdot e\\right ) \\\\ \\left ( X\\cdot Y\\right ) & 0 & \\left ( Y\\cdot e\\right ) \\\\ \\left ( X\\cdot e\\right ) & \\left ( Y\\cdot e\\right ) & 1 \\end{array}\\right ] \\end{equation*}\n", + "\\begin{equation*} (X\\W Y)^{2} = \\left ( X\\cdot Y\\right ) ^{2} \\end{equation*}\n", + "\\begin{equation*} L = X\\W Y\\W e \\text{ is a non-euclidian line} \\end{equation*}\n", + "\\begin{equation*} B = L e = \\boldsymbol{X}\\wedge \\boldsymbol{Y} - \\left ( Y\\cdot e\\right ) \\boldsymbol{X}\\wedge \\boldsymbol{e} + \\left ( X\\cdot e\\right ) \\boldsymbol{Y}\\wedge \\boldsymbol{e} \\end{equation*}\n", + "\\begin{equation*} BeB^{\\dagger} = \\left ( X\\cdot Y\\right ) \\left(- \\left ( X\\cdot Y\\right ) + 2 \\left ( X\\cdot e\\right ) \\left ( Y\\cdot e\\right ) \\right) \\boldsymbol{e} \\end{equation*}\n", + "\\begin{equation*} B^{2} = \\left ( X\\cdot Y\\right ) \\left(\\left ( X\\cdot Y\\right ) - 2 \\left ( X\\cdot e\\right ) \\left ( Y\\cdot e\\right ) \\right) \\end{equation*}\n", + "\\begin{equation*} L^{2} = \\left ( X\\cdot Y\\right ) \\left(\\left ( X\\cdot Y\\right ) - 2 \\left ( X\\cdot e\\right ) \\left ( Y\\cdot e\\right ) \\right) \\end{equation*}\n", + "\\begin{equation*} s = \\f{\\sinh}{\\alpha/2} \\text{ and } c = \\f{\\cosh}{\\alpha/2} \\end{equation*}\n", + "\\begin{equation*} e^{\\alpha B/{2\\abs{B}}} = c + (1/B) s \\boldsymbol{X}\\wedge \\boldsymbol{Y} - (1/B) \\left ( Y\\cdot e\\right ) s \\boldsymbol{X}\\wedge \\boldsymbol{e} + (1/B) \\left ( X\\cdot e\\right ) s \\boldsymbol{Y}\\wedge \\boldsymbol{e} \\end{equation*}\n", + "\\begin{equation*} W = Z\\cdot Y = (1/B)^{2} \\left ( X\\cdot Y\\right ) ^{3} s^{2} - 4 (1/B)^{2} \\left ( X\\cdot Y\\right ) ^{2} \\left ( X\\cdot e\\right ) \\left ( Y\\cdot e\\right ) s^{2} + 4 (1/B)^{2} \\left ( X\\cdot Y\\right ) \\left ( X\\cdot e\\right ) ^{2} \\left ( Y\\cdot e\\right ) ^{2} s^{2} + 2 (1/B) \\left ( X\\cdot Y\\right ) ^{2} c s - 4 (1/B) \\left ( X\\cdot Y\\right ) \\left ( X\\cdot e\\right ) \\left ( Y\\cdot e\\right ) c s + \\left ( X\\cdot Y\\right ) c^{2} \\end{equation*}\n", + "\\begin{equation*} S = \\f{\\sinh}{\\alpha} \\text{ and } C = \\f{\\cosh}{\\alpha} \\end{equation*}\n", + "\\begin{equation*} W = \\left ( X\\cdot Y\\right ) C - \\left ( X\\cdot e\\right ) \\left ( Y\\cdot e\\right ) C + \\left ( X\\cdot e\\right ) \\left ( Y\\cdot e\\right ) + S \\sqrt{\\left ( X\\cdot Y\\right ) ^{2} - 2 \\left ( X\\cdot Y\\right ) \\left ( X\\cdot e\\right ) \\left ( Y\\cdot e\\right ) } \\end{equation*}\n", + "\\begin{equation*} \\text{Scalar Coefficient} = \\left ( X\\cdot e\\right ) \\left ( Y\\cdot e\\right ) \\end{equation*}\n", + "\\begin{equation*} \\text{Cosh Coefficient} = \\left ( X\\cdot Y\\right ) - \\left ( X\\cdot e\\right ) \\left ( Y\\cdot e\\right ) \\end{equation*}\n", + "\\begin{equation*} \\text{Sinh Coefficient} = \\sqrt{\\left ( X\\cdot Y\\right ) ^{2} - 2 \\left ( X\\cdot Y\\right ) \\left ( X\\cdot e\\right ) \\left ( Y\\cdot e\\right ) } \\end{equation*}\n", + "\\begin{equation*} \\abs{B} = \\sqrt{\\left ( X\\cdot Y\\right ) ^{2} - 2 \\left ( X\\cdot Y\\right ) \\left ( X\\cdot e\\right ) \\left ( Y\\cdot e\\right ) } \\end{equation*}\n", + "\\begin{equation*} \\text{Require } aC^{2}+bC+c = 0 \\end{equation*}\n", + "\\begin{equation*} a = \\left ( X\\cdot e\\right ) ^{2} \\left ( Y\\cdot e\\right ) ^{2} \\end{equation*}\n", + "\\begin{equation*} b = 2 \\left ( X\\cdot e\\right ) \\left ( Y\\cdot e\\right ) \\left(\\left ( X\\cdot Y\\right ) - \\left ( X\\cdot e\\right ) \\left ( Y\\cdot e\\right ) \\right) \\end{equation*}\n", + "\\begin{equation*} c = \\left ( X\\cdot Y\\right ) ^{2} - 2 \\left ( X\\cdot Y\\right ) \\left ( X\\cdot e\\right ) \\left ( Y\\cdot e\\right ) + \\left ( X\\cdot e\\right ) ^{2} \\left ( Y\\cdot e\\right ) ^{2} \\end{equation*}\n", + "\\begin{equation*} b^{2}-4ac = 0 \\end{equation*}\n", + "\\begin{equation*} \\f{\\cosh}{\\alpha} = C = -b/(2a) = - \\frac{\\left ( X\\cdot Y\\right ) }{\\left ( X\\cdot e\\right ) \\left ( Y\\cdot e\\right ) } + 1 \\end{equation*}\n", + "\\\\begin{lstlisting}[language=Python,showspaces=false,showstringspaces=false,backgroundcolor=\\color{gray},frame=single]\n", + "def conformal_representations_of_circles_lines_spheres_and_planes():\n", + " Print_Function()\n", + " global n,nbar\n", + " Fmt(1)\n", + " g = '1 0 0 0 0,0 1 0 0 0,0 0 1 0 0,0 0 0 0 2,0 0 0 2 0'\n", + " c3d = Ga('e_1 e_2 e_3 n \\\\bar{n}',g=g)\n", + " (e1,e2,e3,n,nbar) = c3d.mv()\n", + " print('g_{ij} =',c3d.g)\n", + " e = n+nbar\n", + " #conformal representation of points\n", + " A = make_vector(e1, ga=c3d) # point a = (1,0,0) A = F(a)\n", + " B = make_vector(e2, ga=c3d) # point b = (0,1,0) B = F(b)\n", + " C = make_vector(-e1, ga=c3d) # point c = (-1,0,0) C = F(c)\n", + " D = make_vector(e3, ga=c3d) # point d = (0,0,1) D = F(d)\n", + " X = make_vector('x',3, ga=c3d)\n", + " print('F(a) =',A)\n", + " print('F(b) =',B)\n", + " print('F(c) =',C)\n", + " print('F(d) =',D)\n", + " print('F(x) =',X)\n", + " print('#a = e1, b = e2, c = -e1, and d = e3')\n", + " print('#A = F(a) = 1/2*(a*a*n+2*a-nbar), etc.')\n", + " print('#Circle through a, b, and c')\n", + " print('Circle: A^B^C^X = 0 =',(A^B^C^X))\n", + " print('#Line through a and b')\n", + " print('Line : A^B^n^X = 0 =',(A^B^n^X))\n", + " print('#Sphere through a, b, c, and d')\n", + " print('Sphere: A^B^C^D^X = 0 =',(((A^B)^C)^D)^X)\n", + " print('#Plane through a, b, and d')\n", + " print('Plane : A^B^n^D^X = 0 =',(A^B^n^D^X))\n", + " L = (A^B^e)^X\n", + " L.Fmt(3,'Hyperbolic\\\\;\\\\; Circle: (A^B^e)^X = 0')\n", + " return\n", + "\\end{lstlisting}\n", + "Code Output:\n", + "\\begin{equation*} g_{ij} = \\left [ \\begin{array}{ccccc} 1 & 0 & 0 & 0 & 0 \\\\ 0 & 1 & 0 & 0 & 0 \\\\ 0 & 0 & 1 & 0 & 0 \\\\ 0 & 0 & 0 & 0 & 2 \\\\ 0 & 0 & 0 & 2 & 0 \\end{array}\\right ] \\end{equation*}\n", + "\\begin{equation*} F(a) = \\boldsymbol{e}_{1} + \\frac{1}{2} \\boldsymbol{n} - \\frac{1}{2} \\boldsymbol{\\bar{n}} \\end{equation*}\n", + "\\begin{equation*} F(b) = \\boldsymbol{e}_{2} + \\frac{1}{2} \\boldsymbol{n} - \\frac{1}{2} \\boldsymbol{\\bar{n}} \\end{equation*}\n", + "\\begin{equation*} F(c) = - \\boldsymbol{e}_{1} + \\frac{1}{2} \\boldsymbol{n} - \\frac{1}{2} \\boldsymbol{\\bar{n}} \\end{equation*}\n", + "\\begin{equation*} F(d) = \\boldsymbol{e}_{3} + \\frac{1}{2} \\boldsymbol{n} - \\frac{1}{2} \\boldsymbol{\\bar{n}} \\end{equation*}\n", + "\\begin{equation*} F(x) = x_{1} \\boldsymbol{e}_{1} + x_{2} \\boldsymbol{e}_{2} + x_{3} \\boldsymbol{e}_{3} + \\left ( \\frac{{\\left ( x_{1} \\right )}^{2}}{2} + \\frac{{\\left ( x_{2} \\right )}^{2}}{2} + \\frac{{\\left ( x_{3} \\right )}^{2}}{2}\\right ) \\boldsymbol{n} - \\frac{1}{2} \\boldsymbol{\\bar{n}} \\end{equation*}\n", + "a = e1, b = e2, c = -e1, and d = e3\n", + "A = F(a) = 1/2*(a*a*n+2*a-nbar), etc.\n", + "Circle through a, b, and c\n", + "\\begin{equation*} Circle: A\\W B\\W C\\W X = 0 = - x_{3} \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{2}\\wedge \\boldsymbol{e}_{3}\\wedge \\boldsymbol{n} + x_{3} \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{2}\\wedge \\boldsymbol{e}_{3}\\wedge \\boldsymbol{\\bar{n}} + \\left ( \\frac{{\\left ( x_{1} \\right )}^{2}}{2} + \\frac{{\\left ( x_{2} \\right )}^{2}}{2} + \\frac{{\\left ( x_{3} \\right )}^{2}}{2} - \\frac{1}{2}\\right ) \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{2}\\wedge \\boldsymbol{n}\\wedge \\boldsymbol{\\bar{n}} \\end{equation*}\n", + "Line through a and b\n", + "\\begin{equation*} Line : A\\W B\\W n\\W X = 0 = - x_{3} \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{2}\\wedge \\boldsymbol{e}_{3}\\wedge \\boldsymbol{n} + \\left ( \\frac{x_{1}}{2} + \\frac{x_{2}}{2} - \\frac{1}{2}\\right ) \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{2}\\wedge \\boldsymbol{n}\\wedge \\boldsymbol{\\bar{n}} + \\frac{x_{3}}{2} \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{3}\\wedge \\boldsymbol{n}\\wedge \\boldsymbol{\\bar{n}} - \\frac{x_{3}}{2} \\boldsymbol{e}_{2}\\wedge \\boldsymbol{e}_{3}\\wedge \\boldsymbol{n}\\wedge \\boldsymbol{\\bar{n}} \\end{equation*}\n", + "Sphere through a, b, c, and d\n", + "\\begin{equation*} Sphere: A\\W B\\W C\\W D\\W X = 0 = \\left ( - \\frac{{\\left ( x_{1} \\right )}^{2}}{2} - \\frac{{\\left ( x_{2} \\right )}^{2}}{2} - \\frac{{\\left ( x_{3} \\right )}^{2}}{2} + \\frac{1}{2}\\right ) \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{2}\\wedge \\boldsymbol{e}_{3}\\wedge \\boldsymbol{n}\\wedge \\boldsymbol{\\bar{n}} \\end{equation*}\n", + "Plane through a, b, and d\n", + "\\begin{equation*} Plane : A\\W B\\W n\\W D\\W X = 0 = \\left ( - \\frac{x_{1}}{2} - \\frac{x_{2}}{2} - \\frac{x_{3}}{2} + \\frac{1}{2}\\right ) \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{2}\\wedge \\boldsymbol{e}_{3}\\wedge \\boldsymbol{n}\\wedge \\boldsymbol{\\bar{n}} \\end{equation*}\n", + "\\\\begin{lstlisting}[language=Python,showspaces=false,showstringspaces=false,backgroundcolor=\\color{gray},frame=single]\n", + "def properties_of_geometric_objects():\n", + " Print_Function()\n", + " global n, nbar\n", + " Fmt(1)\n", + " g = '# # # 0 0,'+ \\\n", + " '# # # 0 0,'+ \\\n", + " '# # # 0 0,'+ \\\n", + " '0 0 0 0 2,'+ \\\n", + " '0 0 0 2 0'\n", + " c3d = Ga('p1 p2 p3 n \\\\bar{n}',g=g)\n", + " (p1,p2,p3,n,nbar) = c3d.mv()\n", + " print('g_{ij} =',c3d.g)\n", + " P1 = F(p1)\n", + " P2 = F(p2)\n", + " P3 = F(p3)\n", + " print('\\\\text{Extracting direction of line from }L = P1\\\\W P2\\\\W n')\n", + " L = P1^P2^n\n", + " delta = (L|n)|nbar\n", + " print('(L|n)|\\\\bar{n} =',delta)\n", + " print('\\\\text{Extracting plane of circle from }C = P1\\\\W P2\\\\W P3')\n", + " C = P1^P2^P3\n", + " delta = ((C^n)|n)|nbar\n", + " print('((C^n)|n)|\\\\bar{n}=',delta)\n", + " print('(p2-p1)^(p3-p1)=',(p2-p1)^(p3-p1))\n", + " return\n", + "\\end{lstlisting}\n", + "Code Output:\n", + "\\begin{equation*} g_{ij} = \\left [ \\begin{array}{ccccc} \\left ( p_{1}\\cdot p_{1}\\right ) & \\left ( p_{1}\\cdot p_{2}\\right ) & \\left ( p_{1}\\cdot p_{3}\\right ) & 0 & 0 \\\\ \\left ( p_{1}\\cdot p_{2}\\right ) & \\left ( p_{2}\\cdot p_{2}\\right ) & \\left ( p_{2}\\cdot p_{3}\\right ) & 0 & 0 \\\\ \\left ( p_{1}\\cdot p_{3}\\right ) & \\left ( p_{2}\\cdot p_{3}\\right ) & \\left ( p_{3}\\cdot p_{3}\\right ) & 0 & 0 \\\\ 0 & 0 & 0 & 0 & 2 \\\\ 0 & 0 & 0 & 2 & 0 \\end{array}\\right ] \\end{equation*}\n", + "\\begin{equation*} \\text{Extracting direction of line from }L = P1\\W P2\\W n \\end{equation*}\n", + "\\begin{equation*} (L\\cdot n)\\cdot \\bar{n} = 2 \\boldsymbol{p}_{1} -2 \\boldsymbol{p}_{2} \\end{equation*}\n", + "\\begin{equation*} \\text{Extracting plane of circle from }C = P1\\W P2\\W P3 \\end{equation*}\n", + "\\begin{equation*} ((C\\W n)\\cdot n)\\cdot \\bar{n}= 2 \\boldsymbol{p}_{1}\\wedge \\boldsymbol{p}_{2} -2 \\boldsymbol{p}_{1}\\wedge \\boldsymbol{p}_{3} + 2 \\boldsymbol{p}_{2}\\wedge \\boldsymbol{p}_{3} \\end{equation*}\n", + "\\begin{equation*} (p2-p1)\\W (p3-p1)= \\boldsymbol{p}_{1}\\wedge \\boldsymbol{p}_{2} - \\boldsymbol{p}_{1}\\wedge \\boldsymbol{p}_{3} + \\boldsymbol{p}_{2}\\wedge \\boldsymbol{p}_{3} \\end{equation*}\n", + "\\\\begin{lstlisting}[language=Python,showspaces=false,showstringspaces=false,backgroundcolor=\\color{gray},frame=single]\n", + "def extracting_vectors_from_conformal_2_blade():\n", + " Print_Function()\n", + " Fmt(1)\n", + " print(r'B = P1\\W P2')\n", + " g = '0 -1 #,'+ \\\n", + " '-1 0 #,'+ \\\n", + " '# # #'\n", + " c2b = Ga('P1 P2 a',g=g)\n", + " (P1,P2,a) = c2b.mv()\n", + " print('g_{ij} =',c2b.g)\n", + " B = P1^P2\n", + " Bsq = B*B\n", + " print('%B^{2} =',Bsq)\n", + " ap = a-(a^B)*B\n", + " print(\"a' = a-(a^B)*B =\",ap)\n", + " Ap = ap+ap*B\n", + " Am = ap-ap*B\n", + " print(\"A+ = a'+a'*B =\",Ap)\n", + " print(\"A- = a'-a'*B =\",Am)\n", + " print('%(A+)^{2} =',Ap*Ap)\n", + " print('%(A-)^{2} =',Am*Am)\n", + " aB = a|B\n", + " print('a|B =',aB)\n", + " return\n", + "\\end{lstlisting}\n", + "Code Output:\n", + "\\begin{equation*} B = P1\\W P2 \\end{equation*}\n", + "\\begin{equation*} g_{ij} = \\left [ \\begin{array}{ccc} 0 & -1 & \\left ( P_{1}\\cdot a\\right ) \\\\ -1 & 0 & \\left ( P_{2}\\cdot a\\right ) \\\\ \\left ( P_{1}\\cdot a\\right ) & \\left ( P_{2}\\cdot a\\right ) & \\left ( a\\cdot a\\right ) \\end{array}\\right ] \\end{equation*}\n", + "\\begin{equation*} B^{2} = 1 \\end{equation*}\n", + "\\begin{equation*} a' = a-(a\\W B) B = - \\left ( P_{2}\\cdot a\\right ) \\boldsymbol{P}_{1} - \\left ( P_{1}\\cdot a\\right ) \\boldsymbol{P}_{2} \\end{equation*}\n", + "\\begin{equation*} A+ = a'+a' B = - 2 \\left ( P_{2}\\cdot a\\right ) \\boldsymbol{P}_{1} \\end{equation*}\n", + "\\begin{equation*} A- = a'-a' B = - 2 \\left ( P_{1}\\cdot a\\right ) \\boldsymbol{P}_{2} \\end{equation*}\n", + "\\begin{equation*} (A+)^{2} = 0 \\end{equation*}\n", + "\\begin{equation*} (A-)^{2} = 0 \\end{equation*}\n", + "\\begin{equation*} a\\cdot B = - \\left ( P_{2}\\cdot a\\right ) \\boldsymbol{P}_{1} + \\left ( P_{1}\\cdot a\\right ) \\boldsymbol{P}_{2} \\end{equation*}\n", + "\\\\begin{lstlisting}[language=Python,showspaces=false,showstringspaces=false,backgroundcolor=\\color{gray},frame=single]\n", + "def reciprocal_frame_test():\n", + " Print_Function()\n", + " Fmt(1)\n", + " g = '1 # #,'+ \\\n", + " '# 1 #,'+ \\\n", + " '# # 1'\n", + " ng3d = Ga('e1 e2 e3',g=g)\n", + " (e1,e2,e3) = ng3d.mv()\n", + " print('g_{ij} =',ng3d.g)\n", + " E = e1^e2^e3\n", + " Esq = (E*E).scalar()\n", + " print('E =',E)\n", + " print('%E^{2} =',Esq)\n", + " Esq_inv = 1/Esq\n", + " E1 = (e2^e3)*E\n", + " E2 = (-1)*(e1^e3)*E\n", + " E3 = (e1^e2)*E\n", + " print('E1 = (e2^e3)*E =',E1)\n", + " print('E2 =-(e1^e3)*E =',E2)\n", + " print('E3 = (e1^e2)*E =',E3)\n", + " w = (E1|e2)\n", + " w = w.expand()\n", + " print('E1|e2 =',w)\n", + " w = (E1|e3)\n", + " w = w.expand()\n", + " print('E1|e3 =',w)\n", + " w = (E2|e1)\n", + " w = w.expand()\n", + " print('E2|e1 =',w)\n", + " w = (E2|e3)\n", + " w = w.expand()\n", + " print('E2|e3 =',w)\n", + " w = (E3|e1)\n", + " w = w.expand()\n", + " print('E3|e1 =',w)\n", + " w = (E3|e2)\n", + " w = w.expand()\n", + " print('E3|e2 =',w)\n", + " w = (E1|e1)\n", + " w = (w.expand()).scalar()\n", + " Esq = expand(Esq)\n", + " print('%(E1\\\\cdot e1)/E^{2} =',simplify(w/Esq))\n", + " w = (E2|e2)\n", + " w = (w.expand()).scalar()\n", + " print('%(E2\\\\cdot e2)/E^{2} =',simplify(w/Esq))\n", + " w = (E3|e3)\n", + " w = (w.expand()).scalar()\n", + " print('%(E3\\\\cdot e3)/E^{2} =',simplify(w/Esq))\n", + " return\n", + "\\end{lstlisting}\n", + "Code Output:\n", + "\\begin{equation*} g_{ij} = \\left [ \\begin{array}{ccc} 1 & \\left ( e_{1}\\cdot e_{2}\\right ) & \\left ( e_{1}\\cdot e_{3}\\right ) \\\\ \\left ( e_{1}\\cdot e_{2}\\right ) & 1 & \\left ( e_{2}\\cdot e_{3}\\right ) \\\\ \\left ( e_{1}\\cdot e_{3}\\right ) & \\left ( e_{2}\\cdot e_{3}\\right ) & 1 \\end{array}\\right ] \\end{equation*}\n", + "\\begin{equation*} E = \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{2}\\wedge \\boldsymbol{e}_{3} \\end{equation*}\n", + "\\begin{equation*} E^{2} = \\left ( e_{1}\\cdot e_{2}\\right ) ^{2} - 2 \\left ( e_{1}\\cdot e_{2}\\right ) \\left ( e_{1}\\cdot e_{3}\\right ) \\left ( e_{2}\\cdot e_{3}\\right ) + \\left ( e_{1}\\cdot e_{3}\\right ) ^{2} + \\left ( e_{2}\\cdot e_{3}\\right ) ^{2} - 1 \\end{equation*}\n", + "\\begin{equation*} E1 = (e2\\W e3) E = \\left ( \\left ( e_{2}\\cdot e_{3}\\right ) ^{2} - 1\\right ) \\boldsymbol{e}_{1} + \\left ( \\left ( e_{1}\\cdot e_{2}\\right ) - \\left ( e_{1}\\cdot e_{3}\\right ) \\left ( e_{2}\\cdot e_{3}\\right ) \\right ) \\boldsymbol{e}_{2} + \\left ( - \\left ( e_{1}\\cdot e_{2}\\right ) \\left ( e_{2}\\cdot e_{3}\\right ) + \\left ( e_{1}\\cdot e_{3}\\right ) \\right ) \\boldsymbol{e}_{3} \\end{equation*}\n", + "\\begin{equation*} E2 =-(e1\\W e3) E = \\left ( \\left ( e_{1}\\cdot e_{2}\\right ) - \\left ( e_{1}\\cdot e_{3}\\right ) \\left ( e_{2}\\cdot e_{3}\\right ) \\right ) \\boldsymbol{e}_{1} + \\left ( \\left ( e_{1}\\cdot e_{3}\\right ) ^{2} - 1\\right ) \\boldsymbol{e}_{2} + \\left ( - \\left ( e_{1}\\cdot e_{2}\\right ) \\left ( e_{1}\\cdot e_{3}\\right ) + \\left ( e_{2}\\cdot e_{3}\\right ) \\right ) \\boldsymbol{e}_{3} \\end{equation*}\n", + "\\begin{equation*} E3 = (e1\\W e2) E = \\left ( - \\left ( e_{1}\\cdot e_{2}\\right ) \\left ( e_{2}\\cdot e_{3}\\right ) + \\left ( e_{1}\\cdot e_{3}\\right ) \\right ) \\boldsymbol{e}_{1} + \\left ( - \\left ( e_{1}\\cdot e_{2}\\right ) \\left ( e_{1}\\cdot e_{3}\\right ) + \\left ( e_{2}\\cdot e_{3}\\right ) \\right ) \\boldsymbol{e}_{2} + \\left ( \\left ( e_{1}\\cdot e_{2}\\right ) ^{2} - 1\\right ) \\boldsymbol{e}_{3} \\end{equation*}\n", + "\\begin{equation*} E1\\cdot e2 = 0 \\end{equation*}\n", + "\\begin{equation*} E1\\cdot e3 = 0 \\end{equation*}\n", + "\\begin{equation*} E2\\cdot e1 = 0 \\end{equation*}\n", + "\\begin{equation*} E2\\cdot e3 = 0 \\end{equation*}\n", + "\\begin{equation*} E3\\cdot e1 = 0 \\end{equation*}\n", + "\\begin{equation*} E3\\cdot e2 = 0 \\end{equation*}\n", + "\\begin{equation*} (E1\\cdot e1)/E^{2} = 1 \\end{equation*}\n", + "\\begin{equation*} (E2\\cdot e2)/E^{2} = 1 \\end{equation*}\n", + "\\begin{equation*} (E3\\cdot e3)/E^{2} = 1 \\end{equation*}\n", + "\\\\begin{lstlisting}[language=Python,showspaces=false,showstringspaces=false,backgroundcolor=\\color{gray},frame=single]\n", + "def signature_test():\n", + " Print_Function()\n", + " e3d = Ga('e1 e2 e3',g=[1,1,1])\n", + " print('g =', e3d.g)\n", + " print(r'%Signature = (3,0)\\: I =', e3d.I(),'\\: I^{2} =', e3d.I()*e3d.I())\n", + " e3d = Ga('e1 e2 e3',g=[2,2,2])\n", + " print('g =', e3d.g)\n", + " print(r'%Signature = (3,0)\\: I =', e3d.I(),'|; I^{2} =', e3d.I()*e3d.I())\n", + " sp4d = Ga('e1 e2 e3 e4',g=[1,-1,-1,-1])\n", + " print('g =', sp4d.g)\n", + " print(r'%Signature = (1,3)\\: I =', sp4d.I(),'\\: I^{2} =', sp4d.I()*sp4d.I())\n", + " sp4d = Ga('e1 e2 e3 e4',g=[2,-2,-2,-2])\n", + " print('g =', sp4d.g)\n", + " print(r'%Signature = (1,3)\\: I =', sp4d.I(),'\\: I^{2} =', sp4d.I()*sp4d.I())\n", + " e4d = Ga('e1 e2 e3 e4',g=[1,1,1,1])\n", + " print('g =', e4d.g)\n", + " print(r'%Signature = (4,0)\\: I =', e4d.I(),'\\: I^{2} =', e4d.I()*e4d.I())\n", + " cf3d = Ga('e1 e2 e3 e4 e5',g=[1,1,1,1,-1])\n", + " print('g =', cf3d.g)\n", + " print(r'%Signature = (4,1)\\: I =', cf3d.I(),'\\: I^{2} =', cf3d.I()*cf3d.I())\n", + " cf3d = Ga('e1 e2 e3 e4 e5',g=[2,2,2,2,-2])\n", + " print('g =', cf3d.g)\n", + " print(r'%Signature = (4,1)\\: I =', cf3d.I(),'\\: I^{2} =', cf3d.I()*cf3d.I())\n", + " return\n", + "\\end{lstlisting}\n", + "Code Output:\n", + "\\begin{equation*} g = \\left [ \\begin{array}{ccc} 1 & 0 & 0 \\\\ 0 & 1 & 0 \\\\ 0 & 0 & 1 \\end{array}\\right ] \\end{equation*}\n", + "\\begin{equation*} Signature = (3,0)\\: I = \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{2}\\wedge \\boldsymbol{e}_{3} \\: I^{2} = -1 \\end{equation*}\n", + "\\begin{equation*} g = \\left [ \\begin{array}{ccc} 2 & 0 & 0 \\\\ 0 & 2 & 0 \\\\ 0 & 0 & 2 \\end{array}\\right ] \\end{equation*}\n", + "\\begin{equation*} Signature = (3,0)\\: I = \\frac{\\sqrt{2}}{4} \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{2}\\wedge \\boldsymbol{e}_{3} |; I^{2} = -1 \\end{equation*}\n", + "\\begin{equation*} g = \\left [ \\begin{array}{cccc} 1 & 0 & 0 & 0 \\\\ 0 & -1 & 0 & 0 \\\\ 0 & 0 & -1 & 0 \\\\ 0 & 0 & 0 & -1 \\end{array}\\right ] \\end{equation*}\n", + "\\begin{equation*} Signature = (1,3)\\: I = \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{2}\\wedge \\boldsymbol{e}_{3}\\wedge \\boldsymbol{e}_{4} \\: I^{2} = -1 \\end{equation*}\n", + "\\begin{equation*} g = \\left [ \\begin{array}{cccc} 2 & 0 & 0 & 0 \\\\ 0 & -2 & 0 & 0 \\\\ 0 & 0 & -2 & 0 \\\\ 0 & 0 & 0 & -2 \\end{array}\\right ] \\end{equation*}\n", + "\\begin{equation*} Signature = (1,3)\\: I = \\frac{1}{4} \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{2}\\wedge \\boldsymbol{e}_{3}\\wedge \\boldsymbol{e}_{4} \\: I^{2} = -1 \\end{equation*}\n", + "\\begin{equation*} g = \\left [ \\begin{array}{cccc} 1 & 0 & 0 & 0 \\\\ 0 & 1 & 0 & 0 \\\\ 0 & 0 & 1 & 0 \\\\ 0 & 0 & 0 & 1 \\end{array}\\right ] \\end{equation*}\n", + "\\begin{equation*} Signature = (4,0)\\: I = \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{2}\\wedge \\boldsymbol{e}_{3}\\wedge \\boldsymbol{e}_{4} \\: I^{2} = 1 \\end{equation*}\n", + "\\begin{equation*} g = \\left [ \\begin{array}{ccccc} 1 & 0 & 0 & 0 & 0 \\\\ 0 & 1 & 0 & 0 & 0 \\\\ 0 & 0 & 1 & 0 & 0 \\\\ 0 & 0 & 0 & 1 & 0 \\\\ 0 & 0 & 0 & 0 & -1 \\end{array}\\right ] \\end{equation*}\n", + "\\begin{equation*} Signature = (4,1)\\: I = \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{2}\\wedge \\boldsymbol{e}_{3}\\wedge \\boldsymbol{e}_{4}\\wedge \\boldsymbol{e}_{5} \\: I^{2} = -1 \\end{equation*}\n", + "\\begin{equation*} g = \\left [ \\begin{array}{ccccc} 2 & 0 & 0 & 0 & 0 \\\\ 0 & 2 & 0 & 0 & 0 \\\\ 0 & 0 & 2 & 0 & 0 \\\\ 0 & 0 & 0 & 2 & 0 \\\\ 0 & 0 & 0 & 0 & -2 \\end{array}\\right ] \\end{equation*}\n", + "\\begin{equation*} Signature = (4,1)\\: I = \\frac{\\sqrt{2}}{8} \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{2}\\wedge \\boldsymbol{e}_{3}\\wedge \\boldsymbol{e}_{4}\\wedge \\boldsymbol{e}_{5} \\: I^{2} = -1 \\end{equation*}\n", + "\\\\begin{lstlisting}[language=Python,showspaces=false,showstringspaces=false,backgroundcolor=\\color{gray},frame=single]\n", + "def Fmt_test():\n", + " Print_Function()\n", + " e3d = Ga('e1 e2 e3',g=[1,1,1])\n", + " v = e3d.mv('v','vector')\n", + " B = e3d.mv('B','bivector')\n", + " M = e3d.mv('M','mv')\n", + " Fmt(2)\n", + " print('#Global $Fmt = 2$')\n", + " print('v =',v)\n", + " print('B =',B)\n", + " print('M =',M)\n", + " print('#Using $.Fmt()$ Function')\n", + " print('v.Fmt(3) =',v.Fmt(3))\n", + " print('B.Fmt(3) =',B.Fmt(3))\n", + " print('M.Fmt(2) =',M.Fmt(2))\n", + " print('M.Fmt(1) =',M.Fmt(1))\n", + " print('#Global $Fmt = 1$')\n", + " Fmt(1)\n", + " print('v =',v)\n", + " print('B =',B)\n", + " print('M =',M)\n", + " return\n", + "\\end{lstlisting}\n", + "Code Output:\n", + "Global $Fmt = 2$\n", + "\\begin{equation*} v = v^{1} \\boldsymbol{e}_{1} + v^{2} \\boldsymbol{e}_{2} + v^{3} \\boldsymbol{e}_{3} \\end{equation*}\n", + "\\begin{equation*} B = B^{12} \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{2} + B^{13} \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{3} + B^{23} \\boldsymbol{e}_{2}\\wedge \\boldsymbol{e}_{3} \\end{equation*}\n", + " \\begin{align*} M = & M \\\\ & + M^{1} \\boldsymbol{e}_{1} + M^{2} \\boldsymbol{e}_{2} + M^{3} \\boldsymbol{e}_{3} \\\\ & + M^{12} \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{2} + M^{13} \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{3} + M^{23} \\boldsymbol{e}_{2}\\wedge \\boldsymbol{e}_{3} \\\\ & + M^{123} \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{2}\\wedge \\boldsymbol{e}_{3} \\end{align*} \n", + "Using $.Fmt()$ Function\n", + " \\begin{align*} v \\cdot Fmt(3) = & v^{1} \\boldsymbol{e}_{1} \\\\ & + v^{2} \\boldsymbol{e}_{2} \\\\ & + v^{3} \\boldsymbol{e}_{3} \\end{align*} \n", + " \\begin{align*} B \\cdot Fmt(3) = & B^{12} \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{2} \\\\ & + B^{13} \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{3} \\\\ & + B^{23} \\boldsymbol{e}_{2}\\wedge \\boldsymbol{e}_{3} \\end{align*} \n", + " \\begin{align*} M \\cdot Fmt(2) = & M \\\\ & + M^{1} \\boldsymbol{e}_{1} + M^{2} \\boldsymbol{e}_{2} + M^{3} \\boldsymbol{e}_{3} \\\\ & + M^{12} \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{2} + M^{13} \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{3} + M^{23} \\boldsymbol{e}_{2}\\wedge \\boldsymbol{e}_{3} \\\\ & + M^{123} \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{2}\\wedge \\boldsymbol{e}_{3} \\end{align*} \n", + "\\begin{equation*} M \\cdot Fmt(1) = M + M^{1} \\boldsymbol{e}_{1} + M^{2} \\boldsymbol{e}_{2} + M^{3} \\boldsymbol{e}_{3} + M^{12} \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{2} + M^{13} \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{3} + M^{23} \\boldsymbol{e}_{2}\\wedge \\boldsymbol{e}_{3} + M^{123} \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{2}\\wedge \\boldsymbol{e}_{3} \\end{equation*}\n", + "Global $Fmt = 1$\n", + "\\begin{equation*} v = v^{1} \\boldsymbol{e}_{1} + v^{2} \\boldsymbol{e}_{2} + v^{3} \\boldsymbol{e}_{3} \\end{equation*}\n", + "\\begin{equation*} B = B^{12} \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{2} + B^{13} \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{3} + B^{23} \\boldsymbol{e}_{2}\\wedge \\boldsymbol{e}_{3} \\end{equation*}\n", + "\\begin{equation*} M = M + M^{1} \\boldsymbol{e}_{1} + M^{2} \\boldsymbol{e}_{2} + M^{3} \\boldsymbol{e}_{3} + M^{12} \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{2} + M^{13} \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{3} + M^{23} \\boldsymbol{e}_{2}\\wedge \\boldsymbol{e}_{3} + M^{123} \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{2}\\wedge \\boldsymbol{e}_{3} \\end{equation*}\n", + "\\end{document}\n" + ] + }, + "metadata": {}, + "output_type": "display_data" } ], "source": [ - "!cat latex_check.tex" + "check('latex_check')" ] }, { "cell_type": "code", - "execution_count": 22, + "execution_count": 12, "metadata": {}, - "outputs": [], - "source": [ - "!python lin_tran_check.py" - ] - }, - { - "cell_type": "code", - "execution_count": 23, - "metadata": { - "collapsed": false, - "scrolled": false - }, "outputs": [ { - "name": "stdout", - "output_type": "stream", - "text": [ - "\r\n", - "\\documentclass[10pt,fleqn]{report}\r\n", - "\\usepackage[vcentering]{geometry}\r\n", - "\\geometry{papersize={14in,11in},total={13in,10in}}\r\n", - "\r\n", - "\\pagestyle{empty}\r\n", - "\\usepackage[latin1]{inputenc}\r\n", - "\\usepackage{amsmath}\r\n", - "\\usepackage{amsfonts}\r\n", - "\\usepackage{amssymb}\r\n", - "\\usepackage{amsbsy}\r\n", - "\\usepackage{tensor}\r\n", - "\\usepackage{listings}\r\n", - "\\usepackage{color}\r\n", - "\\usepackage{xcolor}\r\n", - "\\usepackage{bm}\r\n", - "\\usepackage{breqn}\r\n", - "\\definecolor{gray}{rgb}{0.95,0.95,0.95}\r\n", - "\\setlength{\\parindent}{0pt}\r\n", - "\\DeclareMathOperator{\\Tr}{Tr}\r\n", - "\\DeclareMathOperator{\\Adj}{Adj}\r\n", - "\\newcommand{\\bfrac}[2]{\\displaystyle\\frac{#1}{#2}}\r\n", - "\\newcommand{\\lp}{\\left (}\r\n", - "\\newcommand{\\rp}{\\right )}\r\n", - "\\newcommand{\\paren}[1]{\\lp {#1} \\rp}\r\n", - "\\newcommand{\\half}{\\frac{1}{2}}\r\n", - "\\newcommand{\\llt}{\\left <}\r\n", - "\\newcommand{\\rgt}{\\right >}\r\n", - "\\newcommand{\\abs}[1]{\\left |{#1}\\right | }\r\n", - "\\newcommand{\\pdiff}[2]{\\bfrac{\\partial {#1}}{\\partial {#2}}}\r\n", - "\\newcommand{\\lbrc}{\\left \\{}\r\n", - "\\newcommand{\\rbrc}{\\right \\}}\r\n", - "\\newcommand{\\W}{\\wedge}\r\n", - "\\newcommand{\\prm}[1]{{#1}'}\r\n", - "\\newcommand{\\ddt}[1]{\\bfrac{d{#1}}{dt}}\r\n", - "\\newcommand{\\R}{\\dagger}\r\n", - "\\newcommand{\\deriv}[3]{\\bfrac{d^{#3}#1}{d{#2}^{#3}}}\r\n", - "\\newcommand{\\grade}[1]{\\left < {#1} \\right >}\r\n", - "\\newcommand{\\f}[2]{{#1}\\lp{#2}\\rp}\r\n", - "\\newcommand{\\eval}[2]{\\left . {#1} \\right |_{#2}}\r\n", - "\\newcommand{\\Nabla}{\\boldsymbol{\\nabla}}\r\n", - "\\newcommand{\\eb}{\\boldsymbol{e}}\r\n", - "\\usepackage{float}\r\n", - "\\floatstyle{plain} % optionally change the style of the new float\r\n", - "\\newfloat{Code}{H}{myc}\r\n", - "\\lstloadlanguages{Python}\r\n", - "\r\n", - "\\begin{document}\r\n", - "3d orthogonal ($A$ is vector function)\r\n", - "\\begin{equation*} A = A^{x} \\boldsymbol{e}_{x} + A^{y} \\boldsymbol{e}_{y} + A^{z} \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} A^{2} = {A^{x} }^{2} + {A^{y} }^{2} + {A^{z} }^{2} \\end{equation*}\r\n", - "\\begin{equation*} \\boldsymbol{\\nabla} \\cdot A = \\partial_{x} A^{x} + \\partial_{y} A^{y} + \\partial_{z} A^{z} \\end{equation*}\r\n", - "\\begin{equation*} \\boldsymbol{\\nabla} A = \\left ( \\partial_{x} A^{x} + \\partial_{y} A^{y} + \\partial_{z} A^{z} \\right ) + \\left ( - \\partial_{y} A^{x} + \\partial_{x} A^{y} \\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + \\left ( - \\partial_{z} A^{x} + \\partial_{x} A^{z} \\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + \\left ( - \\partial_{z} A^{y} + \\partial_{y} A^{z} \\right ) \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} v\\cdot (\\boldsymbol{\\nabla} A) = \\left ( v^{y} \\partial_{y} A^{x} - v^{y} \\partial_{x} A^{y} + v^{z} \\partial_{z} A^{x} - v^{z} \\partial_{x} A^{z} \\right ) \\boldsymbol{e}_{x} + \\left ( - v^{x} \\partial_{y} A^{x} + v^{x} \\partial_{x} A^{y} + v^{z} \\partial_{z} A^{y} - v^{z} \\partial_{y} A^{z} \\right ) \\boldsymbol{e}_{y} + \\left ( - v^{x} \\partial_{z} A^{x} + v^{x} \\partial_{x} A^{z} - v^{y} \\partial_{z} A^{y} + v^{y} \\partial_{y} A^{z} \\right ) \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "2d general ($A$ is vector function)\r\n", - "\\begin{equation*} A = A^{u} \\boldsymbol{e}_{u} + A^{v} \\boldsymbol{e}_{v} \\end{equation*}\r\n", - "\\begin{equation*} A^{2} = \\left ( e_{u}\\cdot e_{u}\\right ) {A^{u} }^{2} + 2 \\left ( e_{u}\\cdot e_{v}\\right ) A^{u} A^{v} + \\left ( e_{v}\\cdot e_{v}\\right ) {A^{v} }^{2} \\end{equation*}\r\n", - "\\begin{equation*} \\boldsymbol{\\nabla} \\cdot A = \\partial_{u} A^{u} + \\partial_{v} A^{v} \\end{equation*}\r\n", - "\\begin{equation*} \\boldsymbol{\\nabla} A = \\left ( \\partial_{u} A^{u} + \\partial_{v} A^{v} \\right ) + \\frac{- \\left ( e_{u}\\cdot e_{u}\\right ) \\partial_{v} A^{u} + \\left ( e_{u}\\cdot e_{v}\\right ) \\partial_{u} A^{u} - \\left ( e_{u}\\cdot e_{v}\\right ) \\partial_{v} A^{v} + \\left ( e_{v}\\cdot e_{v}\\right ) \\partial_{u} A^{v} }{\\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) - \\left ( e_{u}\\cdot e_{v}\\right ) ^{2}} \\boldsymbol{e}_{u}\\wedge \\boldsymbol{e}_{v} \\end{equation*}\r\n", - "3d orthogonal ($A,\\;B$ are linear transformations)\r\n", - "\\begin{equation*} A = \\left \\{ \\begin{array}{ll} L \\left ( \\boldsymbol{e}_{x}\\right ) =& A_{xx} \\boldsymbol{e}_{x} + A_{yx} \\boldsymbol{e}_{y} + A_{zx} \\boldsymbol{e}_{z} \\\\ L \\left ( \\boldsymbol{e}_{y}\\right ) =& A_{xy} \\boldsymbol{e}_{x} + A_{yy} \\boldsymbol{e}_{y} + A_{zy} \\boldsymbol{e}_{z} \\\\ L \\left ( \\boldsymbol{e}_{z}\\right ) =& A_{xz} \\boldsymbol{e}_{x} + A_{yz} \\boldsymbol{e}_{y} + A_{zz} \\boldsymbol{e}_{z} \\end{array} \\right \\} \\end{equation*}\r\n", - "\\begin{equation*} \\f{mat}{A} = \\left [ \\begin{array}{ccc} A_{xx} & A_{xy} & A_{xz} \\\\ A_{yx} & A_{yy} & A_{yz} \\\\ A_{zx} & A_{zy} & A_{zz} \\end{array}\\right ] \\end{equation*}\r\n", - "\\begin{equation*} \\f{\\det}{A} = A_{xz} \\left(A_{yx} A_{zy} - A_{yy} A_{zx}\\right) - A_{yz} \\left(A_{xx} A_{zy} - A_{xy} A_{zx}\\right) + A_{zz} \\left(A_{xx} A_{yy} - A_{xy} A_{yx}\\right) \\end{equation*}\r\n", - "\\begin{equation*} \\overline{A} = \\left \\{ \\begin{array}{ll} L \\left ( \\boldsymbol{e}_{x}\\right ) =& A_{xx} \\boldsymbol{e}_{x} + A_{xy} \\boldsymbol{e}_{y} + A_{xz} \\boldsymbol{e}_{z} \\\\ L \\left ( \\boldsymbol{e}_{y}\\right ) =& A_{yx} \\boldsymbol{e}_{x} + A_{yy} \\boldsymbol{e}_{y} + A_{yz} \\boldsymbol{e}_{z} \\\\ L \\left ( \\boldsymbol{e}_{z}\\right ) =& A_{zx} \\boldsymbol{e}_{x} + A_{zy} \\boldsymbol{e}_{y} + A_{zz} \\boldsymbol{e}_{z} \\end{array} \\right \\} \\end{equation*}\r\n", - "\\begin{equation*} \\f{\\Tr}{A} = A_{xx} + A_{yy} + A_{zz} \\end{equation*}\r\n", - "\\begin{equation*} \\f{A}{e_x\\W e_y} = \\left ( A_{xx} A_{yy} - A_{xy} A_{yx}\\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + \\left ( A_{xx} A_{zy} - A_{xy} A_{zx}\\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + \\left ( A_{yx} A_{zy} - A_{yy} A_{zx}\\right ) \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} \\f{A}{e_x}\\W \\f{A}{e_y} = \\left ( A_{xx} A_{yy} - A_{xy} A_{yx}\\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + \\left ( A_{xx} A_{zy} - A_{xy} A_{zx}\\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + \\left ( A_{yx} A_{zy} - A_{yy} A_{zx}\\right ) \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} g = \\left [ \\begin{array}{ccc} 1 & 0 & 0 \\\\ 0 & 1 & 0 \\\\ 0 & 0 & 1 \\end{array}\\right ] \\end{equation*}\r\n", - "\\begin{equation*} g^{-1} = \\left[\\begin{matrix}1 & 0 & 0\\\\0 & 1 & 0\\\\0 & 0 & 1\\end{matrix}\\right] \\end{equation*}\r\n", - "\\begin{equation*} A + B = \\left \\{ \\begin{array}{ll} L \\left ( \\boldsymbol{e}_{x}\\right ) =& \\left ( A_{xx} + B_{xx}\\right ) \\boldsymbol{e}_{x} + \\left ( A_{yx} + B_{yx}\\right ) \\boldsymbol{e}_{y} + \\left ( A_{zx} + B_{zx}\\right ) \\boldsymbol{e}_{z} \\\\ L \\left ( \\boldsymbol{e}_{y}\\right ) =& \\left ( A_{xy} + B_{xy}\\right ) \\boldsymbol{e}_{x} + \\left ( A_{yy} + B_{yy}\\right ) \\boldsymbol{e}_{y} + \\left ( A_{zy} + B_{zy}\\right ) \\boldsymbol{e}_{z} \\\\ L \\left ( \\boldsymbol{e}_{z}\\right ) =& \\left ( A_{xz} + B_{xz}\\right ) \\boldsymbol{e}_{x} + \\left ( A_{yz} + B_{yz}\\right ) \\boldsymbol{e}_{y} + \\left ( A_{zz} + B_{zz}\\right ) \\boldsymbol{e}_{z} \\end{array} \\right \\} \\end{equation*}\r\n", - "\\begin{equation*} AB = \\left \\{ \\begin{array}{ll} L \\left ( \\boldsymbol{e}_{x}\\right ) =& \\left ( A_{xx} B_{xx} + A_{xy} B_{yx} + A_{xz} B_{zx}\\right ) \\boldsymbol{e}_{x} + \\left ( A_{yx} B_{xx} + A_{yy} B_{yx} + A_{yz} B_{zx}\\right ) \\boldsymbol{e}_{y} + \\left ( A_{zx} B_{xx} + A_{zy} B_{yx} + A_{zz} B_{zx}\\right ) \\boldsymbol{e}_{z} \\\\ L \\left ( \\boldsymbol{e}_{y}\\right ) =& \\left ( A_{xx} B_{xy} + A_{xy} B_{yy} + A_{xz} B_{zy}\\right ) \\boldsymbol{e}_{x} + \\left ( A_{yx} B_{xy} + A_{yy} B_{yy} + A_{yz} B_{zy}\\right ) \\boldsymbol{e}_{y} + \\left ( A_{zx} B_{xy} + A_{zy} B_{yy} + A_{zz} B_{zy}\\right ) \\boldsymbol{e}_{z} \\\\ L \\left ( \\boldsymbol{e}_{z}\\right ) =& \\left ( A_{xx} B_{xz} + A_{xy} B_{yz} + A_{xz} B_{zz}\\right ) \\boldsymbol{e}_{x} + \\left ( A_{yx} B_{xz} + A_{yy} B_{yz} + A_{yz} B_{zz}\\right ) \\boldsymbol{e}_{y} + \\left ( A_{zx} B_{xz} + A_{zy} B_{yz} + A_{zz} B_{zz}\\right ) \\boldsymbol{e}_{z} \\end{array} \\right \\} \\end{equation*}\r\n", - "\\begin{equation*} A - B = \\left \\{ \\begin{array}{ll} L \\left ( \\boldsymbol{e}_{x}\\right ) =& \\left ( A_{xx} - B_{xx}\\right ) \\boldsymbol{e}_{x} + \\left ( A_{yx} - B_{yx}\\right ) \\boldsymbol{e}_{y} + \\left ( A_{zx} - B_{zx}\\right ) \\boldsymbol{e}_{z} \\\\ L \\left ( \\boldsymbol{e}_{y}\\right ) =& \\left ( A_{xy} - B_{xy}\\right ) \\boldsymbol{e}_{x} + \\left ( A_{yy} - B_{yy}\\right ) \\boldsymbol{e}_{y} + \\left ( A_{zy} - B_{zy}\\right ) \\boldsymbol{e}_{z} \\\\ L \\left ( \\boldsymbol{e}_{z}\\right ) =& \\left ( A_{xz} - B_{xz}\\right ) \\boldsymbol{e}_{x} + \\left ( A_{yz} - B_{yz}\\right ) \\boldsymbol{e}_{y} + \\left ( A_{zz} - B_{zz}\\right ) \\boldsymbol{e}_{z} \\end{array} \\right \\} \\end{equation*}\r\n", - "\\begin{equation*} General Symmetric Linear Transformation \\end{equation*}\r\n", - "\\begin{equation*} A = \\left \\{ \\begin{array}{ll} L \\left ( \\boldsymbol{e}_{x}\\right ) =& A_{xx} \\boldsymbol{e}_{x} + A_{xy} \\boldsymbol{e}_{y} + A_{xz} \\boldsymbol{e}_{z} \\\\ L \\left ( \\boldsymbol{e}_{y}\\right ) =& A_{xy} \\boldsymbol{e}_{x} + A_{yy} \\boldsymbol{e}_{y} + A_{yz} \\boldsymbol{e}_{z} \\\\ L \\left ( \\boldsymbol{e}_{z}\\right ) =& A_{xz} \\boldsymbol{e}_{x} + A_{yz} \\boldsymbol{e}_{y} + A_{zz} \\boldsymbol{e}_{z} \\end{array} \\right \\} \\end{equation*}\r\n", - "\\begin{equation*} General Antisymmetric Linear Transformation \\end{equation*}\r\n", - "\\begin{equation*} A = \\left \\{ \\begin{array}{ll} L \\left ( \\boldsymbol{e}_{x}\\right ) =& - A_{xy} \\boldsymbol{e}_{y} - A_{xz} \\boldsymbol{e}_{z} \\\\ L \\left ( \\boldsymbol{e}_{y}\\right ) =& A_{xy} \\boldsymbol{e}_{x} - A_{yz} \\boldsymbol{e}_{z} \\\\ L \\left ( \\boldsymbol{e}_{z}\\right ) =& A_{xz} \\boldsymbol{e}_{x} + A_{yz} \\boldsymbol{e}_{y} \\end{array} \\right \\} \\end{equation*}\r\n", - "2d general ($A,\\;B$ are linear transformations)\r\n", - "\\begin{equation*} g = \\left [ \\begin{array}{cc} \\left ( e_{u}\\cdot e_{u}\\right ) & \\left ( e_{u}\\cdot e_{v}\\right ) \\\\ \\left ( e_{u}\\cdot e_{v}\\right ) & \\left ( e_{v}\\cdot e_{v}\\right ) \\end{array}\\right ] \\end{equation*}\r\n", - "\\begin{equation*} g^{-1} = \\left[\\begin{matrix}\\frac{\\left ( e_{v}\\cdot e_{v}\\right ) }{\\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) - \\left ( e_{u}\\cdot e_{v}\\right ) ^{2}} & - \\frac{\\left ( e_{u}\\cdot e_{v}\\right ) }{\\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) - \\left ( e_{u}\\cdot e_{v}\\right ) ^{2}}\\\\- \\frac{\\left ( e_{u}\\cdot e_{v}\\right ) }{\\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) - \\left ( e_{u}\\cdot e_{v}\\right ) ^{2}} & \\frac{\\left ( e_{u}\\cdot e_{u}\\right ) }{\\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) - \\left ( e_{u}\\cdot e_{v}\\right ) ^{2}}\\end{matrix}\\right] \\end{equation*}\r\n", - "\\begin{equation*} gg^{-1} = \\left[\\begin{matrix}1 & 0\\\\0 & 1\\end{matrix}\\right] \\end{equation*}\r\n", - "\\begin{equation*} A = \\left \\{ \\begin{array}{ll} L \\left ( \\boldsymbol{e}_{u}\\right ) =& \\frac{- \\left ( e_{u}\\cdot e_{v}\\right ) A_{uv} + \\left ( e_{v}\\cdot e_{v}\\right ) A_{uu}}{\\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) - \\left ( e_{u}\\cdot e_{v}\\right ) ^{2}} \\boldsymbol{e}_{u} + \\frac{- \\left ( e_{u}\\cdot e_{v}\\right ) A_{vv} + \\left ( e_{v}\\cdot e_{v}\\right ) A_{vu}}{\\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) - \\left ( e_{u}\\cdot e_{v}\\right ) ^{2}} \\boldsymbol{e}_{v} \\\\ L \\left ( \\boldsymbol{e}_{v}\\right ) =& \\frac{\\left ( e_{u}\\cdot e_{u}\\right ) A_{uv} - \\left ( e_{u}\\cdot e_{v}\\right ) A_{uu}}{\\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) - \\left ( e_{u}\\cdot e_{v}\\right ) ^{2}} \\boldsymbol{e}_{u} + \\frac{\\left ( e_{u}\\cdot e_{u}\\right ) A_{vv} - \\left ( e_{u}\\cdot e_{v}\\right ) A_{vu}}{\\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) - \\left ( e_{u}\\cdot e_{v}\\right ) ^{2}} \\boldsymbol{e}_{v} \\end{array} \\right \\} \\end{equation*}\r\n", - "\\begin{equation*} \\f{mat}{A} = \\left [ \\begin{array}{cc} A_{uu} & A_{uv} \\\\ A_{vu} & A_{vv} \\end{array}\\right ] \\end{equation*}\r\n", - "\\begin{equation*} \\f{\\det}{A} = \\frac{- \\left(\\frac{\\left ( e_{u}\\cdot e_{u}\\right ) A_{uv}}{\\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) - \\left ( e_{u}\\cdot e_{v}\\right ) ^{2}} - \\frac{\\left ( e_{u}\\cdot e_{v}\\right ) A_{uu}}{\\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) - \\left ( e_{u}\\cdot e_{v}\\right ) ^{2}}\\right) \\left(- \\frac{\\left ( e_{u}\\cdot e_{v}\\right ) A_{vv}}{\\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) - \\left ( e_{u}\\cdot e_{v}\\right ) ^{2}} + \\frac{\\left ( e_{v}\\cdot e_{v}\\right ) A_{vu}}{\\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) - \\left ( e_{u}\\cdot e_{v}\\right ) ^{2}}\\right) \\boldsymbol{e}_{u}\\wedge \\boldsymbol{e}_{v} + \\left(\\frac{\\left ( e_{u}\\cdot e_{u}\\right ) A_{vv}}{\\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) - \\left ( e_{u}\\cdot e_{v}\\right ) ^{2}} - \\frac{\\left ( e_{u}\\cdot e_{v}\\right ) A_{vu}}{\\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) - \\left ( e_{u}\\cdot e_{v}\\right ) ^{2}}\\right) \\left(- \\frac{\\left ( e_{u}\\cdot e_{v}\\right ) A_{uv}}{\\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) - \\left ( e_{u}\\cdot e_{v}\\right ) ^{2}} + \\frac{\\left ( e_{v}\\cdot e_{v}\\right ) A_{uu}}{\\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) - \\left ( e_{u}\\cdot e_{v}\\right ) ^{2}}\\right) \\boldsymbol{e}_{u}\\wedge \\boldsymbol{e}_{v}}{\\sqrt{\\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) - \\left ( e_{u}\\cdot e_{v}\\right ) ^{2}}} \\end{equation*}\r\n", - "\\begin{equation*} \\overline{A} = \\left \\{ \\begin{array}{ll} L \\left ( \\boldsymbol{e}_{u}\\right ) =& \\frac{- \\left ( e_{u}\\cdot e_{u}\\right ) ^{2} \\left ( e_{u}\\cdot e_{v}\\right ) A_{uv} + \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} A_{uu} - \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} A_{vv} - \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) A_{uv} + \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) ^{2} A_{uu} + \\left ( e_{u}\\cdot e_{v}\\right ) ^{3} A_{vu} - \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) A_{vv} + \\left ( e_{u}\\cdot e_{v}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) ^{2} A_{vu}}{\\left ( e_{u}\\cdot e_{u}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) ^{2} - 2 \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) + \\left ( e_{u}\\cdot e_{v}\\right ) ^{4}} \\boldsymbol{e}_{u} + \\frac{A_{uv} \\left ( e_{u}\\cdot e_{u}\\right ) ^{3} - \\left ( e_{u}\\cdot e_{u}\\right ) ^{2} \\left ( e_{u}\\cdot e_{v}\\right ) A_{uu} + \\left ( e_{u}\\cdot e_{u}\\right ) ^{2} \\left ( e_{u}\\cdot e_{v}\\right ) A_{vv} + \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} A_{uv} - \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} A_{vu} - \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) A_{uu} + \\left ( e_{u}\\cdot e_{v}\\right ) ^{3} A_{vv} - \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) A_{vu}}{\\left ( e_{u}\\cdot e_{u}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) ^{2} - 2 \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) + \\left ( e_{u}\\cdot e_{v}\\right ) ^{4}} \\boldsymbol{e}_{v} \\\\ L \\left ( \\boldsymbol{e}_{v}\\right ) =& \\frac{- \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} A_{uv} - \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) A_{vv} + \\left ( e_{u}\\cdot e_{v}\\right ) ^{3} A_{uu} - \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) A_{uv} + \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) A_{vu} + \\left ( e_{u}\\cdot e_{v}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) ^{2} A_{uu} - \\left ( e_{u}\\cdot e_{v}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) ^{2} A_{vv} + A_{vu} \\left ( e_{v}\\cdot e_{v}\\right ) ^{3}}{\\left ( e_{u}\\cdot e_{u}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) ^{2} - 2 \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) + \\left ( e_{u}\\cdot e_{v}\\right ) ^{4}} \\boldsymbol{e}_{u} + \\frac{\\left ( e_{u}\\cdot e_{u}\\right ) ^{2} \\left ( e_{u}\\cdot e_{v}\\right ) A_{uv} + \\left ( e_{u}\\cdot e_{u}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) A_{vv} - \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} A_{uu} - \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) A_{vu} + \\left ( e_{u}\\cdot e_{v}\\right ) ^{3} A_{uv} - \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) A_{uu} + \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) A_{vv} - \\left ( e_{u}\\cdot e_{v}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) ^{2} A_{vu}}{\\left ( e_{u}\\cdot e_{u}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) ^{2} - 2 \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) + \\left ( e_{u}\\cdot e_{v}\\right ) ^{4}} \\boldsymbol{e}_{v} \\end{array} \\right \\} \\end{equation*}\r\n", - "\\begin{equation*} \\f{mat}{\\overline{A}} = \\left[\\begin{matrix}- \\frac{\\left ( e_{u}\\cdot e_{u}\\right ) \\left(\\left ( e_{u}\\cdot e_{u}\\right ) ^{2} \\left ( e_{u}\\cdot e_{v}\\right ) A_{uv} - \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} A_{uu} + \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} A_{vv} + \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) A_{uv} - \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) ^{2} A_{uu} - \\left ( e_{u}\\cdot e_{v}\\right ) ^{3} A_{vu} + \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) A_{vv} - \\left ( e_{u}\\cdot e_{v}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) ^{2} A_{vu}\\right) + \\left ( e_{u}\\cdot e_{v}\\right ) \\left(\\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} A_{uv} + \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) A_{vv} - \\left ( e_{u}\\cdot e_{v}\\right ) ^{3} A_{uu} + \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) A_{uv} - \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) A_{vu} - \\left ( e_{u}\\cdot e_{v}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) ^{2} A_{uu} + \\left ( e_{u}\\cdot e_{v}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) ^{2} A_{vv} - A_{vu} \\left ( e_{v}\\cdot e_{v}\\right ) ^{3}\\right)}{\\left ( e_{u}\\cdot e_{u}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) ^{2} - 2 \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) + \\left ( e_{u}\\cdot e_{v}\\right ) ^{4}} & \\frac{- \\left ( e_{u}\\cdot e_{u}\\right ) ^{2} \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} A_{uv} + \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) ^{3} A_{uu} - \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) ^{3} A_{vv} - 2 \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) A_{uv} + \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) ^{2} A_{uu} - \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) ^{2} A_{vv} + A_{vu} \\left ( e_{u}\\cdot e_{v}\\right ) ^{4} + \\left ( e_{u}\\cdot e_{v}\\right ) ^{3} \\left ( e_{v}\\cdot e_{v}\\right ) A_{uu} - \\left ( e_{u}\\cdot e_{v}\\right ) ^{3} \\left ( e_{v}\\cdot e_{v}\\right ) A_{vv} - \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) ^{2} A_{uv} + 2 \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) ^{2} A_{vu} + \\left ( e_{u}\\cdot e_{v}\\right ) A_{uu} \\left ( e_{v}\\cdot e_{v}\\right ) ^{3} - \\left ( e_{u}\\cdot e_{v}\\right ) A_{vv} \\left ( e_{v}\\cdot e_{v}\\right ) ^{3} + A_{vu} \\left ( e_{v}\\cdot e_{v}\\right ) ^{4}}{\\left ( e_{u}\\cdot e_{u}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) ^{2} - 2 \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) + \\left ( e_{u}\\cdot e_{v}\\right ) ^{4}}\\\\\\frac{\\left ( e_{u}\\cdot e_{u}\\right ) \\left(A_{uv} \\left ( e_{u}\\cdot e_{u}\\right ) ^{3} - \\left ( e_{u}\\cdot e_{u}\\right ) ^{2} \\left ( e_{u}\\cdot e_{v}\\right ) A_{uu} + \\left ( e_{u}\\cdot e_{u}\\right ) ^{2} \\left ( e_{u}\\cdot e_{v}\\right ) A_{vv} + \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} A_{uv} - \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} A_{vu} - \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) A_{uu} + \\left ( e_{u}\\cdot e_{v}\\right ) ^{3} A_{vv} - \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) A_{vu}\\right) + \\left ( e_{u}\\cdot e_{v}\\right ) \\left(\\left ( e_{u}\\cdot e_{u}\\right ) ^{2} \\left ( e_{u}\\cdot e_{v}\\right ) A_{uv} + \\left ( e_{u}\\cdot e_{u}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) A_{vv} - \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} A_{uu} - \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) A_{vu} + \\left ( e_{u}\\cdot e_{v}\\right ) ^{3} A_{uv} - \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) A_{uu} + \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) A_{vv} - \\left ( e_{u}\\cdot e_{v}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) ^{2} A_{vu}\\right)}{\\left ( e_{u}\\cdot e_{u}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) ^{2} - 2 \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) + \\left ( e_{u}\\cdot e_{v}\\right ) ^{4}} & \\frac{\\left ( e_{u}\\cdot e_{v}\\right ) \\left(A_{uv} \\left ( e_{u}\\cdot e_{u}\\right ) ^{3} - \\left ( e_{u}\\cdot e_{u}\\right ) ^{2} \\left ( e_{u}\\cdot e_{v}\\right ) A_{uu} + \\left ( e_{u}\\cdot e_{u}\\right ) ^{2} \\left ( e_{u}\\cdot e_{v}\\right ) A_{vv} + \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} A_{uv} - \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} A_{vu} - \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) A_{uu} + \\left ( e_{u}\\cdot e_{v}\\right ) ^{3} A_{vv} - \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) A_{vu}\\right) + \\left ( e_{v}\\cdot e_{v}\\right ) \\left(\\left ( e_{u}\\cdot e_{u}\\right ) ^{2} \\left ( e_{u}\\cdot e_{v}\\right ) A_{uv} + \\left ( e_{u}\\cdot e_{u}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) A_{vv} - \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} A_{uu} - \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) A_{vu} + \\left ( e_{u}\\cdot e_{v}\\right ) ^{3} A_{uv} - \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) A_{uu} + \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) A_{vv} - \\left ( e_{u}\\cdot e_{v}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) ^{2} A_{vu}\\right)}{\\left ( e_{u}\\cdot e_{u}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) ^{2} - 2 \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) + \\left ( e_{u}\\cdot e_{v}\\right ) ^{4}}\\end{matrix}\\right] \\end{equation*}\r\n", - "\\begin{equation*} \\f{\\Tr}{A} = - \\frac{\\left ( e_{u}\\cdot e_{u}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) A_{vv}}{- \\left ( e_{u}\\cdot e_{u}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) ^{2} + 2 \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) - \\left ( e_{u}\\cdot e_{v}\\right ) ^{4}} + \\frac{\\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} A_{vv}}{- \\left ( e_{u}\\cdot e_{u}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) ^{2} + 2 \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) - \\left ( e_{u}\\cdot e_{v}\\right ) ^{4}} + \\frac{\\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) A_{uv}}{- \\left ( e_{u}\\cdot e_{u}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) ^{2} + 2 \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) - \\left ( e_{u}\\cdot e_{v}\\right ) ^{4}} + \\frac{\\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) A_{vu}}{- \\left ( e_{u}\\cdot e_{u}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) ^{2} + 2 \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) - \\left ( e_{u}\\cdot e_{v}\\right ) ^{4}} - \\frac{\\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) ^{2} A_{uu}}{- \\left ( e_{u}\\cdot e_{u}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) ^{2} + 2 \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) - \\left ( e_{u}\\cdot e_{v}\\right ) ^{4}} - \\frac{\\left ( e_{u}\\cdot e_{v}\\right ) ^{3} A_{uv}}{- \\left ( e_{u}\\cdot e_{u}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) ^{2} + 2 \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) - \\left ( e_{u}\\cdot e_{v}\\right ) ^{4}} - \\frac{\\left ( e_{u}\\cdot e_{v}\\right ) ^{3} A_{vu}}{- \\left ( e_{u}\\cdot e_{u}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) ^{2} + 2 \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) - \\left ( e_{u}\\cdot e_{v}\\right ) ^{4}} + \\frac{\\left ( e_{u}\\cdot e_{v}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) A_{uu}}{- \\left ( e_{u}\\cdot e_{u}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) ^{2} + 2 \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) - \\left ( e_{u}\\cdot e_{v}\\right ) ^{4}} \\end{equation*}\r\n", - "\\begin{equation*} \\f{A}{e_u\\W e_v} = \\frac{A_{uu} A_{vv} - A_{uv} A_{vu}}{\\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) - \\left ( e_{u}\\cdot e_{v}\\right ) ^{2}} \\boldsymbol{e}_{u}\\wedge \\boldsymbol{e}_{v} \\end{equation*}\r\n", - "\\begin{equation*} \\f{A}{e_u}\\W \\f{A}{e_v} = \\frac{A_{uu} A_{vv} - A_{uv} A_{vu}}{\\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) - \\left ( e_{u}\\cdot e_{v}\\right ) ^{2}} \\boldsymbol{e}_{u}\\wedge \\boldsymbol{e}_{v} \\end{equation*}\r\n", - "\\begin{equation*} B = \\left \\{ \\begin{array}{ll} L \\left ( \\boldsymbol{e}_{u}\\right ) =& \\frac{- \\left ( e_{u}\\cdot e_{v}\\right ) B_{uv} + \\left ( e_{v}\\cdot e_{v}\\right ) B_{uu}}{\\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) - \\left ( e_{u}\\cdot e_{v}\\right ) ^{2}} \\boldsymbol{e}_{u} + \\frac{- \\left ( e_{u}\\cdot e_{v}\\right ) B_{vv} + \\left ( e_{v}\\cdot e_{v}\\right ) B_{vu}}{\\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) - \\left ( e_{u}\\cdot e_{v}\\right ) ^{2}} \\boldsymbol{e}_{v} \\\\ L \\left ( \\boldsymbol{e}_{v}\\right ) =& \\frac{\\left ( e_{u}\\cdot e_{u}\\right ) B_{uv} - \\left ( e_{u}\\cdot e_{v}\\right ) B_{uu}}{\\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) - \\left ( e_{u}\\cdot e_{v}\\right ) ^{2}} \\boldsymbol{e}_{u} + \\frac{\\left ( e_{u}\\cdot e_{u}\\right ) B_{vv} - \\left ( e_{u}\\cdot e_{v}\\right ) B_{vu}}{\\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) - \\left ( e_{u}\\cdot e_{v}\\right ) ^{2}} \\boldsymbol{e}_{v} \\end{array} \\right \\} \\end{equation*}\r\n", - "\\begin{equation*} A + B = \\left \\{ \\begin{array}{ll} L \\left ( \\boldsymbol{e}_{u}\\right ) =& \\frac{- \\left ( e_{u}\\cdot e_{v}\\right ) A_{uv} - \\left ( e_{u}\\cdot e_{v}\\right ) B_{uv} + \\left ( e_{v}\\cdot e_{v}\\right ) A_{uu} + \\left ( e_{v}\\cdot e_{v}\\right ) B_{uu}}{\\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) - \\left ( e_{u}\\cdot e_{v}\\right ) ^{2}} \\boldsymbol{e}_{u} + \\frac{- \\left ( e_{u}\\cdot e_{v}\\right ) A_{vv} - \\left ( e_{u}\\cdot e_{v}\\right ) B_{vv} + \\left ( e_{v}\\cdot e_{v}\\right ) A_{vu} + \\left ( e_{v}\\cdot e_{v}\\right ) B_{vu}}{\\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) - \\left ( e_{u}\\cdot e_{v}\\right ) ^{2}} \\boldsymbol{e}_{v} \\\\ L \\left ( \\boldsymbol{e}_{v}\\right ) =& \\frac{\\left ( e_{u}\\cdot e_{u}\\right ) A_{uv} + \\left ( e_{u}\\cdot e_{u}\\right ) B_{uv} - \\left ( e_{u}\\cdot e_{v}\\right ) A_{uu} - \\left ( e_{u}\\cdot e_{v}\\right ) B_{uu}}{\\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) - \\left ( e_{u}\\cdot e_{v}\\right ) ^{2}} \\boldsymbol{e}_{u} + \\frac{\\left ( e_{u}\\cdot e_{u}\\right ) A_{vv} + \\left ( e_{u}\\cdot e_{u}\\right ) B_{vv} - \\left ( e_{u}\\cdot e_{v}\\right ) A_{vu} - \\left ( e_{u}\\cdot e_{v}\\right ) B_{vu}}{\\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) - \\left ( e_{u}\\cdot e_{v}\\right ) ^{2}} \\boldsymbol{e}_{v} \\end{array} \\right \\} \\end{equation*}\r\n", - "\\begin{equation*} AB = \\left \\{ \\begin{array}{ll} L \\left ( \\boldsymbol{e}_{u}\\right ) =& \\frac{- \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) A_{uv} B_{vv} + \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) A_{uv} B_{vu} + \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} A_{uu} B_{vv} + \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} A_{uv} B_{uv} - \\left ( e_{u}\\cdot e_{v}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) A_{uu} B_{uv} - \\left ( e_{u}\\cdot e_{v}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) A_{uu} B_{vu} - \\left ( e_{u}\\cdot e_{v}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) A_{uv} B_{uu} + \\left ( e_{v}\\cdot e_{v}\\right ) ^{2} A_{uu} B_{uu}}{\\left ( e_{u}\\cdot e_{u}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) ^{2} - 2 \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) + \\left ( e_{u}\\cdot e_{v}\\right ) ^{4}} \\boldsymbol{e}_{u} + \\frac{- \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) A_{vv} B_{vv} + \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) A_{vv} B_{vu} + \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} A_{vu} B_{vv} + \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} A_{vv} B_{uv} - \\left ( e_{u}\\cdot e_{v}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) A_{vu} B_{uv} - \\left ( e_{u}\\cdot e_{v}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) A_{vu} B_{vu} - \\left ( e_{u}\\cdot e_{v}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) A_{vv} B_{uu} + \\left ( e_{v}\\cdot e_{v}\\right ) ^{2} A_{vu} B_{uu}}{\\left ( e_{u}\\cdot e_{u}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) ^{2} - 2 \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) + \\left ( e_{u}\\cdot e_{v}\\right ) ^{4}} \\boldsymbol{e}_{v} \\\\ L \\left ( \\boldsymbol{e}_{v}\\right ) =& \\frac{\\left ( e_{u}\\cdot e_{u}\\right ) ^{2} A_{uv} B_{vv} - \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) A_{uu} B_{vv} - \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) A_{uv} B_{uv} - \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) A_{uv} B_{vu} + \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) A_{uu} B_{uv} + \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} A_{uu} B_{vu} + \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} A_{uv} B_{uu} - \\left ( e_{u}\\cdot e_{v}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) A_{uu} B_{uu}}{\\left ( e_{u}\\cdot e_{u}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) ^{2} - 2 \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) + \\left ( e_{u}\\cdot e_{v}\\right ) ^{4}} \\boldsymbol{e}_{u} + \\frac{\\left ( e_{u}\\cdot e_{u}\\right ) ^{2} A_{vv} B_{vv} - \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) A_{vu} B_{vv} - \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) A_{vv} B_{uv} - \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) A_{vv} B_{vu} + \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) A_{vu} B_{uv} + \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} A_{vu} B_{vu} + \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} A_{vv} B_{uu} - \\left ( e_{u}\\cdot e_{v}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) A_{vu} B_{uu}}{\\left ( e_{u}\\cdot e_{u}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) ^{2} - 2 \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) + \\left ( e_{u}\\cdot e_{v}\\right ) ^{4}} \\boldsymbol{e}_{v} \\end{array} \\right \\} \\end{equation*}\r\n", - "\\begin{equation*} A - B = \\left \\{ \\begin{array}{ll} L \\left ( \\boldsymbol{e}_{u}\\right ) =& \\frac{- \\left ( e_{u}\\cdot e_{v}\\right ) A_{uv} + \\left ( e_{u}\\cdot e_{v}\\right ) B_{uv} + \\left ( e_{v}\\cdot e_{v}\\right ) A_{uu} - \\left ( e_{v}\\cdot e_{v}\\right ) B_{uu}}{\\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) - \\left ( e_{u}\\cdot e_{v}\\right ) ^{2}} \\boldsymbol{e}_{u} + \\frac{- \\left ( e_{u}\\cdot e_{v}\\right ) A_{vv} + \\left ( e_{u}\\cdot e_{v}\\right ) B_{vv} + \\left ( e_{v}\\cdot e_{v}\\right ) A_{vu} - \\left ( e_{v}\\cdot e_{v}\\right ) B_{vu}}{\\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) - \\left ( e_{u}\\cdot e_{v}\\right ) ^{2}} \\boldsymbol{e}_{v} \\\\ L \\left ( \\boldsymbol{e}_{v}\\right ) =& \\frac{\\left ( e_{u}\\cdot e_{u}\\right ) A_{uv} - \\left ( e_{u}\\cdot e_{u}\\right ) B_{uv} - \\left ( e_{u}\\cdot e_{v}\\right ) A_{uu} + \\left ( e_{u}\\cdot e_{v}\\right ) B_{uu}}{\\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) - \\left ( e_{u}\\cdot e_{v}\\right ) ^{2}} \\boldsymbol{e}_{u} + \\frac{\\left ( e_{u}\\cdot e_{u}\\right ) A_{vv} - \\left ( e_{u}\\cdot e_{u}\\right ) B_{vv} - \\left ( e_{u}\\cdot e_{v}\\right ) A_{vu} + \\left ( e_{u}\\cdot e_{v}\\right ) B_{vu}}{\\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) - \\left ( e_{u}\\cdot e_{v}\\right ) ^{2}} \\boldsymbol{e}_{v} \\end{array} \\right \\} \\end{equation*}\r\n", - "\\begin{equation*} a\\cdot \\f{\\overline{A}}{b}-b\\cdot \\f{\\underline{A}}{a} = 0 \\end{equation*}\r\n", - "\\begin{equation*} g = \\left [ \\begin{array}{cccc} 1 & 0 & 0 & 0 \\\\ 0 & -1 & 0 & 0 \\\\ 0 & 0 & -1 & 0 \\\\ 0 & 0 & 0 & -1 \\end{array}\\right ] \\end{equation*}\r\n", - "\\begin{equation*} \\underline{T} = \\left \\{ \\begin{array}{ll} L \\left ( \\boldsymbol{e}_{t}\\right ) =& T_{tt} \\boldsymbol{e}_{t} + T_{xt} \\boldsymbol{e}_{x} + T_{yt} \\boldsymbol{e}_{y} + T_{zt} \\boldsymbol{e}_{z} \\\\ L \\left ( \\boldsymbol{e}_{x}\\right ) =& - T_{tx} \\boldsymbol{e}_{t} - T_{xx} \\boldsymbol{e}_{x} - T_{yx} \\boldsymbol{e}_{y} - T_{zx} \\boldsymbol{e}_{z} \\\\ L \\left ( \\boldsymbol{e}_{y}\\right ) =& - T_{ty} \\boldsymbol{e}_{t} - T_{xy} \\boldsymbol{e}_{x} - T_{yy} \\boldsymbol{e}_{y} - T_{zy} \\boldsymbol{e}_{z} \\\\ L \\left ( \\boldsymbol{e}_{z}\\right ) =& - T_{tz} \\boldsymbol{e}_{t} - T_{xz} \\boldsymbol{e}_{x} - T_{yz} \\boldsymbol{e}_{y} - T_{zz} \\boldsymbol{e}_{z} \\end{array} \\right \\} \\end{equation*}\r\n", - "\\begin{equation*} \\overline{T} = \\left \\{ \\begin{array}{ll} L \\left ( \\boldsymbol{e}_{t}\\right ) =& T_{tt} \\boldsymbol{e}_{t} + T_{tx} \\boldsymbol{e}_{x} + T_{ty} \\boldsymbol{e}_{y} + T_{tz} \\boldsymbol{e}_{z} \\\\ L \\left ( \\boldsymbol{e}_{x}\\right ) =& - T_{xt} \\boldsymbol{e}_{t} - T_{xx} \\boldsymbol{e}_{x} - T_{xy} \\boldsymbol{e}_{y} - T_{xz} \\boldsymbol{e}_{z} \\\\ L \\left ( \\boldsymbol{e}_{y}\\right ) =& - T_{yt} \\boldsymbol{e}_{t} - T_{yx} \\boldsymbol{e}_{x} - T_{yy} \\boldsymbol{e}_{y} - T_{yz} \\boldsymbol{e}_{z} \\\\ L \\left ( \\boldsymbol{e}_{z}\\right ) =& - T_{zt} \\boldsymbol{e}_{t} - T_{zx} \\boldsymbol{e}_{x} - T_{zy} \\boldsymbol{e}_{y} - T_{zz} \\boldsymbol{e}_{z} \\end{array} \\right \\} \\end{equation*}\r\n", - "\\begin{equation*} \\f{\\det}{\\underline{T}} = T_{tz} \\left(T_{xt} T_{yx} T_{zy} - T_{xt} T_{yy} T_{zx} - T_{xx} T_{yt} T_{zy} + T_{xx} T_{yy} T_{zt} + T_{xy} T_{yt} T_{zx} - T_{xy} T_{yx} T_{zt}\\right) - T_{xz} \\left(T_{tt} T_{yx} T_{zy} - T_{tt} T_{yy} T_{zx} - T_{tx} T_{yt} T_{zy} + T_{tx} T_{yy} T_{zt} + T_{ty} T_{yt} T_{zx} - T_{ty} T_{yx} T_{zt}\\right) + T_{yz} \\left(T_{tt} T_{xx} T_{zy} - T_{tt} T_{xy} T_{zx} - T_{tx} T_{xt} T_{zy} + T_{tx} T_{xy} T_{zt} + T_{ty} T_{xt} T_{zx} - T_{ty} T_{xx} T_{zt}\\right) - T_{zz} \\left(T_{tt} T_{xx} T_{yy} - T_{tt} T_{xy} T_{yx} - T_{tx} T_{xt} T_{yy} + T_{tx} T_{xy} T_{yt} + T_{ty} T_{xt} T_{yx} - T_{ty} T_{xx} T_{yt}\\right) \\end{equation*}\r\n", - "\\begin{equation*} \\f{\\mbox{tr}}{\\underline{T}} = T_{tt} - T_{xx} - T_{yy} - T_{zz} \\end{equation*}\r\n", - "\\begin{equation*} a\\cdot \\f{\\overline{T}}{b}-b\\cdot \\f{\\underline{T}}{a} = 0 \\end{equation*}\r\n", - "\\begin{equation*} f = f \\end{equation*}\r\n", - "\\begin{equation*} \\boldsymbol{\\nabla} f = \\partial_{u} f \\boldsymbol{e}_{u} + \\frac{\\partial_{v} f }{\\sin{\\left (u \\right )}} \\boldsymbol{e}_{v} \\end{equation*}\r\n", - "\\begin{equation*} F = F^{u} \\boldsymbol{e}_{u} + F^{v} \\boldsymbol{e}_{v} \\end{equation*}\r\n", - "\\begin{equation*} \\boldsymbol{\\nabla} F = \\left ( \\frac{F^{u} }{\\tan{\\left (u \\right )}} + \\partial_{u} F^{u} + \\frac{\\partial_{v} F^{v} }{\\sin{\\left (u \\right )}}\\right ) + \\left ( \\frac{F^{v} }{\\tan{\\left (u \\right )}} + \\partial_{u} F^{v} - \\frac{\\partial_{v} F^{u} }{\\sin{\\left (u \\right )}}\\right ) \\boldsymbol{e}_{u}\\wedge \\boldsymbol{e}_{v} \\end{equation*}\r\n", - "\\begin{equation*} f = f \\end{equation*}\r\n", - "\\begin{equation*} \\boldsymbol{\\nabla} f = \\partial_{\\theta } f \\boldsymbol{e}_{\\theta } + \\frac{\\partial_{\\phi } f }{\\sin{\\left (\\theta \\right )}} \\boldsymbol{e}_{\\phi } \\end{equation*}\r\n", - "\\begin{equation*} F = F^{\\theta } \\boldsymbol{e}_{\\theta } + F^{\\phi } \\boldsymbol{e}_{\\phi } \\end{equation*}\r\n", - "\\begin{equation*} \\boldsymbol{\\nabla} F = \\left ( \\frac{F^{\\theta } }{\\tan{\\left (\\theta \\right )}} + \\partial_{\\theta } F^{\\theta } + \\frac{\\partial_{\\phi } F^{\\phi } }{\\sin{\\left (\\theta \\right )}}\\right ) + \\left ( \\frac{F^{\\phi } }{\\tan{\\left (\\theta \\right )}} + \\partial_{\\theta } F^{\\phi } - \\frac{\\partial_{\\phi } F^{\\theta } }{\\sin{\\left (\\theta \\right )}}\\right ) \\boldsymbol{e}_{\\theta }\\wedge \\boldsymbol{e}_{\\phi } \\end{equation*}\r\n", - "\\end{document}\r\n" - ] + "data": { + "text/plain": [ + "\n", + "\\documentclass[10pt,fleqn]{report}\n", + "\\usepackage[vcentering]{geometry}\n", + "\\geometry{papersize={14in,11in},total={13in,10in}}\n", + "\n", + "\\pagestyle{empty}\n", + "\\usepackage[latin1]{inputenc}\n", + "\\usepackage{amsmath}\n", + "\\usepackage{amsfonts}\n", + "\\usepackage{amssymb}\n", + "\\usepackage{amsbsy}\n", + "\\usepackage{tensor}\n", + "\\usepackage{listings}\n", + "\\usepackage{color}\n", + "\\usepackage{xcolor}\n", + "\\usepackage{bm}\n", + "\\usepackage{breqn}\n", + "\\definecolor{gray}{rgb}{0.95,0.95,0.95}\n", + "\\setlength{\\parindent}{0pt}\n", + "\\DeclareMathOperator{\\Tr}{Tr}\n", + "\\DeclareMathOperator{\\Adj}{Adj}\n", + "\\newcommand{\\bfrac}[2]{\\displaystyle\\frac{#1}{#2}}\n", + "\\newcommand{\\lp}{\\left (}\n", + "\\newcommand{\\rp}{\\right )}\n", + "\\newcommand{\\paren}[1]{\\lp {#1} \\rp}\n", + "\\newcommand{\\half}{\\frac{1}{2}}\n", + "\\newcommand{\\llt}{\\left <}\n", + "\\newcommand{\\rgt}{\\right >}\n", + "\\newcommand{\\abs}[1]{\\left |{#1}\\right | }\n", + "\\newcommand{\\pdiff}[2]{\\bfrac{\\partial {#1}}{\\partial {#2}}}\n", + "\\newcommand{\\lbrc}{\\left \\{}\n", + "\\newcommand{\\rbrc}{\\right \\}}\n", + "\\newcommand{\\W}{\\wedge}\n", + "\\newcommand{\\prm}[1]{{#1}'}\n", + "\\newcommand{\\ddt}[1]{\\bfrac{d{#1}}{dt}}\n", + "\\newcommand{\\R}{\\dagger}\n", + "\\newcommand{\\deriv}[3]{\\bfrac{d^{#3}#1}{d{#2}^{#3}}}\n", + "\\newcommand{\\grade}[1]{\\left < {#1} \\right >}\n", + "\\newcommand{\\f}[2]{{#1}\\lp{#2}\\rp}\n", + "\\newcommand{\\eval}[2]{\\left . {#1} \\right |_{#2}}\n", + "\\newcommand{\\Nabla}{\\boldsymbol{\\nabla}}\n", + "\\newcommand{\\eb}{\\boldsymbol{e}}\n", + "\\usepackage{float}\n", + "\\floatstyle{plain} % optionally change the style of the new float\n", + "\\newfloat{Code}{H}{myc}\n", + "\\lstloadlanguages{Python}\n", + "\n", + "\\begin{document}\n", + "3d orthogonal ($A$ is vector function)\n", + "\\begin{equation*} A = A^{x} \\boldsymbol{e}_{x} + A^{y} \\boldsymbol{e}_{y} + A^{z} \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} A^{2} = {A^{x} }^{2} + {A^{y} }^{2} + {A^{z} }^{2} \\end{equation*}\n", + "\\begin{equation*} \\boldsymbol{\\nabla} \\cdot A = \\partial_{x} A^{x} + \\partial_{y} A^{y} + \\partial_{z} A^{z} \\end{equation*}\n", + "\\begin{equation*} \\boldsymbol{\\nabla} A = \\left ( \\partial_{x} A^{x} + \\partial_{y} A^{y} + \\partial_{z} A^{z} \\right ) + \\left ( - \\partial_{y} A^{x} + \\partial_{x} A^{y} \\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + \\left ( - \\partial_{z} A^{x} + \\partial_{x} A^{z} \\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + \\left ( - \\partial_{z} A^{y} + \\partial_{y} A^{z} \\right ) \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} v\\cdot (\\boldsymbol{\\nabla} A) = \\left ( v^{y} \\partial_{y} A^{x} - v^{y} \\partial_{x} A^{y} + v^{z} \\partial_{z} A^{x} - v^{z} \\partial_{x} A^{z} \\right ) \\boldsymbol{e}_{x} + \\left ( - v^{x} \\partial_{y} A^{x} + v^{x} \\partial_{x} A^{y} + v^{z} \\partial_{z} A^{y} - v^{z} \\partial_{y} A^{z} \\right ) \\boldsymbol{e}_{y} + \\left ( - v^{x} \\partial_{z} A^{x} + v^{x} \\partial_{x} A^{z} - v^{y} \\partial_{z} A^{y} + v^{y} \\partial_{y} A^{z} \\right ) \\boldsymbol{e}_{z} \\end{equation*}\n", + "2d general ($A$ is vector function)\n", + "\\begin{equation*} A = A^{u} \\boldsymbol{e}_{u} + A^{v} \\boldsymbol{e}_{v} \\end{equation*}\n", + "\\begin{equation*} A^{2} = \\left ( e_{u}\\cdot e_{u}\\right ) {A^{u} }^{2} + 2 \\left ( e_{u}\\cdot e_{v}\\right ) A^{u} A^{v} + \\left ( e_{v}\\cdot e_{v}\\right ) {A^{v} }^{2} \\end{equation*}\n", + "\\begin{equation*} \\boldsymbol{\\nabla} \\cdot A = \\partial_{u} A^{u} + \\partial_{v} A^{v} \\end{equation*}\n", + "\\begin{equation*} \\boldsymbol{\\nabla} A = \\left ( \\partial_{u} A^{u} + \\partial_{v} A^{v} \\right ) + \\frac{- \\left ( e_{u}\\cdot e_{u}\\right ) \\partial_{v} A^{u} + \\left ( e_{u}\\cdot e_{v}\\right ) \\partial_{u} A^{u} - \\left ( e_{u}\\cdot e_{v}\\right ) \\partial_{v} A^{v} + \\left ( e_{v}\\cdot e_{v}\\right ) \\partial_{u} A^{v} }{\\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) - \\left ( e_{u}\\cdot e_{v}\\right ) ^{2}} \\boldsymbol{e}_{u}\\wedge \\boldsymbol{e}_{v} \\end{equation*}\n", + "3d orthogonal ($A,\\;B$ are linear transformations)\n", + "\\begin{equation*} A = \\left \\{ \\begin{array}{ll} L \\left ( \\boldsymbol{e}_{x}\\right ) =& A_{xx} \\boldsymbol{e}_{x} + A_{yx} \\boldsymbol{e}_{y} + A_{zx} \\boldsymbol{e}_{z} \\\\ L \\left ( \\boldsymbol{e}_{y}\\right ) =& A_{xy} \\boldsymbol{e}_{x} + A_{yy} \\boldsymbol{e}_{y} + A_{zy} \\boldsymbol{e}_{z} \\\\ L \\left ( \\boldsymbol{e}_{z}\\right ) =& A_{xz} \\boldsymbol{e}_{x} + A_{yz} \\boldsymbol{e}_{y} + A_{zz} \\boldsymbol{e}_{z} \\end{array} \\right \\} \\end{equation*}\n", + "\\begin{equation*} \\f{mat}{A} = \\left [ \\begin{array}{ccc} A_{xx} & A_{xy} & A_{xz} \\\\ A_{yx} & A_{yy} & A_{yz} \\\\ A_{zx} & A_{zy} & A_{zz} \\end{array}\\right ] \\end{equation*}\n", + "\\begin{equation*} \\f{\\det}{A} = A_{xz} \\left(A_{yx} A_{zy} - A_{yy} A_{zx}\\right) - A_{yz} \\left(A_{xx} A_{zy} - A_{xy} A_{zx}\\right) + A_{zz} \\left(A_{xx} A_{yy} - A_{xy} A_{yx}\\right) \\end{equation*}\n", + "\\begin{equation*} \\overline{A} = \\left \\{ \\begin{array}{ll} L \\left ( \\boldsymbol{e}_{x}\\right ) =& A_{xx} \\boldsymbol{e}_{x} + A_{xy} \\boldsymbol{e}_{y} + A_{xz} \\boldsymbol{e}_{z} \\\\ L \\left ( \\boldsymbol{e}_{y}\\right ) =& A_{yx} \\boldsymbol{e}_{x} + A_{yy} \\boldsymbol{e}_{y} + A_{yz} \\boldsymbol{e}_{z} \\\\ L \\left ( \\boldsymbol{e}_{z}\\right ) =& A_{zx} \\boldsymbol{e}_{x} + A_{zy} \\boldsymbol{e}_{y} + A_{zz} \\boldsymbol{e}_{z} \\end{array} \\right \\} \\end{equation*}\n", + "\\begin{equation*} \\f{\\Tr}{A} = A_{xx} + A_{yy} + A_{zz} \\end{equation*}\n", + "\\begin{equation*} \\f{A}{e_x\\W e_y} = \\left ( A_{xx} A_{yy} - A_{xy} A_{yx}\\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + \\left ( A_{xx} A_{zy} - A_{xy} A_{zx}\\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + \\left ( A_{yx} A_{zy} - A_{yy} A_{zx}\\right ) \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} \\f{A}{e_x}\\W \\f{A}{e_y} = \\left ( A_{xx} A_{yy} - A_{xy} A_{yx}\\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + \\left ( A_{xx} A_{zy} - A_{xy} A_{zx}\\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + \\left ( A_{yx} A_{zy} - A_{yy} A_{zx}\\right ) \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} g = \\left [ \\begin{array}{ccc} 1 & 0 & 0 \\\\ 0 & 1 & 0 \\\\ 0 & 0 & 1 \\end{array}\\right ] \\end{equation*}\n", + "\\begin{equation*} g^{-1} = \\left[\\begin{matrix}1 & 0 & 0\\\\0 & 1 & 0\\\\0 & 0 & 1\\end{matrix}\\right] \\end{equation*}\n", + "\\begin{equation*} A + B = \\left \\{ \\begin{array}{ll} L \\left ( \\boldsymbol{e}_{x}\\right ) =& \\left ( A_{xx} + B_{xx}\\right ) \\boldsymbol{e}_{x} + \\left ( A_{yx} + B_{yx}\\right ) \\boldsymbol{e}_{y} + \\left ( A_{zx} + B_{zx}\\right ) \\boldsymbol{e}_{z} \\\\ L \\left ( \\boldsymbol{e}_{y}\\right ) =& \\left ( A_{xy} + B_{xy}\\right ) \\boldsymbol{e}_{x} + \\left ( A_{yy} + B_{yy}\\right ) \\boldsymbol{e}_{y} + \\left ( A_{zy} + B_{zy}\\right ) \\boldsymbol{e}_{z} \\\\ L \\left ( \\boldsymbol{e}_{z}\\right ) =& \\left ( A_{xz} + B_{xz}\\right ) \\boldsymbol{e}_{x} + \\left ( A_{yz} + B_{yz}\\right ) \\boldsymbol{e}_{y} + \\left ( A_{zz} + B_{zz}\\right ) \\boldsymbol{e}_{z} \\end{array} \\right \\} \\end{equation*}\n", + "\\begin{equation*} AB = \\left \\{ \\begin{array}{ll} L \\left ( \\boldsymbol{e}_{x}\\right ) =& \\left ( A_{xx} B_{xx} + A_{xy} B_{yx} + A_{xz} B_{zx}\\right ) \\boldsymbol{e}_{x} + \\left ( A_{yx} B_{xx} + A_{yy} B_{yx} + A_{yz} B_{zx}\\right ) \\boldsymbol{e}_{y} + \\left ( A_{zx} B_{xx} + A_{zy} B_{yx} + A_{zz} B_{zx}\\right ) \\boldsymbol{e}_{z} \\\\ L \\left ( \\boldsymbol{e}_{y}\\right ) =& \\left ( A_{xx} B_{xy} + A_{xy} B_{yy} + A_{xz} B_{zy}\\right ) \\boldsymbol{e}_{x} + \\left ( A_{yx} B_{xy} + A_{yy} B_{yy} + A_{yz} B_{zy}\\right ) \\boldsymbol{e}_{y} + \\left ( A_{zx} B_{xy} + A_{zy} B_{yy} + A_{zz} B_{zy}\\right ) \\boldsymbol{e}_{z} \\\\ L \\left ( \\boldsymbol{e}_{z}\\right ) =& \\left ( A_{xx} B_{xz} + A_{xy} B_{yz} + A_{xz} B_{zz}\\right ) \\boldsymbol{e}_{x} + \\left ( A_{yx} B_{xz} + A_{yy} B_{yz} + A_{yz} B_{zz}\\right ) \\boldsymbol{e}_{y} + \\left ( A_{zx} B_{xz} + A_{zy} B_{yz} + A_{zz} B_{zz}\\right ) \\boldsymbol{e}_{z} \\end{array} \\right \\} \\end{equation*}\n", + "\\begin{equation*} A - B = \\left \\{ \\begin{array}{ll} L \\left ( \\boldsymbol{e}_{x}\\right ) =& \\left ( A_{xx} - B_{xx}\\right ) \\boldsymbol{e}_{x} + \\left ( A_{yx} - B_{yx}\\right ) \\boldsymbol{e}_{y} + \\left ( A_{zx} - B_{zx}\\right ) \\boldsymbol{e}_{z} \\\\ L \\left ( \\boldsymbol{e}_{y}\\right ) =& \\left ( A_{xy} - B_{xy}\\right ) \\boldsymbol{e}_{x} + \\left ( A_{yy} - B_{yy}\\right ) \\boldsymbol{e}_{y} + \\left ( A_{zy} - B_{zy}\\right ) \\boldsymbol{e}_{z} \\\\ L \\left ( \\boldsymbol{e}_{z}\\right ) =& \\left ( A_{xz} - B_{xz}\\right ) \\boldsymbol{e}_{x} + \\left ( A_{yz} - B_{yz}\\right ) \\boldsymbol{e}_{y} + \\left ( A_{zz} - B_{zz}\\right ) \\boldsymbol{e}_{z} \\end{array} \\right \\} \\end{equation*}\n", + "\\begin{equation*} General Symmetric Linear Transformation \\end{equation*}\n", + "\\begin{equation*} A = \\left \\{ \\begin{array}{ll} L \\left ( \\boldsymbol{e}_{x}\\right ) =& A_{xx} \\boldsymbol{e}_{x} + A_{xy} \\boldsymbol{e}_{y} + A_{xz} \\boldsymbol{e}_{z} \\\\ L \\left ( \\boldsymbol{e}_{y}\\right ) =& A_{xy} \\boldsymbol{e}_{x} + A_{yy} \\boldsymbol{e}_{y} + A_{yz} \\boldsymbol{e}_{z} \\\\ L \\left ( \\boldsymbol{e}_{z}\\right ) =& A_{xz} \\boldsymbol{e}_{x} + A_{yz} \\boldsymbol{e}_{y} + A_{zz} \\boldsymbol{e}_{z} \\end{array} \\right \\} \\end{equation*}\n", + "\\begin{equation*} General Antisymmetric Linear Transformation \\end{equation*}\n", + "\\begin{equation*} A = \\left \\{ \\begin{array}{ll} L \\left ( \\boldsymbol{e}_{x}\\right ) =& - A_{xy} \\boldsymbol{e}_{y} - A_{xz} \\boldsymbol{e}_{z} \\\\ L \\left ( \\boldsymbol{e}_{y}\\right ) =& A_{xy} \\boldsymbol{e}_{x} - A_{yz} \\boldsymbol{e}_{z} \\\\ L \\left ( \\boldsymbol{e}_{z}\\right ) =& A_{xz} \\boldsymbol{e}_{x} + A_{yz} \\boldsymbol{e}_{y} \\end{array} \\right \\} \\end{equation*}\n", + "2d general ($A,\\;B$ are linear transformations)\n", + "\\begin{equation*} g = \\left [ \\begin{array}{cc} \\left ( e_{u}\\cdot e_{u}\\right ) & \\left ( e_{u}\\cdot e_{v}\\right ) \\\\ \\left ( e_{u}\\cdot e_{v}\\right ) & \\left ( e_{v}\\cdot e_{v}\\right ) \\end{array}\\right ] \\end{equation*}\n", + "\\begin{equation*} g^{-1} = \\left[\\begin{matrix}\\frac{\\left ( e_{v}\\cdot e_{v}\\right ) }{\\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) - \\left ( e_{u}\\cdot e_{v}\\right ) ^{2}} & - \\frac{\\left ( e_{u}\\cdot e_{v}\\right ) }{\\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) - \\left ( e_{u}\\cdot e_{v}\\right ) ^{2}}\\\\- \\frac{\\left ( e_{u}\\cdot e_{v}\\right ) }{\\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) - \\left ( e_{u}\\cdot e_{v}\\right ) ^{2}} & \\frac{\\left ( e_{u}\\cdot e_{u}\\right ) }{\\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) - \\left ( e_{u}\\cdot e_{v}\\right ) ^{2}}\\end{matrix}\\right] \\end{equation*}\n", + "\\begin{equation*} gg^{-1} = \\left[\\begin{matrix}1 & 0\\\\0 & 1\\end{matrix}\\right] \\end{equation*}\n", + "\\begin{equation*} A = \\left \\{ \\begin{array}{ll} L \\left ( \\boldsymbol{e}_{u}\\right ) =& \\frac{- \\left ( e_{u}\\cdot e_{v}\\right ) A_{uv} + \\left ( e_{v}\\cdot e_{v}\\right ) A_{uu}}{\\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) - \\left ( e_{u}\\cdot e_{v}\\right ) ^{2}} \\boldsymbol{e}_{u} + \\frac{- \\left ( e_{u}\\cdot e_{v}\\right ) A_{vv} + \\left ( e_{v}\\cdot e_{v}\\right ) A_{vu}}{\\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) - \\left ( e_{u}\\cdot e_{v}\\right ) ^{2}} \\boldsymbol{e}_{v} \\\\ L \\left ( \\boldsymbol{e}_{v}\\right ) =& \\frac{\\left ( e_{u}\\cdot e_{u}\\right ) A_{uv} - \\left ( e_{u}\\cdot e_{v}\\right ) A_{uu}}{\\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) - \\left ( e_{u}\\cdot e_{v}\\right ) ^{2}} \\boldsymbol{e}_{u} + \\frac{\\left ( e_{u}\\cdot e_{u}\\right ) A_{vv} - \\left ( e_{u}\\cdot e_{v}\\right ) A_{vu}}{\\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) - \\left ( e_{u}\\cdot e_{v}\\right ) ^{2}} \\boldsymbol{e}_{v} \\end{array} \\right \\} \\end{equation*}\n", + "\\begin{equation*} \\f{mat}{A} = \\left [ \\begin{array}{cc} A_{uu} & A_{uv} \\\\ A_{vu} & A_{vv} \\end{array}\\right ] \\end{equation*}\n", + "\\begin{equation*} \\f{\\det}{A} = \\frac{- \\left(\\frac{\\left ( e_{u}\\cdot e_{u}\\right ) A_{uv}}{\\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) - \\left ( e_{u}\\cdot e_{v}\\right ) ^{2}} - \\frac{\\left ( e_{u}\\cdot e_{v}\\right ) A_{uu}}{\\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) - \\left ( e_{u}\\cdot e_{v}\\right ) ^{2}}\\right) \\left(- \\frac{\\left ( e_{u}\\cdot e_{v}\\right ) A_{vv}}{\\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) - \\left ( e_{u}\\cdot e_{v}\\right ) ^{2}} + \\frac{\\left ( e_{v}\\cdot e_{v}\\right ) A_{vu}}{\\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) - \\left ( e_{u}\\cdot e_{v}\\right ) ^{2}}\\right) \\boldsymbol{e}_{u}\\wedge \\boldsymbol{e}_{v} + \\left(\\frac{\\left ( e_{u}\\cdot e_{u}\\right ) A_{vv}}{\\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) - \\left ( e_{u}\\cdot e_{v}\\right ) ^{2}} - \\frac{\\left ( e_{u}\\cdot e_{v}\\right ) A_{vu}}{\\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) - \\left ( e_{u}\\cdot e_{v}\\right ) ^{2}}\\right) \\left(- \\frac{\\left ( e_{u}\\cdot e_{v}\\right ) A_{uv}}{\\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) - \\left ( e_{u}\\cdot e_{v}\\right ) ^{2}} + \\frac{\\left ( e_{v}\\cdot e_{v}\\right ) A_{uu}}{\\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) - \\left ( e_{u}\\cdot e_{v}\\right ) ^{2}}\\right) \\boldsymbol{e}_{u}\\wedge \\boldsymbol{e}_{v}}{\\sqrt{\\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) - \\left ( e_{u}\\cdot e_{v}\\right ) ^{2}}} \\end{equation*}\n", + "\\begin{equation*} \\overline{A} = \\left \\{ \\begin{array}{ll} L \\left ( \\boldsymbol{e}_{u}\\right ) =& \\frac{- \\left ( e_{u}\\cdot e_{u}\\right ) ^{2} \\left ( e_{u}\\cdot e_{v}\\right ) A_{uv} + \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} A_{uu} - \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} A_{vv} - \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) A_{uv} + \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) ^{2} A_{uu} + \\left ( e_{u}\\cdot e_{v}\\right ) ^{3} A_{vu} - \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) A_{vv} + \\left ( e_{u}\\cdot e_{v}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) ^{2} A_{vu}}{\\left ( e_{u}\\cdot e_{u}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) ^{2} - 2 \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) + \\left ( e_{u}\\cdot e_{v}\\right ) ^{4}} \\boldsymbol{e}_{u} + \\frac{A_{uv} \\left ( e_{u}\\cdot e_{u}\\right ) ^{3} - \\left ( e_{u}\\cdot e_{u}\\right ) ^{2} \\left ( e_{u}\\cdot e_{v}\\right ) A_{uu} + \\left ( e_{u}\\cdot e_{u}\\right ) ^{2} \\left ( e_{u}\\cdot e_{v}\\right ) A_{vv} + \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} A_{uv} - \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} A_{vu} - \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) A_{uu} + \\left ( e_{u}\\cdot e_{v}\\right ) ^{3} A_{vv} - \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) A_{vu}}{\\left ( e_{u}\\cdot e_{u}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) ^{2} - 2 \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) + \\left ( e_{u}\\cdot e_{v}\\right ) ^{4}} \\boldsymbol{e}_{v} \\\\ L \\left ( \\boldsymbol{e}_{v}\\right ) =& \\frac{- \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} A_{uv} - \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) A_{vv} + \\left ( e_{u}\\cdot e_{v}\\right ) ^{3} A_{uu} - \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) A_{uv} + \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) A_{vu} + \\left ( e_{u}\\cdot e_{v}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) ^{2} A_{uu} - \\left ( e_{u}\\cdot e_{v}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) ^{2} A_{vv} + A_{vu} \\left ( e_{v}\\cdot e_{v}\\right ) ^{3}}{\\left ( e_{u}\\cdot e_{u}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) ^{2} - 2 \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) + \\left ( e_{u}\\cdot e_{v}\\right ) ^{4}} \\boldsymbol{e}_{u} + \\frac{\\left ( e_{u}\\cdot e_{u}\\right ) ^{2} \\left ( e_{u}\\cdot e_{v}\\right ) A_{uv} + \\left ( e_{u}\\cdot e_{u}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) A_{vv} - \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} A_{uu} - \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) A_{vu} + \\left ( e_{u}\\cdot e_{v}\\right ) ^{3} A_{uv} - \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) A_{uu} + \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) A_{vv} - \\left ( e_{u}\\cdot e_{v}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) ^{2} A_{vu}}{\\left ( e_{u}\\cdot e_{u}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) ^{2} - 2 \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) + \\left ( e_{u}\\cdot e_{v}\\right ) ^{4}} \\boldsymbol{e}_{v} \\end{array} \\right \\} \\end{equation*}\n", + "\\begin{equation*} \\f{mat}{\\overline{A}} = \\left[\\begin{matrix}- \\frac{\\left ( e_{u}\\cdot e_{u}\\right ) \\left(\\left ( e_{u}\\cdot e_{u}\\right ) ^{2} \\left ( e_{u}\\cdot e_{v}\\right ) A_{uv} - \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} A_{uu} + \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} A_{vv} + \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) A_{uv} - \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) ^{2} A_{uu} - \\left ( e_{u}\\cdot e_{v}\\right ) ^{3} A_{vu} + \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) A_{vv} - \\left ( e_{u}\\cdot e_{v}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) ^{2} A_{vu}\\right) + \\left ( e_{u}\\cdot e_{v}\\right ) \\left(\\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} A_{uv} + \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) A_{vv} - \\left ( e_{u}\\cdot e_{v}\\right ) ^{3} A_{uu} + \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) A_{uv} - \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) A_{vu} - \\left ( e_{u}\\cdot e_{v}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) ^{2} A_{uu} + \\left ( e_{u}\\cdot e_{v}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) ^{2} A_{vv} - A_{vu} \\left ( e_{v}\\cdot e_{v}\\right ) ^{3}\\right)}{\\left ( e_{u}\\cdot e_{u}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) ^{2} - 2 \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) + \\left ( e_{u}\\cdot e_{v}\\right ) ^{4}} & \\frac{- \\left ( e_{u}\\cdot e_{u}\\right ) ^{2} \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} A_{uv} + \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) ^{3} A_{uu} - \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) ^{3} A_{vv} - 2 \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) A_{uv} + \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) ^{2} A_{uu} - \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) ^{2} A_{vv} + A_{vu} \\left ( e_{u}\\cdot e_{v}\\right ) ^{4} + \\left ( e_{u}\\cdot e_{v}\\right ) ^{3} \\left ( e_{v}\\cdot e_{v}\\right ) A_{uu} - \\left ( e_{u}\\cdot e_{v}\\right ) ^{3} \\left ( e_{v}\\cdot e_{v}\\right ) A_{vv} - \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) ^{2} A_{uv} + 2 \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) ^{2} A_{vu} + \\left ( e_{u}\\cdot e_{v}\\right ) A_{uu} \\left ( e_{v}\\cdot e_{v}\\right ) ^{3} - \\left ( e_{u}\\cdot e_{v}\\right ) A_{vv} \\left ( e_{v}\\cdot e_{v}\\right ) ^{3} + A_{vu} \\left ( e_{v}\\cdot e_{v}\\right ) ^{4}}{\\left ( e_{u}\\cdot e_{u}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) ^{2} - 2 \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) + \\left ( e_{u}\\cdot e_{v}\\right ) ^{4}}\\\\\\frac{\\left ( e_{u}\\cdot e_{u}\\right ) \\left(A_{uv} \\left ( e_{u}\\cdot e_{u}\\right ) ^{3} - \\left ( e_{u}\\cdot e_{u}\\right ) ^{2} \\left ( e_{u}\\cdot e_{v}\\right ) A_{uu} + \\left ( e_{u}\\cdot e_{u}\\right ) ^{2} \\left ( e_{u}\\cdot e_{v}\\right ) A_{vv} + \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} A_{uv} - \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} A_{vu} - \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) A_{uu} + \\left ( e_{u}\\cdot e_{v}\\right ) ^{3} A_{vv} - \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) A_{vu}\\right) + \\left ( e_{u}\\cdot e_{v}\\right ) \\left(\\left ( e_{u}\\cdot e_{u}\\right ) ^{2} \\left ( e_{u}\\cdot e_{v}\\right ) A_{uv} + \\left ( e_{u}\\cdot e_{u}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) A_{vv} - \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} A_{uu} - \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) A_{vu} + \\left ( e_{u}\\cdot e_{v}\\right ) ^{3} A_{uv} - \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) A_{uu} + \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) A_{vv} - \\left ( e_{u}\\cdot e_{v}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) ^{2} A_{vu}\\right)}{\\left ( e_{u}\\cdot e_{u}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) ^{2} - 2 \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) + \\left ( e_{u}\\cdot e_{v}\\right ) ^{4}} & \\frac{\\left ( e_{u}\\cdot e_{v}\\right ) \\left(A_{uv} \\left ( e_{u}\\cdot e_{u}\\right ) ^{3} - \\left ( e_{u}\\cdot e_{u}\\right ) ^{2} \\left ( e_{u}\\cdot e_{v}\\right ) A_{uu} + \\left ( e_{u}\\cdot e_{u}\\right ) ^{2} \\left ( e_{u}\\cdot e_{v}\\right ) A_{vv} + \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} A_{uv} - \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} A_{vu} - \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) A_{uu} + \\left ( e_{u}\\cdot e_{v}\\right ) ^{3} A_{vv} - \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) A_{vu}\\right) + \\left ( e_{v}\\cdot e_{v}\\right ) \\left(\\left ( e_{u}\\cdot e_{u}\\right ) ^{2} \\left ( e_{u}\\cdot e_{v}\\right ) A_{uv} + \\left ( e_{u}\\cdot e_{u}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) A_{vv} - \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} A_{uu} - \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) A_{vu} + \\left ( e_{u}\\cdot e_{v}\\right ) ^{3} A_{uv} - \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) A_{uu} + \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) A_{vv} - \\left ( e_{u}\\cdot e_{v}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) ^{2} A_{vu}\\right)}{\\left ( e_{u}\\cdot e_{u}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) ^{2} - 2 \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) + \\left ( e_{u}\\cdot e_{v}\\right ) ^{4}}\\end{matrix}\\right] \\end{equation*}\n", + "\\begin{equation*} \\f{\\Tr}{A} = - \\frac{\\left ( e_{u}\\cdot e_{u}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) A_{vv}}{- \\left ( e_{u}\\cdot e_{u}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) ^{2} + 2 \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) - \\left ( e_{u}\\cdot e_{v}\\right ) ^{4}} + \\frac{\\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} A_{vv}}{- \\left ( e_{u}\\cdot e_{u}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) ^{2} + 2 \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) - \\left ( e_{u}\\cdot e_{v}\\right ) ^{4}} + \\frac{\\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) A_{uv}}{- \\left ( e_{u}\\cdot e_{u}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) ^{2} + 2 \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) - \\left ( e_{u}\\cdot e_{v}\\right ) ^{4}} + \\frac{\\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) A_{vu}}{- \\left ( e_{u}\\cdot e_{u}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) ^{2} + 2 \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) - \\left ( e_{u}\\cdot e_{v}\\right ) ^{4}} - \\frac{\\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) ^{2} A_{uu}}{- \\left ( e_{u}\\cdot e_{u}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) ^{2} + 2 \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) - \\left ( e_{u}\\cdot e_{v}\\right ) ^{4}} - \\frac{\\left ( e_{u}\\cdot e_{v}\\right ) ^{3} A_{uv}}{- \\left ( e_{u}\\cdot e_{u}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) ^{2} + 2 \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) - \\left ( e_{u}\\cdot e_{v}\\right ) ^{4}} - \\frac{\\left ( e_{u}\\cdot e_{v}\\right ) ^{3} A_{vu}}{- \\left ( e_{u}\\cdot e_{u}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) ^{2} + 2 \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) - \\left ( e_{u}\\cdot e_{v}\\right ) ^{4}} + \\frac{\\left ( e_{u}\\cdot e_{v}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) A_{uu}}{- \\left ( e_{u}\\cdot e_{u}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) ^{2} + 2 \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) - \\left ( e_{u}\\cdot e_{v}\\right ) ^{4}} \\end{equation*}\n", + "\\begin{equation*} \\f{A}{e_u\\W e_v} = \\frac{A_{uu} A_{vv} - A_{uv} A_{vu}}{\\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) - \\left ( e_{u}\\cdot e_{v}\\right ) ^{2}} \\boldsymbol{e}_{u}\\wedge \\boldsymbol{e}_{v} \\end{equation*}\n", + "\\begin{equation*} \\f{A}{e_u}\\W \\f{A}{e_v} = \\frac{A_{uu} A_{vv} - A_{uv} A_{vu}}{\\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) - \\left ( e_{u}\\cdot e_{v}\\right ) ^{2}} \\boldsymbol{e}_{u}\\wedge \\boldsymbol{e}_{v} \\end{equation*}\n", + "\\begin{equation*} B = \\left \\{ \\begin{array}{ll} L \\left ( \\boldsymbol{e}_{u}\\right ) =& \\frac{- \\left ( e_{u}\\cdot e_{v}\\right ) B_{uv} + \\left ( e_{v}\\cdot e_{v}\\right ) B_{uu}}{\\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) - \\left ( e_{u}\\cdot e_{v}\\right ) ^{2}} \\boldsymbol{e}_{u} + \\frac{- \\left ( e_{u}\\cdot e_{v}\\right ) B_{vv} + \\left ( e_{v}\\cdot e_{v}\\right ) B_{vu}}{\\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) - \\left ( e_{u}\\cdot e_{v}\\right ) ^{2}} \\boldsymbol{e}_{v} \\\\ L \\left ( \\boldsymbol{e}_{v}\\right ) =& \\frac{\\left ( e_{u}\\cdot e_{u}\\right ) B_{uv} - \\left ( e_{u}\\cdot e_{v}\\right ) B_{uu}}{\\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) - \\left ( e_{u}\\cdot e_{v}\\right ) ^{2}} \\boldsymbol{e}_{u} + \\frac{\\left ( e_{u}\\cdot e_{u}\\right ) B_{vv} - \\left ( e_{u}\\cdot e_{v}\\right ) B_{vu}}{\\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) - \\left ( e_{u}\\cdot e_{v}\\right ) ^{2}} \\boldsymbol{e}_{v} \\end{array} \\right \\} \\end{equation*}\n", + "\\begin{equation*} A + B = \\left \\{ \\begin{array}{ll} L \\left ( \\boldsymbol{e}_{u}\\right ) =& \\frac{- \\left ( e_{u}\\cdot e_{v}\\right ) A_{uv} - \\left ( e_{u}\\cdot e_{v}\\right ) B_{uv} + \\left ( e_{v}\\cdot e_{v}\\right ) A_{uu} + \\left ( e_{v}\\cdot e_{v}\\right ) B_{uu}}{\\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) - \\left ( e_{u}\\cdot e_{v}\\right ) ^{2}} \\boldsymbol{e}_{u} + \\frac{- \\left ( e_{u}\\cdot e_{v}\\right ) A_{vv} - \\left ( e_{u}\\cdot e_{v}\\right ) B_{vv} + \\left ( e_{v}\\cdot e_{v}\\right ) A_{vu} + \\left ( e_{v}\\cdot e_{v}\\right ) B_{vu}}{\\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) - \\left ( e_{u}\\cdot e_{v}\\right ) ^{2}} \\boldsymbol{e}_{v} \\\\ L \\left ( \\boldsymbol{e}_{v}\\right ) =& \\frac{\\left ( e_{u}\\cdot e_{u}\\right ) A_{uv} + \\left ( e_{u}\\cdot e_{u}\\right ) B_{uv} - \\left ( e_{u}\\cdot e_{v}\\right ) A_{uu} - \\left ( e_{u}\\cdot e_{v}\\right ) B_{uu}}{\\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) - \\left ( e_{u}\\cdot e_{v}\\right ) ^{2}} \\boldsymbol{e}_{u} + \\frac{\\left ( e_{u}\\cdot e_{u}\\right ) A_{vv} + \\left ( e_{u}\\cdot e_{u}\\right ) B_{vv} - \\left ( e_{u}\\cdot e_{v}\\right ) A_{vu} - \\left ( e_{u}\\cdot e_{v}\\right ) B_{vu}}{\\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) - \\left ( e_{u}\\cdot e_{v}\\right ) ^{2}} \\boldsymbol{e}_{v} \\end{array} \\right \\} \\end{equation*}\n", + "\\begin{equation*} AB = \\left \\{ \\begin{array}{ll} L \\left ( \\boldsymbol{e}_{u}\\right ) =& \\frac{- \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) A_{uv} B_{vv} + \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) A_{uv} B_{vu} + \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} A_{uu} B_{vv} + \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} A_{uv} B_{uv} - \\left ( e_{u}\\cdot e_{v}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) A_{uu} B_{uv} - \\left ( e_{u}\\cdot e_{v}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) A_{uu} B_{vu} - \\left ( e_{u}\\cdot e_{v}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) A_{uv} B_{uu} + \\left ( e_{v}\\cdot e_{v}\\right ) ^{2} A_{uu} B_{uu}}{\\left ( e_{u}\\cdot e_{u}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) ^{2} - 2 \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) + \\left ( e_{u}\\cdot e_{v}\\right ) ^{4}} \\boldsymbol{e}_{u} + \\frac{- \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) A_{vv} B_{vv} + \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) A_{vv} B_{vu} + \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} A_{vu} B_{vv} + \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} A_{vv} B_{uv} - \\left ( e_{u}\\cdot e_{v}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) A_{vu} B_{uv} - \\left ( e_{u}\\cdot e_{v}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) A_{vu} B_{vu} - \\left ( e_{u}\\cdot e_{v}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) A_{vv} B_{uu} + \\left ( e_{v}\\cdot e_{v}\\right ) ^{2} A_{vu} B_{uu}}{\\left ( e_{u}\\cdot e_{u}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) ^{2} - 2 \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) + \\left ( e_{u}\\cdot e_{v}\\right ) ^{4}} \\boldsymbol{e}_{v} \\\\ L \\left ( \\boldsymbol{e}_{v}\\right ) =& \\frac{\\left ( e_{u}\\cdot e_{u}\\right ) ^{2} A_{uv} B_{vv} - \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) A_{uu} B_{vv} - \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) A_{uv} B_{uv} - \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) A_{uv} B_{vu} + \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) A_{uu} B_{uv} + \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} A_{uu} B_{vu} + \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} A_{uv} B_{uu} - \\left ( e_{u}\\cdot e_{v}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) A_{uu} B_{uu}}{\\left ( e_{u}\\cdot e_{u}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) ^{2} - 2 \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) + \\left ( e_{u}\\cdot e_{v}\\right ) ^{4}} \\boldsymbol{e}_{u} + \\frac{\\left ( e_{u}\\cdot e_{u}\\right ) ^{2} A_{vv} B_{vv} - \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) A_{vu} B_{vv} - \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) A_{vv} B_{uv} - \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) A_{vv} B_{vu} + \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) A_{vu} B_{uv} + \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} A_{vu} B_{vu} + \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} A_{vv} B_{uu} - \\left ( e_{u}\\cdot e_{v}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) A_{vu} B_{uu}}{\\left ( e_{u}\\cdot e_{u}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) ^{2} - 2 \\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{u}\\cdot e_{v}\\right ) ^{2} \\left ( e_{v}\\cdot e_{v}\\right ) + \\left ( e_{u}\\cdot e_{v}\\right ) ^{4}} \\boldsymbol{e}_{v} \\end{array} \\right \\} \\end{equation*}\n", + "\\begin{equation*} A - B = \\left \\{ \\begin{array}{ll} L \\left ( \\boldsymbol{e}_{u}\\right ) =& \\frac{- \\left ( e_{u}\\cdot e_{v}\\right ) A_{uv} + \\left ( e_{u}\\cdot e_{v}\\right ) B_{uv} + \\left ( e_{v}\\cdot e_{v}\\right ) A_{uu} - \\left ( e_{v}\\cdot e_{v}\\right ) B_{uu}}{\\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) - \\left ( e_{u}\\cdot e_{v}\\right ) ^{2}} \\boldsymbol{e}_{u} + \\frac{- \\left ( e_{u}\\cdot e_{v}\\right ) A_{vv} + \\left ( e_{u}\\cdot e_{v}\\right ) B_{vv} + \\left ( e_{v}\\cdot e_{v}\\right ) A_{vu} - \\left ( e_{v}\\cdot e_{v}\\right ) B_{vu}}{\\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) - \\left ( e_{u}\\cdot e_{v}\\right ) ^{2}} \\boldsymbol{e}_{v} \\\\ L \\left ( \\boldsymbol{e}_{v}\\right ) =& \\frac{\\left ( e_{u}\\cdot e_{u}\\right ) A_{uv} - \\left ( e_{u}\\cdot e_{u}\\right ) B_{uv} - \\left ( e_{u}\\cdot e_{v}\\right ) A_{uu} + \\left ( e_{u}\\cdot e_{v}\\right ) B_{uu}}{\\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) - \\left ( e_{u}\\cdot e_{v}\\right ) ^{2}} \\boldsymbol{e}_{u} + \\frac{\\left ( e_{u}\\cdot e_{u}\\right ) A_{vv} - \\left ( e_{u}\\cdot e_{u}\\right ) B_{vv} - \\left ( e_{u}\\cdot e_{v}\\right ) A_{vu} + \\left ( e_{u}\\cdot e_{v}\\right ) B_{vu}}{\\left ( e_{u}\\cdot e_{u}\\right ) \\left ( e_{v}\\cdot e_{v}\\right ) - \\left ( e_{u}\\cdot e_{v}\\right ) ^{2}} \\boldsymbol{e}_{v} \\end{array} \\right \\} \\end{equation*}\n", + "\\begin{equation*} a\\cdot \\f{\\overline{A}}{b}-b\\cdot \\f{\\underline{A}}{a} = 0 \\end{equation*}\n", + "\\begin{equation*} g = \\left [ \\begin{array}{cccc} 1 & 0 & 0 & 0 \\\\ 0 & -1 & 0 & 0 \\\\ 0 & 0 & -1 & 0 \\\\ 0 & 0 & 0 & -1 \\end{array}\\right ] \\end{equation*}\n", + "\\begin{equation*} \\underline{T} = \\left \\{ \\begin{array}{ll} L \\left ( \\boldsymbol{e}_{t}\\right ) =& T_{tt} \\boldsymbol{e}_{t} + T_{xt} \\boldsymbol{e}_{x} + T_{yt} \\boldsymbol{e}_{y} + T_{zt} \\boldsymbol{e}_{z} \\\\ L \\left ( \\boldsymbol{e}_{x}\\right ) =& - T_{tx} \\boldsymbol{e}_{t} - T_{xx} \\boldsymbol{e}_{x} - T_{yx} \\boldsymbol{e}_{y} - T_{zx} \\boldsymbol{e}_{z} \\\\ L \\left ( \\boldsymbol{e}_{y}\\right ) =& - T_{ty} \\boldsymbol{e}_{t} - T_{xy} \\boldsymbol{e}_{x} - T_{yy} \\boldsymbol{e}_{y} - T_{zy} \\boldsymbol{e}_{z} \\\\ L \\left ( \\boldsymbol{e}_{z}\\right ) =& - T_{tz} \\boldsymbol{e}_{t} - T_{xz} \\boldsymbol{e}_{x} - T_{yz} \\boldsymbol{e}_{y} - T_{zz} \\boldsymbol{e}_{z} \\end{array} \\right \\} \\end{equation*}\n", + "\\begin{equation*} \\overline{T} = \\left \\{ \\begin{array}{ll} L \\left ( \\boldsymbol{e}_{t}\\right ) =& T_{tt} \\boldsymbol{e}_{t} + T_{tx} \\boldsymbol{e}_{x} + T_{ty} \\boldsymbol{e}_{y} + T_{tz} \\boldsymbol{e}_{z} \\\\ L \\left ( \\boldsymbol{e}_{x}\\right ) =& - T_{xt} \\boldsymbol{e}_{t} - T_{xx} \\boldsymbol{e}_{x} - T_{xy} \\boldsymbol{e}_{y} - T_{xz} \\boldsymbol{e}_{z} \\\\ L \\left ( \\boldsymbol{e}_{y}\\right ) =& - T_{yt} \\boldsymbol{e}_{t} - T_{yx} \\boldsymbol{e}_{x} - T_{yy} \\boldsymbol{e}_{y} - T_{yz} \\boldsymbol{e}_{z} \\\\ L \\left ( \\boldsymbol{e}_{z}\\right ) =& - T_{zt} \\boldsymbol{e}_{t} - T_{zx} \\boldsymbol{e}_{x} - T_{zy} \\boldsymbol{e}_{y} - T_{zz} \\boldsymbol{e}_{z} \\end{array} \\right \\} \\end{equation*}\n", + "\\begin{equation*} \\f{\\det}{\\underline{T}} = T_{tz} \\left(T_{xt} T_{yx} T_{zy} - T_{xt} T_{yy} T_{zx} - T_{xx} T_{yt} T_{zy} + T_{xx} T_{yy} T_{zt} + T_{xy} T_{yt} T_{zx} - T_{xy} T_{yx} T_{zt}\\right) - T_{xz} \\left(T_{tt} T_{yx} T_{zy} - T_{tt} T_{yy} T_{zx} - T_{tx} T_{yt} T_{zy} + T_{tx} T_{yy} T_{zt} + T_{ty} T_{yt} T_{zx} - T_{ty} T_{yx} T_{zt}\\right) + T_{yz} \\left(T_{tt} T_{xx} T_{zy} - T_{tt} T_{xy} T_{zx} - T_{tx} T_{xt} T_{zy} + T_{tx} T_{xy} T_{zt} + T_{ty} T_{xt} T_{zx} - T_{ty} T_{xx} T_{zt}\\right) - T_{zz} \\left(T_{tt} T_{xx} T_{yy} - T_{tt} T_{xy} T_{yx} - T_{tx} T_{xt} T_{yy} + T_{tx} T_{xy} T_{yt} + T_{ty} T_{xt} T_{yx} - T_{ty} T_{xx} T_{yt}\\right) \\end{equation*}\n", + "\\begin{equation*} \\f{\\mbox{tr}}{\\underline{T}} = T_{tt} - T_{xx} - T_{yy} - T_{zz} \\end{equation*}\n", + "\\begin{equation*} a\\cdot \\f{\\overline{T}}{b}-b\\cdot \\f{\\underline{T}}{a} = 0 \\end{equation*}\n", + "\\begin{equation*} f = f \\end{equation*}\n", + "\\begin{equation*} \\boldsymbol{\\nabla} f = \\partial_{u} f \\boldsymbol{e}_{u} + \\frac{\\partial_{v} f }{\\sin{\\left (u \\right )}} \\boldsymbol{e}_{v} \\end{equation*}\n", + "\\begin{equation*} F = F^{u} \\boldsymbol{e}_{u} + F^{v} \\boldsymbol{e}_{v} \\end{equation*}\n", + "\\begin{equation*} \\boldsymbol{\\nabla} F = \\left ( \\frac{F^{u} }{\\tan{\\left (u \\right )}} + \\partial_{u} F^{u} + \\frac{\\partial_{v} F^{v} }{\\sin{\\left (u \\right )}}\\right ) + \\left ( \\frac{F^{v} }{\\tan{\\left (u \\right )}} + \\partial_{u} F^{v} - \\frac{\\partial_{v} F^{u} }{\\sin{\\left (u \\right )}}\\right ) \\boldsymbol{e}_{u}\\wedge \\boldsymbol{e}_{v} \\end{equation*}\n", + "\\begin{equation*} f = f \\end{equation*}\n", + "\\begin{equation*} \\boldsymbol{\\nabla} f = \\partial_{\\theta } f \\boldsymbol{e}_{\\theta } + \\frac{\\partial_{\\phi } f }{\\sin{\\left (\\theta \\right )}} \\boldsymbol{e}_{\\phi } \\end{equation*}\n", + "\\begin{equation*} F = F^{\\theta } \\boldsymbol{e}_{\\theta } + F^{\\phi } \\boldsymbol{e}_{\\phi } \\end{equation*}\n", + "\\begin{equation*} \\boldsymbol{\\nabla} F = \\left ( \\frac{F^{\\theta } }{\\tan{\\left (\\theta \\right )}} + \\partial_{\\theta } F^{\\theta } + \\frac{\\partial_{\\phi } F^{\\phi } }{\\sin{\\left (\\theta \\right )}}\\right ) + \\left ( \\frac{F^{\\phi } }{\\tan{\\left (\\theta \\right )}} + \\partial_{\\theta } F^{\\phi } - \\frac{\\partial_{\\phi } F^{\\theta } }{\\sin{\\left (\\theta \\right )}}\\right ) \\boldsymbol{e}_{\\theta }\\wedge \\boldsymbol{e}_{\\phi } \\end{equation*}\n", + "\\end{document}\n" + ] + }, + "metadata": {}, + "output_type": "display_data" } ], "source": [ - "!cat lin_tran_check.tex" - ] - }, - { - "cell_type": "code", - "execution_count": 24, - "metadata": {}, - "outputs": [], - "source": [ - "!python linear_EM_waves.py" + "check('lin_tran_check')" ] }, { "cell_type": "code", - "execution_count": 25, + "execution_count": 13, "metadata": {}, "outputs": [ { - "name": "stdout", - "output_type": "stream", - "text": [ - "\r\n", - "\\documentclass[10pt,fleqn]{report}\r\n", - "\\usepackage[vcentering]{geometry}\r\n", - "\\geometry{papersize={14in,11in},total={13in,10in}}\r\n", - "\r\n", - "\\pagestyle{empty}\r\n", - "\\usepackage[latin1]{inputenc}\r\n", - "\\usepackage{amsmath}\r\n", - "\\usepackage{amsfonts}\r\n", - "\\usepackage{amssymb}\r\n", - "\\usepackage{amsbsy}\r\n", - "\\usepackage{tensor}\r\n", - "\\usepackage{listings}\r\n", - "\\usepackage{color}\r\n", - "\\usepackage{xcolor}\r\n", - "\\usepackage{bm}\r\n", - "\\usepackage{breqn}\r\n", - "\\definecolor{gray}{rgb}{0.95,0.95,0.95}\r\n", - "\\setlength{\\parindent}{0pt}\r\n", - "\\DeclareMathOperator{\\Tr}{Tr}\r\n", - "\\DeclareMathOperator{\\Adj}{Adj}\r\n", - "\\newcommand{\\bfrac}[2]{\\displaystyle\\frac{#1}{#2}}\r\n", - "\\newcommand{\\lp}{\\left (}\r\n", - "\\newcommand{\\rp}{\\right )}\r\n", - "\\newcommand{\\paren}[1]{\\lp {#1} \\rp}\r\n", - "\\newcommand{\\half}{\\frac{1}{2}}\r\n", - "\\newcommand{\\llt}{\\left <}\r\n", - "\\newcommand{\\rgt}{\\right >}\r\n", - "\\newcommand{\\abs}[1]{\\left |{#1}\\right | }\r\n", - "\\newcommand{\\pdiff}[2]{\\bfrac{\\partial {#1}}{\\partial {#2}}}\r\n", - "\\newcommand{\\lbrc}{\\left \\{}\r\n", - "\\newcommand{\\rbrc}{\\right \\}}\r\n", - "\\newcommand{\\W}{\\wedge}\r\n", - "\\newcommand{\\prm}[1]{{#1}'}\r\n", - "\\newcommand{\\ddt}[1]{\\bfrac{d{#1}}{dt}}\r\n", - "\\newcommand{\\R}{\\dagger}\r\n", - "\\newcommand{\\deriv}[3]{\\bfrac{d^{#3}#1}{d{#2}^{#3}}}\r\n", - "\\newcommand{\\grade}[1]{\\left < {#1} \\right >}\r\n", - "\\newcommand{\\f}[2]{{#1}\\lp{#2}\\rp}\r\n", - "\\newcommand{\\eval}[2]{\\left . {#1} \\right |_{#2}}\r\n", - "\\newcommand{\\Nabla}{\\boldsymbol{\\nabla}}\r\n", - "\\newcommand{\\eb}{\\boldsymbol{e}}\r\n", - "\\usepackage{float}\r\n", - "\\floatstyle{plain} % optionally change the style of the new float\r\n", - "\\newfloat{Code}{H}{myc}\r\n", - "\\lstloadlanguages{Python}\r\n", - "\r\n", - "\\begin{document}\r\n", - "\\begin{equation*} g = \\left [ \\begin{array}{cccc} 1 & \\left ( e_{E}\\cdot e_{B}\\right ) & \\left ( e_{E}\\cdot e_{k}\\right ) & 0 \\\\ \\left ( e_{E}\\cdot e_{B}\\right ) & 1 & \\left ( e_{B}\\cdot e_{k}\\right ) & 0 \\\\ \\left ( e_{E}\\cdot e_{k}\\right ) & \\left ( e_{B}\\cdot e_{k}\\right ) & 1 & 0 \\\\ 0 & 0 & 0 & -1 \\end{array}\\right ] \\end{equation*}\r\n", - "\\begin{equation*} X = x_{E} \\boldsymbol{e}_{E} + x_{B} \\boldsymbol{e}_{B} + x_{k} \\boldsymbol{e}_{k} + t \\boldsymbol{e}_{t} \\end{equation*}\r\n", - "\\begin{equation*} K = k \\boldsymbol{e}_{k} + \\omega \\boldsymbol{e}_{t} \\end{equation*}\r\n", - "\\begin{equation*} K\\cdot X = \\left ( e_{B}\\cdot e_{k}\\right ) k x_{B} + \\left ( e_{E}\\cdot e_{k}\\right ) k x_{E} - \\omega t + k x_{k} \\end{equation*}\r\n", - "\\begin{equation*} F = \\frac{\\left ( e_{B}\\cdot e_{k}\\right ) B e^{i \\left(\\left ( e_{B}\\cdot e_{k}\\right ) k x_{B} + \\left ( e_{E}\\cdot e_{k}\\right ) k x_{E} - \\omega t + k x_{k}\\right)}}{\\sqrt{- \\left ( e_{B}\\cdot e_{k}\\right ) ^{2} + 2 \\left ( e_{B}\\cdot e_{k}\\right ) \\left ( e_{E}\\cdot e_{B}\\right ) \\left ( e_{E}\\cdot e_{k}\\right ) - \\left ( e_{E}\\cdot e_{B}\\right ) ^{2} - \\left ( e_{E}\\cdot e_{k}\\right ) ^{2} + 1}} \\boldsymbol{e}_{E}\\wedge \\boldsymbol{e}_{B} - \\frac{B e^{i \\left(\\left ( e_{B}\\cdot e_{k}\\right ) k x_{B} + \\left ( e_{E}\\cdot e_{k}\\right ) k x_{E} - \\omega t + k x_{k}\\right)}}{\\sqrt{- \\left ( e_{B}\\cdot e_{k}\\right ) ^{2} + 2 \\left ( e_{B}\\cdot e_{k}\\right ) \\left ( e_{E}\\cdot e_{B}\\right ) \\left ( e_{E}\\cdot e_{k}\\right ) - \\left ( e_{E}\\cdot e_{B}\\right ) ^{2} - \\left ( e_{E}\\cdot e_{k}\\right ) ^{2} + 1}} \\boldsymbol{e}_{E}\\wedge \\boldsymbol{e}_{k} + E e^{i \\left(\\left ( e_{B}\\cdot e_{k}\\right ) k x_{B} + \\left ( e_{E}\\cdot e_{k}\\right ) k x_{E} - \\omega t + k x_{k}\\right)} \\boldsymbol{e}_{E}\\wedge \\boldsymbol{e}_{t} + \\frac{\\left ( e_{E}\\cdot e_{B}\\right ) B e^{i \\left(\\left ( e_{B}\\cdot e_{k}\\right ) k x_{B} + \\left ( e_{E}\\cdot e_{k}\\right ) k x_{E} - \\omega t + k x_{k}\\right)}}{\\sqrt{- \\left ( e_{B}\\cdot e_{k}\\right ) ^{2} + 2 \\left ( e_{B}\\cdot e_{k}\\right ) \\left ( e_{E}\\cdot e_{B}\\right ) \\left ( e_{E}\\cdot e_{k}\\right ) - \\left ( e_{E}\\cdot e_{B}\\right ) ^{2} - \\left ( e_{E}\\cdot e_{k}\\right ) ^{2} + 1}} \\boldsymbol{e}_{B}\\wedge \\boldsymbol{e}_{k} \\end{equation*}\r\n", - "\\begin{equation*} \\mbox{Substituting }e_{E}\\cdot e_{B} = e_{E}\\cdot e_{k} = e_{B}\\cdot e_{k} = 0 \\end{equation*}\r\n", - "\\begin{equation*} g = \\left [ \\begin{array}{cccc} 1 & \\left ( e_{E}\\cdot e_{B}\\right ) & \\left ( e_{E}\\cdot e_{k}\\right ) & 0 \\\\ \\left ( e_{E}\\cdot e_{B}\\right ) & 1 & \\left ( e_{B}\\cdot e_{k}\\right ) & 0 \\\\ \\left ( e_{E}\\cdot e_{k}\\right ) & \\left ( e_{B}\\cdot e_{k}\\right ) & 1 & 0 \\\\ 0 & 0 & 0 & -1 \\end{array}\\right ] \\end{equation*}\r\n", - " \\begin{align*} X = & x_{E} \\boldsymbol{e}_{E} \\\\ & + x_{B} \\boldsymbol{e}_{B} \\\\ & + x_{k} \\boldsymbol{e}_{k} \\\\ & + t \\boldsymbol{e}_{t} \\end{align*} \r\n", - " \\begin{align*} K = & k \\boldsymbol{e}_{k} \\\\ & + \\omega \\boldsymbol{e}_{t} \\end{align*} \r\n", - "\\begin{equation*} K\\cdot X = \\left ( e_{B}\\cdot e_{k}\\right ) k x_{B} + \\left ( e_{E}\\cdot e_{k}\\right ) k x_{E} - \\omega t + k x_{k} \\end{equation*}\r\n", - "\\begin{equation*} \\mbox{Substituting }e_{E}\\cdot e_{B} = e_{E}\\cdot e_{k} = e_{B}\\cdot e_{k} = 0 \\end{equation*}\r\n", - "\\end{document}\r\n" - ] + "data": { + "text/plain": [ + "\n", + "\\documentclass[10pt,fleqn]{report}\n", + "\\usepackage[vcentering]{geometry}\n", + "\\geometry{papersize={14in,11in},total={13in,10in}}\n", + "\n", + "\\pagestyle{empty}\n", + "\\usepackage[latin1]{inputenc}\n", + "\\usepackage{amsmath}\n", + "\\usepackage{amsfonts}\n", + "\\usepackage{amssymb}\n", + "\\usepackage{amsbsy}\n", + "\\usepackage{tensor}\n", + "\\usepackage{listings}\n", + "\\usepackage{color}\n", + "\\usepackage{xcolor}\n", + "\\usepackage{bm}\n", + "\\usepackage{breqn}\n", + "\\definecolor{gray}{rgb}{0.95,0.95,0.95}\n", + "\\setlength{\\parindent}{0pt}\n", + "\\DeclareMathOperator{\\Tr}{Tr}\n", + "\\DeclareMathOperator{\\Adj}{Adj}\n", + "\\newcommand{\\bfrac}[2]{\\displaystyle\\frac{#1}{#2}}\n", + "\\newcommand{\\lp}{\\left (}\n", + "\\newcommand{\\rp}{\\right )}\n", + "\\newcommand{\\paren}[1]{\\lp {#1} \\rp}\n", + "\\newcommand{\\half}{\\frac{1}{2}}\n", + "\\newcommand{\\llt}{\\left <}\n", + "\\newcommand{\\rgt}{\\right >}\n", + "\\newcommand{\\abs}[1]{\\left |{#1}\\right | }\n", + "\\newcommand{\\pdiff}[2]{\\bfrac{\\partial {#1}}{\\partial {#2}}}\n", + "\\newcommand{\\lbrc}{\\left \\{}\n", + "\\newcommand{\\rbrc}{\\right \\}}\n", + "\\newcommand{\\W}{\\wedge}\n", + "\\newcommand{\\prm}[1]{{#1}'}\n", + "\\newcommand{\\ddt}[1]{\\bfrac{d{#1}}{dt}}\n", + "\\newcommand{\\R}{\\dagger}\n", + "\\newcommand{\\deriv}[3]{\\bfrac{d^{#3}#1}{d{#2}^{#3}}}\n", + "\\newcommand{\\grade}[1]{\\left < {#1} \\right >}\n", + "\\newcommand{\\f}[2]{{#1}\\lp{#2}\\rp}\n", + "\\newcommand{\\eval}[2]{\\left . {#1} \\right |_{#2}}\n", + "\\newcommand{\\Nabla}{\\boldsymbol{\\nabla}}\n", + "\\newcommand{\\eb}{\\boldsymbol{e}}\n", + "\\usepackage{float}\n", + "\\floatstyle{plain} % optionally change the style of the new float\n", + "\\newfloat{Code}{H}{myc}\n", + "\\lstloadlanguages{Python}\n", + "\n", + "\\begin{document}\n", + "\\begin{equation*} g = \\left [ \\begin{array}{cccc} 1 & \\left ( e_{E}\\cdot e_{B}\\right ) & \\left ( e_{E}\\cdot e_{k}\\right ) & 0 \\\\ \\left ( e_{E}\\cdot e_{B}\\right ) & 1 & \\left ( e_{B}\\cdot e_{k}\\right ) & 0 \\\\ \\left ( e_{E}\\cdot e_{k}\\right ) & \\left ( e_{B}\\cdot e_{k}\\right ) & 1 & 0 \\\\ 0 & 0 & 0 & -1 \\end{array}\\right ] \\end{equation*}\n", + "\\begin{equation*} X = x_{E} \\boldsymbol{e}_{E} + x_{B} \\boldsymbol{e}_{B} + x_{k} \\boldsymbol{e}_{k} + t \\boldsymbol{e}_{t} \\end{equation*}\n", + "\\begin{equation*} K = k \\boldsymbol{e}_{k} + \\omega \\boldsymbol{e}_{t} \\end{equation*}\n", + "\\begin{equation*} K\\cdot X = \\left ( e_{B}\\cdot e_{k}\\right ) k x_{B} + \\left ( e_{E}\\cdot e_{k}\\right ) k x_{E} - \\omega t + k x_{k} \\end{equation*}\n", + "\\begin{equation*} F = \\frac{\\left ( e_{B}\\cdot e_{k}\\right ) B e^{i \\left(\\left ( e_{B}\\cdot e_{k}\\right ) k x_{B} + \\left ( e_{E}\\cdot e_{k}\\right ) k x_{E} - \\omega t + k x_{k}\\right)}}{\\sqrt{- \\left ( e_{B}\\cdot e_{k}\\right ) ^{2} + 2 \\left ( e_{B}\\cdot e_{k}\\right ) \\left ( e_{E}\\cdot e_{B}\\right ) \\left ( e_{E}\\cdot e_{k}\\right ) - \\left ( e_{E}\\cdot e_{B}\\right ) ^{2} - \\left ( e_{E}\\cdot e_{k}\\right ) ^{2} + 1}} \\boldsymbol{e}_{E}\\wedge \\boldsymbol{e}_{B} - \\frac{B e^{i \\left(\\left ( e_{B}\\cdot e_{k}\\right ) k x_{B} + \\left ( e_{E}\\cdot e_{k}\\right ) k x_{E} - \\omega t + k x_{k}\\right)}}{\\sqrt{- \\left ( e_{B}\\cdot e_{k}\\right ) ^{2} + 2 \\left ( e_{B}\\cdot e_{k}\\right ) \\left ( e_{E}\\cdot e_{B}\\right ) \\left ( e_{E}\\cdot e_{k}\\right ) - \\left ( e_{E}\\cdot e_{B}\\right ) ^{2} - \\left ( e_{E}\\cdot e_{k}\\right ) ^{2} + 1}} \\boldsymbol{e}_{E}\\wedge \\boldsymbol{e}_{k} + E e^{i \\left(\\left ( e_{B}\\cdot e_{k}\\right ) k x_{B} + \\left ( e_{E}\\cdot e_{k}\\right ) k x_{E} - \\omega t + k x_{k}\\right)} \\boldsymbol{e}_{E}\\wedge \\boldsymbol{e}_{t} + \\frac{\\left ( e_{E}\\cdot e_{B}\\right ) B e^{i \\left(\\left ( e_{B}\\cdot e_{k}\\right ) k x_{B} + \\left ( e_{E}\\cdot e_{k}\\right ) k x_{E} - \\omega t + k x_{k}\\right)}}{\\sqrt{- \\left ( e_{B}\\cdot e_{k}\\right ) ^{2} + 2 \\left ( e_{B}\\cdot e_{k}\\right ) \\left ( e_{E}\\cdot e_{B}\\right ) \\left ( e_{E}\\cdot e_{k}\\right ) - \\left ( e_{E}\\cdot e_{B}\\right ) ^{2} - \\left ( e_{E}\\cdot e_{k}\\right ) ^{2} + 1}} \\boldsymbol{e}_{B}\\wedge \\boldsymbol{e}_{k} \\end{equation*}\n", + "\\begin{equation*} \\mbox{Substituting }e_{E}\\cdot e_{B} = e_{E}\\cdot e_{k} = e_{B}\\cdot e_{k} = 0 \\end{equation*}\n", + "\\begin{equation*} g = \\left [ \\begin{array}{cccc} 1 & \\left ( e_{E}\\cdot e_{B}\\right ) & \\left ( e_{E}\\cdot e_{k}\\right ) & 0 \\\\ \\left ( e_{E}\\cdot e_{B}\\right ) & 1 & \\left ( e_{B}\\cdot e_{k}\\right ) & 0 \\\\ \\left ( e_{E}\\cdot e_{k}\\right ) & \\left ( e_{B}\\cdot e_{k}\\right ) & 1 & 0 \\\\ 0 & 0 & 0 & -1 \\end{array}\\right ] \\end{equation*}\n", + " \\begin{align*} X = & x_{E} \\boldsymbol{e}_{E} \\\\ & + x_{B} \\boldsymbol{e}_{B} \\\\ & + x_{k} \\boldsymbol{e}_{k} \\\\ & + t \\boldsymbol{e}_{t} \\end{align*} \n", + " \\begin{align*} K = & k \\boldsymbol{e}_{k} \\\\ & + \\omega \\boldsymbol{e}_{t} \\end{align*} \n", + "\\begin{equation*} K\\cdot X = \\left ( e_{B}\\cdot e_{k}\\right ) k x_{B} + \\left ( e_{E}\\cdot e_{k}\\right ) k x_{E} - \\omega t + k x_{k} \\end{equation*}\n", + "\\begin{equation*} \\mbox{Substituting }e_{E}\\cdot e_{B} = e_{E}\\cdot e_{k} = e_{B}\\cdot e_{k} = 0 \\end{equation*}\n", + "\\end{document}\n" + ] + }, + "metadata": {}, + "output_type": "display_data" } ], "source": [ - "!cat linear_EM_waves.tex" - ] - }, - { - "cell_type": "code", - "execution_count": 26, - "metadata": {}, - "outputs": [], - "source": [ - "!python manifold.py" + "check('linear_EM_waves')" ] }, { "cell_type": "code", - "execution_count": 27, + "execution_count": 14, "metadata": {}, "outputs": [ { - "name": "stdout", - "output_type": "stream", - "text": [ - "\r\n", - "\\documentclass[10pt,fleqn]{report}\r\n", - "\\usepackage[vcentering]{geometry}\r\n", - "\\geometry{papersize={14in,11in},total={13in,10in}}\r\n", - "\r\n", - "\\pagestyle{empty}\r\n", - "\\usepackage[latin1]{inputenc}\r\n", - "\\usepackage{amsmath}\r\n", - "\\usepackage{amsfonts}\r\n", - "\\usepackage{amssymb}\r\n", - "\\usepackage{amsbsy}\r\n", - "\\usepackage{tensor}\r\n", - "\\usepackage{listings}\r\n", - "\\usepackage{color}\r\n", - "\\usepackage{xcolor}\r\n", - "\\usepackage{bm}\r\n", - "\\usepackage{breqn}\r\n", - "\\definecolor{gray}{rgb}{0.95,0.95,0.95}\r\n", - "\\setlength{\\parindent}{0pt}\r\n", - "\\DeclareMathOperator{\\Tr}{Tr}\r\n", - "\\DeclareMathOperator{\\Adj}{Adj}\r\n", - "\\newcommand{\\bfrac}[2]{\\displaystyle\\frac{#1}{#2}}\r\n", - "\\newcommand{\\lp}{\\left (}\r\n", - "\\newcommand{\\rp}{\\right )}\r\n", - "\\newcommand{\\paren}[1]{\\lp {#1} \\rp}\r\n", - "\\newcommand{\\half}{\\frac{1}{2}}\r\n", - "\\newcommand{\\llt}{\\left <}\r\n", - "\\newcommand{\\rgt}{\\right >}\r\n", - "\\newcommand{\\abs}[1]{\\left |{#1}\\right | }\r\n", - "\\newcommand{\\pdiff}[2]{\\bfrac{\\partial {#1}}{\\partial {#2}}}\r\n", - "\\newcommand{\\lbrc}{\\left \\{}\r\n", - "\\newcommand{\\rbrc}{\\right \\}}\r\n", - "\\newcommand{\\W}{\\wedge}\r\n", - "\\newcommand{\\prm}[1]{{#1}'}\r\n", - "\\newcommand{\\ddt}[1]{\\bfrac{d{#1}}{dt}}\r\n", - "\\newcommand{\\R}{\\dagger}\r\n", - "\\newcommand{\\deriv}[3]{\\bfrac{d^{#3}#1}{d{#2}^{#3}}}\r\n", - "\\newcommand{\\grade}[1]{\\left < {#1} \\right >}\r\n", - "\\newcommand{\\f}[2]{{#1}\\lp{#2}\\rp}\r\n", - "\\newcommand{\\eval}[2]{\\left . {#1} \\right |_{#2}}\r\n", - "\\newcommand{\\Nabla}{\\boldsymbol{\\nabla}}\r\n", - "\\newcommand{\\eb}{\\boldsymbol{e}}\r\n", - "\\usepackage{float}\r\n", - "\\floatstyle{plain} % optionally change the style of the new float\r\n", - "\\newfloat{Code}{H}{myc}\r\n", - "\\lstloadlanguages{Python}\r\n", - "\r\n", - "\\begin{document}\r\n", - "\\begin{equation*} (u,v)\\rightarrow (r,\\theta,\\phi) = [1, u, v] \\end{equation*}\r\n", - "Unit Sphere Manifold:\r\n", - "\\begin{equation*} g = \\left [ \\begin{array}{cc} 1 & 0 \\\\ 0 & {\\sin{\\left (u \\right )}}^{2} \\end{array}\\right ] \\end{equation*}\r\n", - "\\begin{equation*} a = a^{u} \\boldsymbol{e}_{u} + a^{v} \\boldsymbol{e}_{v} \\end{equation*}\r\n", - "\\begin{equation*} f = f^{u} \\boldsymbol{e}_{u} + f^{v} \\boldsymbol{e}_{v} \\end{equation*}\r\n", - "\\begin{equation*} \\nabla = \\boldsymbol{e}_{u} \\frac{\\partial}{\\partial u} + \\boldsymbol{e}_{v} \\frac{1}{{\\sin{\\left (u \\right )}}^{2}} \\frac{\\partial}{\\partial v} \\end{equation*}\r\n", - "\\begin{equation*} a\\cdot\\nabla = a^{u} \\frac{\\partial}{\\partial u} + a^{v} \\frac{\\partial}{\\partial v} \\end{equation*}\r\n", - "\\begin{equation*} \\paren{a\\cdot\\nabla}\\bm{e}_u = \\frac{a^{v}}{\\tan{\\left (u \\right )}} \\boldsymbol{e}_{v} \\end{equation*}\r\n", - "\\begin{equation*} \\paren{a\\cdot\\nabla}\\bm{e}_v = - \\frac{a^{v} \\sin{\\left (2 u \\right )}}{2} \\boldsymbol{e}_{u} + \\frac{a^{u}}{\\tan{\\left (u \\right )}} \\boldsymbol{e}_{v} \\end{equation*}\r\n", - "\\begin{equation*} \\paren{a\\cdot\\nabla}f = \\left ( a^{u} \\partial_{u} f^{u} - \\frac{a^{v} f^{v} \\sin{\\left (2 u \\right )}}{2} + a^{v} \\partial_{v} f^{u} \\right ) \\boldsymbol{e}_{u} + \\left ( \\frac{a^{u} f^{v} }{\\tan{\\left (u \\right )}} + a^{u} \\partial_{u} f^{v} + \\frac{a^{v} f^{u} }{\\tan{\\left (u \\right )}} + a^{v} \\partial_{v} f^{v} \\right ) \\boldsymbol{e}_{v} \\end{equation*}\r\n", - "\\begin{equation*} \\nabla f = \\left ( \\frac{f^{u} }{\\tan{\\left (u \\right )}} + \\partial_{u} f^{u} + \\partial_{v} f^{v} \\right ) + \\left ( \\frac{2 f^{v} }{\\tan{\\left (u \\right )}} + \\partial_{u} f^{v} - \\frac{\\partial_{v} f^{u} }{{\\sin{\\left (u \\right )}}^{2}}\\right ) \\boldsymbol{e}_{u}\\wedge \\boldsymbol{e}_{v} \\end{equation*}\r\n", - "1-D Manifold On Unit Sphere:\r\n", - "\\begin{equation*} \\nabla = \\boldsymbol{e}_{s} \\frac{1}{{\\sin{\\left (u^{s} \\right )}}^{2} \\left(\\partial_{s} v^{s} \\right)^{2} + \\left(\\partial_{s} u^{s} \\right)^{2}} \\frac{\\partial}{\\partial s} \\end{equation*}\r\n", - "\\begin{equation*} \\nabla g = \\frac{\\partial_{s} g }{{\\sin{\\left (u^{s} \\right )}}^{2} \\left(\\partial_{s} v^{s} \\right)^{2} + \\left(\\partial_{s} u^{s} \\right)^{2}} \\boldsymbol{e}_{s} \\end{equation*}\r\n", - "\\begin{equation*} \\nabla \\cdot \\bm{h} = \\frac{\\left({\\sin{\\left (u^{s} \\right )}}^{2} \\left(\\partial_{s} v^{s} \\right)^{2} + \\left(\\partial_{s} u^{s} \\right)^{2}\\right) \\partial_{s} h^{s} + \\left({\\sin{\\left (u^{s} \\right )}}^{2} \\partial_{s} v^{s} \\partial^{2}_{s} v^{s} + \\partial_{s} u^{s} \\partial^{2}_{s} u^{s} \\right) h^{s} + \\frac{h^{s} \\sin{\\left (2 u^{s} \\right )} \\partial_{s} u^{s} \\left(\\partial_{s} v^{s} \\right)^{2}}{2}}{{\\sin{\\left (u^{s} \\right )}}^{2} \\left(\\partial_{s} v^{s} \\right)^{2} + \\left(\\partial_{s} u^{s} \\right)^{2}} \\end{equation*}\r\n", - "\\end{document}\r\n" - ] + "data": { + "text/plain": [ + "\n", + "\\documentclass[10pt,fleqn]{report}\n", + "\\usepackage[vcentering]{geometry}\n", + "\\geometry{papersize={14in,11in},total={13in,10in}}\n", + "\n", + "\\pagestyle{empty}\n", + "\\usepackage[latin1]{inputenc}\n", + "\\usepackage{amsmath}\n", + "\\usepackage{amsfonts}\n", + "\\usepackage{amssymb}\n", + "\\usepackage{amsbsy}\n", + "\\usepackage{tensor}\n", + "\\usepackage{listings}\n", + "\\usepackage{color}\n", + "\\usepackage{xcolor}\n", + "\\usepackage{bm}\n", + "\\usepackage{breqn}\n", + "\\definecolor{gray}{rgb}{0.95,0.95,0.95}\n", + "\\setlength{\\parindent}{0pt}\n", + "\\DeclareMathOperator{\\Tr}{Tr}\n", + "\\DeclareMathOperator{\\Adj}{Adj}\n", + "\\newcommand{\\bfrac}[2]{\\displaystyle\\frac{#1}{#2}}\n", + "\\newcommand{\\lp}{\\left (}\n", + "\\newcommand{\\rp}{\\right )}\n", + "\\newcommand{\\paren}[1]{\\lp {#1} \\rp}\n", + "\\newcommand{\\half}{\\frac{1}{2}}\n", + "\\newcommand{\\llt}{\\left <}\n", + "\\newcommand{\\rgt}{\\right >}\n", + "\\newcommand{\\abs}[1]{\\left |{#1}\\right | }\n", + "\\newcommand{\\pdiff}[2]{\\bfrac{\\partial {#1}}{\\partial {#2}}}\n", + "\\newcommand{\\lbrc}{\\left \\{}\n", + "\\newcommand{\\rbrc}{\\right \\}}\n", + "\\newcommand{\\W}{\\wedge}\n", + "\\newcommand{\\prm}[1]{{#1}'}\n", + "\\newcommand{\\ddt}[1]{\\bfrac{d{#1}}{dt}}\n", + "\\newcommand{\\R}{\\dagger}\n", + "\\newcommand{\\deriv}[3]{\\bfrac{d^{#3}#1}{d{#2}^{#3}}}\n", + "\\newcommand{\\grade}[1]{\\left < {#1} \\right >}\n", + "\\newcommand{\\f}[2]{{#1}\\lp{#2}\\rp}\n", + "\\newcommand{\\eval}[2]{\\left . {#1} \\right |_{#2}}\n", + "\\newcommand{\\Nabla}{\\boldsymbol{\\nabla}}\n", + "\\newcommand{\\eb}{\\boldsymbol{e}}\n", + "\\usepackage{float}\n", + "\\floatstyle{plain} % optionally change the style of the new float\n", + "\\newfloat{Code}{H}{myc}\n", + "\\lstloadlanguages{Python}\n", + "\n", + "\\begin{document}\n", + "\\begin{equation*} (u,v)\\rightarrow (r,\\theta,\\phi) = [1, u, v] \\end{equation*}\n", + "Unit Sphere Manifold:\n", + "\\begin{equation*} g = \\left [ \\begin{array}{cc} 1 & 0 \\\\ 0 & {\\sin{\\left (u \\right )}}^{2} \\end{array}\\right ] \\end{equation*}\n", + "\\begin{equation*} a = a^{u} \\boldsymbol{e}_{u} + a^{v} \\boldsymbol{e}_{v} \\end{equation*}\n", + "\\begin{equation*} f = f^{u} \\boldsymbol{e}_{u} + f^{v} \\boldsymbol{e}_{v} \\end{equation*}\n", + "\\begin{equation*} \\nabla = \\boldsymbol{e}_{u} \\frac{\\partial}{\\partial u} + \\boldsymbol{e}_{v} \\frac{1}{{\\sin{\\left (u \\right )}}^{2}} \\frac{\\partial}{\\partial v} \\end{equation*}\n", + "\\begin{equation*} a\\cdot\\nabla = a^{u} \\frac{\\partial}{\\partial u} + a^{v} \\frac{\\partial}{\\partial v} \\end{equation*}\n", + "\\begin{equation*} \\paren{a\\cdot\\nabla}\\bm{e}_u = \\frac{a^{v}}{\\tan{\\left (u \\right )}} \\boldsymbol{e}_{v} \\end{equation*}\n", + "\\begin{equation*} \\paren{a\\cdot\\nabla}\\bm{e}_v = - \\frac{a^{v} \\sin{\\left (2 u \\right )}}{2} \\boldsymbol{e}_{u} + \\frac{a^{u}}{\\tan{\\left (u \\right )}} \\boldsymbol{e}_{v} \\end{equation*}\n", + "\\begin{equation*} \\paren{a\\cdot\\nabla}f = \\left ( a^{u} \\partial_{u} f^{u} - \\frac{a^{v} f^{v} \\sin{\\left (2 u \\right )}}{2} + a^{v} \\partial_{v} f^{u} \\right ) \\boldsymbol{e}_{u} + \\left ( \\frac{a^{u} f^{v} }{\\tan{\\left (u \\right )}} + a^{u} \\partial_{u} f^{v} + \\frac{a^{v} f^{u} }{\\tan{\\left (u \\right )}} + a^{v} \\partial_{v} f^{v} \\right ) \\boldsymbol{e}_{v} \\end{equation*}\n", + "\\begin{equation*} \\nabla f = \\left ( \\frac{f^{u} }{\\tan{\\left (u \\right )}} + \\partial_{u} f^{u} + \\partial_{v} f^{v} \\right ) + \\left ( \\frac{2 f^{v} }{\\tan{\\left (u \\right )}} + \\partial_{u} f^{v} - \\frac{\\partial_{v} f^{u} }{{\\sin{\\left (u \\right )}}^{2}}\\right ) \\boldsymbol{e}_{u}\\wedge \\boldsymbol{e}_{v} \\end{equation*}\n", + "1-D Manifold On Unit Sphere:\n", + "\\begin{equation*} \\nabla = \\boldsymbol{e}_{s} \\frac{1}{{\\sin{\\left (u^{s} \\right )}}^{2} \\left(\\partial_{s} v^{s} \\right)^{2} + \\left(\\partial_{s} u^{s} \\right)^{2}} \\frac{\\partial}{\\partial s} \\end{equation*}\n", + "\\begin{equation*} \\nabla g = \\frac{\\partial_{s} g }{{\\sin{\\left (u^{s} \\right )}}^{2} \\left(\\partial_{s} v^{s} \\right)^{2} + \\left(\\partial_{s} u^{s} \\right)^{2}} \\boldsymbol{e}_{s} \\end{equation*}\n", + "\\begin{equation*} \\nabla \\cdot \\bm{h} = \\frac{\\left({\\sin{\\left (u^{s} \\right )}}^{2} \\left(\\partial_{s} v^{s} \\right)^{2} + \\left(\\partial_{s} u^{s} \\right)^{2}\\right) \\partial_{s} h^{s} + \\left({\\sin{\\left (u^{s} \\right )}}^{2} \\partial_{s} v^{s} \\partial^{2}_{s} v^{s} + \\partial_{s} u^{s} \\partial^{2}_{s} u^{s} \\right) h^{s} + \\frac{h^{s} \\sin{\\left (2 u^{s} \\right )} \\partial_{s} u^{s} \\left(\\partial_{s} v^{s} \\right)^{2}}{2}}{{\\sin{\\left (u^{s} \\right )}}^{2} \\left(\\partial_{s} v^{s} \\right)^{2} + \\left(\\partial_{s} u^{s} \\right)^{2}} \\end{equation*}\n", + "\\end{document}\n" + ] + }, + "metadata": {}, + "output_type": "display_data" } ], "source": [ - "!cat manifold.tex" - ] - }, - { - "cell_type": "code", - "execution_count": 28, - "metadata": {}, - "outputs": [], - "source": [ - "!python matrix_latex.py" + "check('manifold')" ] }, { "cell_type": "code", - "execution_count": 29, + "execution_count": 15, "metadata": {}, "outputs": [ { - "name": "stdout", - "output_type": "stream", - "text": [ - "\r\n", - "\\documentclass[10pt,fleqn]{report}\r\n", - "\\usepackage[vcentering]{geometry}\r\n", - "\\geometry{papersize={14in,11in},total={13in,10in}}\r\n", - "\r\n", - "\\pagestyle{empty}\r\n", - "\\usepackage[latin1]{inputenc}\r\n", - "\\usepackage{amsmath}\r\n", - "\\usepackage{amsfonts}\r\n", - "\\usepackage{amssymb}\r\n", - "\\usepackage{amsbsy}\r\n", - "\\usepackage{tensor}\r\n", - "\\usepackage{listings}\r\n", - "\\usepackage{color}\r\n", - "\\usepackage{xcolor}\r\n", - "\\usepackage{bm}\r\n", - "\\usepackage{breqn}\r\n", - "\\definecolor{gray}{rgb}{0.95,0.95,0.95}\r\n", - "\\setlength{\\parindent}{0pt}\r\n", - "\\DeclareMathOperator{\\Tr}{Tr}\r\n", - "\\DeclareMathOperator{\\Adj}{Adj}\r\n", - "\\newcommand{\\bfrac}[2]{\\displaystyle\\frac{#1}{#2}}\r\n", - "\\newcommand{\\lp}{\\left (}\r\n", - "\\newcommand{\\rp}{\\right )}\r\n", - "\\newcommand{\\paren}[1]{\\lp {#1} \\rp}\r\n", - "\\newcommand{\\half}{\\frac{1}{2}}\r\n", - "\\newcommand{\\llt}{\\left <}\r\n", - "\\newcommand{\\rgt}{\\right >}\r\n", - "\\newcommand{\\abs}[1]{\\left |{#1}\\right | }\r\n", - "\\newcommand{\\pdiff}[2]{\\bfrac{\\partial {#1}}{\\partial {#2}}}\r\n", - "\\newcommand{\\lbrc}{\\left \\{}\r\n", - "\\newcommand{\\rbrc}{\\right \\}}\r\n", - "\\newcommand{\\W}{\\wedge}\r\n", - "\\newcommand{\\prm}[1]{{#1}'}\r\n", - "\\newcommand{\\ddt}[1]{\\bfrac{d{#1}}{dt}}\r\n", - "\\newcommand{\\R}{\\dagger}\r\n", - "\\newcommand{\\deriv}[3]{\\bfrac{d^{#3}#1}{d{#2}^{#3}}}\r\n", - "\\newcommand{\\grade}[1]{\\left < {#1} \\right >}\r\n", - "\\newcommand{\\f}[2]{{#1}\\lp{#2}\\rp}\r\n", - "\\newcommand{\\eval}[2]{\\left . {#1} \\right |_{#2}}\r\n", - "\\newcommand{\\Nabla}{\\boldsymbol{\\nabla}}\r\n", - "\\newcommand{\\eb}{\\boldsymbol{e}}\r\n", - "\\usepackage{float}\r\n", - "\\floatstyle{plain} % optionally change the style of the new float\r\n", - "\\newfloat{Code}{H}{myc}\r\n", - "\\lstloadlanguages{Python}\r\n", - "\r\n", - "\\begin{document}\r\n", - "\\begin{equation*} \\left [ \\begin{array}{cc} 1 & 2 \\\\ 3 & 4 \\end{array}\\right ] \\left [ \\begin{array}{c} 5 \\\\ 6 \\end{array}\\right ] = \\left [ \\begin{array}{c} 17 \\\\ 39 \\end{array}\\right ] \\end{equation*}\r\n", - "\\begin{equation*} \\left [ \\begin{array}{cc} x^{3} & y^{3} \\end{array}\\right ] \\left [ \\begin{array}{cc} x^{2} & 2 x y \\\\ 2 x y & y^{2} \\end{array}\\right ] = \\left [ \\begin{array}{cc} x^{5} + 2 x y^{4} & 2 x^{4} y + y^{5} \\end{array}\\right ] \\end{equation*}\r\n", - "\\end{document}\r\n" - ] + "data": { + "text/plain": [ + "\n", + "\\documentclass[10pt,fleqn]{report}\n", + "\\usepackage[vcentering]{geometry}\n", + "\\geometry{papersize={14in,11in},total={13in,10in}}\n", + "\n", + "\\pagestyle{empty}\n", + "\\usepackage[latin1]{inputenc}\n", + "\\usepackage{amsmath}\n", + "\\usepackage{amsfonts}\n", + "\\usepackage{amssymb}\n", + "\\usepackage{amsbsy}\n", + "\\usepackage{tensor}\n", + "\\usepackage{listings}\n", + "\\usepackage{color}\n", + "\\usepackage{xcolor}\n", + "\\usepackage{bm}\n", + "\\usepackage{breqn}\n", + "\\definecolor{gray}{rgb}{0.95,0.95,0.95}\n", + "\\setlength{\\parindent}{0pt}\n", + "\\DeclareMathOperator{\\Tr}{Tr}\n", + "\\DeclareMathOperator{\\Adj}{Adj}\n", + "\\newcommand{\\bfrac}[2]{\\displaystyle\\frac{#1}{#2}}\n", + "\\newcommand{\\lp}{\\left (}\n", + "\\newcommand{\\rp}{\\right )}\n", + "\\newcommand{\\paren}[1]{\\lp {#1} \\rp}\n", + "\\newcommand{\\half}{\\frac{1}{2}}\n", + "\\newcommand{\\llt}{\\left <}\n", + "\\newcommand{\\rgt}{\\right >}\n", + "\\newcommand{\\abs}[1]{\\left |{#1}\\right | }\n", + "\\newcommand{\\pdiff}[2]{\\bfrac{\\partial {#1}}{\\partial {#2}}}\n", + "\\newcommand{\\lbrc}{\\left \\{}\n", + "\\newcommand{\\rbrc}{\\right \\}}\n", + "\\newcommand{\\W}{\\wedge}\n", + "\\newcommand{\\prm}[1]{{#1}'}\n", + "\\newcommand{\\ddt}[1]{\\bfrac{d{#1}}{dt}}\n", + "\\newcommand{\\R}{\\dagger}\n", + "\\newcommand{\\deriv}[3]{\\bfrac{d^{#3}#1}{d{#2}^{#3}}}\n", + "\\newcommand{\\grade}[1]{\\left < {#1} \\right >}\n", + "\\newcommand{\\f}[2]{{#1}\\lp{#2}\\rp}\n", + "\\newcommand{\\eval}[2]{\\left . {#1} \\right |_{#2}}\n", + "\\newcommand{\\Nabla}{\\boldsymbol{\\nabla}}\n", + "\\newcommand{\\eb}{\\boldsymbol{e}}\n", + "\\usepackage{float}\n", + "\\floatstyle{plain} % optionally change the style of the new float\n", + "\\newfloat{Code}{H}{myc}\n", + "\\lstloadlanguages{Python}\n", + "\n", + "\\begin{document}\n", + "\\begin{equation*} \\left [ \\begin{array}{cc} 1 & 2 \\\\ 3 & 4 \\end{array}\\right ] \\left [ \\begin{array}{c} 5 \\\\ 6 \\end{array}\\right ] = \\left [ \\begin{array}{c} 17 \\\\ 39 \\end{array}\\right ] \\end{equation*}\n", + "\\begin{equation*} \\left [ \\begin{array}{cc} x^{3} & y^{3} \\end{array}\\right ] \\left [ \\begin{array}{cc} x^{2} & 2 x y \\\\ 2 x y & y^{2} \\end{array}\\right ] = \\left [ \\begin{array}{cc} x^{5} + 2 x y^{4} & 2 x^{4} y + y^{5} \\end{array}\\right ] \\end{equation*}\n", + "\\end{document}\n" + ] + }, + "metadata": {}, + "output_type": "display_data" } ], "source": [ - "!cat matrix_latex.tex" - ] - }, - { - "cell_type": "code", - "execution_count": 30, - "metadata": {}, - "outputs": [], - "source": [ - "!python new_bug_grad_exp.py" + "check('matrix_latex')" ] }, { "cell_type": "code", - "execution_count": 31, + "execution_count": 16, "metadata": {}, "outputs": [ { - "name": "stdout", - "output_type": "stream", - "text": [ - "\r\n", - "\\documentclass[10pt,fleqn]{report}\r\n", - "\\usepackage[vcentering]{geometry}\r\n", - "\\geometry{papersize={14in,11in},total={13in,10in}}\r\n", - "\r\n", - "\\pagestyle{empty}\r\n", - "\\usepackage[latin1]{inputenc}\r\n", - "\\usepackage{amsmath}\r\n", - "\\usepackage{amsfonts}\r\n", - "\\usepackage{amssymb}\r\n", - "\\usepackage{amsbsy}\r\n", - "\\usepackage{tensor}\r\n", - "\\usepackage{listings}\r\n", - "\\usepackage{color}\r\n", - "\\usepackage{xcolor}\r\n", - "\\usepackage{bm}\r\n", - "\\usepackage{breqn}\r\n", - "\\definecolor{gray}{rgb}{0.95,0.95,0.95}\r\n", - "\\setlength{\\parindent}{0pt}\r\n", - "\\DeclareMathOperator{\\Tr}{Tr}\r\n", - "\\DeclareMathOperator{\\Adj}{Adj}\r\n", - "\\newcommand{\\bfrac}[2]{\\displaystyle\\frac{#1}{#2}}\r\n", - "\\newcommand{\\lp}{\\left (}\r\n", - "\\newcommand{\\rp}{\\right )}\r\n", - "\\newcommand{\\paren}[1]{\\lp {#1} \\rp}\r\n", - "\\newcommand{\\half}{\\frac{1}{2}}\r\n", - "\\newcommand{\\llt}{\\left <}\r\n", - "\\newcommand{\\rgt}{\\right >}\r\n", - "\\newcommand{\\abs}[1]{\\left |{#1}\\right | }\r\n", - "\\newcommand{\\pdiff}[2]{\\bfrac{\\partial {#1}}{\\partial {#2}}}\r\n", - "\\newcommand{\\lbrc}{\\left \\{}\r\n", - "\\newcommand{\\rbrc}{\\right \\}}\r\n", - "\\newcommand{\\W}{\\wedge}\r\n", - "\\newcommand{\\prm}[1]{{#1}'}\r\n", - "\\newcommand{\\ddt}[1]{\\bfrac{d{#1}}{dt}}\r\n", - "\\newcommand{\\R}{\\dagger}\r\n", - "\\newcommand{\\deriv}[3]{\\bfrac{d^{#3}#1}{d{#2}^{#3}}}\r\n", - "\\newcommand{\\grade}[1]{\\left < {#1} \\right >}\r\n", - "\\newcommand{\\f}[2]{{#1}\\lp{#2}\\rp}\r\n", - "\\newcommand{\\eval}[2]{\\left . {#1} \\right |_{#2}}\r\n", - "\\newcommand{\\Nabla}{\\boldsymbol{\\nabla}}\r\n", - "\\newcommand{\\eb}{\\boldsymbol{e}}\r\n", - "\\usepackage{float}\r\n", - "\\floatstyle{plain} % optionally change the style of the new float\r\n", - "\\newfloat{Code}{H}{myc}\r\n", - "\\lstloadlanguages{Python}\r\n", - "\r\n", - "\\begin{document}\r\n", - "Results with all scalar variables declared as real\r\n", - "\\begin{equation*} X = t \\boldsymbol{\\gamma }_{t} + x \\boldsymbol{\\gamma }_{x} + y \\boldsymbol{\\gamma }_{y} + z \\boldsymbol{\\gamma }_{z} + w \\boldsymbol{\\gamma }_{w} \\end{equation*}\r\n", - "\\begin{equation*} K = k^{t} \\boldsymbol{\\gamma }_{t} + k^{x} \\boldsymbol{\\gamma }_{x} + k^{y} \\boldsymbol{\\gamma }_{y} + k^{z} \\boldsymbol{\\gamma }_{z} + k^{w} \\boldsymbol{\\gamma }_{w} \\end{equation*}\r\n", - "\\begin{equation*} K\\cdot X = k^{t} t - k^{w} w - k^{x} x - k^{y} y - k^{z} z \\end{equation*}\r\n", - "\\begin{equation*} I^{2} = 1 \\end{equation*}\r\n", - "\\begin{equation*} I_{xyzw} = I\\gamma_{x}\\gamma_{y}\\gamma_{z}\\gamma_{w} = \\boldsymbol{\\gamma }_{t} \\end{equation*}\r\n", - "\\begin{equation*} \\lp I\\gamma_{x}\\gamma_{y}\\gamma_{z}\\gamma_{w}\\rp^{2} = 1 \\end{equation*}\r\n", - "\\begin{equation*} e^{I_{xyzw}K\\cdot X} = \\cosh{\\left (- k^{t} t + k^{w} w + k^{x} x + k^{y} y + k^{z} z \\right )} - \\sinh{\\left (- k^{t} t + k^{w} w + k^{x} x + k^{y} y + k^{z} z \\right )} \\boldsymbol{\\gamma }_{t} \\end{equation*}\r\n", - "\\end{document}\r\n" - ] + "data": { + "text/plain": [ + "\n", + "\\documentclass[10pt,fleqn]{report}\n", + "\\usepackage[vcentering]{geometry}\n", + "\\geometry{papersize={14in,11in},total={13in,10in}}\n", + "\n", + "\\pagestyle{empty}\n", + "\\usepackage[latin1]{inputenc}\n", + "\\usepackage{amsmath}\n", + "\\usepackage{amsfonts}\n", + "\\usepackage{amssymb}\n", + "\\usepackage{amsbsy}\n", + "\\usepackage{tensor}\n", + "\\usepackage{listings}\n", + "\\usepackage{color}\n", + "\\usepackage{xcolor}\n", + "\\usepackage{bm}\n", + "\\usepackage{breqn}\n", + "\\definecolor{gray}{rgb}{0.95,0.95,0.95}\n", + "\\setlength{\\parindent}{0pt}\n", + "\\DeclareMathOperator{\\Tr}{Tr}\n", + "\\DeclareMathOperator{\\Adj}{Adj}\n", + "\\newcommand{\\bfrac}[2]{\\displaystyle\\frac{#1}{#2}}\n", + "\\newcommand{\\lp}{\\left (}\n", + "\\newcommand{\\rp}{\\right )}\n", + "\\newcommand{\\paren}[1]{\\lp {#1} \\rp}\n", + "\\newcommand{\\half}{\\frac{1}{2}}\n", + "\\newcommand{\\llt}{\\left <}\n", + "\\newcommand{\\rgt}{\\right >}\n", + "\\newcommand{\\abs}[1]{\\left |{#1}\\right | }\n", + "\\newcommand{\\pdiff}[2]{\\bfrac{\\partial {#1}}{\\partial {#2}}}\n", + "\\newcommand{\\lbrc}{\\left \\{}\n", + "\\newcommand{\\rbrc}{\\right \\}}\n", + "\\newcommand{\\W}{\\wedge}\n", + "\\newcommand{\\prm}[1]{{#1}'}\n", + "\\newcommand{\\ddt}[1]{\\bfrac{d{#1}}{dt}}\n", + "\\newcommand{\\R}{\\dagger}\n", + "\\newcommand{\\deriv}[3]{\\bfrac{d^{#3}#1}{d{#2}^{#3}}}\n", + "\\newcommand{\\grade}[1]{\\left < {#1} \\right >}\n", + "\\newcommand{\\f}[2]{{#1}\\lp{#2}\\rp}\n", + "\\newcommand{\\eval}[2]{\\left . {#1} \\right |_{#2}}\n", + "\\newcommand{\\Nabla}{\\boldsymbol{\\nabla}}\n", + "\\newcommand{\\eb}{\\boldsymbol{e}}\n", + "\\usepackage{float}\n", + "\\floatstyle{plain} % optionally change the style of the new float\n", + "\\newfloat{Code}{H}{myc}\n", + "\\lstloadlanguages{Python}\n", + "\n", + "\\begin{document}\n", + "Results with all scalar variables declared as real\n", + "\\begin{equation*} X = t \\boldsymbol{\\gamma }_{t} + x \\boldsymbol{\\gamma }_{x} + y \\boldsymbol{\\gamma }_{y} + z \\boldsymbol{\\gamma }_{z} + w \\boldsymbol{\\gamma }_{w} \\end{equation*}\n", + "\\begin{equation*} K = k^{t} \\boldsymbol{\\gamma }_{t} + k^{x} \\boldsymbol{\\gamma }_{x} + k^{y} \\boldsymbol{\\gamma }_{y} + k^{z} \\boldsymbol{\\gamma }_{z} + k^{w} \\boldsymbol{\\gamma }_{w} \\end{equation*}\n", + "\\begin{equation*} K\\cdot X = k^{t} t - k^{w} w - k^{x} x - k^{y} y - k^{z} z \\end{equation*}\n", + "\\begin{equation*} I^{2} = 1 \\end{equation*}\n", + "\\begin{equation*} I_{xyzw} = I\\gamma_{x}\\gamma_{y}\\gamma_{z}\\gamma_{w} = \\boldsymbol{\\gamma }_{t} \\end{equation*}\n", + "\\begin{equation*} \\lp I\\gamma_{x}\\gamma_{y}\\gamma_{z}\\gamma_{w}\\rp^{2} = 1 \\end{equation*}\n", + "\\begin{equation*} e^{I_{xyzw}K\\cdot X} = \\cosh{\\left (- k^{t} t + k^{w} w + k^{x} x + k^{y} y + k^{z} z \\right )} - \\sinh{\\left (- k^{t} t + k^{w} w + k^{x} x + k^{y} y + k^{z} z \\right )} \\boldsymbol{\\gamma }_{t} \\end{equation*}\n", + "\\end{document}\n" + ] + }, + "metadata": {}, + "output_type": "display_data" } ], "source": [ - "!cat new_bug_grad_exp.tex" - ] - }, - { - "cell_type": "code", - "execution_count": 32, - "metadata": {}, - "outputs": [], - "source": [ - "!python physics_check_latex.py" + "check('new_bug_grad_exp')" ] }, { "cell_type": "code", - "execution_count": 33, + "execution_count": 17, "metadata": {}, "outputs": [ { - "name": "stdout", - "output_type": "stream", - "text": [ - "\r\n", - "\\documentclass[10pt,fleqn]{report}\r\n", - "\\usepackage[vcentering]{geometry}\r\n", - "\\geometry{papersize={14in,11in},total={13in,10in}}\r\n", - "\r\n", - "\\pagestyle{empty}\r\n", - "\\usepackage[latin1]{inputenc}\r\n", - "\\usepackage{amsmath}\r\n", - "\\usepackage{amsfonts}\r\n", - "\\usepackage{amssymb}\r\n", - "\\usepackage{amsbsy}\r\n", - "\\usepackage{tensor}\r\n", - "\\usepackage{listings}\r\n", - "\\usepackage{color}\r\n", - "\\usepackage{xcolor}\r\n", - "\\usepackage{bm}\r\n", - "\\usepackage{breqn}\r\n", - "\\definecolor{gray}{rgb}{0.95,0.95,0.95}\r\n", - "\\setlength{\\parindent}{0pt}\r\n", - "\\DeclareMathOperator{\\Tr}{Tr}\r\n", - "\\DeclareMathOperator{\\Adj}{Adj}\r\n", - "\\newcommand{\\bfrac}[2]{\\displaystyle\\frac{#1}{#2}}\r\n", - "\\newcommand{\\lp}{\\left (}\r\n", - "\\newcommand{\\rp}{\\right )}\r\n", - "\\newcommand{\\paren}[1]{\\lp {#1} \\rp}\r\n", - "\\newcommand{\\half}{\\frac{1}{2}}\r\n", - "\\newcommand{\\llt}{\\left <}\r\n", - "\\newcommand{\\rgt}{\\right >}\r\n", - "\\newcommand{\\abs}[1]{\\left |{#1}\\right | }\r\n", - "\\newcommand{\\pdiff}[2]{\\bfrac{\\partial {#1}}{\\partial {#2}}}\r\n", - "\\newcommand{\\lbrc}{\\left \\{}\r\n", - "\\newcommand{\\rbrc}{\\right \\}}\r\n", - "\\newcommand{\\W}{\\wedge}\r\n", - "\\newcommand{\\prm}[1]{{#1}'}\r\n", - "\\newcommand{\\ddt}[1]{\\bfrac{d{#1}}{dt}}\r\n", - "\\newcommand{\\R}{\\dagger}\r\n", - "\\newcommand{\\deriv}[3]{\\bfrac{d^{#3}#1}{d{#2}^{#3}}}\r\n", - "\\newcommand{\\grade}[1]{\\left < {#1} \\right >}\r\n", - "\\newcommand{\\f}[2]{{#1}\\lp{#2}\\rp}\r\n", - "\\newcommand{\\eval}[2]{\\left . {#1} \\right |_{#2}}\r\n", - "\\newcommand{\\Nabla}{\\boldsymbol{\\nabla}}\r\n", - "\\newcommand{\\eb}{\\boldsymbol{e}}\r\n", - "\\usepackage{float}\r\n", - "\\floatstyle{plain} % optionally change the style of the new float\r\n", - "\\newfloat{Code}{H}{myc}\r\n", - "\\lstloadlanguages{Python}\r\n", - "\r\n", - "\\begin{document}\r\n", - "\\\\begin{lstlisting}[language=Python,showspaces=false,showstringspaces=false,backgroundcolor=\\color{gray},frame=single]\r\n", - "def General_Lorentz_Tranformation():\r\n", - " Print_Function()\r\n", - " (alpha,beta,gamma) = symbols('alpha beta gamma')\r\n", - " (x,y,z,t) = symbols(\"x y z t\",real=True)\r\n", - " (st4d,g0,g1,g2,g3) = Ga.build('gamma*t|x|y|z',g=[1,-1,-1,-1])\r\n", - " B = (x*g1+y*g2+z*g3)^(t*g0)\r\n", - " print(B)\r\n", - " print(B.exp(hint='+'))\r\n", - " print(B.exp(hint='-'))\r\n", - "\\end{lstlisting}\r\n", - "Code Output:\r\n", - "\\begin{equation*} - t x \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{x} - t y \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{y} - t z \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{z} \\end{equation*}\r\n", - "\\begin{equation*} \\cosh{\\left (\\sqrt{x^{2} + y^{2} + z^{2}} \\left|{t}\\right| \\right )} - \\frac{t x \\sinh{\\left (\\sqrt{x^{2} + y^{2} + z^{2}} \\left|{t}\\right| \\right )}}{\\sqrt{x^{2} + y^{2} + z^{2}} \\left|{t}\\right|} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{x} - \\frac{t y \\sinh{\\left (\\sqrt{x^{2} + y^{2} + z^{2}} \\left|{t}\\right| \\right )}}{\\sqrt{x^{2} + y^{2} + z^{2}} \\left|{t}\\right|} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{y} - \\frac{t z \\sinh{\\left (\\sqrt{x^{2} + y^{2} + z^{2}} \\left|{t}\\right| \\right )}}{\\sqrt{x^{2} + y^{2} + z^{2}} \\left|{t}\\right|} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{z} \\end{equation*}\r\n", - "\\begin{equation*} \\cosh{\\left (\\sqrt{x^{2} + y^{2} + z^{2}} \\left|{t}\\right| \\right )} - \\frac{t x \\sinh{\\left (\\sqrt{x^{2} + y^{2} + z^{2}} \\left|{t}\\right| \\right )}}{\\sqrt{x^{2} + y^{2} + z^{2}} \\left|{t}\\right|} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{x} - \\frac{t y \\sinh{\\left (\\sqrt{x^{2} + y^{2} + z^{2}} \\left|{t}\\right| \\right )}}{\\sqrt{x^{2} + y^{2} + z^{2}} \\left|{t}\\right|} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{y} - \\frac{t z \\sinh{\\left (\\sqrt{x^{2} + y^{2} + z^{2}} \\left|{t}\\right| \\right )}}{\\sqrt{x^{2} + y^{2} + z^{2}} \\left|{t}\\right|} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{z} \\end{equation*}\r\n", - "\\end{document}\r\n" - ] + "data": { + "text/plain": [ + "\n", + "\\documentclass[10pt,fleqn]{report}\n", + "\\usepackage[vcentering]{geometry}\n", + "\\geometry{papersize={14in,11in},total={13in,10in}}\n", + "\n", + "\\pagestyle{empty}\n", + "\\usepackage[latin1]{inputenc}\n", + "\\usepackage{amsmath}\n", + "\\usepackage{amsfonts}\n", + "\\usepackage{amssymb}\n", + "\\usepackage{amsbsy}\n", + "\\usepackage{tensor}\n", + "\\usepackage{listings}\n", + "\\usepackage{color}\n", + "\\usepackage{xcolor}\n", + "\\usepackage{bm}\n", + "\\usepackage{breqn}\n", + "\\definecolor{gray}{rgb}{0.95,0.95,0.95}\n", + "\\setlength{\\parindent}{0pt}\n", + "\\DeclareMathOperator{\\Tr}{Tr}\n", + "\\DeclareMathOperator{\\Adj}{Adj}\n", + "\\newcommand{\\bfrac}[2]{\\displaystyle\\frac{#1}{#2}}\n", + "\\newcommand{\\lp}{\\left (}\n", + "\\newcommand{\\rp}{\\right )}\n", + "\\newcommand{\\paren}[1]{\\lp {#1} \\rp}\n", + "\\newcommand{\\half}{\\frac{1}{2}}\n", + "\\newcommand{\\llt}{\\left <}\n", + "\\newcommand{\\rgt}{\\right >}\n", + "\\newcommand{\\abs}[1]{\\left |{#1}\\right | }\n", + "\\newcommand{\\pdiff}[2]{\\bfrac{\\partial {#1}}{\\partial {#2}}}\n", + "\\newcommand{\\lbrc}{\\left \\{}\n", + "\\newcommand{\\rbrc}{\\right \\}}\n", + "\\newcommand{\\W}{\\wedge}\n", + "\\newcommand{\\prm}[1]{{#1}'}\n", + "\\newcommand{\\ddt}[1]{\\bfrac{d{#1}}{dt}}\n", + "\\newcommand{\\R}{\\dagger}\n", + "\\newcommand{\\deriv}[3]{\\bfrac{d^{#3}#1}{d{#2}^{#3}}}\n", + "\\newcommand{\\grade}[1]{\\left < {#1} \\right >}\n", + "\\newcommand{\\f}[2]{{#1}\\lp{#2}\\rp}\n", + "\\newcommand{\\eval}[2]{\\left . {#1} \\right |_{#2}}\n", + "\\newcommand{\\Nabla}{\\boldsymbol{\\nabla}}\n", + "\\newcommand{\\eb}{\\boldsymbol{e}}\n", + "\\usepackage{float}\n", + "\\floatstyle{plain} % optionally change the style of the new float\n", + "\\newfloat{Code}{H}{myc}\n", + "\\lstloadlanguages{Python}\n", + "\n", + "\\begin{document}\n", + "\\\\begin{lstlisting}[language=Python,showspaces=false,showstringspaces=false,backgroundcolor=\\color{gray},frame=single]\n", + "def General_Lorentz_Tranformation():\n", + " Print_Function()\n", + " (alpha,beta,gamma) = symbols('alpha beta gamma')\n", + " (x,y,z,t) = symbols(\"x y z t\",real=True)\n", + " (st4d,g0,g1,g2,g3) = Ga.build('gamma*t|x|y|z',g=[1,-1,-1,-1])\n", + " B = (x*g1+y*g2+z*g3)^(t*g0)\n", + " print(B)\n", + " print(B.exp(hint='+'))\n", + " print(B.exp(hint='-'))\n", + "\\end{lstlisting}\n", + "Code Output:\n", + "\\begin{equation*} - t x \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{x} - t y \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{y} - t z \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{z} \\end{equation*}\n", + "\\begin{equation*} \\cosh{\\left (\\sqrt{x^{2} + y^{2} + z^{2}} \\left|{t}\\right| \\right )} - \\frac{t x \\sinh{\\left (\\sqrt{x^{2} + y^{2} + z^{2}} \\left|{t}\\right| \\right )}}{\\sqrt{x^{2} + y^{2} + z^{2}} \\left|{t}\\right|} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{x} - \\frac{t y \\sinh{\\left (\\sqrt{x^{2} + y^{2} + z^{2}} \\left|{t}\\right| \\right )}}{\\sqrt{x^{2} + y^{2} + z^{2}} \\left|{t}\\right|} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{y} - \\frac{t z \\sinh{\\left (\\sqrt{x^{2} + y^{2} + z^{2}} \\left|{t}\\right| \\right )}}{\\sqrt{x^{2} + y^{2} + z^{2}} \\left|{t}\\right|} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{z} \\end{equation*}\n", + "\\begin{equation*} \\cosh{\\left (\\sqrt{x^{2} + y^{2} + z^{2}} \\left|{t}\\right| \\right )} - \\frac{t x \\sinh{\\left (\\sqrt{x^{2} + y^{2} + z^{2}} \\left|{t}\\right| \\right )}}{\\sqrt{x^{2} + y^{2} + z^{2}} \\left|{t}\\right|} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{x} - \\frac{t y \\sinh{\\left (\\sqrt{x^{2} + y^{2} + z^{2}} \\left|{t}\\right| \\right )}}{\\sqrt{x^{2} + y^{2} + z^{2}} \\left|{t}\\right|} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{y} - \\frac{t z \\sinh{\\left (\\sqrt{x^{2} + y^{2} + z^{2}} \\left|{t}\\right| \\right )}}{\\sqrt{x^{2} + y^{2} + z^{2}} \\left|{t}\\right|} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{z} \\end{equation*}\n", + "\\end{document}\n" + ] + }, + "metadata": {}, + "output_type": "display_data" } ], "source": [ - "!cat physics_check_latex.tex" + "check('physics_check_latex')" ] }, { "cell_type": "code", - "execution_count": 34, + "execution_count": 18, "metadata": {}, - "outputs": [], - "source": [ - "!python print_check_latex.py" - ] - }, - { - "cell_type": "code", - "execution_count": 35, - "metadata": { - "collapsed": false, - "scrolled": false - }, "outputs": [ { - "name": "stdout", - "output_type": "stream", - "text": [ - "\r\n", - "\\documentclass[10pt,fleqn]{report}\r\n", - "\\usepackage[vcentering]{geometry}\r\n", - "\\geometry{papersize={14in,11in},total={13in,10in}}\r\n", - "\r\n", - "\\pagestyle{empty}\r\n", - "\\usepackage[latin1]{inputenc}\r\n", - "\\usepackage{amsmath}\r\n", - "\\usepackage{amsfonts}\r\n", - "\\usepackage{amssymb}\r\n", - "\\usepackage{amsbsy}\r\n", - "\\usepackage{tensor}\r\n", - "\\usepackage{listings}\r\n", - "\\usepackage{color}\r\n", - "\\usepackage{xcolor}\r\n", - "\\usepackage{bm}\r\n", - "\\usepackage{breqn}\r\n", - "\\definecolor{gray}{rgb}{0.95,0.95,0.95}\r\n", - "\\setlength{\\parindent}{0pt}\r\n", - "\\DeclareMathOperator{\\Tr}{Tr}\r\n", - "\\DeclareMathOperator{\\Adj}{Adj}\r\n", - "\\newcommand{\\bfrac}[2]{\\displaystyle\\frac{#1}{#2}}\r\n", - "\\newcommand{\\lp}{\\left (}\r\n", - "\\newcommand{\\rp}{\\right )}\r\n", - "\\newcommand{\\paren}[1]{\\lp {#1} \\rp}\r\n", - "\\newcommand{\\half}{\\frac{1}{2}}\r\n", - "\\newcommand{\\llt}{\\left <}\r\n", - "\\newcommand{\\rgt}{\\right >}\r\n", - "\\newcommand{\\abs}[1]{\\left |{#1}\\right | }\r\n", - "\\newcommand{\\pdiff}[2]{\\bfrac{\\partial {#1}}{\\partial {#2}}}\r\n", - "\\newcommand{\\lbrc}{\\left \\{}\r\n", - "\\newcommand{\\rbrc}{\\right \\}}\r\n", - "\\newcommand{\\W}{\\wedge}\r\n", - "\\newcommand{\\prm}[1]{{#1}'}\r\n", - "\\newcommand{\\ddt}[1]{\\bfrac{d{#1}}{dt}}\r\n", - "\\newcommand{\\R}{\\dagger}\r\n", - "\\newcommand{\\deriv}[3]{\\bfrac{d^{#3}#1}{d{#2}^{#3}}}\r\n", - "\\newcommand{\\grade}[1]{\\left < {#1} \\right >}\r\n", - "\\newcommand{\\f}[2]{{#1}\\lp{#2}\\rp}\r\n", - "\\newcommand{\\eval}[2]{\\left . {#1} \\right |_{#2}}\r\n", - "\\newcommand{\\Nabla}{\\boldsymbol{\\nabla}}\r\n", - "\\newcommand{\\eb}{\\boldsymbol{e}}\r\n", - "\\usepackage{float}\r\n", - "\\floatstyle{plain} % optionally change the style of the new float\r\n", - "\\newfloat{Code}{H}{myc}\r\n", - "\\lstloadlanguages{Python}\r\n", - "\r\n", - "\\begin{document}\r\n", - "\\begin{equation*} \\bm{A} = A + A^{x} \\boldsymbol{e}_{x} + A^{y} \\boldsymbol{e}_{y} + A^{z} \\boldsymbol{e}_{z} + A^{xy} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + A^{xz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + A^{yz} \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} + A^{xyz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\r\n", - " \\begin{align*} \\bm{A} = & A^{x} \\boldsymbol{e}_{x} \\\\ & + A^{y} \\boldsymbol{e}_{y} \\\\ & + A^{z} \\boldsymbol{e}_{z} \\end{align*} \r\n", - " \\begin{align*} \\bm{B} = & B^{xy} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} \\\\ & + B^{xz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} \\\\ & + B^{yz} \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{align*} \r\n", - " \\begin{align*} \\boldsymbol{\\nabla} f = & \\partial_{x} f \\boldsymbol{e}_{x} \\\\ & + \\partial_{y} f \\boldsymbol{e}_{y} \\\\ & + \\partial_{z} f \\boldsymbol{e}_{z} \\end{align*} \r\n", - "\\begin{equation*} \\boldsymbol{\\nabla} \\cdot \\bm{A} = \\partial_{x} A^{x} + \\partial_{y} A^{y} + \\partial_{z} A^{z} \\end{equation*}\r\n", - " \\begin{align*} \\boldsymbol{\\nabla} \\bm{A} = & \\left ( \\partial_{x} A^{x} + \\partial_{y} A^{y} + \\partial_{z} A^{z} \\right ) \\\\ & + \\left ( - \\partial_{y} A^{x} + \\partial_{x} A^{y} \\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} \\\\ & + \\left ( - \\partial_{z} A^{x} + \\partial_{x} A^{z} \\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} \\\\ & + \\left ( - \\partial_{z} A^{y} + \\partial_{y} A^{z} \\right ) \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{align*} \r\n", - " \\begin{align*} -I (\\boldsymbol{\\nabla} \\W \\bm{A}) = & \\left ( - \\partial_{z} A^{y} + \\partial_{y} A^{z} \\right ) \\boldsymbol{e}_{x} \\\\ & + \\left ( \\partial_{z} A^{x} - \\partial_{x} A^{z} \\right ) \\boldsymbol{e}_{y} \\\\ & + \\left ( - \\partial_{y} A^{x} + \\partial_{x} A^{y} \\right ) \\boldsymbol{e}_{z} \\end{align*} \r\n", - " \\begin{align*} \\boldsymbol{\\nabla} \\bm{B} = & \\left ( - \\partial_{y} B^{xy} - \\partial_{z} B^{xz} \\right ) \\boldsymbol{e}_{x} \\\\ & + \\left ( \\partial_{x} B^{xy} - \\partial_{z} B^{yz} \\right ) \\boldsymbol{e}_{y} \\\\ & + \\left ( \\partial_{x} B^{xz} + \\partial_{y} B^{yz} \\right ) \\boldsymbol{e}_{z} \\\\ & + \\left ( \\partial_{z} B^{xy} - \\partial_{y} B^{xz} + \\partial_{x} B^{yz} \\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{align*} \r\n", - "\\begin{equation*} \\boldsymbol{\\nabla} \\W \\bm{B} = \\left ( \\partial_{z} B^{xy} - \\partial_{y} B^{xz} + \\partial_{x} B^{yz} \\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\r\n", - " \\begin{align*} \\boldsymbol{\\nabla} \\cdot \\bm{B} = & \\left ( - \\partial_{y} B^{xy} - \\partial_{z} B^{xz} \\right ) \\boldsymbol{e}_{x} \\\\ & + \\left ( \\partial_{x} B^{xy} - \\partial_{z} B^{yz} \\right ) \\boldsymbol{e}_{y} \\\\ & + \\left ( \\partial_{x} B^{xz} + \\partial_{y} B^{yz} \\right ) \\boldsymbol{e}_{z} \\end{align*} \r\n", - "\\begin{equation*} g_{ij} = \\left [ \\begin{array}{cccc} \\left ( a\\cdot a\\right ) & \\left ( a\\cdot b\\right ) & \\left ( a\\cdot c\\right ) & \\left ( a\\cdot d\\right ) \\\\ \\left ( a\\cdot b\\right ) & \\left ( b\\cdot b\\right ) & \\left ( b\\cdot c\\right ) & \\left ( b\\cdot d\\right ) \\\\ \\left ( a\\cdot c\\right ) & \\left ( b\\cdot c\\right ) & \\left ( c\\cdot c\\right ) & \\left ( c\\cdot d\\right ) \\\\ \\left ( a\\cdot d\\right ) & \\left ( b\\cdot d\\right ) & \\left ( c\\cdot d\\right ) & \\left ( d\\cdot d\\right ) \\end{array}\\right ] \\end{equation*}\r\n", - " \\begin{align*} \\bm{a\\cdot (b c)} = & - \\left ( a\\cdot c\\right ) \\boldsymbol{b} \\\\ & + \\left ( a\\cdot b\\right ) \\boldsymbol{c} \\end{align*} \r\n", - " \\begin{align*} \\bm{a\\cdot (b\\W c)} = & - \\left ( a\\cdot c\\right ) \\boldsymbol{b} \\\\ & + \\left ( a\\cdot b\\right ) \\boldsymbol{c} \\end{align*} \r\n", - " \\begin{align*} \\bm{a\\cdot (b\\W c\\W d)} = & \\left ( a\\cdot d\\right ) \\boldsymbol{b}\\wedge \\boldsymbol{c} \\\\ & - \\left ( a\\cdot c\\right ) \\boldsymbol{b}\\wedge \\boldsymbol{d} \\\\ & + \\left ( a\\cdot b\\right ) \\boldsymbol{c}\\wedge \\boldsymbol{d} \\end{align*} \r\n", - "\\begin{equation*} \\bm{a\\cdot (b\\W c)+c\\cdot (a\\W b)+b\\cdot (c\\W a)} = 0 \\end{equation*}\r\n", - "\\begin{equation*} \\bm{a (b\\W c)-b (a\\W c)+c (a\\W b)} = 3 \\boldsymbol{a}\\wedge \\boldsymbol{b}\\wedge \\boldsymbol{c} \\end{equation*}\r\n", - "\\begin{equation*} \\bm{a (b\\W c\\W d)-b (a\\W c\\W d)+c (a\\W b\\W d)-d (a\\W b\\W c)} = 4 \\boldsymbol{a}\\wedge \\boldsymbol{b}\\wedge \\boldsymbol{c}\\wedge \\boldsymbol{d} \\end{equation*}\r\n", - "\\begin{equation*} \\bm{(a\\W b)\\cdot (c\\W d)} = - \\left ( a\\cdot c\\right ) \\left ( b\\cdot d\\right ) + \\left ( a\\cdot d\\right ) \\left ( b\\cdot c\\right ) \\end{equation*}\r\n", - "\\begin{equation*} \\bm{((a\\W b)\\cdot c)\\cdot d} = - \\left ( a\\cdot c\\right ) \\left ( b\\cdot d\\right ) + \\left ( a\\cdot d\\right ) \\left ( b\\cdot c\\right ) \\end{equation*}\r\n", - " \\begin{align*} \\bm{(a\\W b)\\times (c\\W d)} = & - \\left ( b\\cdot d\\right ) \\boldsymbol{a}\\wedge \\boldsymbol{c} \\\\ & + \\left ( b\\cdot c\\right ) \\boldsymbol{a}\\wedge \\boldsymbol{d} \\\\ & + \\left ( a\\cdot d\\right ) \\boldsymbol{b}\\wedge \\boldsymbol{c} \\\\ & - \\left ( a\\cdot c\\right ) \\boldsymbol{b}\\wedge \\boldsymbol{d} \\end{align*} \r\n", - "\\begin{equation*} E = \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{2}\\wedge \\boldsymbol{e}_{3} \\end{equation*}\r\n", - "\\begin{equation*} E^{2} = \\left ( e_{1}\\cdot e_{2}\\right ) ^{2} - 2 \\left ( e_{1}\\cdot e_{2}\\right ) \\left ( e_{1}\\cdot e_{3}\\right ) \\left ( e_{2}\\cdot e_{3}\\right ) + \\left ( e_{1}\\cdot e_{3}\\right ) ^{2} + \\left ( e_{2}\\cdot e_{3}\\right ) ^{2} - 1 \\end{equation*}\r\n", - " \\begin{align*} E1 = (e2\\W e3) E = & \\left ( \\left ( e_{2}\\cdot e_{3}\\right ) ^{2} - 1\\right ) \\boldsymbol{e}_{1} \\\\ & + \\left ( \\left ( e_{1}\\cdot e_{2}\\right ) - \\left ( e_{1}\\cdot e_{3}\\right ) \\left ( e_{2}\\cdot e_{3}\\right ) \\right ) \\boldsymbol{e}_{2} \\\\ & + \\left ( - \\left ( e_{1}\\cdot e_{2}\\right ) \\left ( e_{2}\\cdot e_{3}\\right ) + \\left ( e_{1}\\cdot e_{3}\\right ) \\right ) \\boldsymbol{e}_{3} \\end{align*} \r\n", - " \\begin{align*} E2 =-(e1\\W e3) E = & \\left ( \\left ( e_{1}\\cdot e_{2}\\right ) - \\left ( e_{1}\\cdot e_{3}\\right ) \\left ( e_{2}\\cdot e_{3}\\right ) \\right ) \\boldsymbol{e}_{1} \\\\ & + \\left ( \\left ( e_{1}\\cdot e_{3}\\right ) ^{2} - 1\\right ) \\boldsymbol{e}_{2} \\\\ & + \\left ( - \\left ( e_{1}\\cdot e_{2}\\right ) \\left ( e_{1}\\cdot e_{3}\\right ) + \\left ( e_{2}\\cdot e_{3}\\right ) \\right ) \\boldsymbol{e}_{3} \\end{align*} \r\n", - " \\begin{align*} E3 = (e1\\W e2) E = & \\left ( - \\left ( e_{1}\\cdot e_{2}\\right ) \\left ( e_{2}\\cdot e_{3}\\right ) + \\left ( e_{1}\\cdot e_{3}\\right ) \\right ) \\boldsymbol{e}_{1} \\\\ & + \\left ( - \\left ( e_{1}\\cdot e_{2}\\right ) \\left ( e_{1}\\cdot e_{3}\\right ) + \\left ( e_{2}\\cdot e_{3}\\right ) \\right ) \\boldsymbol{e}_{2} \\\\ & + \\left ( \\left ( e_{1}\\cdot e_{2}\\right ) ^{2} - 1\\right ) \\boldsymbol{e}_{3} \\end{align*} \r\n", - "\\begin{equation*} E1\\cdot e2 = 0 \\end{equation*}\r\n", - "\\begin{equation*} E1\\cdot e3 = 0 \\end{equation*}\r\n", - "\\begin{equation*} E2\\cdot e1 = 0 \\end{equation*}\r\n", - "\\begin{equation*} E2\\cdot e3 = 0 \\end{equation*}\r\n", - "\\begin{equation*} E3\\cdot e1 = 0 \\end{equation*}\r\n", - "\\begin{equation*} E3\\cdot e2 = 0 \\end{equation*}\r\n", - "\\begin{equation*} (E1\\cdot e1)/E^{2} = 1 \\end{equation*}\r\n", - "\\begin{equation*} (E2\\cdot e2)/E^{2} = 1 \\end{equation*}\r\n", - "\\begin{equation*} (E3\\cdot e3)/E^{2} = 1 \\end{equation*}\r\n", - " \\begin{align*} A = & A^{r} \\boldsymbol{e}_{r} \\\\ & + A^{\\theta } \\boldsymbol{e}_{\\theta } \\\\ & + A^{\\phi } \\boldsymbol{e}_{\\phi } \\end{align*} \r\n", - " \\begin{align*} B = & B^{r\\theta } \\boldsymbol{e}_{r}\\wedge \\boldsymbol{e}_{\\theta } \\\\ & + B^{r\\phi } \\boldsymbol{e}_{r}\\wedge \\boldsymbol{e}_{\\phi } \\\\ & + B^{\\theta \\phi } \\boldsymbol{e}_{\\theta }\\wedge \\boldsymbol{e}_{\\phi } \\end{align*} \r\n", - " \\begin{align*} \\boldsymbol{\\nabla} f = & \\partial_{r} f \\boldsymbol{e}_{r} \\\\ & + \\frac{\\partial_{\\theta } f }{r} \\boldsymbol{e}_{\\theta } \\\\ & + \\frac{\\partial_{\\phi } f }{r \\sin{\\left (\\theta \\right )}} \\boldsymbol{e}_{\\phi } \\end{align*} \r\n", - "\\begin{equation*} \\boldsymbol{\\nabla} \\cdot A = \\frac{r \\partial_{r} A^{r} + 2 A^{r} + \\frac{A^{\\theta } }{\\tan{\\left (\\theta \\right )}} + \\partial_{\\theta } A^{\\theta } + \\frac{\\partial_{\\phi } A^{\\phi } }{\\sin{\\left (\\theta \\right )}}}{r} \\end{equation*}\r\n", - " \\begin{align*} -I (\\boldsymbol{\\nabla} \\W A) = & \\frac{\\frac{A^{\\phi } }{\\tan{\\left (\\theta \\right )}} + \\partial_{\\theta } A^{\\phi } - \\frac{\\partial_{\\phi } A^{\\theta } }{\\sin{\\left (\\theta \\right )}}}{r} \\boldsymbol{e}_{r} \\\\ & + \\frac{- r \\partial_{r} A^{\\phi } - A^{\\phi } + \\frac{\\partial_{\\phi } A^{r} }{\\sin{\\left (\\theta \\right )}}}{r} \\boldsymbol{e}_{\\theta } \\\\ & + \\frac{r \\partial_{r} A^{\\theta } + A^{\\theta } - \\partial_{\\theta } A^{r} }{r} \\boldsymbol{e}_{\\phi } \\end{align*} \r\n", - "\\begin{equation*} \\boldsymbol{\\nabla} \\W B = \\frac{r \\partial_{r} B^{\\theta \\phi } - \\frac{B^{r\\phi } }{\\tan{\\left (\\theta \\right )}} + 2 B^{\\theta \\phi } - \\partial_{\\theta } B^{r\\phi } + \\frac{\\partial_{\\phi } B^{r\\theta } }{\\sin{\\left (\\theta \\right )}}}{r} \\boldsymbol{e}_{r}\\wedge \\boldsymbol{e}_{\\theta }\\wedge \\boldsymbol{e}_{\\phi } \\end{equation*}\r\n", - " \\begin{align*} B = \\bm{B\\gamma_{t}} = & - B^{x} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{x} \\\\ & - B^{y} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{y} \\\\ & - B^{z} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{z} \\end{align*} \r\n", - " \\begin{align*} E = \\bm{E\\gamma_{t}} = & - E^{x} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{x} \\\\ & - E^{y} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{y} \\\\ & - E^{z} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{z} \\end{align*} \r\n", - " \\begin{align*} F = E+IB = & - E^{x} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{x} \\\\ & - E^{y} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{y} \\\\ & - E^{z} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{z} \\\\ & - B^{z} \\boldsymbol{\\gamma }_{x}\\wedge \\boldsymbol{\\gamma }_{y} \\\\ & + B^{y} \\boldsymbol{\\gamma }_{x}\\wedge \\boldsymbol{\\gamma }_{z} \\\\ & - B^{x} \\boldsymbol{\\gamma }_{y}\\wedge \\boldsymbol{\\gamma }_{z} \\end{align*} \r\n", - " \\begin{align*} J = & J^{t} \\boldsymbol{\\gamma }_{t} \\\\ & + J^{x} \\boldsymbol{\\gamma }_{x} \\\\ & + J^{y} \\boldsymbol{\\gamma }_{y} \\\\ & + J^{z} \\boldsymbol{\\gamma }_{z} \\end{align*} \r\n", - "\\begin{equation*} \\boldsymbol{\\nabla} F = J \\end{equation*}\r\n", - " \\begin{align*} R = & \\cosh{\\left (\\frac{\\alpha }{2} \\right )} \\\\ & + \\sinh{\\left (\\frac{\\alpha }{2} \\right )} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{x} \\end{align*} \r\n", - "\\begin{equation*} t\\bm{\\gamma_{t}}+x\\bm{\\gamma_{x}} = t'\\bm{\\gamma'_{t}}+x'\\bm{\\gamma'_{x}} = R\\lp t'\\bm{\\gamma_{t}}+x'\\bm{\\gamma_{x}}\\rp R^{\\dagger} \\end{equation*}\r\n", - " \\begin{align*} t\\bm{\\gamma_{t}}+x\\bm{\\gamma_{x}} = & \\left ( t' \\cosh{\\left (\\alpha \\right )} - x' \\sinh{\\left (\\alpha \\right )}\\right ) \\boldsymbol{\\gamma }_{t} \\\\ & + \\left ( - t' \\sinh{\\left (\\alpha \\right )} + x' \\cosh{\\left (\\alpha \\right )}\\right ) \\boldsymbol{\\gamma }_{x} \\end{align*} \r\n", - "\\begin{equation*} \\f{\\sinh}{\\alpha} = \\gamma\\beta \\end{equation*}\r\n", - "\\begin{equation*} \\f{\\cosh}{\\alpha} = \\gamma \\end{equation*}\r\n", - " \\begin{align*} t\\bm{\\gamma_{t}}+x\\bm{\\gamma_{x}} = & \\gamma \\left(- \\beta x' + t'\\right) \\boldsymbol{\\gamma }_{t} \\\\ & + \\gamma \\left(- \\beta t' + x'\\right) \\boldsymbol{\\gamma }_{x} \\end{align*} \r\n", - " \\begin{align*} \\bm{A} = & A^{t} \\boldsymbol{\\gamma }_{t} \\\\ & + A^{x} \\boldsymbol{\\gamma }_{x} \\\\ & + A^{y} \\boldsymbol{\\gamma }_{y} \\\\ & + A^{z} \\boldsymbol{\\gamma }_{z} \\end{align*} \r\n", - " \\begin{align*} \\bm{\\psi} = & \\psi \\\\ & + \\psi ^{tx} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{x} \\\\ & + \\psi ^{ty} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{y} \\\\ & + \\psi ^{tz} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{z} \\\\ & + \\psi ^{xy} \\boldsymbol{\\gamma }_{x}\\wedge \\boldsymbol{\\gamma }_{y} \\\\ & + \\psi ^{xz} \\boldsymbol{\\gamma }_{x}\\wedge \\boldsymbol{\\gamma }_{z} \\\\ & + \\psi ^{yz} \\boldsymbol{\\gamma }_{y}\\wedge \\boldsymbol{\\gamma }_{z} \\\\ & + \\psi ^{txyz} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{x}\\wedge \\boldsymbol{\\gamma }_{y}\\wedge \\boldsymbol{\\gamma }_{z} \\end{align*} \r\n", - "\r\n", - "\\end{document}\r\n" - ] + "data": { + "text/plain": [ + "\n", + "\\documentclass[10pt,fleqn]{report}\n", + "\\usepackage[vcentering]{geometry}\n", + "\\geometry{papersize={14in,11in},total={13in,10in}}\n", + "\n", + "\\pagestyle{empty}\n", + "\\usepackage[latin1]{inputenc}\n", + "\\usepackage{amsmath}\n", + "\\usepackage{amsfonts}\n", + "\\usepackage{amssymb}\n", + "\\usepackage{amsbsy}\n", + "\\usepackage{tensor}\n", + "\\usepackage{listings}\n", + "\\usepackage{color}\n", + "\\usepackage{xcolor}\n", + "\\usepackage{bm}\n", + "\\usepackage{breqn}\n", + "\\definecolor{gray}{rgb}{0.95,0.95,0.95}\n", + "\\setlength{\\parindent}{0pt}\n", + "\\DeclareMathOperator{\\Tr}{Tr}\n", + "\\DeclareMathOperator{\\Adj}{Adj}\n", + "\\newcommand{\\bfrac}[2]{\\displaystyle\\frac{#1}{#2}}\n", + "\\newcommand{\\lp}{\\left (}\n", + "\\newcommand{\\rp}{\\right )}\n", + "\\newcommand{\\paren}[1]{\\lp {#1} \\rp}\n", + "\\newcommand{\\half}{\\frac{1}{2}}\n", + "\\newcommand{\\llt}{\\left <}\n", + "\\newcommand{\\rgt}{\\right >}\n", + "\\newcommand{\\abs}[1]{\\left |{#1}\\right | }\n", + "\\newcommand{\\pdiff}[2]{\\bfrac{\\partial {#1}}{\\partial {#2}}}\n", + "\\newcommand{\\lbrc}{\\left \\{}\n", + "\\newcommand{\\rbrc}{\\right \\}}\n", + "\\newcommand{\\W}{\\wedge}\n", + "\\newcommand{\\prm}[1]{{#1}'}\n", + "\\newcommand{\\ddt}[1]{\\bfrac{d{#1}}{dt}}\n", + "\\newcommand{\\R}{\\dagger}\n", + "\\newcommand{\\deriv}[3]{\\bfrac{d^{#3}#1}{d{#2}^{#3}}}\n", + "\\newcommand{\\grade}[1]{\\left < {#1} \\right >}\n", + "\\newcommand{\\f}[2]{{#1}\\lp{#2}\\rp}\n", + "\\newcommand{\\eval}[2]{\\left . {#1} \\right |_{#2}}\n", + "\\newcommand{\\Nabla}{\\boldsymbol{\\nabla}}\n", + "\\newcommand{\\eb}{\\boldsymbol{e}}\n", + "\\usepackage{float}\n", + "\\floatstyle{plain} % optionally change the style of the new float\n", + "\\newfloat{Code}{H}{myc}\n", + "\\lstloadlanguages{Python}\n", + "\n", + "\\begin{document}\n", + "\\begin{equation*} \\bm{A} = A + A^{x} \\boldsymbol{e}_{x} + A^{y} \\boldsymbol{e}_{y} + A^{z} \\boldsymbol{e}_{z} + A^{xy} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + A^{xz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + A^{yz} \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} + A^{xyz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\n", + " \\begin{align*} \\bm{A} = & A^{x} \\boldsymbol{e}_{x} \\\\ & + A^{y} \\boldsymbol{e}_{y} \\\\ & + A^{z} \\boldsymbol{e}_{z} \\end{align*} \n", + " \\begin{align*} \\bm{B} = & B^{xy} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} \\\\ & + B^{xz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} \\\\ & + B^{yz} \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{align*} \n", + " \\begin{align*} \\boldsymbol{\\nabla} f = & \\partial_{x} f \\boldsymbol{e}_{x} \\\\ & + \\partial_{y} f \\boldsymbol{e}_{y} \\\\ & + \\partial_{z} f \\boldsymbol{e}_{z} \\end{align*} \n", + "\\begin{equation*} \\boldsymbol{\\nabla} \\cdot \\bm{A} = \\partial_{x} A^{x} + \\partial_{y} A^{y} + \\partial_{z} A^{z} \\end{equation*}\n", + " \\begin{align*} \\boldsymbol{\\nabla} \\bm{A} = & \\left ( \\partial_{x} A^{x} + \\partial_{y} A^{y} + \\partial_{z} A^{z} \\right ) \\\\ & + \\left ( - \\partial_{y} A^{x} + \\partial_{x} A^{y} \\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} \\\\ & + \\left ( - \\partial_{z} A^{x} + \\partial_{x} A^{z} \\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} \\\\ & + \\left ( - \\partial_{z} A^{y} + \\partial_{y} A^{z} \\right ) \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{align*} \n", + " \\begin{align*} -I (\\boldsymbol{\\nabla} \\W \\bm{A}) = & \\left ( - \\partial_{z} A^{y} + \\partial_{y} A^{z} \\right ) \\boldsymbol{e}_{x} \\\\ & + \\left ( \\partial_{z} A^{x} - \\partial_{x} A^{z} \\right ) \\boldsymbol{e}_{y} \\\\ & + \\left ( - \\partial_{y} A^{x} + \\partial_{x} A^{y} \\right ) \\boldsymbol{e}_{z} \\end{align*} \n", + " \\begin{align*} \\boldsymbol{\\nabla} \\bm{B} = & \\left ( - \\partial_{y} B^{xy} - \\partial_{z} B^{xz} \\right ) \\boldsymbol{e}_{x} \\\\ & + \\left ( \\partial_{x} B^{xy} - \\partial_{z} B^{yz} \\right ) \\boldsymbol{e}_{y} \\\\ & + \\left ( \\partial_{x} B^{xz} + \\partial_{y} B^{yz} \\right ) \\boldsymbol{e}_{z} \\\\ & + \\left ( \\partial_{z} B^{xy} - \\partial_{y} B^{xz} + \\partial_{x} B^{yz} \\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{align*} \n", + "\\begin{equation*} \\boldsymbol{\\nabla} \\W \\bm{B} = \\left ( \\partial_{z} B^{xy} - \\partial_{y} B^{xz} + \\partial_{x} B^{yz} \\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\n", + " \\begin{align*} \\boldsymbol{\\nabla} \\cdot \\bm{B} = & \\left ( - \\partial_{y} B^{xy} - \\partial_{z} B^{xz} \\right ) \\boldsymbol{e}_{x} \\\\ & + \\left ( \\partial_{x} B^{xy} - \\partial_{z} B^{yz} \\right ) \\boldsymbol{e}_{y} \\\\ & + \\left ( \\partial_{x} B^{xz} + \\partial_{y} B^{yz} \\right ) \\boldsymbol{e}_{z} \\end{align*} \n", + "\\begin{equation*} g_{ij} = \\left [ \\begin{array}{cccc} \\left ( a\\cdot a\\right ) & \\left ( a\\cdot b\\right ) & \\left ( a\\cdot c\\right ) & \\left ( a\\cdot d\\right ) \\\\ \\left ( a\\cdot b\\right ) & \\left ( b\\cdot b\\right ) & \\left ( b\\cdot c\\right ) & \\left ( b\\cdot d\\right ) \\\\ \\left ( a\\cdot c\\right ) & \\left ( b\\cdot c\\right ) & \\left ( c\\cdot c\\right ) & \\left ( c\\cdot d\\right ) \\\\ \\left ( a\\cdot d\\right ) & \\left ( b\\cdot d\\right ) & \\left ( c\\cdot d\\right ) & \\left ( d\\cdot d\\right ) \\end{array}\\right ] \\end{equation*}\n", + " \\begin{align*} \\bm{a\\cdot (b c)} = & - \\left ( a\\cdot c\\right ) \\boldsymbol{b} \\\\ & + \\left ( a\\cdot b\\right ) \\boldsymbol{c} \\end{align*} \n", + " \\begin{align*} \\bm{a\\cdot (b\\W c)} = & - \\left ( a\\cdot c\\right ) \\boldsymbol{b} \\\\ & + \\left ( a\\cdot b\\right ) \\boldsymbol{c} \\end{align*} \n", + " \\begin{align*} \\bm{a\\cdot (b\\W c\\W d)} = & \\left ( a\\cdot d\\right ) \\boldsymbol{b}\\wedge \\boldsymbol{c} \\\\ & - \\left ( a\\cdot c\\right ) \\boldsymbol{b}\\wedge \\boldsymbol{d} \\\\ & + \\left ( a\\cdot b\\right ) \\boldsymbol{c}\\wedge \\boldsymbol{d} \\end{align*} \n", + "\\begin{equation*} \\bm{a\\cdot (b\\W c)+c\\cdot (a\\W b)+b\\cdot (c\\W a)} = 0 \\end{equation*}\n", + "\\begin{equation*} \\bm{a (b\\W c)-b (a\\W c)+c (a\\W b)} = 3 \\boldsymbol{a}\\wedge \\boldsymbol{b}\\wedge \\boldsymbol{c} \\end{equation*}\n", + "\\begin{equation*} \\bm{a (b\\W c\\W d)-b (a\\W c\\W d)+c (a\\W b\\W d)-d (a\\W b\\W c)} = 4 \\boldsymbol{a}\\wedge \\boldsymbol{b}\\wedge \\boldsymbol{c}\\wedge \\boldsymbol{d} \\end{equation*}\n", + "\\begin{equation*} \\bm{(a\\W b)\\cdot (c\\W d)} = - \\left ( a\\cdot c\\right ) \\left ( b\\cdot d\\right ) + \\left ( a\\cdot d\\right ) \\left ( b\\cdot c\\right ) \\end{equation*}\n", + "\\begin{equation*} \\bm{((a\\W b)\\cdot c)\\cdot d} = - \\left ( a\\cdot c\\right ) \\left ( b\\cdot d\\right ) + \\left ( a\\cdot d\\right ) \\left ( b\\cdot c\\right ) \\end{equation*}\n", + " \\begin{align*} \\bm{(a\\W b)\\times (c\\W d)} = & - \\left ( b\\cdot d\\right ) \\boldsymbol{a}\\wedge \\boldsymbol{c} \\\\ & + \\left ( b\\cdot c\\right ) \\boldsymbol{a}\\wedge \\boldsymbol{d} \\\\ & + \\left ( a\\cdot d\\right ) \\boldsymbol{b}\\wedge \\boldsymbol{c} \\\\ & - \\left ( a\\cdot c\\right ) \\boldsymbol{b}\\wedge \\boldsymbol{d} \\end{align*} \n", + "\\begin{equation*} E = \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{2}\\wedge \\boldsymbol{e}_{3} \\end{equation*}\n", + "\\begin{equation*} E^{2} = \\left ( e_{1}\\cdot e_{2}\\right ) ^{2} - 2 \\left ( e_{1}\\cdot e_{2}\\right ) \\left ( e_{1}\\cdot e_{3}\\right ) \\left ( e_{2}\\cdot e_{3}\\right ) + \\left ( e_{1}\\cdot e_{3}\\right ) ^{2} + \\left ( e_{2}\\cdot e_{3}\\right ) ^{2} - 1 \\end{equation*}\n", + " \\begin{align*} E1 = (e2\\W e3) E = & \\left ( \\left ( e_{2}\\cdot e_{3}\\right ) ^{2} - 1\\right ) \\boldsymbol{e}_{1} \\\\ & + \\left ( \\left ( e_{1}\\cdot e_{2}\\right ) - \\left ( e_{1}\\cdot e_{3}\\right ) \\left ( e_{2}\\cdot e_{3}\\right ) \\right ) \\boldsymbol{e}_{2} \\\\ & + \\left ( - \\left ( e_{1}\\cdot e_{2}\\right ) \\left ( e_{2}\\cdot e_{3}\\right ) + \\left ( e_{1}\\cdot e_{3}\\right ) \\right ) \\boldsymbol{e}_{3} \\end{align*} \n", + " \\begin{align*} E2 =-(e1\\W e3) E = & \\left ( \\left ( e_{1}\\cdot e_{2}\\right ) - \\left ( e_{1}\\cdot e_{3}\\right ) \\left ( e_{2}\\cdot e_{3}\\right ) \\right ) \\boldsymbol{e}_{1} \\\\ & + \\left ( \\left ( e_{1}\\cdot e_{3}\\right ) ^{2} - 1\\right ) \\boldsymbol{e}_{2} \\\\ & + \\left ( - \\left ( e_{1}\\cdot e_{2}\\right ) \\left ( e_{1}\\cdot e_{3}\\right ) + \\left ( e_{2}\\cdot e_{3}\\right ) \\right ) \\boldsymbol{e}_{3} \\end{align*} \n", + " \\begin{align*} E3 = (e1\\W e2) E = & \\left ( - \\left ( e_{1}\\cdot e_{2}\\right ) \\left ( e_{2}\\cdot e_{3}\\right ) + \\left ( e_{1}\\cdot e_{3}\\right ) \\right ) \\boldsymbol{e}_{1} \\\\ & + \\left ( - \\left ( e_{1}\\cdot e_{2}\\right ) \\left ( e_{1}\\cdot e_{3}\\right ) + \\left ( e_{2}\\cdot e_{3}\\right ) \\right ) \\boldsymbol{e}_{2} \\\\ & + \\left ( \\left ( e_{1}\\cdot e_{2}\\right ) ^{2} - 1\\right ) \\boldsymbol{e}_{3} \\end{align*} \n", + "\\begin{equation*} E1\\cdot e2 = 0 \\end{equation*}\n", + "\\begin{equation*} E1\\cdot e3 = 0 \\end{equation*}\n", + "\\begin{equation*} E2\\cdot e1 = 0 \\end{equation*}\n", + "\\begin{equation*} E2\\cdot e3 = 0 \\end{equation*}\n", + "\\begin{equation*} E3\\cdot e1 = 0 \\end{equation*}\n", + "\\begin{equation*} E3\\cdot e2 = 0 \\end{equation*}\n", + "\\begin{equation*} (E1\\cdot e1)/E^{2} = 1 \\end{equation*}\n", + "\\begin{equation*} (E2\\cdot e2)/E^{2} = 1 \\end{equation*}\n", + "\\begin{equation*} (E3\\cdot e3)/E^{2} = 1 \\end{equation*}\n", + " \\begin{align*} A = & A^{r} \\boldsymbol{e}_{r} \\\\ & + A^{\\theta } \\boldsymbol{e}_{\\theta } \\\\ & + A^{\\phi } \\boldsymbol{e}_{\\phi } \\end{align*} \n", + " \\begin{align*} B = & B^{r\\theta } \\boldsymbol{e}_{r}\\wedge \\boldsymbol{e}_{\\theta } \\\\ & + B^{r\\phi } \\boldsymbol{e}_{r}\\wedge \\boldsymbol{e}_{\\phi } \\\\ & + B^{\\theta \\phi } \\boldsymbol{e}_{\\theta }\\wedge \\boldsymbol{e}_{\\phi } \\end{align*} \n", + " \\begin{align*} \\boldsymbol{\\nabla} f = & \\partial_{r} f \\boldsymbol{e}_{r} \\\\ & + \\frac{\\partial_{\\theta } f }{r} \\boldsymbol{e}_{\\theta } \\\\ & + \\frac{\\partial_{\\phi } f }{r \\sin{\\left (\\theta \\right )}} \\boldsymbol{e}_{\\phi } \\end{align*} \n", + "\\begin{equation*} \\boldsymbol{\\nabla} \\cdot A = \\frac{r \\partial_{r} A^{r} + 2 A^{r} + \\frac{A^{\\theta } }{\\tan{\\left (\\theta \\right )}} + \\partial_{\\theta } A^{\\theta } + \\frac{\\partial_{\\phi } A^{\\phi } }{\\sin{\\left (\\theta \\right )}}}{r} \\end{equation*}\n", + " \\begin{align*} -I (\\boldsymbol{\\nabla} \\W A) = & \\frac{\\frac{A^{\\phi } }{\\tan{\\left (\\theta \\right )}} + \\partial_{\\theta } A^{\\phi } - \\frac{\\partial_{\\phi } A^{\\theta } }{\\sin{\\left (\\theta \\right )}}}{r} \\boldsymbol{e}_{r} \\\\ & + \\frac{- r \\partial_{r} A^{\\phi } - A^{\\phi } + \\frac{\\partial_{\\phi } A^{r} }{\\sin{\\left (\\theta \\right )}}}{r} \\boldsymbol{e}_{\\theta } \\\\ & + \\frac{r \\partial_{r} A^{\\theta } + A^{\\theta } - \\partial_{\\theta } A^{r} }{r} \\boldsymbol{e}_{\\phi } \\end{align*} \n", + "\\begin{equation*} \\boldsymbol{\\nabla} \\W B = \\frac{r \\partial_{r} B^{\\theta \\phi } - \\frac{B^{r\\phi } }{\\tan{\\left (\\theta \\right )}} + 2 B^{\\theta \\phi } - \\partial_{\\theta } B^{r\\phi } + \\frac{\\partial_{\\phi } B^{r\\theta } }{\\sin{\\left (\\theta \\right )}}}{r} \\boldsymbol{e}_{r}\\wedge \\boldsymbol{e}_{\\theta }\\wedge \\boldsymbol{e}_{\\phi } \\end{equation*}\n", + " \\begin{align*} B = \\bm{B\\gamma_{t}} = & - B^{x} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{x} \\\\ & - B^{y} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{y} \\\\ & - B^{z} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{z} \\end{align*} \n", + " \\begin{align*} E = \\bm{E\\gamma_{t}} = & - E^{x} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{x} \\\\ & - E^{y} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{y} \\\\ & - E^{z} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{z} \\end{align*} \n", + " \\begin{align*} F = E+IB = & - E^{x} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{x} \\\\ & - E^{y} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{y} \\\\ & - E^{z} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{z} \\\\ & - B^{z} \\boldsymbol{\\gamma }_{x}\\wedge \\boldsymbol{\\gamma }_{y} \\\\ & + B^{y} \\boldsymbol{\\gamma }_{x}\\wedge \\boldsymbol{\\gamma }_{z} \\\\ & - B^{x} \\boldsymbol{\\gamma }_{y}\\wedge \\boldsymbol{\\gamma }_{z} \\end{align*} \n", + " \\begin{align*} J = & J^{t} \\boldsymbol{\\gamma }_{t} \\\\ & + J^{x} \\boldsymbol{\\gamma }_{x} \\\\ & + J^{y} \\boldsymbol{\\gamma }_{y} \\\\ & + J^{z} \\boldsymbol{\\gamma }_{z} \\end{align*} \n", + "\\begin{equation*} \\boldsymbol{\\nabla} F = J \\end{equation*}\n", + " \\begin{align*} R = & \\cosh{\\left (\\frac{\\alpha }{2} \\right )} \\\\ & + \\sinh{\\left (\\frac{\\alpha }{2} \\right )} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{x} \\end{align*} \n", + "\\begin{equation*} t\\bm{\\gamma_{t}}+x\\bm{\\gamma_{x}} = t'\\bm{\\gamma'_{t}}+x'\\bm{\\gamma'_{x}} = R\\lp t'\\bm{\\gamma_{t}}+x'\\bm{\\gamma_{x}}\\rp R^{\\dagger} \\end{equation*}\n", + " \\begin{align*} t\\bm{\\gamma_{t}}+x\\bm{\\gamma_{x}} = & \\left ( t' \\cosh{\\left (\\alpha \\right )} - x' \\sinh{\\left (\\alpha \\right )}\\right ) \\boldsymbol{\\gamma }_{t} \\\\ & + \\left ( - t' \\sinh{\\left (\\alpha \\right )} + x' \\cosh{\\left (\\alpha \\right )}\\right ) \\boldsymbol{\\gamma }_{x} \\end{align*} \n", + "\\begin{equation*} \\f{\\sinh}{\\alpha} = \\gamma\\beta \\end{equation*}\n", + "\\begin{equation*} \\f{\\cosh}{\\alpha} = \\gamma \\end{equation*}\n", + " \\begin{align*} t\\bm{\\gamma_{t}}+x\\bm{\\gamma_{x}} = & \\gamma \\left(- \\beta x' + t'\\right) \\boldsymbol{\\gamma }_{t} \\\\ & + \\gamma \\left(- \\beta t' + x'\\right) \\boldsymbol{\\gamma }_{x} \\end{align*} \n", + " \\begin{align*} \\bm{A} = & A^{t} \\boldsymbol{\\gamma }_{t} \\\\ & + A^{x} \\boldsymbol{\\gamma }_{x} \\\\ & + A^{y} \\boldsymbol{\\gamma }_{y} \\\\ & + A^{z} \\boldsymbol{\\gamma }_{z} \\end{align*} \n", + " \\begin{align*} \\bm{\\psi} = & \\psi \\\\ & + \\psi ^{tx} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{x} \\\\ & + \\psi ^{ty} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{y} \\\\ & + \\psi ^{tz} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{z} \\\\ & + \\psi ^{xy} \\boldsymbol{\\gamma }_{x}\\wedge \\boldsymbol{\\gamma }_{y} \\\\ & + \\psi ^{xz} \\boldsymbol{\\gamma }_{x}\\wedge \\boldsymbol{\\gamma }_{z} \\\\ & + \\psi ^{yz} \\boldsymbol{\\gamma }_{y}\\wedge \\boldsymbol{\\gamma }_{z} \\\\ & + \\psi ^{txyz} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{x}\\wedge \\boldsymbol{\\gamma }_{y}\\wedge \\boldsymbol{\\gamma }_{z} \\end{align*} \n", + "\n", + "\\end{document}\n" + ] + }, + "metadata": {}, + "output_type": "display_data" } ], "source": [ - "!cat print_check_latex.tex" + "check('print_check_latex')" ] }, { "cell_type": "code", - "execution_count": 36, + "execution_count": 19, "metadata": {}, - "outputs": [], - "source": [ - "!python products_latex.py" - ] - }, - { - "cell_type": "code", - "execution_count": 37, - "metadata": { - "collapsed": false, - "scrolled": false - }, "outputs": [ { - "name": "stdout", - "output_type": "stream", - "text": [ - "\r\n", - "\\documentclass[10pt,fleqn]{report}\r\n", - "\r\n", - "\\pagestyle{empty}\r\n", - "\\usepackage[latin1]{inputenc}\r\n", - "\\usepackage{amsmath}\r\n", - "\\usepackage{amsfonts}\r\n", - "\\usepackage{amssymb}\r\n", - "\\usepackage{amsbsy}\r\n", - "\\usepackage{tensor}\r\n", - "\\usepackage{listings}\r\n", - "\\usepackage{color}\r\n", - "\\usepackage{xcolor}\r\n", - "\\usepackage{bm}\r\n", - "\\usepackage{breqn}\r\n", - "\\definecolor{gray}{rgb}{0.95,0.95,0.95}\r\n", - "\\setlength{\\parindent}{0pt}\r\n", - "\\DeclareMathOperator{\\Tr}{Tr}\r\n", - "\\DeclareMathOperator{\\Adj}{Adj}\r\n", - "\\newcommand{\\bfrac}[2]{\\displaystyle\\frac{#1}{#2}}\r\n", - "\\newcommand{\\lp}{\\left (}\r\n", - "\\newcommand{\\rp}{\\right )}\r\n", - "\\newcommand{\\paren}[1]{\\lp {#1} \\rp}\r\n", - "\\newcommand{\\half}{\\frac{1}{2}}\r\n", - "\\newcommand{\\llt}{\\left <}\r\n", - "\\newcommand{\\rgt}{\\right >}\r\n", - "\\newcommand{\\abs}[1]{\\left |{#1}\\right | }\r\n", - "\\newcommand{\\pdiff}[2]{\\bfrac{\\partial {#1}}{\\partial {#2}}}\r\n", - "\\newcommand{\\lbrc}{\\left \\{}\r\n", - "\\newcommand{\\rbrc}{\\right \\}}\r\n", - "\\newcommand{\\W}{\\wedge}\r\n", - "\\newcommand{\\prm}[1]{{#1}'}\r\n", - "\\newcommand{\\ddt}[1]{\\bfrac{d{#1}}{dt}}\r\n", - "\\newcommand{\\R}{\\dagger}\r\n", - "\\newcommand{\\deriv}[3]{\\bfrac{d^{#3}#1}{d{#2}^{#3}}}\r\n", - "\\newcommand{\\grade}[1]{\\left < {#1} \\right >}\r\n", - "\\newcommand{\\f}[2]{{#1}\\lp{#2}\\rp}\r\n", - "\\newcommand{\\eval}[2]{\\left . {#1} \\right |_{#2}}\r\n", - "\\newcommand{\\Nabla}{\\boldsymbol{\\nabla}}\r\n", - "\\newcommand{\\eb}{\\boldsymbol{e}}\r\n", - "\\usepackage{float}\r\n", - "\\floatstyle{plain} % optionally change the style of the new float\r\n", - "\\newfloat{Code}{H}{myc}\r\n", - "\\lstloadlanguages{Python}\r\n", - "\r\n", - "\\begin{document}\r\n", - "3D Orthogonal Metric\\newline\r\n", - "Multvectors:\r\n", - "\\begin{equation*} s = s \\end{equation*}\r\n", - "\\begin{equation*} v = v^{x} \\boldsymbol{e}_{x} + v^{y} \\boldsymbol{e}_{y} + v^{z} \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} b = b^{xy} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + b^{xz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + b^{yz} \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "Products:\r\n", - "\\begin{equation*} s s = s^{2} \\end{equation*}\r\n", - "\\begin{equation*} s \\W s = s^{2} \\end{equation*}\r\n", - "\\begin{equation*} s \\rfloor s = s^{2} \\end{equation*}\r\n", - "\\begin{equation*} s \\lfloor s = s^{2} \\end{equation*}\r\n", - "\\begin{equation*} s v = s v^{x} \\boldsymbol{e}_{x} + s v^{y} \\boldsymbol{e}_{y} + s v^{z} \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} s \\W v = s v^{x} \\boldsymbol{e}_{x} + s v^{y} \\boldsymbol{e}_{y} + s v^{z} \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} s \\rfloor v = s v^{x} \\boldsymbol{e}_{x} + s v^{y} \\boldsymbol{e}_{y} + s v^{z} \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} s \\lfloor v = 0 \\end{equation*}\r\n", - "\\begin{equation*} s b = b^{xy} s \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + b^{xz} s \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + b^{yz} s \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} s \\W b = b^{xy} s \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + b^{xz} s \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + b^{yz} s \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} s \\rfloor b = b^{xy} s \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + b^{xz} s \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + b^{yz} s \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} s \\lfloor b = 0 \\end{equation*}\r\n", - "\\begin{equation*} v s = s v^{x} \\boldsymbol{e}_{x} + s v^{y} \\boldsymbol{e}_{y} + s v^{z} \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} v \\W s = s v^{x} \\boldsymbol{e}_{x} + s v^{y} \\boldsymbol{e}_{y} + s v^{z} \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} v \\rfloor s = 0 \\end{equation*}\r\n", - "\\begin{equation*} v \\lfloor s = s v^{x} \\boldsymbol{e}_{x} + s v^{y} \\boldsymbol{e}_{y} + s v^{z} \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} v v = {\\left ( v^{x} \\right )}^{2} + {\\left ( v^{y} \\right )}^{2} + {\\left ( v^{z} \\right )}^{2} \\end{equation*}\r\n", - "\\begin{equation*} v \\W v = 0 \\end{equation*}\r\n", - "\\begin{equation*} v \\cdot v = {\\left ( v^{x} \\right )}^{2} + {\\left ( v^{y} \\right )}^{2} + {\\left ( v^{z} \\right )}^{2} \\end{equation*}\r\n", - "\\begin{equation*} v \\rfloor v = {\\left ( v^{x} \\right )}^{2} + {\\left ( v^{y} \\right )}^{2} + {\\left ( v^{z} \\right )}^{2} \\end{equation*}\r\n", - "\\begin{equation*} v \\lfloor v = {\\left ( v^{x} \\right )}^{2} + {\\left ( v^{y} \\right )}^{2} + {\\left ( v^{z} \\right )}^{2} \\end{equation*}\r\n", - "\\begin{equation*} v b = \\left ( - b^{xy} v^{y} - b^{xz} v^{z}\\right ) \\boldsymbol{e}_{x} + \\left ( b^{xy} v^{x} - b^{yz} v^{z}\\right ) \\boldsymbol{e}_{y} + \\left ( b^{xz} v^{x} + b^{yz} v^{y}\\right ) \\boldsymbol{e}_{z} + \\left ( b^{xy} v^{z} - b^{xz} v^{y} + b^{yz} v^{x}\\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} v \\W b = \\left ( b^{xy} v^{z} - b^{xz} v^{y} + b^{yz} v^{x}\\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} v \\cdot b = \\left ( - b^{xy} v^{y} - b^{xz} v^{z}\\right ) \\boldsymbol{e}_{x} + \\left ( b^{xy} v^{x} - b^{yz} v^{z}\\right ) \\boldsymbol{e}_{y} + \\left ( b^{xz} v^{x} + b^{yz} v^{y}\\right ) \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} v \\rfloor b = \\left ( - b^{xy} v^{y} - b^{xz} v^{z}\\right ) \\boldsymbol{e}_{x} + \\left ( b^{xy} v^{x} - b^{yz} v^{z}\\right ) \\boldsymbol{e}_{y} + \\left ( b^{xz} v^{x} + b^{yz} v^{y}\\right ) \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} v \\lfloor b = 0 \\end{equation*}\r\n", - "\\begin{equation*} b s = b^{xy} s \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + b^{xz} s \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + b^{yz} s \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} b \\W s = b^{xy} s \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + b^{xz} s \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + b^{yz} s \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} b \\rfloor s = 0 \\end{equation*}\r\n", - "\\begin{equation*} b \\lfloor s = b^{xy} s \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + b^{xz} s \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + b^{yz} s \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} b v = \\left ( b^{xy} v^{y} + b^{xz} v^{z}\\right ) \\boldsymbol{e}_{x} + \\left ( - b^{xy} v^{x} + b^{yz} v^{z}\\right ) \\boldsymbol{e}_{y} + \\left ( - b^{xz} v^{x} - b^{yz} v^{y}\\right ) \\boldsymbol{e}_{z} + \\left ( b^{xy} v^{z} - b^{xz} v^{y} + b^{yz} v^{x}\\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} b \\W v = \\left ( b^{xy} v^{z} - b^{xz} v^{y} + b^{yz} v^{x}\\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} b \\cdot v = \\left ( b^{xy} v^{y} + b^{xz} v^{z}\\right ) \\boldsymbol{e}_{x} + \\left ( - b^{xy} v^{x} + b^{yz} v^{z}\\right ) \\boldsymbol{e}_{y} + \\left ( - b^{xz} v^{x} - b^{yz} v^{y}\\right ) \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} b \\rfloor v = 0 \\end{equation*}\r\n", - "\\begin{equation*} b \\lfloor v = \\left ( b^{xy} v^{y} + b^{xz} v^{z}\\right ) \\boldsymbol{e}_{x} + \\left ( - b^{xy} v^{x} + b^{yz} v^{z}\\right ) \\boldsymbol{e}_{y} + \\left ( - b^{xz} v^{x} - b^{yz} v^{y}\\right ) \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} b b = - {\\left ( b^{xy} \\right )}^{2} - {\\left ( b^{xz} \\right )}^{2} - {\\left ( b^{yz} \\right )}^{2} \\end{equation*}\r\n", - "\\begin{equation*} b \\W b = 0 \\end{equation*}\r\n", - "\\begin{equation*} b \\cdot b = - {\\left ( b^{xy} \\right )}^{2} - {\\left ( b^{xz} \\right )}^{2} - {\\left ( b^{yz} \\right )}^{2} \\end{equation*}\r\n", - "\\begin{equation*} b \\rfloor b = - {\\left ( b^{xy} \\right )}^{2} - {\\left ( b^{xz} \\right )}^{2} - {\\left ( b^{yz} \\right )}^{2} \\end{equation*}\r\n", - "\\begin{equation*} b \\lfloor b = - {\\left ( b^{xy} \\right )}^{2} - {\\left ( b^{xz} \\right )}^{2} - {\\left ( b^{yz} \\right )}^{2} \\end{equation*}\r\n", - "Multivector Functions:\r\n", - "\\begin{equation*} s(X) = s \\end{equation*}\r\n", - "\\begin{equation*} v(X) = v^{x} \\boldsymbol{e}_{x} + v^{y} \\boldsymbol{e}_{y} + v^{z} \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} b(X) = b^{xy} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + b^{xz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + b^{yz} \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "Products:\r\n", - "\\begin{equation*} \\boldsymbol{\\nabla} s = \\partial_{x} s \\boldsymbol{e}_{x} + \\partial_{y} s \\boldsymbol{e}_{y} + \\partial_{z} s \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} \\boldsymbol{\\nabla} \\W s = \\partial_{x} s \\boldsymbol{e}_{x} + \\partial_{y} s \\boldsymbol{e}_{y} + \\partial_{z} s \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} \\boldsymbol{\\nabla} \\rfloor s = 0 \\end{equation*}\r\n", - "\\begin{equation*} \\boldsymbol{\\nabla} \\lfloor s = \\partial_{x} s \\boldsymbol{e}_{x} + \\partial_{y} s \\boldsymbol{e}_{y} + \\partial_{z} s \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} \\boldsymbol{\\nabla} v = \\left ( \\partial_{x} v^{x} + \\partial_{y} v^{y} + \\partial_{z} v^{z} \\right ) + \\left ( - \\partial_{y} v^{x} + \\partial_{x} v^{y} \\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + \\left ( - \\partial_{z} v^{x} + \\partial_{x} v^{z} \\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + \\left ( - \\partial_{z} v^{y} + \\partial_{y} v^{z} \\right ) \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} \\boldsymbol{\\nabla} \\W v = \\left ( - \\partial_{y} v^{x} + \\partial_{x} v^{y} \\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + \\left ( - \\partial_{z} v^{x} + \\partial_{x} v^{z} \\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + \\left ( - \\partial_{z} v^{y} + \\partial_{y} v^{z} \\right ) \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} \\boldsymbol{\\nabla} \\cdot v = \\partial_{x} v^{x} + \\partial_{y} v^{y} + \\partial_{z} v^{z} \\end{equation*}\r\n", - "\\begin{equation*} \\boldsymbol{\\nabla} \\rfloor v = \\partial_{x} v^{x} + \\partial_{y} v^{y} + \\partial_{z} v^{z} \\end{equation*}\r\n", - "\\begin{equation*} \\boldsymbol{\\nabla} \\lfloor v = \\partial_{x} v^{x} + \\partial_{y} v^{y} + \\partial_{z} v^{z} \\end{equation*}\r\n", - "\\begin{equation*} \\boldsymbol{\\nabla} b = \\left ( - \\partial_{y} b^{xy} - \\partial_{z} b^{xz} \\right ) \\boldsymbol{e}_{x} + \\left ( \\partial_{x} b^{xy} - \\partial_{z} b^{yz} \\right ) \\boldsymbol{e}_{y} + \\left ( \\partial_{x} b^{xz} + \\partial_{y} b^{yz} \\right ) \\boldsymbol{e}_{z} + \\left ( \\partial_{z} b^{xy} - \\partial_{y} b^{xz} + \\partial_{x} b^{yz} \\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} \\boldsymbol{\\nabla} \\W b = \\left ( \\partial_{z} b^{xy} - \\partial_{y} b^{xz} + \\partial_{x} b^{yz} \\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} \\boldsymbol{\\nabla} \\cdot b = \\left ( - \\partial_{y} b^{xy} - \\partial_{z} b^{xz} \\right ) \\boldsymbol{e}_{x} + \\left ( \\partial_{x} b^{xy} - \\partial_{z} b^{yz} \\right ) \\boldsymbol{e}_{y} + \\left ( \\partial_{x} b^{xz} + \\partial_{y} b^{yz} \\right ) \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} \\boldsymbol{\\nabla} \\rfloor b = \\left ( - \\partial_{y} b^{xy} - \\partial_{z} b^{xz} \\right ) \\boldsymbol{e}_{x} + \\left ( \\partial_{x} b^{xy} - \\partial_{z} b^{yz} \\right ) \\boldsymbol{e}_{y} + \\left ( \\partial_{x} b^{xz} + \\partial_{y} b^{yz} \\right ) \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} \\boldsymbol{\\nabla} \\lfloor b = 0 \\end{equation*}\r\n", - "\\begin{equation*} s \\boldsymbol{\\nabla} = \\boldsymbol{e}_{x} s \\frac{\\partial}{\\partial x} + \\boldsymbol{e}_{y} s \\frac{\\partial}{\\partial y} + \\boldsymbol{e}_{z} s \\frac{\\partial}{\\partial z} \\end{equation*}\r\n", - "\\begin{equation*} s \\W \\boldsymbol{\\nabla} = \\boldsymbol{e}_{x} s \\frac{\\partial}{\\partial x} + \\boldsymbol{e}_{y} s \\frac{\\partial}{\\partial y} + \\boldsymbol{e}_{z} s \\frac{\\partial}{\\partial z} \\end{equation*}\r\n", - "\\begin{equation*} s \\rfloor \\boldsymbol{\\nabla} = \\boldsymbol{e}_{x} s \\frac{\\partial}{\\partial x} + \\boldsymbol{e}_{y} s \\frac{\\partial}{\\partial y} + \\boldsymbol{e}_{z} s \\frac{\\partial}{\\partial z} \\end{equation*}\r\n", - "\\begin{equation*} s \\lfloor \\boldsymbol{\\nabla} = \\end{equation*}\r\n", - "\\begin{equation*} s s = {s }^{2} \\end{equation*}\r\n", - "\\begin{equation*} s \\W s = {s }^{2} \\end{equation*}\r\n", - "\\begin{equation*} s \\rfloor s = {s }^{2} \\end{equation*}\r\n", - "\\begin{equation*} s \\lfloor s = {s }^{2} \\end{equation*}\r\n", - "\\begin{equation*} s v = s v^{x} \\boldsymbol{e}_{x} + s v^{y} \\boldsymbol{e}_{y} + s v^{z} \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} s \\W v = s v^{x} \\boldsymbol{e}_{x} + s v^{y} \\boldsymbol{e}_{y} + s v^{z} \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} s \\rfloor v = s v^{x} \\boldsymbol{e}_{x} + s v^{y} \\boldsymbol{e}_{y} + s v^{z} \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} s \\lfloor v = 0 \\end{equation*}\r\n", - "\\begin{equation*} s b = b^{xy} s \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + b^{xz} s \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + b^{yz} s \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} s \\W b = b^{xy} s \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + b^{xz} s \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + b^{yz} s \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} s \\rfloor b = b^{xy} s \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + b^{xz} s \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + b^{yz} s \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} s \\lfloor b = 0 \\end{equation*}\r\n", - "\\begin{equation*} v \\boldsymbol{\\nabla} = v^{x} \\frac{\\partial}{\\partial x} + v^{y} \\frac{\\partial}{\\partial y} + v^{z} \\frac{\\partial}{\\partial z} + \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} \\left ( - v^{y} \\frac{\\partial}{\\partial x} + v^{x} \\frac{\\partial}{\\partial y}\\right ) + \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} \\left ( - v^{z} \\frac{\\partial}{\\partial x} + v^{x} \\frac{\\partial}{\\partial z}\\right ) + \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\left ( - v^{z} \\frac{\\partial}{\\partial y} + v^{y} \\frac{\\partial}{\\partial z}\\right ) \\end{equation*}\r\n", - "\\begin{equation*} v \\W \\boldsymbol{\\nabla} = \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} \\left ( - v^{y} \\frac{\\partial}{\\partial x} + v^{x} \\frac{\\partial}{\\partial y}\\right ) + \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} \\left ( - v^{z} \\frac{\\partial}{\\partial x} + v^{x} \\frac{\\partial}{\\partial z}\\right ) + \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\left ( - v^{z} \\frac{\\partial}{\\partial y} + v^{y} \\frac{\\partial}{\\partial z}\\right ) \\end{equation*}\r\n", - "\\begin{equation*} v \\cdot \\boldsymbol{\\nabla} = v^{x} \\frac{\\partial}{\\partial x} + v^{y} \\frac{\\partial}{\\partial y} + v^{z} \\frac{\\partial}{\\partial z} \\end{equation*}\r\n", - "\\begin{equation*} v \\rfloor \\boldsymbol{\\nabla} = v^{x} \\frac{\\partial}{\\partial x} + v^{y} \\frac{\\partial}{\\partial y} + v^{z} \\frac{\\partial}{\\partial z} \\end{equation*}\r\n", - "\\begin{equation*} v \\lfloor \\boldsymbol{\\nabla} = v^{x} \\frac{\\partial}{\\partial x} + v^{y} \\frac{\\partial}{\\partial y} + v^{z} \\frac{\\partial}{\\partial z} \\end{equation*}\r\n", - "\\begin{equation*} v s = s v^{x} \\boldsymbol{e}_{x} + s v^{y} \\boldsymbol{e}_{y} + s v^{z} \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} v \\W s = s v^{x} \\boldsymbol{e}_{x} + s v^{y} \\boldsymbol{e}_{y} + s v^{z} \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} v \\rfloor s = 0 \\end{equation*}\r\n", - "\\begin{equation*} v \\lfloor s = s v^{x} \\boldsymbol{e}_{x} + s v^{y} \\boldsymbol{e}_{y} + s v^{z} \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} v v = {v^{x} }^{2} + {v^{y} }^{2} + {v^{z} }^{2} \\end{equation*}\r\n", - "\\begin{equation*} v \\W v = 0 \\end{equation*}\r\n", - "\\begin{equation*} v \\cdot v = {v^{x} }^{2} + {v^{y} }^{2} + {v^{z} }^{2} \\end{equation*}\r\n", - "\\begin{equation*} v \\rfloor v = {v^{x} }^{2} + {v^{y} }^{2} + {v^{z} }^{2} \\end{equation*}\r\n", - "\\begin{equation*} v \\lfloor v = {v^{x} }^{2} + {v^{y} }^{2} + {v^{z} }^{2} \\end{equation*}\r\n", - "\\begin{equation*} v b = \\left ( - b^{xy} v^{y} - b^{xz} v^{z} \\right ) \\boldsymbol{e}_{x} + \\left ( b^{xy} v^{x} - b^{yz} v^{z} \\right ) \\boldsymbol{e}_{y} + \\left ( b^{xz} v^{x} + b^{yz} v^{y} \\right ) \\boldsymbol{e}_{z} + \\left ( b^{xy} v^{z} - b^{xz} v^{y} + b^{yz} v^{x} \\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} v \\W b = \\left ( b^{xy} v^{z} - b^{xz} v^{y} + b^{yz} v^{x} \\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} v \\cdot b = \\left ( - b^{xy} v^{y} - b^{xz} v^{z} \\right ) \\boldsymbol{e}_{x} + \\left ( b^{xy} v^{x} - b^{yz} v^{z} \\right ) \\boldsymbol{e}_{y} + \\left ( b^{xz} v^{x} + b^{yz} v^{y} \\right ) \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} v \\rfloor b = \\left ( - b^{xy} v^{y} - b^{xz} v^{z} \\right ) \\boldsymbol{e}_{x} + \\left ( b^{xy} v^{x} - b^{yz} v^{z} \\right ) \\boldsymbol{e}_{y} + \\left ( b^{xz} v^{x} + b^{yz} v^{y} \\right ) \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} v \\lfloor b = 0 \\end{equation*}\r\n", - "\\begin{equation*} b \\boldsymbol{\\nabla} = \\boldsymbol{e}_{x} \\left ( b^{xy} \\frac{\\partial}{\\partial y} + b^{xz} \\frac{\\partial}{\\partial z}\\right ) + \\boldsymbol{e}_{y} \\left ( - b^{xy} \\frac{\\partial}{\\partial x} + b^{yz} \\frac{\\partial}{\\partial z}\\right ) + \\boldsymbol{e}_{z} \\left ( - b^{xz} \\frac{\\partial}{\\partial x} - b^{yz} \\frac{\\partial}{\\partial y}\\right ) + \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\left ( b^{yz} \\frac{\\partial}{\\partial x} - b^{xz} \\frac{\\partial}{\\partial y} + b^{xy} \\frac{\\partial}{\\partial z}\\right ) \\end{equation*}\r\n", - "\\begin{equation*} b \\W \\boldsymbol{\\nabla} = \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\left ( b^{yz} \\frac{\\partial}{\\partial x} - b^{xz} \\frac{\\partial}{\\partial y} + b^{xy} \\frac{\\partial}{\\partial z}\\right ) \\end{equation*}\r\n", - "\\begin{equation*} b \\cdot \\boldsymbol{\\nabla} = \\boldsymbol{e}_{x} \\left ( b^{xy} \\frac{\\partial}{\\partial y} + b^{xz} \\frac{\\partial}{\\partial z}\\right ) + \\boldsymbol{e}_{y} \\left ( - b^{xy} \\frac{\\partial}{\\partial x} + b^{yz} \\frac{\\partial}{\\partial z}\\right ) + \\boldsymbol{e}_{z} \\left ( - b^{xz} \\frac{\\partial}{\\partial x} - b^{yz} \\frac{\\partial}{\\partial y}\\right ) \\end{equation*}\r\n", - "\\begin{equation*} b \\rfloor \\boldsymbol{\\nabla} = \\end{equation*}\r\n", - "\\begin{equation*} b \\lfloor \\boldsymbol{\\nabla} = \\boldsymbol{e}_{x} \\left ( b^{xy} \\frac{\\partial}{\\partial y} + b^{xz} \\frac{\\partial}{\\partial z}\\right ) + \\boldsymbol{e}_{y} \\left ( - b^{xy} \\frac{\\partial}{\\partial x} + b^{yz} \\frac{\\partial}{\\partial z}\\right ) + \\boldsymbol{e}_{z} \\left ( - b^{xz} \\frac{\\partial}{\\partial x} - b^{yz} \\frac{\\partial}{\\partial y}\\right ) \\end{equation*}\r\n", - "\\begin{equation*} b s = b^{xy} s \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + b^{xz} s \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + b^{yz} s \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} b \\W s = b^{xy} s \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + b^{xz} s \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + b^{yz} s \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} b \\rfloor s = 0 \\end{equation*}\r\n", - "\\begin{equation*} b \\lfloor s = b^{xy} s \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + b^{xz} s \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + b^{yz} s \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} b v = \\left ( b^{xy} v^{y} + b^{xz} v^{z} \\right ) \\boldsymbol{e}_{x} + \\left ( - b^{xy} v^{x} + b^{yz} v^{z} \\right ) \\boldsymbol{e}_{y} + \\left ( - b^{xz} v^{x} - b^{yz} v^{y} \\right ) \\boldsymbol{e}_{z} + \\left ( b^{xy} v^{z} - b^{xz} v^{y} + b^{yz} v^{x} \\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} b \\W v = \\left ( b^{xy} v^{z} - b^{xz} v^{y} + b^{yz} v^{x} \\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} b \\cdot v = \\left ( b^{xy} v^{y} + b^{xz} v^{z} \\right ) \\boldsymbol{e}_{x} + \\left ( - b^{xy} v^{x} + b^{yz} v^{z} \\right ) \\boldsymbol{e}_{y} + \\left ( - b^{xz} v^{x} - b^{yz} v^{y} \\right ) \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} b \\rfloor v = 0 \\end{equation*}\r\n", - "\\begin{equation*} b \\lfloor v = \\left ( b^{xy} v^{y} + b^{xz} v^{z} \\right ) \\boldsymbol{e}_{x} + \\left ( - b^{xy} v^{x} + b^{yz} v^{z} \\right ) \\boldsymbol{e}_{y} + \\left ( - b^{xz} v^{x} - b^{yz} v^{y} \\right ) \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} b b = - {b^{xy} }^{2} - {b^{xz} }^{2} - {b^{yz} }^{2} \\end{equation*}\r\n", - "\\begin{equation*} b \\W b = 0 \\end{equation*}\r\n", - "\\begin{equation*} b \\cdot b = - {b^{xy} }^{2} - {b^{xz} }^{2} - {b^{yz} }^{2} \\end{equation*}\r\n", - "\\begin{equation*} b \\rfloor b = - {b^{xy} }^{2} - {b^{xz} }^{2} - {b^{yz} }^{2} \\end{equation*}\r\n", - "\\begin{equation*} b \\lfloor b = - {b^{xy} }^{2} - {b^{xz} }^{2} - {b^{yz} }^{2} \\end{equation*}\r\n", - "General 2D Metric\\newline\r\n", - "Multivector Functions:\r\n", - "\\begin{equation*} s(X) = s \\end{equation*}\r\n", - "\\begin{equation*} v(X) = v^{x} \\boldsymbol{e}_{x} + v^{y} \\boldsymbol{e}_{y} \\end{equation*}\r\n", - "\\begin{equation*} b(X) = v^{xy} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} \\end{equation*}\r\n", - "Products:\r\n", - "\\begin{equation*} \\boldsymbol{\\nabla} s = \\frac{- \\left ( e_{x}\\cdot e_{y}\\right ) \\partial_{y} s + \\left ( e_{y}\\cdot e_{y}\\right ) \\partial_{x} s }{\\left ( e_{x}\\cdot e_{x}\\right ) \\left ( e_{y}\\cdot e_{y}\\right ) - \\left ( e_{x}\\cdot e_{y}\\right ) ^{2}} \\boldsymbol{e}_{x} + \\frac{\\left ( e_{x}\\cdot e_{x}\\right ) \\partial_{y} s - \\left ( e_{x}\\cdot e_{y}\\right ) \\partial_{x} s }{\\left ( e_{x}\\cdot e_{x}\\right ) \\left ( e_{y}\\cdot e_{y}\\right ) - \\left ( e_{x}\\cdot e_{y}\\right ) ^{2}} \\boldsymbol{e}_{y} \\end{equation*}\r\n", - "\\begin{equation*} \\boldsymbol{\\nabla} \\W s = \\frac{- \\left ( e_{x}\\cdot e_{y}\\right ) \\partial_{y} s + \\left ( e_{y}\\cdot e_{y}\\right ) \\partial_{x} s }{\\left ( e_{x}\\cdot e_{x}\\right ) \\left ( e_{y}\\cdot e_{y}\\right ) - \\left ( e_{x}\\cdot e_{y}\\right ) ^{2}} \\boldsymbol{e}_{x} + \\frac{\\left ( e_{x}\\cdot e_{x}\\right ) \\partial_{y} s - \\left ( e_{x}\\cdot e_{y}\\right ) \\partial_{x} s }{\\left ( e_{x}\\cdot e_{x}\\right ) \\left ( e_{y}\\cdot e_{y}\\right ) - \\left ( e_{x}\\cdot e_{y}\\right ) ^{2}} \\boldsymbol{e}_{y} \\end{equation*}\r\n", - "\\begin{equation*} \\boldsymbol{\\nabla} \\cdot s = Not Allowed \\end{equation*}\r\n", - "\\begin{equation*} \\boldsymbol{\\nabla} \\rfloor s = 0 \\end{equation*}\r\n", - "\\begin{equation*} \\boldsymbol{\\nabla} \\lfloor s = \\frac{- \\left ( e_{x}\\cdot e_{y}\\right ) \\partial_{y} s + \\left ( e_{y}\\cdot e_{y}\\right ) \\partial_{x} s }{\\left ( e_{x}\\cdot e_{x}\\right ) \\left ( e_{y}\\cdot e_{y}\\right ) - \\left ( e_{x}\\cdot e_{y}\\right ) ^{2}} \\boldsymbol{e}_{x} + \\frac{\\left ( e_{x}\\cdot e_{x}\\right ) \\partial_{y} s - \\left ( e_{x}\\cdot e_{y}\\right ) \\partial_{x} s }{\\left ( e_{x}\\cdot e_{x}\\right ) \\left ( e_{y}\\cdot e_{y}\\right ) - \\left ( e_{x}\\cdot e_{y}\\right ) ^{2}} \\boldsymbol{e}_{y} \\end{equation*}\r\n", - "\\begin{equation*} \\boldsymbol{\\nabla} v = \\left ( \\partial_{x} v^{x} + \\partial_{y} v^{y} \\right ) + \\frac{- \\left ( e_{x}\\cdot e_{x}\\right ) \\partial_{y} v^{x} + \\left ( e_{x}\\cdot e_{y}\\right ) \\partial_{x} v^{x} - \\left ( e_{x}\\cdot e_{y}\\right ) \\partial_{y} v^{y} + \\left ( e_{y}\\cdot e_{y}\\right ) \\partial_{x} v^{y} }{\\left ( e_{x}\\cdot e_{x}\\right ) \\left ( e_{y}\\cdot e_{y}\\right ) - \\left ( e_{x}\\cdot e_{y}\\right ) ^{2}} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} \\end{equation*}\r\n", - "\\begin{equation*} \\boldsymbol{\\nabla} \\W v = \\frac{- \\left ( e_{x}\\cdot e_{x}\\right ) \\partial_{y} v^{x} + \\left ( e_{x}\\cdot e_{y}\\right ) \\partial_{x} v^{x} - \\left ( e_{x}\\cdot e_{y}\\right ) \\partial_{y} v^{y} + \\left ( e_{y}\\cdot e_{y}\\right ) \\partial_{x} v^{y} }{\\left ( e_{x}\\cdot e_{x}\\right ) \\left ( e_{y}\\cdot e_{y}\\right ) - \\left ( e_{x}\\cdot e_{y}\\right ) ^{2}} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} \\end{equation*}\r\n", - "\\begin{equation*} \\boldsymbol{\\nabla} \\cdot v = \\partial_{x} v^{x} + \\partial_{y} v^{y} \\end{equation*}\r\n", - "\\begin{equation*} \\boldsymbol{\\nabla} \\rfloor v = \\partial_{x} v^{x} + \\partial_{y} v^{y} \\end{equation*}\r\n", - "\\begin{equation*} \\boldsymbol{\\nabla} \\lfloor v = \\partial_{x} v^{x} + \\partial_{y} v^{y} \\end{equation*}\r\n", - "\\begin{equation*} s \\boldsymbol{\\nabla} = \\boldsymbol{e}_{x} \\left ( \\frac{\\left ( e_{y}\\cdot e_{y}\\right ) s }{\\left ( e_{x}\\cdot e_{x}\\right ) \\left ( e_{y}\\cdot e_{y}\\right ) - \\left ( e_{x}\\cdot e_{y}\\right ) ^{2}} \\frac{\\partial}{\\partial x} - \\frac{\\left ( e_{x}\\cdot e_{y}\\right ) s }{\\left ( e_{x}\\cdot e_{x}\\right ) \\left ( e_{y}\\cdot e_{y}\\right ) - \\left ( e_{x}\\cdot e_{y}\\right ) ^{2}} \\frac{\\partial}{\\partial y}\\right ) + \\boldsymbol{e}_{y} \\left ( - \\frac{\\left ( e_{x}\\cdot e_{y}\\right ) s }{\\left ( e_{x}\\cdot e_{x}\\right ) \\left ( e_{y}\\cdot e_{y}\\right ) - \\left ( e_{x}\\cdot e_{y}\\right ) ^{2}} \\frac{\\partial}{\\partial x} + \\frac{\\left ( e_{x}\\cdot e_{x}\\right ) s }{\\left ( e_{x}\\cdot e_{x}\\right ) \\left ( e_{y}\\cdot e_{y}\\right ) - \\left ( e_{x}\\cdot e_{y}\\right ) ^{2}} \\frac{\\partial}{\\partial y}\\right ) \\end{equation*}\r\n", - "\\begin{equation*} s \\W \\boldsymbol{\\nabla} = \\boldsymbol{e}_{x} \\left ( \\frac{\\left ( e_{y}\\cdot e_{y}\\right ) s }{\\left ( e_{x}\\cdot e_{x}\\right ) \\left ( e_{y}\\cdot e_{y}\\right ) - \\left ( e_{x}\\cdot e_{y}\\right ) ^{2}} \\frac{\\partial}{\\partial x} - \\frac{\\left ( e_{x}\\cdot e_{y}\\right ) s }{\\left ( e_{x}\\cdot e_{x}\\right ) \\left ( e_{y}\\cdot e_{y}\\right ) - \\left ( e_{x}\\cdot e_{y}\\right ) ^{2}} \\frac{\\partial}{\\partial y}\\right ) + \\boldsymbol{e}_{y} \\left ( - \\frac{\\left ( e_{x}\\cdot e_{y}\\right ) s }{\\left ( e_{x}\\cdot e_{x}\\right ) \\left ( e_{y}\\cdot e_{y}\\right ) - \\left ( e_{x}\\cdot e_{y}\\right ) ^{2}} \\frac{\\partial}{\\partial x} + \\frac{\\left ( e_{x}\\cdot e_{x}\\right ) s }{\\left ( e_{x}\\cdot e_{x}\\right ) \\left ( e_{y}\\cdot e_{y}\\right ) - \\left ( e_{x}\\cdot e_{y}\\right ) ^{2}} \\frac{\\partial}{\\partial y}\\right ) \\end{equation*}\r\n", - "\\begin{equation*} s \\cdot \\boldsymbol{\\nabla} = Not Allowed \\end{equation*}\r\n", - "\\begin{equation*} s \\rfloor \\boldsymbol{\\nabla} = \\boldsymbol{e}_{x} \\left ( \\frac{\\left ( e_{y}\\cdot e_{y}\\right ) s }{\\left ( e_{x}\\cdot e_{x}\\right ) \\left ( e_{y}\\cdot e_{y}\\right ) - \\left ( e_{x}\\cdot e_{y}\\right ) ^{2}} \\frac{\\partial}{\\partial x} - \\frac{\\left ( e_{x}\\cdot e_{y}\\right ) s }{\\left ( e_{x}\\cdot e_{x}\\right ) \\left ( e_{y}\\cdot e_{y}\\right ) - \\left ( e_{x}\\cdot e_{y}\\right ) ^{2}} \\frac{\\partial}{\\partial y}\\right ) + \\boldsymbol{e}_{y} \\left ( - \\frac{\\left ( e_{x}\\cdot e_{y}\\right ) s }{\\left ( e_{x}\\cdot e_{x}\\right ) \\left ( e_{y}\\cdot e_{y}\\right ) - \\left ( e_{x}\\cdot e_{y}\\right ) ^{2}} \\frac{\\partial}{\\partial x} + \\frac{\\left ( e_{x}\\cdot e_{x}\\right ) s }{\\left ( e_{x}\\cdot e_{x}\\right ) \\left ( e_{y}\\cdot e_{y}\\right ) - \\left ( e_{x}\\cdot e_{y}\\right ) ^{2}} \\frac{\\partial}{\\partial y}\\right ) \\end{equation*}\r\n", - "\\begin{equation*} s \\lfloor \\boldsymbol{\\nabla} = \\end{equation*}\r\n", - "\\begin{equation*} s s = {s }^{2} \\end{equation*}\r\n", - "\\begin{equation*} s \\W s = {s }^{2} \\end{equation*}\r\n", - "\\begin{equation*} s \\cdot s = Not Allowed \\end{equation*}\r\n", - "\\begin{equation*} s \\rfloor s = {s }^{2} \\end{equation*}\r\n", - "\\begin{equation*} s \\lfloor s = {s }^{2} \\end{equation*}\r\n", - "\\begin{equation*} s v = s v^{x} \\boldsymbol{e}_{x} + s v^{y} \\boldsymbol{e}_{y} \\end{equation*}\r\n", - "\\begin{equation*} s \\W v = s v^{x} \\boldsymbol{e}_{x} + s v^{y} \\boldsymbol{e}_{y} \\end{equation*}\r\n", - "\\begin{equation*} s \\cdot v = Not Allowed \\end{equation*}\r\n", - "\\begin{equation*} s \\rfloor v = s v^{x} \\boldsymbol{e}_{x} + s v^{y} \\boldsymbol{e}_{y} \\end{equation*}\r\n", - "\\begin{equation*} s \\lfloor v = 0 \\end{equation*}\r\n", - "\\begin{equation*} v \\boldsymbol{\\nabla} = v^{x} \\frac{\\partial}{\\partial x} + v^{y} \\frac{\\partial}{\\partial y} + \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} \\left ( - \\frac{\\left ( e_{x}\\cdot e_{y}\\right ) v^{x} + \\left ( e_{y}\\cdot e_{y}\\right ) v^{y} }{\\left ( e_{x}\\cdot e_{x}\\right ) \\left ( e_{y}\\cdot e_{y}\\right ) - \\left ( e_{x}\\cdot e_{y}\\right ) ^{2}} \\frac{\\partial}{\\partial x} + \\frac{\\left ( e_{x}\\cdot e_{x}\\right ) v^{x} + \\left ( e_{x}\\cdot e_{y}\\right ) v^{y} }{\\left ( e_{x}\\cdot e_{x}\\right ) \\left ( e_{y}\\cdot e_{y}\\right ) - \\left ( e_{x}\\cdot e_{y}\\right ) ^{2}} \\frac{\\partial}{\\partial y}\\right ) \\end{equation*}\r\n", - "\\begin{equation*} v \\W \\boldsymbol{\\nabla} = \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} \\left ( - \\frac{\\left ( e_{x}\\cdot e_{y}\\right ) v^{x} + \\left ( e_{y}\\cdot e_{y}\\right ) v^{y} }{\\left ( e_{x}\\cdot e_{x}\\right ) \\left ( e_{y}\\cdot e_{y}\\right ) - \\left ( e_{x}\\cdot e_{y}\\right ) ^{2}} \\frac{\\partial}{\\partial x} + \\frac{\\left ( e_{x}\\cdot e_{x}\\right ) v^{x} + \\left ( e_{x}\\cdot e_{y}\\right ) v^{y} }{\\left ( e_{x}\\cdot e_{x}\\right ) \\left ( e_{y}\\cdot e_{y}\\right ) - \\left ( e_{x}\\cdot e_{y}\\right ) ^{2}} \\frac{\\partial}{\\partial y}\\right ) \\end{equation*}\r\n", - "\\begin{equation*} v \\cdot \\boldsymbol{\\nabla} = v^{x} \\frac{\\partial}{\\partial x} + v^{y} \\frac{\\partial}{\\partial y} \\end{equation*}\r\n", - "\\begin{equation*} v \\rfloor \\boldsymbol{\\nabla} = v^{x} \\frac{\\partial}{\\partial x} + v^{y} \\frac{\\partial}{\\partial y} \\end{equation*}\r\n", - "\\begin{equation*} v \\lfloor \\boldsymbol{\\nabla} = v^{x} \\frac{\\partial}{\\partial x} + v^{y} \\frac{\\partial}{\\partial y} \\end{equation*}\r\n", - "\\begin{equation*} v s = s v^{x} \\boldsymbol{e}_{x} + s v^{y} \\boldsymbol{e}_{y} \\end{equation*}\r\n", - "\\begin{equation*} v \\W s = s v^{x} \\boldsymbol{e}_{x} + s v^{y} \\boldsymbol{e}_{y} \\end{equation*}\r\n", - "\\begin{equation*} v \\cdot s = Not Allowed \\end{equation*}\r\n", - "\\begin{equation*} v \\rfloor s = 0 \\end{equation*}\r\n", - "\\begin{equation*} v \\lfloor s = s v^{x} \\boldsymbol{e}_{x} + s v^{y} \\boldsymbol{e}_{y} \\end{equation*}\r\n", - "\\begin{equation*} v v = \\left ( e_{x}\\cdot e_{x}\\right ) {v^{x} }^{2} + 2 \\left ( e_{x}\\cdot e_{y}\\right ) v^{x} v^{y} + \\left ( e_{y}\\cdot e_{y}\\right ) {v^{y} }^{2} \\end{equation*}\r\n", - "\\begin{equation*} v \\W v = 0 \\end{equation*}\r\n", - "\\begin{equation*} v \\cdot v = \\left ( e_{x}\\cdot e_{x}\\right ) {v^{x} }^{2} + 2 \\left ( e_{x}\\cdot e_{y}\\right ) v^{x} v^{y} + \\left ( e_{y}\\cdot e_{y}\\right ) {v^{y} }^{2} \\end{equation*}\r\n", - "\\begin{equation*} v \\rfloor v = \\left ( e_{x}\\cdot e_{x}\\right ) {v^{x} }^{2} + 2 \\left ( e_{x}\\cdot e_{y}\\right ) v^{x} v^{y} + \\left ( e_{y}\\cdot e_{y}\\right ) {v^{y} }^{2} \\end{equation*}\r\n", - "\\begin{equation*} v \\lfloor v = \\left ( e_{x}\\cdot e_{x}\\right ) {v^{x} }^{2} + 2 \\left ( e_{x}\\cdot e_{y}\\right ) v^{x} v^{y} + \\left ( e_{y}\\cdot e_{y}\\right ) {v^{y} }^{2} \\end{equation*}\r\n", - "\\end{document}\r\n" - ] + "data": { + "text/plain": [ + "\n", + "\\documentclass[10pt,fleqn]{report}\n", + "\n", + "\\pagestyle{empty}\n", + "\\usepackage[latin1]{inputenc}\n", + "\\usepackage{amsmath}\n", + "\\usepackage{amsfonts}\n", + "\\usepackage{amssymb}\n", + "\\usepackage{amsbsy}\n", + "\\usepackage{tensor}\n", + "\\usepackage{listings}\n", + "\\usepackage{color}\n", + "\\usepackage{xcolor}\n", + "\\usepackage{bm}\n", + "\\usepackage{breqn}\n", + "\\definecolor{gray}{rgb}{0.95,0.95,0.95}\n", + "\\setlength{\\parindent}{0pt}\n", + "\\DeclareMathOperator{\\Tr}{Tr}\n", + "\\DeclareMathOperator{\\Adj}{Adj}\n", + "\\newcommand{\\bfrac}[2]{\\displaystyle\\frac{#1}{#2}}\n", + "\\newcommand{\\lp}{\\left (}\n", + "\\newcommand{\\rp}{\\right )}\n", + "\\newcommand{\\paren}[1]{\\lp {#1} \\rp}\n", + "\\newcommand{\\half}{\\frac{1}{2}}\n", + "\\newcommand{\\llt}{\\left <}\n", + "\\newcommand{\\rgt}{\\right >}\n", + "\\newcommand{\\abs}[1]{\\left |{#1}\\right | }\n", + "\\newcommand{\\pdiff}[2]{\\bfrac{\\partial {#1}}{\\partial {#2}}}\n", + "\\newcommand{\\lbrc}{\\left \\{}\n", + "\\newcommand{\\rbrc}{\\right \\}}\n", + "\\newcommand{\\W}{\\wedge}\n", + "\\newcommand{\\prm}[1]{{#1}'}\n", + "\\newcommand{\\ddt}[1]{\\bfrac{d{#1}}{dt}}\n", + "\\newcommand{\\R}{\\dagger}\n", + "\\newcommand{\\deriv}[3]{\\bfrac{d^{#3}#1}{d{#2}^{#3}}}\n", + "\\newcommand{\\grade}[1]{\\left < {#1} \\right >}\n", + "\\newcommand{\\f}[2]{{#1}\\lp{#2}\\rp}\n", + "\\newcommand{\\eval}[2]{\\left . {#1} \\right |_{#2}}\n", + "\\newcommand{\\Nabla}{\\boldsymbol{\\nabla}}\n", + "\\newcommand{\\eb}{\\boldsymbol{e}}\n", + "\\usepackage{float}\n", + "\\floatstyle{plain} % optionally change the style of the new float\n", + "\\newfloat{Code}{H}{myc}\n", + "\\lstloadlanguages{Python}\n", + "\n", + "\\begin{document}\n", + "3D Orthogonal Metric\\newline\n", + "Multvectors:\n", + "\\begin{equation*} s = s \\end{equation*}\n", + "\\begin{equation*} v = v^{x} \\boldsymbol{e}_{x} + v^{y} \\boldsymbol{e}_{y} + v^{z} \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} b = b^{xy} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + b^{xz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + b^{yz} \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\n", + "Products:\n", + "\\begin{equation*} s s = s^{2} \\end{equation*}\n", + "\\begin{equation*} s \\W s = s^{2} \\end{equation*}\n", + "\\begin{equation*} s \\rfloor s = s^{2} \\end{equation*}\n", + "\\begin{equation*} s \\lfloor s = s^{2} \\end{equation*}\n", + "\\begin{equation*} s v = s v^{x} \\boldsymbol{e}_{x} + s v^{y} \\boldsymbol{e}_{y} + s v^{z} \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} s \\W v = s v^{x} \\boldsymbol{e}_{x} + s v^{y} \\boldsymbol{e}_{y} + s v^{z} \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} s \\rfloor v = s v^{x} \\boldsymbol{e}_{x} + s v^{y} \\boldsymbol{e}_{y} + s v^{z} \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} s \\lfloor v = 0 \\end{equation*}\n", + "\\begin{equation*} s b = b^{xy} s \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + b^{xz} s \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + b^{yz} s \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} s \\W b = b^{xy} s \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + b^{xz} s \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + b^{yz} s \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} s \\rfloor b = b^{xy} s \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + b^{xz} s \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + b^{yz} s \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} s \\lfloor b = 0 \\end{equation*}\n", + "\\begin{equation*} v s = s v^{x} \\boldsymbol{e}_{x} + s v^{y} \\boldsymbol{e}_{y} + s v^{z} \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} v \\W s = s v^{x} \\boldsymbol{e}_{x} + s v^{y} \\boldsymbol{e}_{y} + s v^{z} \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} v \\rfloor s = 0 \\end{equation*}\n", + "\\begin{equation*} v \\lfloor s = s v^{x} \\boldsymbol{e}_{x} + s v^{y} \\boldsymbol{e}_{y} + s v^{z} \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} v v = {\\left ( v^{x} \\right )}^{2} + {\\left ( v^{y} \\right )}^{2} + {\\left ( v^{z} \\right )}^{2} \\end{equation*}\n", + "\\begin{equation*} v \\W v = 0 \\end{equation*}\n", + "\\begin{equation*} v \\cdot v = {\\left ( v^{x} \\right )}^{2} + {\\left ( v^{y} \\right )}^{2} + {\\left ( v^{z} \\right )}^{2} \\end{equation*}\n", + "\\begin{equation*} v \\rfloor v = {\\left ( v^{x} \\right )}^{2} + {\\left ( v^{y} \\right )}^{2} + {\\left ( v^{z} \\right )}^{2} \\end{equation*}\n", + "\\begin{equation*} v \\lfloor v = {\\left ( v^{x} \\right )}^{2} + {\\left ( v^{y} \\right )}^{2} + {\\left ( v^{z} \\right )}^{2} \\end{equation*}\n", + "\\begin{equation*} v b = \\left ( - b^{xy} v^{y} - b^{xz} v^{z}\\right ) \\boldsymbol{e}_{x} + \\left ( b^{xy} v^{x} - b^{yz} v^{z}\\right ) \\boldsymbol{e}_{y} + \\left ( b^{xz} v^{x} + b^{yz} v^{y}\\right ) \\boldsymbol{e}_{z} + \\left ( b^{xy} v^{z} - b^{xz} v^{y} + b^{yz} v^{x}\\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} v \\W b = \\left ( b^{xy} v^{z} - b^{xz} v^{y} + b^{yz} v^{x}\\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} v \\cdot b = \\left ( - b^{xy} v^{y} - b^{xz} v^{z}\\right ) \\boldsymbol{e}_{x} + \\left ( b^{xy} v^{x} - b^{yz} v^{z}\\right ) \\boldsymbol{e}_{y} + \\left ( b^{xz} v^{x} + b^{yz} v^{y}\\right ) \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} v \\rfloor b = \\left ( - b^{xy} v^{y} - b^{xz} v^{z}\\right ) \\boldsymbol{e}_{x} + \\left ( b^{xy} v^{x} - b^{yz} v^{z}\\right ) \\boldsymbol{e}_{y} + \\left ( b^{xz} v^{x} + b^{yz} v^{y}\\right ) \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} v \\lfloor b = 0 \\end{equation*}\n", + "\\begin{equation*} b s = b^{xy} s \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + b^{xz} s \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + b^{yz} s \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} b \\W s = b^{xy} s \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + b^{xz} s \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + b^{yz} s \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} b \\rfloor s = 0 \\end{equation*}\n", + "\\begin{equation*} b \\lfloor s = b^{xy} s \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + b^{xz} s \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + b^{yz} s \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} b v = \\left ( b^{xy} v^{y} + b^{xz} v^{z}\\right ) \\boldsymbol{e}_{x} + \\left ( - b^{xy} v^{x} + b^{yz} v^{z}\\right ) \\boldsymbol{e}_{y} + \\left ( - b^{xz} v^{x} - b^{yz} v^{y}\\right ) \\boldsymbol{e}_{z} + \\left ( b^{xy} v^{z} - b^{xz} v^{y} + b^{yz} v^{x}\\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} b \\W v = \\left ( b^{xy} v^{z} - b^{xz} v^{y} + b^{yz} v^{x}\\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} b \\cdot v = \\left ( b^{xy} v^{y} + b^{xz} v^{z}\\right ) \\boldsymbol{e}_{x} + \\left ( - b^{xy} v^{x} + b^{yz} v^{z}\\right ) \\boldsymbol{e}_{y} + \\left ( - b^{xz} v^{x} - b^{yz} v^{y}\\right ) \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} b \\rfloor v = 0 \\end{equation*}\n", + "\\begin{equation*} b \\lfloor v = \\left ( b^{xy} v^{y} + b^{xz} v^{z}\\right ) \\boldsymbol{e}_{x} + \\left ( - b^{xy} v^{x} + b^{yz} v^{z}\\right ) \\boldsymbol{e}_{y} + \\left ( - b^{xz} v^{x} - b^{yz} v^{y}\\right ) \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} b b = - {\\left ( b^{xy} \\right )}^{2} - {\\left ( b^{xz} \\right )}^{2} - {\\left ( b^{yz} \\right )}^{2} \\end{equation*}\n", + "\\begin{equation*} b \\W b = 0 \\end{equation*}\n", + "\\begin{equation*} b \\cdot b = - {\\left ( b^{xy} \\right )}^{2} - {\\left ( b^{xz} \\right )}^{2} - {\\left ( b^{yz} \\right )}^{2} \\end{equation*}\n", + "\\begin{equation*} b \\rfloor b = - {\\left ( b^{xy} \\right )}^{2} - {\\left ( b^{xz} \\right )}^{2} - {\\left ( b^{yz} \\right )}^{2} \\end{equation*}\n", + "\\begin{equation*} b \\lfloor b = - {\\left ( b^{xy} \\right )}^{2} - {\\left ( b^{xz} \\right )}^{2} - {\\left ( b^{yz} \\right )}^{2} \\end{equation*}\n", + "Multivector Functions:\n", + "\\begin{equation*} s(X) = s \\end{equation*}\n", + "\\begin{equation*} v(X) = v^{x} \\boldsymbol{e}_{x} + v^{y} \\boldsymbol{e}_{y} + v^{z} \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} b(X) = b^{xy} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + b^{xz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + b^{yz} \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\n", + "Products:\n", + "\\begin{equation*} \\boldsymbol{\\nabla} s = \\partial_{x} s \\boldsymbol{e}_{x} + \\partial_{y} s \\boldsymbol{e}_{y} + \\partial_{z} s \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} \\boldsymbol{\\nabla} \\W s = \\partial_{x} s \\boldsymbol{e}_{x} + \\partial_{y} s \\boldsymbol{e}_{y} + \\partial_{z} s \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} \\boldsymbol{\\nabla} \\rfloor s = 0 \\end{equation*}\n", + "\\begin{equation*} \\boldsymbol{\\nabla} \\lfloor s = \\partial_{x} s \\boldsymbol{e}_{x} + \\partial_{y} s \\boldsymbol{e}_{y} + \\partial_{z} s \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} \\boldsymbol{\\nabla} v = \\left ( \\partial_{x} v^{x} + \\partial_{y} v^{y} + \\partial_{z} v^{z} \\right ) + \\left ( - \\partial_{y} v^{x} + \\partial_{x} v^{y} \\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + \\left ( - \\partial_{z} v^{x} + \\partial_{x} v^{z} \\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + \\left ( - \\partial_{z} v^{y} + \\partial_{y} v^{z} \\right ) \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} \\boldsymbol{\\nabla} \\W v = \\left ( - \\partial_{y} v^{x} + \\partial_{x} v^{y} \\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + \\left ( - \\partial_{z} v^{x} + \\partial_{x} v^{z} \\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + \\left ( - \\partial_{z} v^{y} + \\partial_{y} v^{z} \\right ) \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} \\boldsymbol{\\nabla} \\cdot v = \\partial_{x} v^{x} + \\partial_{y} v^{y} + \\partial_{z} v^{z} \\end{equation*}\n", + "\\begin{equation*} \\boldsymbol{\\nabla} \\rfloor v = \\partial_{x} v^{x} + \\partial_{y} v^{y} + \\partial_{z} v^{z} \\end{equation*}\n", + "\\begin{equation*} \\boldsymbol{\\nabla} \\lfloor v = \\partial_{x} v^{x} + \\partial_{y} v^{y} + \\partial_{z} v^{z} \\end{equation*}\n", + "\\begin{equation*} \\boldsymbol{\\nabla} b = \\left ( - \\partial_{y} b^{xy} - \\partial_{z} b^{xz} \\right ) \\boldsymbol{e}_{x} + \\left ( \\partial_{x} b^{xy} - \\partial_{z} b^{yz} \\right ) \\boldsymbol{e}_{y} + \\left ( \\partial_{x} b^{xz} + \\partial_{y} b^{yz} \\right ) \\boldsymbol{e}_{z} + \\left ( \\partial_{z} b^{xy} - \\partial_{y} b^{xz} + \\partial_{x} b^{yz} \\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} \\boldsymbol{\\nabla} \\W b = \\left ( \\partial_{z} b^{xy} - \\partial_{y} b^{xz} + \\partial_{x} b^{yz} \\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} \\boldsymbol{\\nabla} \\cdot b = \\left ( - \\partial_{y} b^{xy} - \\partial_{z} b^{xz} \\right ) \\boldsymbol{e}_{x} + \\left ( \\partial_{x} b^{xy} - \\partial_{z} b^{yz} \\right ) \\boldsymbol{e}_{y} + \\left ( \\partial_{x} b^{xz} + \\partial_{y} b^{yz} \\right ) \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} \\boldsymbol{\\nabla} \\rfloor b = \\left ( - \\partial_{y} b^{xy} - \\partial_{z} b^{xz} \\right ) \\boldsymbol{e}_{x} + \\left ( \\partial_{x} b^{xy} - \\partial_{z} b^{yz} \\right ) \\boldsymbol{e}_{y} + \\left ( \\partial_{x} b^{xz} + \\partial_{y} b^{yz} \\right ) \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} \\boldsymbol{\\nabla} \\lfloor b = 0 \\end{equation*}\n", + "\\begin{equation*} s \\boldsymbol{\\nabla} = \\boldsymbol{e}_{x} s \\frac{\\partial}{\\partial x} + \\boldsymbol{e}_{y} s \\frac{\\partial}{\\partial y} + \\boldsymbol{e}_{z} s \\frac{\\partial}{\\partial z} \\end{equation*}\n", + "\\begin{equation*} s \\W \\boldsymbol{\\nabla} = \\boldsymbol{e}_{x} s \\frac{\\partial}{\\partial x} + \\boldsymbol{e}_{y} s \\frac{\\partial}{\\partial y} + \\boldsymbol{e}_{z} s \\frac{\\partial}{\\partial z} \\end{equation*}\n", + "\\begin{equation*} s \\rfloor \\boldsymbol{\\nabla} = \\boldsymbol{e}_{x} s \\frac{\\partial}{\\partial x} + \\boldsymbol{e}_{y} s \\frac{\\partial}{\\partial y} + \\boldsymbol{e}_{z} s \\frac{\\partial}{\\partial z} \\end{equation*}\n", + "\\begin{equation*} s \\lfloor \\boldsymbol{\\nabla} = 0 \\end{equation*}\n", + "\\begin{equation*} s s = {s }^{2} \\end{equation*}\n", + "\\begin{equation*} s \\W s = {s }^{2} \\end{equation*}\n", + "\\begin{equation*} s \\rfloor s = {s }^{2} \\end{equation*}\n", + "\\begin{equation*} s \\lfloor s = {s }^{2} \\end{equation*}\n", + "\\begin{equation*} s v = s v^{x} \\boldsymbol{e}_{x} + s v^{y} \\boldsymbol{e}_{y} + s v^{z} \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} s \\W v = s v^{x} \\boldsymbol{e}_{x} + s v^{y} \\boldsymbol{e}_{y} + s v^{z} \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} s \\rfloor v = s v^{x} \\boldsymbol{e}_{x} + s v^{y} \\boldsymbol{e}_{y} + s v^{z} \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} s \\lfloor v = 0 \\end{equation*}\n", + "\\begin{equation*} s b = b^{xy} s \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + b^{xz} s \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + b^{yz} s \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} s \\W b = b^{xy} s \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + b^{xz} s \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + b^{yz} s \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} s \\rfloor b = b^{xy} s \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + b^{xz} s \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + b^{yz} s \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} s \\lfloor b = 0 \\end{equation*}\n", + "\\begin{equation*} v \\boldsymbol{\\nabla} = v^{x} \\frac{\\partial}{\\partial x} + v^{y} \\frac{\\partial}{\\partial y} + v^{z} \\frac{\\partial}{\\partial z} + \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} \\left ( - v^{y} \\frac{\\partial}{\\partial x} + v^{x} \\frac{\\partial}{\\partial y}\\right ) + \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} \\left ( - v^{z} \\frac{\\partial}{\\partial x} + v^{x} \\frac{\\partial}{\\partial z}\\right ) + \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\left ( - v^{z} \\frac{\\partial}{\\partial y} + v^{y} \\frac{\\partial}{\\partial z}\\right ) \\end{equation*}\n", + "\\begin{equation*} v \\W \\boldsymbol{\\nabla} = \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} \\left ( - v^{y} \\frac{\\partial}{\\partial x} + v^{x} \\frac{\\partial}{\\partial y}\\right ) + \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} \\left ( - v^{z} \\frac{\\partial}{\\partial x} + v^{x} \\frac{\\partial}{\\partial z}\\right ) + \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\left ( - v^{z} \\frac{\\partial}{\\partial y} + v^{y} \\frac{\\partial}{\\partial z}\\right ) \\end{equation*}\n", + "\\begin{equation*} v \\cdot \\boldsymbol{\\nabla} = v^{x} \\frac{\\partial}{\\partial x} + v^{y} \\frac{\\partial}{\\partial y} + v^{z} \\frac{\\partial}{\\partial z} \\end{equation*}\n", + "\\begin{equation*} v \\rfloor \\boldsymbol{\\nabla} = v^{x} \\frac{\\partial}{\\partial x} + v^{y} \\frac{\\partial}{\\partial y} + v^{z} \\frac{\\partial}{\\partial z} \\end{equation*}\n", + "\\begin{equation*} v \\lfloor \\boldsymbol{\\nabla} = v^{x} \\frac{\\partial}{\\partial x} + v^{y} \\frac{\\partial}{\\partial y} + v^{z} \\frac{\\partial}{\\partial z} \\end{equation*}\n", + "\\begin{equation*} v s = s v^{x} \\boldsymbol{e}_{x} + s v^{y} \\boldsymbol{e}_{y} + s v^{z} \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} v \\W s = s v^{x} \\boldsymbol{e}_{x} + s v^{y} \\boldsymbol{e}_{y} + s v^{z} \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} v \\rfloor s = 0 \\end{equation*}\n", + "\\begin{equation*} v \\lfloor s = s v^{x} \\boldsymbol{e}_{x} + s v^{y} \\boldsymbol{e}_{y} + s v^{z} \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} v v = {v^{x} }^{2} + {v^{y} }^{2} + {v^{z} }^{2} \\end{equation*}\n", + "\\begin{equation*} v \\W v = 0 \\end{equation*}\n", + "\\begin{equation*} v \\cdot v = {v^{x} }^{2} + {v^{y} }^{2} + {v^{z} }^{2} \\end{equation*}\n", + "\\begin{equation*} v \\rfloor v = {v^{x} }^{2} + {v^{y} }^{2} + {v^{z} }^{2} \\end{equation*}\n", + "\\begin{equation*} v \\lfloor v = {v^{x} }^{2} + {v^{y} }^{2} + {v^{z} }^{2} \\end{equation*}\n", + "\\begin{equation*} v b = \\left ( - b^{xy} v^{y} - b^{xz} v^{z} \\right ) \\boldsymbol{e}_{x} + \\left ( b^{xy} v^{x} - b^{yz} v^{z} \\right ) \\boldsymbol{e}_{y} + \\left ( b^{xz} v^{x} + b^{yz} v^{y} \\right ) \\boldsymbol{e}_{z} + \\left ( b^{xy} v^{z} - b^{xz} v^{y} + b^{yz} v^{x} \\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} v \\W b = \\left ( b^{xy} v^{z} - b^{xz} v^{y} + b^{yz} v^{x} \\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} v \\cdot b = \\left ( - b^{xy} v^{y} - b^{xz} v^{z} \\right ) \\boldsymbol{e}_{x} + \\left ( b^{xy} v^{x} - b^{yz} v^{z} \\right ) \\boldsymbol{e}_{y} + \\left ( b^{xz} v^{x} + b^{yz} v^{y} \\right ) \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} v \\rfloor b = \\left ( - b^{xy} v^{y} - b^{xz} v^{z} \\right ) \\boldsymbol{e}_{x} + \\left ( b^{xy} v^{x} - b^{yz} v^{z} \\right ) \\boldsymbol{e}_{y} + \\left ( b^{xz} v^{x} + b^{yz} v^{y} \\right ) \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} v \\lfloor b = 0 \\end{equation*}\n", + "\\begin{equation*} b \\boldsymbol{\\nabla} = \\boldsymbol{e}_{x} \\left ( b^{xy} \\frac{\\partial}{\\partial y} + b^{xz} \\frac{\\partial}{\\partial z}\\right ) + \\boldsymbol{e}_{y} \\left ( - b^{xy} \\frac{\\partial}{\\partial x} + b^{yz} \\frac{\\partial}{\\partial z}\\right ) + \\boldsymbol{e}_{z} \\left ( - b^{xz} \\frac{\\partial}{\\partial x} - b^{yz} \\frac{\\partial}{\\partial y}\\right ) + \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\left ( b^{yz} \\frac{\\partial}{\\partial x} - b^{xz} \\frac{\\partial}{\\partial y} + b^{xy} \\frac{\\partial}{\\partial z}\\right ) \\end{equation*}\n", + "\\begin{equation*} b \\W \\boldsymbol{\\nabla} = \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\left ( b^{yz} \\frac{\\partial}{\\partial x} - b^{xz} \\frac{\\partial}{\\partial y} + b^{xy} \\frac{\\partial}{\\partial z}\\right ) \\end{equation*}\n", + "\\begin{equation*} b \\cdot \\boldsymbol{\\nabla} = \\boldsymbol{e}_{x} \\left ( b^{xy} \\frac{\\partial}{\\partial y} + b^{xz} \\frac{\\partial}{\\partial z}\\right ) + \\boldsymbol{e}_{y} \\left ( - b^{xy} \\frac{\\partial}{\\partial x} + b^{yz} \\frac{\\partial}{\\partial z}\\right ) + \\boldsymbol{e}_{z} \\left ( - b^{xz} \\frac{\\partial}{\\partial x} - b^{yz} \\frac{\\partial}{\\partial y}\\right ) \\end{equation*}\n", + "\\begin{equation*} b \\rfloor \\boldsymbol{\\nabla} = 0 \\end{equation*}\n", + "\\begin{equation*} b \\lfloor \\boldsymbol{\\nabla} = \\boldsymbol{e}_{x} \\left ( b^{xy} \\frac{\\partial}{\\partial y} + b^{xz} \\frac{\\partial}{\\partial z}\\right ) + \\boldsymbol{e}_{y} \\left ( - b^{xy} \\frac{\\partial}{\\partial x} + b^{yz} \\frac{\\partial}{\\partial z}\\right ) + \\boldsymbol{e}_{z} \\left ( - b^{xz} \\frac{\\partial}{\\partial x} - b^{yz} \\frac{\\partial}{\\partial y}\\right ) \\end{equation*}\n", + "\\begin{equation*} b s = b^{xy} s \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + b^{xz} s \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + b^{yz} s \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} b \\W s = b^{xy} s \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + b^{xz} s \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + b^{yz} s \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} b \\rfloor s = 0 \\end{equation*}\n", + "\\begin{equation*} b \\lfloor s = b^{xy} s \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + b^{xz} s \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + b^{yz} s \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} b v = \\left ( b^{xy} v^{y} + b^{xz} v^{z} \\right ) \\boldsymbol{e}_{x} + \\left ( - b^{xy} v^{x} + b^{yz} v^{z} \\right ) \\boldsymbol{e}_{y} + \\left ( - b^{xz} v^{x} - b^{yz} v^{y} \\right ) \\boldsymbol{e}_{z} + \\left ( b^{xy} v^{z} - b^{xz} v^{y} + b^{yz} v^{x} \\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} b \\W v = \\left ( b^{xy} v^{z} - b^{xz} v^{y} + b^{yz} v^{x} \\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} b \\cdot v = \\left ( b^{xy} v^{y} + b^{xz} v^{z} \\right ) \\boldsymbol{e}_{x} + \\left ( - b^{xy} v^{x} + b^{yz} v^{z} \\right ) \\boldsymbol{e}_{y} + \\left ( - b^{xz} v^{x} - b^{yz} v^{y} \\right ) \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} b \\rfloor v = 0 \\end{equation*}\n", + "\\begin{equation*} b \\lfloor v = \\left ( b^{xy} v^{y} + b^{xz} v^{z} \\right ) \\boldsymbol{e}_{x} + \\left ( - b^{xy} v^{x} + b^{yz} v^{z} \\right ) \\boldsymbol{e}_{y} + \\left ( - b^{xz} v^{x} - b^{yz} v^{y} \\right ) \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} b b = - {b^{xy} }^{2} - {b^{xz} }^{2} - {b^{yz} }^{2} \\end{equation*}\n", + "\\begin{equation*} b \\W b = 0 \\end{equation*}\n", + "\\begin{equation*} b \\cdot b = - {b^{xy} }^{2} - {b^{xz} }^{2} - {b^{yz} }^{2} \\end{equation*}\n", + "\\begin{equation*} b \\rfloor b = - {b^{xy} }^{2} - {b^{xz} }^{2} - {b^{yz} }^{2} \\end{equation*}\n", + "\\begin{equation*} b \\lfloor b = - {b^{xy} }^{2} - {b^{xz} }^{2} - {b^{yz} }^{2} \\end{equation*}\n", + "General 2D Metric\\newline\n", + "Multivector Functions:\n", + "\\begin{equation*} s(X) = s \\end{equation*}\n", + "\\begin{equation*} v(X) = v^{x} \\boldsymbol{e}_{x} + v^{y} \\boldsymbol{e}_{y} \\end{equation*}\n", + "\\begin{equation*} b(X) = v^{xy} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} \\end{equation*}\n", + "Products:\n", + "\\begin{equation*} \\boldsymbol{\\nabla} s = \\frac{- \\left ( e_{x}\\cdot e_{y}\\right ) \\partial_{y} s + \\left ( e_{y}\\cdot e_{y}\\right ) \\partial_{x} s }{\\left ( e_{x}\\cdot e_{x}\\right ) \\left ( e_{y}\\cdot e_{y}\\right ) - \\left ( e_{x}\\cdot e_{y}\\right ) ^{2}} \\boldsymbol{e}_{x} + \\frac{\\left ( e_{x}\\cdot e_{x}\\right ) \\partial_{y} s - \\left ( e_{x}\\cdot e_{y}\\right ) \\partial_{x} s }{\\left ( e_{x}\\cdot e_{x}\\right ) \\left ( e_{y}\\cdot e_{y}\\right ) - \\left ( e_{x}\\cdot e_{y}\\right ) ^{2}} \\boldsymbol{e}_{y} \\end{equation*}\n", + "\\begin{equation*} \\boldsymbol{\\nabla} \\W s = \\frac{- \\left ( e_{x}\\cdot e_{y}\\right ) \\partial_{y} s + \\left ( e_{y}\\cdot e_{y}\\right ) \\partial_{x} s }{\\left ( e_{x}\\cdot e_{x}\\right ) \\left ( e_{y}\\cdot e_{y}\\right ) - \\left ( e_{x}\\cdot e_{y}\\right ) ^{2}} \\boldsymbol{e}_{x} + \\frac{\\left ( e_{x}\\cdot e_{x}\\right ) \\partial_{y} s - \\left ( e_{x}\\cdot e_{y}\\right ) \\partial_{x} s }{\\left ( e_{x}\\cdot e_{x}\\right ) \\left ( e_{y}\\cdot e_{y}\\right ) - \\left ( e_{x}\\cdot e_{y}\\right ) ^{2}} \\boldsymbol{e}_{y} \\end{equation*}\n", + "\\begin{equation*} \\boldsymbol{\\nabla} \\cdot s = Not Allowed \\end{equation*}\n", + "\\begin{equation*} \\boldsymbol{\\nabla} \\rfloor s = 0 \\end{equation*}\n", + "\\begin{equation*} \\boldsymbol{\\nabla} \\lfloor s = \\frac{- \\left ( e_{x}\\cdot e_{y}\\right ) \\partial_{y} s + \\left ( e_{y}\\cdot e_{y}\\right ) \\partial_{x} s }{\\left ( e_{x}\\cdot e_{x}\\right ) \\left ( e_{y}\\cdot e_{y}\\right ) - \\left ( e_{x}\\cdot e_{y}\\right ) ^{2}} \\boldsymbol{e}_{x} + \\frac{\\left ( e_{x}\\cdot e_{x}\\right ) \\partial_{y} s - \\left ( e_{x}\\cdot e_{y}\\right ) \\partial_{x} s }{\\left ( e_{x}\\cdot e_{x}\\right ) \\left ( e_{y}\\cdot e_{y}\\right ) - \\left ( e_{x}\\cdot e_{y}\\right ) ^{2}} \\boldsymbol{e}_{y} \\end{equation*}\n", + "\\begin{equation*} \\boldsymbol{\\nabla} v = \\left ( \\partial_{x} v^{x} + \\partial_{y} v^{y} \\right ) + \\frac{- \\left ( e_{x}\\cdot e_{x}\\right ) \\partial_{y} v^{x} + \\left ( e_{x}\\cdot e_{y}\\right ) \\partial_{x} v^{x} - \\left ( e_{x}\\cdot e_{y}\\right ) \\partial_{y} v^{y} + \\left ( e_{y}\\cdot e_{y}\\right ) \\partial_{x} v^{y} }{\\left ( e_{x}\\cdot e_{x}\\right ) \\left ( e_{y}\\cdot e_{y}\\right ) - \\left ( e_{x}\\cdot e_{y}\\right ) ^{2}} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} \\end{equation*}\n", + "\\begin{equation*} \\boldsymbol{\\nabla} \\W v = \\frac{- \\left ( e_{x}\\cdot e_{x}\\right ) \\partial_{y} v^{x} + \\left ( e_{x}\\cdot e_{y}\\right ) \\partial_{x} v^{x} - \\left ( e_{x}\\cdot e_{y}\\right ) \\partial_{y} v^{y} + \\left ( e_{y}\\cdot e_{y}\\right ) \\partial_{x} v^{y} }{\\left ( e_{x}\\cdot e_{x}\\right ) \\left ( e_{y}\\cdot e_{y}\\right ) - \\left ( e_{x}\\cdot e_{y}\\right ) ^{2}} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} \\end{equation*}\n", + "\\begin{equation*} \\boldsymbol{\\nabla} \\cdot v = \\partial_{x} v^{x} + \\partial_{y} v^{y} \\end{equation*}\n", + "\\begin{equation*} \\boldsymbol{\\nabla} \\rfloor v = \\partial_{x} v^{x} + \\partial_{y} v^{y} \\end{equation*}\n", + "\\begin{equation*} \\boldsymbol{\\nabla} \\lfloor v = \\partial_{x} v^{x} + \\partial_{y} v^{y} \\end{equation*}\n", + "\\begin{equation*} s \\boldsymbol{\\nabla} = \\boldsymbol{e}_{x} \\left ( \\frac{\\left ( e_{y}\\cdot e_{y}\\right ) s }{\\left ( e_{x}\\cdot e_{x}\\right ) \\left ( e_{y}\\cdot e_{y}\\right ) - \\left ( e_{x}\\cdot e_{y}\\right ) ^{2}} \\frac{\\partial}{\\partial x} - \\frac{\\left ( e_{x}\\cdot e_{y}\\right ) s }{\\left ( e_{x}\\cdot e_{x}\\right ) \\left ( e_{y}\\cdot e_{y}\\right ) - \\left ( e_{x}\\cdot e_{y}\\right ) ^{2}} \\frac{\\partial}{\\partial y}\\right ) + \\boldsymbol{e}_{y} \\left ( - \\frac{\\left ( e_{x}\\cdot e_{y}\\right ) s }{\\left ( e_{x}\\cdot e_{x}\\right ) \\left ( e_{y}\\cdot e_{y}\\right ) - \\left ( e_{x}\\cdot e_{y}\\right ) ^{2}} \\frac{\\partial}{\\partial x} + \\frac{\\left ( e_{x}\\cdot e_{x}\\right ) s }{\\left ( e_{x}\\cdot e_{x}\\right ) \\left ( e_{y}\\cdot e_{y}\\right ) - \\left ( e_{x}\\cdot e_{y}\\right ) ^{2}} \\frac{\\partial}{\\partial y}\\right ) \\end{equation*}\n", + "\\begin{equation*} s \\W \\boldsymbol{\\nabla} = \\boldsymbol{e}_{x} \\left ( \\frac{\\left ( e_{y}\\cdot e_{y}\\right ) s }{\\left ( e_{x}\\cdot e_{x}\\right ) \\left ( e_{y}\\cdot e_{y}\\right ) - \\left ( e_{x}\\cdot e_{y}\\right ) ^{2}} \\frac{\\partial}{\\partial x} - \\frac{\\left ( e_{x}\\cdot e_{y}\\right ) s }{\\left ( e_{x}\\cdot e_{x}\\right ) \\left ( e_{y}\\cdot e_{y}\\right ) - \\left ( e_{x}\\cdot e_{y}\\right ) ^{2}} \\frac{\\partial}{\\partial y}\\right ) + \\boldsymbol{e}_{y} \\left ( - \\frac{\\left ( e_{x}\\cdot e_{y}\\right ) s }{\\left ( e_{x}\\cdot e_{x}\\right ) \\left ( e_{y}\\cdot e_{y}\\right ) - \\left ( e_{x}\\cdot e_{y}\\right ) ^{2}} \\frac{\\partial}{\\partial x} + \\frac{\\left ( e_{x}\\cdot e_{x}\\right ) s }{\\left ( e_{x}\\cdot e_{x}\\right ) \\left ( e_{y}\\cdot e_{y}\\right ) - \\left ( e_{x}\\cdot e_{y}\\right ) ^{2}} \\frac{\\partial}{\\partial y}\\right ) \\end{equation*}\n", + "\\begin{equation*} s \\cdot \\boldsymbol{\\nabla} = Not Allowed \\end{equation*}\n", + "\\begin{equation*} s \\rfloor \\boldsymbol{\\nabla} = \\boldsymbol{e}_{x} \\left ( \\frac{\\left ( e_{y}\\cdot e_{y}\\right ) s }{\\left ( e_{x}\\cdot e_{x}\\right ) \\left ( e_{y}\\cdot e_{y}\\right ) - \\left ( e_{x}\\cdot e_{y}\\right ) ^{2}} \\frac{\\partial}{\\partial x} - \\frac{\\left ( e_{x}\\cdot e_{y}\\right ) s }{\\left ( e_{x}\\cdot e_{x}\\right ) \\left ( e_{y}\\cdot e_{y}\\right ) - \\left ( e_{x}\\cdot e_{y}\\right ) ^{2}} \\frac{\\partial}{\\partial y}\\right ) + \\boldsymbol{e}_{y} \\left ( - \\frac{\\left ( e_{x}\\cdot e_{y}\\right ) s }{\\left ( e_{x}\\cdot e_{x}\\right ) \\left ( e_{y}\\cdot e_{y}\\right ) - \\left ( e_{x}\\cdot e_{y}\\right ) ^{2}} \\frac{\\partial}{\\partial x} + \\frac{\\left ( e_{x}\\cdot e_{x}\\right ) s }{\\left ( e_{x}\\cdot e_{x}\\right ) \\left ( e_{y}\\cdot e_{y}\\right ) - \\left ( e_{x}\\cdot e_{y}\\right ) ^{2}} \\frac{\\partial}{\\partial y}\\right ) \\end{equation*}\n", + "\\begin{equation*} s \\lfloor \\boldsymbol{\\nabla} = 0 \\end{equation*}\n", + "\\begin{equation*} s s = {s }^{2} \\end{equation*}\n", + "\\begin{equation*} s \\W s = {s }^{2} \\end{equation*}\n", + "\\begin{equation*} s \\cdot s = Not Allowed \\end{equation*}\n", + "\\begin{equation*} s \\rfloor s = {s }^{2} \\end{equation*}\n", + "\\begin{equation*} s \\lfloor s = {s }^{2} \\end{equation*}\n", + "\\begin{equation*} s v = s v^{x} \\boldsymbol{e}_{x} + s v^{y} \\boldsymbol{e}_{y} \\end{equation*}\n", + "\\begin{equation*} s \\W v = s v^{x} \\boldsymbol{e}_{x} + s v^{y} \\boldsymbol{e}_{y} \\end{equation*}\n", + "\\begin{equation*} s \\cdot v = Not Allowed \\end{equation*}\n", + "\\begin{equation*} s \\rfloor v = s v^{x} \\boldsymbol{e}_{x} + s v^{y} \\boldsymbol{e}_{y} \\end{equation*}\n", + "\\begin{equation*} s \\lfloor v = 0 \\end{equation*}\n", + "\\begin{equation*} v \\boldsymbol{\\nabla} = v^{x} \\frac{\\partial}{\\partial x} + v^{y} \\frac{\\partial}{\\partial y} + \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} \\left ( - \\frac{\\left ( e_{x}\\cdot e_{y}\\right ) v^{x} + \\left ( e_{y}\\cdot e_{y}\\right ) v^{y} }{\\left ( e_{x}\\cdot e_{x}\\right ) \\left ( e_{y}\\cdot e_{y}\\right ) - \\left ( e_{x}\\cdot e_{y}\\right ) ^{2}} \\frac{\\partial}{\\partial x} + \\frac{\\left ( e_{x}\\cdot e_{x}\\right ) v^{x} + \\left ( e_{x}\\cdot e_{y}\\right ) v^{y} }{\\left ( e_{x}\\cdot e_{x}\\right ) \\left ( e_{y}\\cdot e_{y}\\right ) - \\left ( e_{x}\\cdot e_{y}\\right ) ^{2}} \\frac{\\partial}{\\partial y}\\right ) \\end{equation*}\n", + "\\begin{equation*} v \\W \\boldsymbol{\\nabla} = \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} \\left ( - \\frac{\\left ( e_{x}\\cdot e_{y}\\right ) v^{x} + \\left ( e_{y}\\cdot e_{y}\\right ) v^{y} }{\\left ( e_{x}\\cdot e_{x}\\right ) \\left ( e_{y}\\cdot e_{y}\\right ) - \\left ( e_{x}\\cdot e_{y}\\right ) ^{2}} \\frac{\\partial}{\\partial x} + \\frac{\\left ( e_{x}\\cdot e_{x}\\right ) v^{x} + \\left ( e_{x}\\cdot e_{y}\\right ) v^{y} }{\\left ( e_{x}\\cdot e_{x}\\right ) \\left ( e_{y}\\cdot e_{y}\\right ) - \\left ( e_{x}\\cdot e_{y}\\right ) ^{2}} \\frac{\\partial}{\\partial y}\\right ) \\end{equation*}\n", + "\\begin{equation*} v \\cdot \\boldsymbol{\\nabla} = v^{x} \\frac{\\partial}{\\partial x} + v^{y} \\frac{\\partial}{\\partial y} \\end{equation*}\n", + "\\begin{equation*} v \\rfloor \\boldsymbol{\\nabla} = v^{x} \\frac{\\partial}{\\partial x} + v^{y} \\frac{\\partial}{\\partial y} \\end{equation*}\n", + "\\begin{equation*} v \\lfloor \\boldsymbol{\\nabla} = v^{x} \\frac{\\partial}{\\partial x} + v^{y} \\frac{\\partial}{\\partial y} \\end{equation*}\n", + "\\begin{equation*} v s = s v^{x} \\boldsymbol{e}_{x} + s v^{y} \\boldsymbol{e}_{y} \\end{equation*}\n", + "\\begin{equation*} v \\W s = s v^{x} \\boldsymbol{e}_{x} + s v^{y} \\boldsymbol{e}_{y} \\end{equation*}\n", + "\\begin{equation*} v \\cdot s = Not Allowed \\end{equation*}\n", + "\\begin{equation*} v \\rfloor s = 0 \\end{equation*}\n", + "\\begin{equation*} v \\lfloor s = s v^{x} \\boldsymbol{e}_{x} + s v^{y} \\boldsymbol{e}_{y} \\end{equation*}\n", + "\\begin{equation*} v v = \\left ( e_{x}\\cdot e_{x}\\right ) {v^{x} }^{2} + 2 \\left ( e_{x}\\cdot e_{y}\\right ) v^{x} v^{y} + \\left ( e_{y}\\cdot e_{y}\\right ) {v^{y} }^{2} \\end{equation*}\n", + "\\begin{equation*} v \\W v = 0 \\end{equation*}\n", + "\\begin{equation*} v \\cdot v = \\left ( e_{x}\\cdot e_{x}\\right ) {v^{x} }^{2} + 2 \\left ( e_{x}\\cdot e_{y}\\right ) v^{x} v^{y} + \\left ( e_{y}\\cdot e_{y}\\right ) {v^{y} }^{2} \\end{equation*}\n", + "\\begin{equation*} v \\rfloor v = \\left ( e_{x}\\cdot e_{x}\\right ) {v^{x} }^{2} + 2 \\left ( e_{x}\\cdot e_{y}\\right ) v^{x} v^{y} + \\left ( e_{y}\\cdot e_{y}\\right ) {v^{y} }^{2} \\end{equation*}\n", + "\\begin{equation*} v \\lfloor v = \\left ( e_{x}\\cdot e_{x}\\right ) {v^{x} }^{2} + 2 \\left ( e_{x}\\cdot e_{y}\\right ) v^{x} v^{y} + \\left ( e_{y}\\cdot e_{y}\\right ) {v^{y} }^{2} \\end{equation*}\n", + "\\end{document}\n" + ] + }, + "metadata": {}, + "output_type": "display_data" } ], "source": [ - "!cat products_latex.tex" - ] - }, - { - "cell_type": "code", - "execution_count": 38, - "metadata": {}, - "outputs": [], - "source": [ - "!python simple_check_latex.py" + "check('products_latex')" ] }, { "cell_type": "code", - "execution_count": 39, + "execution_count": 20, "metadata": {}, "outputs": [ { - "name": "stdout", - "output_type": "stream", - "text": [ - "\r\n", - "\\documentclass[10pt,fleqn]{report}\r\n", - "\\usepackage[vcentering]{geometry}\r\n", - "\\geometry{papersize={14in,11in},total={13in,10in}}\r\n", - "\r\n", - "\\pagestyle{empty}\r\n", - "\\usepackage[latin1]{inputenc}\r\n", - "\\usepackage{amsmath}\r\n", - "\\usepackage{amsfonts}\r\n", - "\\usepackage{amssymb}\r\n", - "\\usepackage{amsbsy}\r\n", - "\\usepackage{tensor}\r\n", - "\\usepackage{listings}\r\n", - "\\usepackage{color}\r\n", - "\\usepackage{xcolor}\r\n", - "\\usepackage{bm}\r\n", - "\\usepackage{breqn}\r\n", - "\\definecolor{gray}{rgb}{0.95,0.95,0.95}\r\n", - "\\setlength{\\parindent}{0pt}\r\n", - "\\DeclareMathOperator{\\Tr}{Tr}\r\n", - "\\DeclareMathOperator{\\Adj}{Adj}\r\n", - "\\newcommand{\\bfrac}[2]{\\displaystyle\\frac{#1}{#2}}\r\n", - "\\newcommand{\\lp}{\\left (}\r\n", - "\\newcommand{\\rp}{\\right )}\r\n", - "\\newcommand{\\paren}[1]{\\lp {#1} \\rp}\r\n", - "\\newcommand{\\half}{\\frac{1}{2}}\r\n", - "\\newcommand{\\llt}{\\left <}\r\n", - "\\newcommand{\\rgt}{\\right >}\r\n", - "\\newcommand{\\abs}[1]{\\left |{#1}\\right | }\r\n", - "\\newcommand{\\pdiff}[2]{\\bfrac{\\partial {#1}}{\\partial {#2}}}\r\n", - "\\newcommand{\\lbrc}{\\left \\{}\r\n", - "\\newcommand{\\rbrc}{\\right \\}}\r\n", - "\\newcommand{\\W}{\\wedge}\r\n", - "\\newcommand{\\prm}[1]{{#1}'}\r\n", - "\\newcommand{\\ddt}[1]{\\bfrac{d{#1}}{dt}}\r\n", - "\\newcommand{\\R}{\\dagger}\r\n", - "\\newcommand{\\deriv}[3]{\\bfrac{d^{#3}#1}{d{#2}^{#3}}}\r\n", - "\\newcommand{\\grade}[1]{\\left < {#1} \\right >}\r\n", - "\\newcommand{\\f}[2]{{#1}\\lp{#2}\\rp}\r\n", - "\\newcommand{\\eval}[2]{\\left . {#1} \\right |_{#2}}\r\n", - "\\newcommand{\\Nabla}{\\boldsymbol{\\nabla}}\r\n", - "\\newcommand{\\eb}{\\boldsymbol{e}}\r\n", - "\\usepackage{float}\r\n", - "\\floatstyle{plain} % optionally change the style of the new float\r\n", - "\\newfloat{Code}{H}{myc}\r\n", - "\\lstloadlanguages{Python}\r\n", - "\r\n", - "\\begin{document}\r\n", - "\\begin{equation*} g_{ij} = \\left [ \\begin{array}{ccc} \\left ( e_{x}\\cdot e_{x}\\right ) & \\left ( e_{x}\\cdot e_{y}\\right ) & \\left ( e_{x}\\cdot e_{z}\\right ) \\\\ \\left ( e_{x}\\cdot e_{y}\\right ) & \\left ( e_{y}\\cdot e_{y}\\right ) & \\left ( e_{y}\\cdot e_{z}\\right ) \\\\ \\left ( e_{x}\\cdot e_{z}\\right ) & \\left ( e_{y}\\cdot e_{z}\\right ) & \\left ( e_{z}\\cdot e_{z}\\right ) \\end{array}\\right ] \\end{equation*}\r\n", - "\\begin{equation*} A = A + A^{x} \\boldsymbol{e}_{x} + A^{y} \\boldsymbol{e}_{y} + A^{z} \\boldsymbol{e}_{z} + A^{xy} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + A^{xz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + A^{yz} \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} + A^{xyz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\r\n", - " \\begin{align*} A = & A \\\\ & + A^{x} \\boldsymbol{e}_{x} + A^{y} \\boldsymbol{e}_{y} + A^{z} \\boldsymbol{e}_{z} \\\\ & + A^{xy} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + A^{xz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + A^{yz} \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\\\ & + A^{xyz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{align*} \r\n", - " \\begin{align*} A = & A \\\\ & + A^{x} \\boldsymbol{e}_{x} \\\\ & + A^{y} \\boldsymbol{e}_{y} \\\\ & + A^{z} \\boldsymbol{e}_{z} \\\\ & + A^{xy} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} \\\\ & + A^{xz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} \\\\ & + A^{yz} \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\\\ & + A^{xyz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{align*} \r\n", - "\\begin{equation*} A_{+} = A + A^{xy} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + A^{xz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + A^{yz} \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} A_{-} = A^{x} \\boldsymbol{e}_{x} + A^{y} \\boldsymbol{e}_{y} + A^{z} \\boldsymbol{e}_{z} + A^{xyz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} X = X^{x} \\boldsymbol{e}_{x} + X^{y} \\boldsymbol{e}_{y} + X^{z} \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} Y = Y^{x} \\boldsymbol{e}_{x} + Y^{y} \\boldsymbol{e}_{y} + Y^{z} \\boldsymbol{e}_{z} \\end{equation*}\r\n", - " \\begin{align*} X Y = & \\left ( \\left ( e_{x}\\cdot e_{x}\\right ) X^{x} Y^{x} + \\left ( e_{x}\\cdot e_{y}\\right ) X^{x} Y^{y} + \\left ( e_{x}\\cdot e_{y}\\right ) X^{y} Y^{x} + \\left ( e_{x}\\cdot e_{z}\\right ) X^{x} Y^{z} + \\left ( e_{x}\\cdot e_{z}\\right ) X^{z} Y^{x} + \\left ( e_{y}\\cdot e_{y}\\right ) X^{y} Y^{y} + \\left ( e_{y}\\cdot e_{z}\\right ) X^{y} Y^{z} + \\left ( e_{y}\\cdot e_{z}\\right ) X^{z} Y^{y} + \\left ( e_{z}\\cdot e_{z}\\right ) X^{z} Y^{z}\\right ) \\\\ & + \\left ( X^{x} Y^{y} - X^{y} Y^{x}\\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + \\left ( X^{x} Y^{z} - X^{z} Y^{x}\\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + \\left ( X^{y} Y^{z} - X^{z} Y^{y}\\right ) \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{align*} \r\n", - "\\begin{equation*} X\\W Y = \\left ( X^{x} Y^{y} - X^{y} Y^{x}\\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + \\left ( X^{x} Y^{z} - X^{z} Y^{x}\\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + \\left ( X^{y} Y^{z} - X^{z} Y^{y}\\right ) \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} X\\cdot Y = \\left ( e_{x}\\cdot e_{x}\\right ) X^{x} Y^{x} + \\left ( e_{x}\\cdot e_{y}\\right ) X^{x} Y^{y} + \\left ( e_{x}\\cdot e_{y}\\right ) X^{y} Y^{x} + \\left ( e_{x}\\cdot e_{z}\\right ) X^{x} Y^{z} + \\left ( e_{x}\\cdot e_{z}\\right ) X^{z} Y^{x} + \\left ( e_{y}\\cdot e_{y}\\right ) X^{y} Y^{y} + \\left ( e_{y}\\cdot e_{z}\\right ) X^{y} Y^{z} + \\left ( e_{y}\\cdot e_{z}\\right ) X^{z} Y^{y} + \\left ( e_{z}\\cdot e_{z}\\right ) X^{z} Y^{z} \\end{equation*}\r\n", - "\\begin{equation*} g_{ij} = \\left [ \\begin{array}{cc} \\left ( e_{x}\\cdot e_{x}\\right ) & \\left ( e_{x}\\cdot e_{y}\\right ) \\\\ \\left ( e_{x}\\cdot e_{y}\\right ) & \\left ( e_{y}\\cdot e_{y}\\right ) \\end{array}\\right ] \\end{equation*}\r\n", - "\\begin{equation*} X = X^{x} \\boldsymbol{e}_{x} + X^{y} \\boldsymbol{e}_{y} \\end{equation*}\r\n", - "\\begin{equation*} A = A + A^{xy} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} \\end{equation*}\r\n", - "\\begin{equation*} X\\cdot A = - A^{xy} \\left(\\left ( e_{x}\\cdot e_{y}\\right ) X^{x} + \\left ( e_{y}\\cdot e_{y}\\right ) X^{y}\\right) \\boldsymbol{e}_{x} + A^{xy} \\left(\\left ( e_{x}\\cdot e_{x}\\right ) X^{x} + \\left ( e_{x}\\cdot e_{y}\\right ) X^{y}\\right) \\boldsymbol{e}_{y} \\end{equation*}\r\n", - "\\begin{equation*} X\\rfloor A = - A^{xy} \\left(\\left ( e_{x}\\cdot e_{y}\\right ) X^{x} + \\left ( e_{y}\\cdot e_{y}\\right ) X^{y}\\right) \\boldsymbol{e}_{x} + A^{xy} \\left(\\left ( e_{x}\\cdot e_{x}\\right ) X^{x} + \\left ( e_{x}\\cdot e_{y}\\right ) X^{y}\\right) \\boldsymbol{e}_{y} \\end{equation*}\r\n", - "\\begin{equation*} A\\lfloor X = A^{xy} \\left(\\left ( e_{x}\\cdot e_{y}\\right ) X^{x} + \\left ( e_{y}\\cdot e_{y}\\right ) X^{y}\\right) \\boldsymbol{e}_{x} - A^{xy} \\left(\\left ( e_{x}\\cdot e_{x}\\right ) X^{x} + \\left ( e_{x}\\cdot e_{y}\\right ) X^{y}\\right) \\boldsymbol{e}_{y} \\end{equation*}\r\n", - "\\end{document}\r\n" - ] + "data": { + "text/plain": [ + "\n", + "\\documentclass[10pt,fleqn]{report}\n", + "\\usepackage[vcentering]{geometry}\n", + "\\geometry{papersize={14in,11in},total={13in,10in}}\n", + "\n", + "\\pagestyle{empty}\n", + "\\usepackage[latin1]{inputenc}\n", + "\\usepackage{amsmath}\n", + "\\usepackage{amsfonts}\n", + "\\usepackage{amssymb}\n", + "\\usepackage{amsbsy}\n", + "\\usepackage{tensor}\n", + "\\usepackage{listings}\n", + "\\usepackage{color}\n", + "\\usepackage{xcolor}\n", + "\\usepackage{bm}\n", + "\\usepackage{breqn}\n", + "\\definecolor{gray}{rgb}{0.95,0.95,0.95}\n", + "\\setlength{\\parindent}{0pt}\n", + "\\DeclareMathOperator{\\Tr}{Tr}\n", + "\\DeclareMathOperator{\\Adj}{Adj}\n", + "\\newcommand{\\bfrac}[2]{\\displaystyle\\frac{#1}{#2}}\n", + "\\newcommand{\\lp}{\\left (}\n", + "\\newcommand{\\rp}{\\right )}\n", + "\\newcommand{\\paren}[1]{\\lp {#1} \\rp}\n", + "\\newcommand{\\half}{\\frac{1}{2}}\n", + "\\newcommand{\\llt}{\\left <}\n", + "\\newcommand{\\rgt}{\\right >}\n", + "\\newcommand{\\abs}[1]{\\left |{#1}\\right | }\n", + "\\newcommand{\\pdiff}[2]{\\bfrac{\\partial {#1}}{\\partial {#2}}}\n", + "\\newcommand{\\lbrc}{\\left \\{}\n", + "\\newcommand{\\rbrc}{\\right \\}}\n", + "\\newcommand{\\W}{\\wedge}\n", + "\\newcommand{\\prm}[1]{{#1}'}\n", + "\\newcommand{\\ddt}[1]{\\bfrac{d{#1}}{dt}}\n", + "\\newcommand{\\R}{\\dagger}\n", + "\\newcommand{\\deriv}[3]{\\bfrac{d^{#3}#1}{d{#2}^{#3}}}\n", + "\\newcommand{\\grade}[1]{\\left < {#1} \\right >}\n", + "\\newcommand{\\f}[2]{{#1}\\lp{#2}\\rp}\n", + "\\newcommand{\\eval}[2]{\\left . {#1} \\right |_{#2}}\n", + "\\newcommand{\\Nabla}{\\boldsymbol{\\nabla}}\n", + "\\newcommand{\\eb}{\\boldsymbol{e}}\n", + "\\usepackage{float}\n", + "\\floatstyle{plain} % optionally change the style of the new float\n", + "\\newfloat{Code}{H}{myc}\n", + "\\lstloadlanguages{Python}\n", + "\n", + "\\begin{document}\n", + "\\begin{equation*} g_{ij} = \\left [ \\begin{array}{ccc} \\left ( e_{x}\\cdot e_{x}\\right ) & \\left ( e_{x}\\cdot e_{y}\\right ) & \\left ( e_{x}\\cdot e_{z}\\right ) \\\\ \\left ( e_{x}\\cdot e_{y}\\right ) & \\left ( e_{y}\\cdot e_{y}\\right ) & \\left ( e_{y}\\cdot e_{z}\\right ) \\\\ \\left ( e_{x}\\cdot e_{z}\\right ) & \\left ( e_{y}\\cdot e_{z}\\right ) & \\left ( e_{z}\\cdot e_{z}\\right ) \\end{array}\\right ] \\end{equation*}\n", + "\\begin{equation*} A = A + A^{x} \\boldsymbol{e}_{x} + A^{y} \\boldsymbol{e}_{y} + A^{z} \\boldsymbol{e}_{z} + A^{xy} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + A^{xz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + A^{yz} \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} + A^{xyz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\n", + " \\begin{align*} A = & A \\\\ & + A^{x} \\boldsymbol{e}_{x} + A^{y} \\boldsymbol{e}_{y} + A^{z} \\boldsymbol{e}_{z} \\\\ & + A^{xy} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + A^{xz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + A^{yz} \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\\\ & + A^{xyz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{align*} \n", + " \\begin{align*} A = & A \\\\ & + A^{x} \\boldsymbol{e}_{x} \\\\ & + A^{y} \\boldsymbol{e}_{y} \\\\ & + A^{z} \\boldsymbol{e}_{z} \\\\ & + A^{xy} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} \\\\ & + A^{xz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} \\\\ & + A^{yz} \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\\\ & + A^{xyz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{align*} \n", + "\\begin{equation*} A_{+} = A + A^{xy} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + A^{xz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + A^{yz} \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} A_{-} = A^{x} \\boldsymbol{e}_{x} + A^{y} \\boldsymbol{e}_{y} + A^{z} \\boldsymbol{e}_{z} + A^{xyz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} X = X^{x} \\boldsymbol{e}_{x} + X^{y} \\boldsymbol{e}_{y} + X^{z} \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} Y = Y^{x} \\boldsymbol{e}_{x} + Y^{y} \\boldsymbol{e}_{y} + Y^{z} \\boldsymbol{e}_{z} \\end{equation*}\n", + " \\begin{align*} X Y = & \\left ( \\left ( e_{x}\\cdot e_{x}\\right ) X^{x} Y^{x} + \\left ( e_{x}\\cdot e_{y}\\right ) X^{x} Y^{y} + \\left ( e_{x}\\cdot e_{y}\\right ) X^{y} Y^{x} + \\left ( e_{x}\\cdot e_{z}\\right ) X^{x} Y^{z} + \\left ( e_{x}\\cdot e_{z}\\right ) X^{z} Y^{x} + \\left ( e_{y}\\cdot e_{y}\\right ) X^{y} Y^{y} + \\left ( e_{y}\\cdot e_{z}\\right ) X^{y} Y^{z} + \\left ( e_{y}\\cdot e_{z}\\right ) X^{z} Y^{y} + \\left ( e_{z}\\cdot e_{z}\\right ) X^{z} Y^{z}\\right ) \\\\ & + \\left ( X^{x} Y^{y} - X^{y} Y^{x}\\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + \\left ( X^{x} Y^{z} - X^{z} Y^{x}\\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + \\left ( X^{y} Y^{z} - X^{z} Y^{y}\\right ) \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{align*} \n", + "\\begin{equation*} X\\W Y = \\left ( X^{x} Y^{y} - X^{y} Y^{x}\\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + \\left ( X^{x} Y^{z} - X^{z} Y^{x}\\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + \\left ( X^{y} Y^{z} - X^{z} Y^{y}\\right ) \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} X\\cdot Y = \\left ( e_{x}\\cdot e_{x}\\right ) X^{x} Y^{x} + \\left ( e_{x}\\cdot e_{y}\\right ) X^{x} Y^{y} + \\left ( e_{x}\\cdot e_{y}\\right ) X^{y} Y^{x} + \\left ( e_{x}\\cdot e_{z}\\right ) X^{x} Y^{z} + \\left ( e_{x}\\cdot e_{z}\\right ) X^{z} Y^{x} + \\left ( e_{y}\\cdot e_{y}\\right ) X^{y} Y^{y} + \\left ( e_{y}\\cdot e_{z}\\right ) X^{y} Y^{z} + \\left ( e_{y}\\cdot e_{z}\\right ) X^{z} Y^{y} + \\left ( e_{z}\\cdot e_{z}\\right ) X^{z} Y^{z} \\end{equation*}\n", + "\\begin{equation*} g_{ij} = \\left [ \\begin{array}{cc} \\left ( e_{x}\\cdot e_{x}\\right ) & \\left ( e_{x}\\cdot e_{y}\\right ) \\\\ \\left ( e_{x}\\cdot e_{y}\\right ) & \\left ( e_{y}\\cdot e_{y}\\right ) \\end{array}\\right ] \\end{equation*}\n", + "\\begin{equation*} X = X^{x} \\boldsymbol{e}_{x} + X^{y} \\boldsymbol{e}_{y} \\end{equation*}\n", + "\\begin{equation*} A = A + A^{xy} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} \\end{equation*}\n", + "\\begin{equation*} X\\cdot A = - A^{xy} \\left(\\left ( e_{x}\\cdot e_{y}\\right ) X^{x} + \\left ( e_{y}\\cdot e_{y}\\right ) X^{y}\\right) \\boldsymbol{e}_{x} + A^{xy} \\left(\\left ( e_{x}\\cdot e_{x}\\right ) X^{x} + \\left ( e_{x}\\cdot e_{y}\\right ) X^{y}\\right) \\boldsymbol{e}_{y} \\end{equation*}\n", + "\\begin{equation*} X\\rfloor A = - A^{xy} \\left(\\left ( e_{x}\\cdot e_{y}\\right ) X^{x} + \\left ( e_{y}\\cdot e_{y}\\right ) X^{y}\\right) \\boldsymbol{e}_{x} + A^{xy} \\left(\\left ( e_{x}\\cdot e_{x}\\right ) X^{x} + \\left ( e_{x}\\cdot e_{y}\\right ) X^{y}\\right) \\boldsymbol{e}_{y} \\end{equation*}\n", + "\\begin{equation*} A\\lfloor X = A^{xy} \\left(\\left ( e_{x}\\cdot e_{y}\\right ) X^{x} + \\left ( e_{y}\\cdot e_{y}\\right ) X^{y}\\right) \\boldsymbol{e}_{x} - A^{xy} \\left(\\left ( e_{x}\\cdot e_{x}\\right ) X^{x} + \\left ( e_{x}\\cdot e_{y}\\right ) X^{y}\\right) \\boldsymbol{e}_{y} \\end{equation*}\n", + "\\end{document}\n" + ] + }, + "metadata": {}, + "output_type": "display_data" } ], "source": [ - "!cat simple_test_latex.tex" - ] - }, - { - "cell_type": "code", - "execution_count": 40, - "metadata": {}, - "outputs": [], - "source": [ - "!python christoffel_symbols.py" + "check('simple_check_latex')" ] }, { "cell_type": "code", - "execution_count": 41, + "execution_count": 21, "metadata": {}, "outputs": [ { - "name": "stdout", - "output_type": "stream", - "text": [ - "\r\n", - "\\documentclass[10pt,fleqn]{report}\r\n", - "\\usepackage[vcentering]{geometry}\r\n", - "\\geometry{papersize={9in,10in},total={8in,9in}}\r\n", - "\r\n", - "\\pagestyle{empty}\r\n", - "\\usepackage[latin1]{inputenc}\r\n", - "\\usepackage{amsmath}\r\n", - "\\usepackage{amsfonts}\r\n", - "\\usepackage{amssymb}\r\n", - "\\usepackage{amsbsy}\r\n", - "\\usepackage{tensor}\r\n", - "\\usepackage{listings}\r\n", - "\\usepackage{color}\r\n", - "\\usepackage{xcolor}\r\n", - "\\usepackage{bm}\r\n", - "\\usepackage{breqn}\r\n", - "\\definecolor{gray}{rgb}{0.95,0.95,0.95}\r\n", - "\\setlength{\\parindent}{0pt}\r\n", - "\\DeclareMathOperator{\\Tr}{Tr}\r\n", - "\\DeclareMathOperator{\\Adj}{Adj}\r\n", - "\\newcommand{\\bfrac}[2]{\\displaystyle\\frac{#1}{#2}}\r\n", - "\\newcommand{\\lp}{\\left (}\r\n", - "\\newcommand{\\rp}{\\right )}\r\n", - "\\newcommand{\\paren}[1]{\\lp {#1} \\rp}\r\n", - "\\newcommand{\\half}{\\frac{1}{2}}\r\n", - "\\newcommand{\\llt}{\\left <}\r\n", - "\\newcommand{\\rgt}{\\right >}\r\n", - "\\newcommand{\\abs}[1]{\\left |{#1}\\right | }\r\n", - "\\newcommand{\\pdiff}[2]{\\bfrac{\\partial {#1}}{\\partial {#2}}}\r\n", - "\\newcommand{\\lbrc}{\\left \\{}\r\n", - "\\newcommand{\\rbrc}{\\right \\}}\r\n", - "\\newcommand{\\W}{\\wedge}\r\n", - "\\newcommand{\\prm}[1]{{#1}'}\r\n", - "\\newcommand{\\ddt}[1]{\\bfrac{d{#1}}{dt}}\r\n", - "\\newcommand{\\R}{\\dagger}\r\n", - "\\newcommand{\\deriv}[3]{\\bfrac{d^{#3}#1}{d{#2}^{#3}}}\r\n", - "\\newcommand{\\grade}[1]{\\left < {#1} \\right >}\r\n", - "\\newcommand{\\f}[2]{{#1}\\lp{#2}\\rp}\r\n", - "\\newcommand{\\eval}[2]{\\left . {#1} \\right |_{#2}}\r\n", - "\\newcommand{\\Nabla}{\\boldsymbol{\\nabla}}\r\n", - "\\newcommand{\\eb}{\\boldsymbol{e}}\r\n", - "\\usepackage{float}\r\n", - "\\floatstyle{plain} % optionally change the style of the new float\r\n", - "\\newfloat{Code}{H}{myc}\r\n", - "\\lstloadlanguages{Python}\r\n", - "\r\n", - "\\begin{document}\r\n", - "\\begin{equation*} \\bm{\\mbox{Base manifold (three dimensional)}} \\end{equation*}\r\n", - "\\begin{equation*} \\bm{\\mbox{Metric tensor (cartesian coordinates - norm = False)}} \\end{equation*}\r\n", - "\\begin{equation*} g = \\left [ \\begin{array}{ccc} 1 & 0 & 0 \\\\ 0 & 1 & 0 \\\\ 0 & 0 & 1 \\end{array}\\right ] \\end{equation*}\r\n", - "\\begin{equation*} \\ \\end{equation*}\r\n", - "\\begin{equation*} \\bm{\\mbox{Two dimensioanal submanifold - Unit sphere}} \\end{equation*}\r\n", - "\\begin{equation*} \\text{Basis not normalised} \\end{equation*}\r\n", - "\\begin{equation*} (\\theta,\\phi)\\rightarrow (r,\\theta,\\phi) = \\left [ 1, \\quad \\theta, \\quad \\phi\\right ] \\end{equation*}\r\n", - "\\begin{equation*} e_\\theta \\cdot e_\\theta = 1 \\end{equation*}\r\n", - "\\begin{equation*} e_\\phi \\cdot e_\\phi = {\\sin{\\left (\\theta \\right )}}^{2} \\end{equation*}\r\n", - "\\begin{equation*} g = \\left [ \\begin{array}{cc} 1 & 0 \\\\ 0 & {\\sin{\\left (\\theta \\right )}}^{2} \\end{array}\\right ] \\end{equation*}\r\n", - "\\begin{equation*} \\text{g\\_inv = } \\left[\\begin{matrix}1 & 0\\\\0 & \\frac{1}{\\sin^{2}{\\left (\\theta \\right )}}\\end{matrix}\\right] \\end{equation*}\r\n", - "\\begin{equation*} \\text{Christoffel symbols of the first kind: } \\end{equation*}\r\n", - "\\begin{equation*} \\Gamma_{1, \\alpha, \\beta} = \\left[\\begin{matrix}0 & 0\\\\0 & - \\frac{\\sin{\\left (2 \\theta \\right )}}{2}\\end{matrix}\\right] \\quad \\Gamma_{2, \\alpha, \\beta} = \\left[\\begin{matrix}0 & \\frac{\\sin{\\left (2 \\theta \\right )}}{2}\\\\\\frac{\\sin{\\left (2 \\theta \\right )}}{2} & 0\\end{matrix}\\right] \\end{equation*}\r\n", - "\\begin{equation*} \\text{Christoffel symbols of the second kind: } \\end{equation*}\r\n", - "\\begin{equation*} \\Gamma^{1}_{\\phantom{1,}\\alpha, \\beta} = \\left[\\begin{matrix}0 & 0\\\\0 & - \\frac{\\sin{\\left (2 \\theta \\right )}}{2}\\end{matrix}\\right] \\quad \\Gamma^{2}_{\\phantom{2,}\\alpha, \\beta} = \\left[\\begin{matrix}0 & \\frac{1}{\\tan{\\left (\\theta \\right )}}\\\\\\frac{1}{\\tan{\\left (\\theta \\right )}} & 0\\end{matrix}\\right] \\end{equation*}\r\n", - "\\begin{equation*} \\boldsymbol{\\nabla} = \\boldsymbol{e}_{\\theta } \\frac{\\partial}{\\partial \\theta } + \\boldsymbol{e}_{\\phi } \\frac{1}{{\\sin{\\left (\\theta \\right )}}^{2}} \\frac{\\partial}{\\partial \\phi } \\end{equation*}\r\n", - "\\begin{equation*} \\boldsymbol{\\nabla} f = \\partial_{\\theta } f \\boldsymbol{e}_{\\theta } + \\frac{\\partial_{\\phi } f }{{\\sin{\\left (\\theta \\right )}}^{2}} \\boldsymbol{e}_{\\phi } \\end{equation*}\r\n", - "\\begin{equation*} F = F^{\\theta } \\boldsymbol{e}_{\\theta } + F^{\\phi } \\boldsymbol{e}_{\\phi } \\end{equation*}\r\n", - "\\begin{equation*} \\boldsymbol{\\nabla} F = \\left ( \\frac{F^{\\theta } }{\\tan{\\left (\\theta \\right )}} + \\partial_{\\phi } F^{\\phi } + \\partial_{\\theta } F^{\\theta } \\right ) + \\left ( \\frac{2 F^{\\phi } }{\\tan{\\left (\\theta \\right )}} + \\partial_{\\theta } F^{\\phi } - \\frac{\\partial_{\\phi } F^{\\theta } }{{\\sin{\\left (\\theta \\right )}}^{2}}\\right ) \\boldsymbol{e}_{\\theta }\\wedge \\boldsymbol{e}_{\\phi } \\end{equation*}\r\n", - "\\begin{equation*} \\ \\end{equation*}\r\n", - "\\begin{equation*} \\mbox{One dimensioanal submanifold} \\end{equation*}\r\n", - "\\begin{equation*} \\mbox{Basis not normalised} \\end{equation*}\r\n", - "\\begin{equation*} (\\phi)\\rightarrow (\\theta,\\phi) = \\left [ \\frac{\\pi}{8}, \\quad \\phi\\right ] \\end{equation*}\r\n", - "\\begin{equation*} e_\\phi \\cdot e_\\phi = - \\frac{\\sqrt{2}}{4} + \\frac{1}{2} \\end{equation*}\r\n", - "\\begin{equation*} g = \\left[\\begin{matrix}- \\frac{\\sqrt{2}}{4} + \\frac{1}{2}\\end{matrix}\\right] \\end{equation*}\r\n", - "\\begin{equation*} \\boldsymbol{\\nabla} = \\boldsymbol{e}_{\\phi } \\left ( 2 \\sqrt{2} + 4\\right ) \\frac{\\partial}{\\partial \\phi } \\end{equation*}\r\n", - "\\begin{equation*} \\nabla h = \\left(2 \\sqrt{2} + 4\\right) \\partial_{\\phi } h \\boldsymbol{e}_{\\phi } \\end{equation*}\r\n", - "\\begin{equation*} H = H^{\\phi } \\boldsymbol{e}_{\\phi } \\end{equation*}\r\n", - "\\begin{equation*} \\nabla H = \\partial_{\\phi } H^{\\phi } \\end{equation*}\r\n", - "\\begin{equation*} \\ \\end{equation*}\r\n", - "\\end{document}\r\n" - ] + "data": { + "text/plain": [ + "\n", + "\\documentclass[10pt,fleqn]{report}\n", + "\\usepackage[vcentering]{geometry}\n", + "\\geometry{papersize={9in,10in},total={8in,9in}}\n", + "\n", + "\\pagestyle{empty}\n", + "\\usepackage[latin1]{inputenc}\n", + "\\usepackage{amsmath}\n", + "\\usepackage{amsfonts}\n", + "\\usepackage{amssymb}\n", + "\\usepackage{amsbsy}\n", + "\\usepackage{tensor}\n", + "\\usepackage{listings}\n", + "\\usepackage{color}\n", + "\\usepackage{xcolor}\n", + "\\usepackage{bm}\n", + "\\usepackage{breqn}\n", + "\\definecolor{gray}{rgb}{0.95,0.95,0.95}\n", + "\\setlength{\\parindent}{0pt}\n", + "\\DeclareMathOperator{\\Tr}{Tr}\n", + "\\DeclareMathOperator{\\Adj}{Adj}\n", + "\\newcommand{\\bfrac}[2]{\\displaystyle\\frac{#1}{#2}}\n", + "\\newcommand{\\lp}{\\left (}\n", + "\\newcommand{\\rp}{\\right )}\n", + "\\newcommand{\\paren}[1]{\\lp {#1} \\rp}\n", + "\\newcommand{\\half}{\\frac{1}{2}}\n", + "\\newcommand{\\llt}{\\left <}\n", + "\\newcommand{\\rgt}{\\right >}\n", + "\\newcommand{\\abs}[1]{\\left |{#1}\\right | }\n", + "\\newcommand{\\pdiff}[2]{\\bfrac{\\partial {#1}}{\\partial {#2}}}\n", + "\\newcommand{\\lbrc}{\\left \\{}\n", + "\\newcommand{\\rbrc}{\\right \\}}\n", + "\\newcommand{\\W}{\\wedge}\n", + "\\newcommand{\\prm}[1]{{#1}'}\n", + "\\newcommand{\\ddt}[1]{\\bfrac{d{#1}}{dt}}\n", + "\\newcommand{\\R}{\\dagger}\n", + "\\newcommand{\\deriv}[3]{\\bfrac{d^{#3}#1}{d{#2}^{#3}}}\n", + "\\newcommand{\\grade}[1]{\\left < {#1} \\right >}\n", + "\\newcommand{\\f}[2]{{#1}\\lp{#2}\\rp}\n", + "\\newcommand{\\eval}[2]{\\left . {#1} \\right |_{#2}}\n", + "\\newcommand{\\Nabla}{\\boldsymbol{\\nabla}}\n", + "\\newcommand{\\eb}{\\boldsymbol{e}}\n", + "\\usepackage{float}\n", + "\\floatstyle{plain} % optionally change the style of the new float\n", + "\\newfloat{Code}{H}{myc}\n", + "\\lstloadlanguages{Python}\n", + "\n", + "\\begin{document}\n", + "\\begin{equation*} \\bm{\\mbox{Base manifold (three dimensional)}} \\end{equation*}\n", + "\\begin{equation*} \\bm{\\mbox{Metric tensor (cartesian coordinates - norm = False)}} \\end{equation*}\n", + "\\begin{equation*} g = \\left [ \\begin{array}{ccc} 1 & 0 & 0 \\\\ 0 & 1 & 0 \\\\ 0 & 0 & 1 \\end{array}\\right ] \\end{equation*}\n", + "\\begin{equation*} \\ \\end{equation*}\n", + "\\begin{equation*} \\bm{\\mbox{Two dimensioanal submanifold - Unit sphere}} \\end{equation*}\n", + "\\begin{equation*} \\text{Basis not normalised} \\end{equation*}\n", + "\\begin{equation*} (\\theta,\\phi)\\rightarrow (r,\\theta,\\phi) = \\left [ 1, \\quad \\theta, \\quad \\phi\\right ] \\end{equation*}\n", + "\\begin{equation*} e_\\theta \\cdot e_\\theta = 1 \\end{equation*}\n", + "\\begin{equation*} e_\\phi \\cdot e_\\phi = {\\sin{\\left (\\theta \\right )}}^{2} \\end{equation*}\n", + "\\begin{equation*} g = \\left [ \\begin{array}{cc} 1 & 0 \\\\ 0 & {\\sin{\\left (\\theta \\right )}}^{2} \\end{array}\\right ] \\end{equation*}\n", + "\\begin{equation*} \\text{g\\_inv = } \\left[\\begin{matrix}1 & 0\\\\0 & \\frac{1}{\\sin^{2}{\\left (\\theta \\right )}}\\end{matrix}\\right] \\end{equation*}\n", + "\\begin{equation*} \\text{Christoffel symbols of the first kind: } \\end{equation*}\n", + "\\begin{equation*} \\Gamma_{1, \\alpha, \\beta} = \\left[\\begin{matrix}0 & 0\\\\0 & - \\frac{\\sin{\\left (2 \\theta \\right )}}{2}\\end{matrix}\\right] \\quad \\Gamma_{2, \\alpha, \\beta} = \\left[\\begin{matrix}0 & \\frac{\\sin{\\left (2 \\theta \\right )}}{2}\\\\\\frac{\\sin{\\left (2 \\theta \\right )}}{2} & 0\\end{matrix}\\right] \\end{equation*}\n", + "\\begin{equation*} \\text{Christoffel symbols of the second kind: } \\end{equation*}\n", + "\\begin{equation*} \\Gamma^{1}_{\\phantom{1,}\\alpha, \\beta} = \\left[\\begin{matrix}0 & 0\\\\0 & - \\frac{\\sin{\\left (2 \\theta \\right )}}{2}\\end{matrix}\\right] \\quad \\Gamma^{2}_{\\phantom{2,}\\alpha, \\beta} = \\left[\\begin{matrix}0 & \\frac{1}{\\tan{\\left (\\theta \\right )}}\\\\\\frac{1}{\\tan{\\left (\\theta \\right )}} & 0\\end{matrix}\\right] \\end{equation*}\n", + "\\begin{equation*} \\boldsymbol{\\nabla} = \\boldsymbol{e}_{\\theta } \\frac{\\partial}{\\partial \\theta } + \\boldsymbol{e}_{\\phi } \\frac{1}{{\\sin{\\left (\\theta \\right )}}^{2}} \\frac{\\partial}{\\partial \\phi } \\end{equation*}\n", + "\\begin{equation*} \\boldsymbol{\\nabla} f = \\partial_{\\theta } f \\boldsymbol{e}_{\\theta } + \\frac{\\partial_{\\phi } f }{{\\sin{\\left (\\theta \\right )}}^{2}} \\boldsymbol{e}_{\\phi } \\end{equation*}\n", + "\\begin{equation*} F = F^{\\theta } \\boldsymbol{e}_{\\theta } + F^{\\phi } \\boldsymbol{e}_{\\phi } \\end{equation*}\n", + "\\begin{equation*} \\boldsymbol{\\nabla} F = \\left ( \\frac{F^{\\theta } }{\\tan{\\left (\\theta \\right )}} + \\partial_{\\phi } F^{\\phi } + \\partial_{\\theta } F^{\\theta } \\right ) + \\left ( \\frac{2 F^{\\phi } }{\\tan{\\left (\\theta \\right )}} + \\partial_{\\theta } F^{\\phi } - \\frac{\\partial_{\\phi } F^{\\theta } }{{\\sin{\\left (\\theta \\right )}}^{2}}\\right ) \\boldsymbol{e}_{\\theta }\\wedge \\boldsymbol{e}_{\\phi } \\end{equation*}\n", + "\\begin{equation*} \\ \\end{equation*}\n", + "\\begin{equation*} \\mbox{One dimensioanal submanifold} \\end{equation*}\n", + "\\begin{equation*} \\mbox{Basis not normalised} \\end{equation*}\n", + "\\begin{equation*} (\\phi)\\rightarrow (\\theta,\\phi) = \\left [ \\frac{\\pi}{8}, \\quad \\phi\\right ] \\end{equation*}\n", + "\\begin{equation*} e_\\phi \\cdot e_\\phi = - \\frac{\\sqrt{2}}{4} + \\frac{1}{2} \\end{equation*}\n", + "\\begin{equation*} g = \\left[\\begin{matrix}- \\frac{\\sqrt{2}}{4} + \\frac{1}{2}\\end{matrix}\\right] \\end{equation*}\n", + "\\begin{equation*} \\boldsymbol{\\nabla} = \\boldsymbol{e}_{\\phi } \\left ( 2 \\sqrt{2} + 4\\right ) \\frac{\\partial}{\\partial \\phi } \\end{equation*}\n", + "\\begin{equation*} \\nabla h = \\left(2 \\sqrt{2} + 4\\right) \\partial_{\\phi } h \\boldsymbol{e}_{\\phi } \\end{equation*}\n", + "\\begin{equation*} H = H^{\\phi } \\boldsymbol{e}_{\\phi } \\end{equation*}\n", + "\\begin{equation*} \\nabla H = \\partial_{\\phi } H^{\\phi } \\end{equation*}\n", + "\\begin{equation*} \\ \\end{equation*}\n", + "\\end{document}\n" + ] + }, + "metadata": {}, + "output_type": "display_data" } ], "source": [ - "!cat christoffel_symbols.tex" - ] - }, - { - "cell_type": "code", - "execution_count": 42, - "metadata": {}, - "outputs": [], - "source": [ - "!python colored_christoffel_symbols.py" + "check('christoffel_symbols')" ] }, { "cell_type": "code", - "execution_count": 43, + "execution_count": 22, "metadata": {}, "outputs": [ { - "name": "stdout", - "output_type": "stream", - "text": [ - "\r\n", - "\\documentclass[10pt,fleqn]{report}\r\n", - "\\usepackage[vcentering]{geometry}\r\n", - "\\geometry{papersize={9in,10in},total={8in,9in}}\r\n", - "\r\n", - "\\pagestyle{empty}\r\n", - "\\usepackage[latin1]{inputenc}\r\n", - "\\usepackage{amsmath}\r\n", - "\\usepackage{amsfonts}\r\n", - "\\usepackage{amssymb}\r\n", - "\\usepackage{amsbsy}\r\n", - "\\usepackage{tensor}\r\n", - "\\usepackage{listings}\r\n", - "\\usepackage{color}\r\n", - "\\usepackage{xcolor}\r\n", - "\\usepackage{bm}\r\n", - "\\usepackage{breqn}\r\n", - "\\definecolor{gray}{rgb}{0.95,0.95,0.95}\r\n", - "\\setlength{\\parindent}{0pt}\r\n", - "\\DeclareMathOperator{\\Tr}{Tr}\r\n", - "\\DeclareMathOperator{\\Adj}{Adj}\r\n", - "\\newcommand{\\bfrac}[2]{\\displaystyle\\frac{#1}{#2}}\r\n", - "\\newcommand{\\lp}{\\left (}\r\n", - "\\newcommand{\\rp}{\\right )}\r\n", - "\\newcommand{\\paren}[1]{\\lp {#1} \\rp}\r\n", - "\\newcommand{\\half}{\\frac{1}{2}}\r\n", - "\\newcommand{\\llt}{\\left <}\r\n", - "\\newcommand{\\rgt}{\\right >}\r\n", - "\\newcommand{\\abs}[1]{\\left |{#1}\\right | }\r\n", - "\\newcommand{\\pdiff}[2]{\\bfrac{\\partial {#1}}{\\partial {#2}}}\r\n", - "\\newcommand{\\lbrc}{\\left \\{}\r\n", - "\\newcommand{\\rbrc}{\\right \\}}\r\n", - "\\newcommand{\\W}{\\wedge}\r\n", - "\\newcommand{\\prm}[1]{{#1}'}\r\n", - "\\newcommand{\\ddt}[1]{\\bfrac{d{#1}}{dt}}\r\n", - "\\newcommand{\\R}{\\dagger}\r\n", - "\\newcommand{\\deriv}[3]{\\bfrac{d^{#3}#1}{d{#2}^{#3}}}\r\n", - "\\newcommand{\\grade}[1]{\\left < {#1} \\right >}\r\n", - "\\newcommand{\\f}[2]{{#1}\\lp{#2}\\rp}\r\n", - "\\newcommand{\\eval}[2]{\\left . {#1} \\right |_{#2}}\r\n", - "\\newcommand{\\Nabla}{\\boldsymbol{\\nabla}}\r\n", - "\\newcommand{\\eb}{\\boldsymbol{e}}\r\n", - "\\usepackage{float}\r\n", - "\\floatstyle{plain} % optionally change the style of the new float\r\n", - "\\newfloat{Code}{H}{myc}\r\n", - "\\lstloadlanguages{Python}\r\n", - "\r\n", - "\\begin{document}\r\n", - "\\definecolor{airforceblue}{rgb}{0.36, 0.54, 0.66}\r\n", - "\\definecolor{applegreen}{rgb}{0.55, 0.71, 0.0}\r\n", - "\\definecolor{atomictangerine}{rgb}{1.0, 0.6, 0.4}\r\n", - "\\begin{equation*} \\bm{\\mbox{Base manifold (three dimensional)}} \\end{equation*}\r\n", - "\\begin{equation*} \\bm{\\mbox{Metric tensor (cartesian coordinates - norm = False)}} \\end{equation*}\r\n", - "\\begin{equation*} g = \\left [ \\begin{array}{ccc} 1 & 0 & 0 \\\\ 0 & 1 & 0 \\\\ 0 & 0 & 1 \\end{array}\\right ] \\end{equation*}\r\n", - "\\begin{equation*} \\ \\end{equation*}\r\n", - "\\begin{equation*} \\bm{\\mbox{Two dimensioanal submanifold - Unit sphere}} \\end{equation*}\r\n", - "\\begin{equation*} \\text{Basis not normalised} \\end{equation*}\r\n", - "\\begin{equation*} (\\theta,\\phi)\\rightarrow (r,\\theta,\\phi) = \\left [ 1, \\quad {\\color{airforceblue}\\theta}, \\quad {\\color{applegreen}\\phi}\\right ] \\end{equation*}\r\n", - "\\begin{equation*} e_\\theta \\cdot e_\\theta = 1 \\end{equation*}\r\n", - "\\begin{equation*} e_\\phi \\cdot e_\\phi = {\\sin{\\left ({\\color{airforceblue}\\theta} \\right )}}^{2} \\end{equation*}\r\n", - "\\begin{equation*} g = \\left [ \\begin{array}{cc} 1 & 0 \\\\ 0 & {\\sin{\\left ({\\color{airforceblue}\\theta} \\right )}}^{2} \\end{array}\\right ] \\end{equation*}\r\n", - "\\begin{equation*} \\text{g\\_inv = } \\left[\\begin{matrix}1 & 0\\\\0 & \\frac{1}{\\sin^{2}{\\left ({\\color{airforceblue}\\theta} \\right )}}\\end{matrix}\\right] \\end{equation*}\r\n", - "\\begin{equation*} \\text{Christoffel symbols of the first kind: } \\end{equation*}\r\n", - "\\begin{equation*} \\Gamma_{1, \\alpha, \\beta} = \\left[\\begin{matrix}0 & 0\\\\0 & - \\frac{\\sin{\\left (2 {\\color{airforceblue}\\theta} \\right )}}{2}\\end{matrix}\\right] \\quad \\Gamma_{2, \\alpha, \\beta} = \\left[\\begin{matrix}0 & \\frac{\\sin{\\left (2 {\\color{airforceblue}\\theta} \\right )}}{2}\\\\\\frac{\\sin{\\left (2 {\\color{airforceblue}\\theta} \\right )}}{2} & 0\\end{matrix}\\right] \\end{equation*}\r\n", - "\\begin{equation*} \\text{Christoffel symbols of the second kind: } \\end{equation*}\r\n", - "\\begin{equation*} \\Gamma^{1}_{\\phantom{1,}\\alpha, \\beta} = \\left[\\begin{matrix}0 & 0\\\\0 & - \\frac{\\sin{\\left (2 {\\color{airforceblue}\\theta} \\right )}}{2}\\end{matrix}\\right] \\quad \\Gamma^{2}_{\\phantom{2,}\\alpha, \\beta} = \\left[\\begin{matrix}0 & \\frac{1}{\\tan{\\left ({\\color{airforceblue}\\theta} \\right )}}\\\\\\frac{1}{\\tan{\\left ({\\color{airforceblue}\\theta} \\right )}} & 0\\end{matrix}\\right] \\end{equation*}\r\n", - "\\begin{equation*} \\boldsymbol{\\nabla} = \\boldsymbol{e}_{{\\color{airforceblue}\\theta}} \\frac{\\partial}{\\partial {\\color{airforceblue}\\theta}} + \\boldsymbol{e}_{{\\color{applegreen}\\phi}} \\frac{1}{{\\sin{\\left ({\\color{airforceblue}\\theta} \\right )}}^{2}} \\frac{\\partial}{\\partial {\\color{applegreen}\\phi}} \\end{equation*}\r\n", - "\\begin{equation*} \\boldsymbol{\\nabla} f = \\partial_{{\\color{airforceblue}\\theta}} f \\boldsymbol{e}_{{\\color{airforceblue}\\theta}} + \\frac{\\partial_{{\\color{applegreen}\\phi}} f }{{\\sin{\\left ({\\color{airforceblue}\\theta} \\right )}}^{2}} \\boldsymbol{e}_{{\\color{applegreen}\\phi}} \\end{equation*}\r\n", - "\\begin{equation*} F = F^{{\\color{airforceblue}\\theta}} \\boldsymbol{e}_{{\\color{airforceblue}\\theta}} + F^{{\\color{applegreen}\\phi}} \\boldsymbol{e}_{{\\color{applegreen}\\phi}} \\end{equation*}\r\n", - "\\begin{equation*} \\boldsymbol{\\nabla} F = \\left ( \\frac{F^{{\\color{airforceblue}\\theta}} }{\\tan{\\left ({\\color{airforceblue}\\theta} \\right )}} + \\partial_{{\\color{airforceblue}\\theta}} F^{{\\color{airforceblue}\\theta}} + \\partial_{{\\color{applegreen}\\phi}} F^{{\\color{applegreen}\\phi}} \\right ) + \\left ( \\frac{2 F^{{\\color{applegreen}\\phi}} }{\\tan{\\left ({\\color{airforceblue}\\theta} \\right )}} + \\partial_{{\\color{airforceblue}\\theta}} F^{{\\color{applegreen}\\phi}} - \\frac{\\partial_{{\\color{applegreen}\\phi}} F^{{\\color{airforceblue}\\theta}} }{{\\sin{\\left ({\\color{airforceblue}\\theta} \\right )}}^{2}}\\right ) \\boldsymbol{e}_{{\\color{airforceblue}\\theta}}\\wedge \\boldsymbol{e}_{{\\color{applegreen}\\phi}} \\end{equation*}\r\n", - "\\begin{equation*} \\ \\end{equation*}\r\n", - "\\begin{equation*} \\mbox{One dimensioanal submanifold} \\end{equation*}\r\n", - "\\begin{equation*} \\mbox{Basis not normalised} \\end{equation*}\r\n", - "\\begin{equation*} (\\phi)\\rightarrow (\\theta,\\phi) = \\left [ \\frac{\\pi}{8}, \\quad {\\color{atomictangerine}\\phi}\\right ] \\end{equation*}\r\n", - "\\begin{equation*} e_\\phi \\cdot e_\\phi = - \\frac{\\sqrt{2}}{4} + \\frac{1}{2} \\end{equation*}\r\n", - "\\begin{equation*} g = \\left[\\begin{matrix}- \\frac{\\sqrt{2}}{4} + \\frac{1}{2}\\end{matrix}\\right] \\end{equation*}\r\n", - "\\begin{equation*} \\boldsymbol{\\nabla} = \\boldsymbol{e}_{{\\color{atomictangerine}\\phi}} \\left ( 2 \\sqrt{2} + 4\\right ) \\frac{\\partial}{\\partial {\\color{atomictangerine}\\phi}} \\end{equation*}\r\n", - "\\begin{equation*} \\nabla h = \\left(2 \\sqrt{2} + 4\\right) \\partial_{{\\color{atomictangerine}\\phi}} h \\boldsymbol{e}_{{\\color{atomictangerine}\\phi}} \\end{equation*}\r\n", - "\\begin{equation*} H = H^{{\\color{atomictangerine}\\phi}} \\boldsymbol{e}_{{\\color{atomictangerine}\\phi}} \\end{equation*}\r\n", - "\\begin{equation*} \\nabla H = \\partial_{{\\color{atomictangerine}\\phi}} H^{{\\color{atomictangerine}\\phi}} \\end{equation*}\r\n", - "\\begin{equation*} \\ \\end{equation*}\r\n", - "\\end{document}\r\n" - ] + "data": { + "text/plain": [ + "\n", + "\\documentclass[10pt,fleqn]{report}\n", + "\\usepackage[vcentering]{geometry}\n", + "\\geometry{papersize={9in,10in},total={8in,9in}}\n", + "\n", + "\\pagestyle{empty}\n", + "\\usepackage[latin1]{inputenc}\n", + "\\usepackage{amsmath}\n", + "\\usepackage{amsfonts}\n", + "\\usepackage{amssymb}\n", + "\\usepackage{amsbsy}\n", + "\\usepackage{tensor}\n", + "\\usepackage{listings}\n", + "\\usepackage{color}\n", + "\\usepackage{xcolor}\n", + "\\usepackage{bm}\n", + "\\usepackage{breqn}\n", + "\\definecolor{gray}{rgb}{0.95,0.95,0.95}\n", + "\\setlength{\\parindent}{0pt}\n", + "\\DeclareMathOperator{\\Tr}{Tr}\n", + "\\DeclareMathOperator{\\Adj}{Adj}\n", + "\\newcommand{\\bfrac}[2]{\\displaystyle\\frac{#1}{#2}}\n", + "\\newcommand{\\lp}{\\left (}\n", + "\\newcommand{\\rp}{\\right )}\n", + "\\newcommand{\\paren}[1]{\\lp {#1} \\rp}\n", + "\\newcommand{\\half}{\\frac{1}{2}}\n", + "\\newcommand{\\llt}{\\left <}\n", + "\\newcommand{\\rgt}{\\right >}\n", + "\\newcommand{\\abs}[1]{\\left |{#1}\\right | }\n", + "\\newcommand{\\pdiff}[2]{\\bfrac{\\partial {#1}}{\\partial {#2}}}\n", + "\\newcommand{\\lbrc}{\\left \\{}\n", + "\\newcommand{\\rbrc}{\\right \\}}\n", + "\\newcommand{\\W}{\\wedge}\n", + "\\newcommand{\\prm}[1]{{#1}'}\n", + "\\newcommand{\\ddt}[1]{\\bfrac{d{#1}}{dt}}\n", + "\\newcommand{\\R}{\\dagger}\n", + "\\newcommand{\\deriv}[3]{\\bfrac{d^{#3}#1}{d{#2}^{#3}}}\n", + "\\newcommand{\\grade}[1]{\\left < {#1} \\right >}\n", + "\\newcommand{\\f}[2]{{#1}\\lp{#2}\\rp}\n", + "\\newcommand{\\eval}[2]{\\left . {#1} \\right |_{#2}}\n", + "\\newcommand{\\Nabla}{\\boldsymbol{\\nabla}}\n", + "\\newcommand{\\eb}{\\boldsymbol{e}}\n", + "\\usepackage{float}\n", + "\\floatstyle{plain} % optionally change the style of the new float\n", + "\\newfloat{Code}{H}{myc}\n", + "\\lstloadlanguages{Python}\n", + "\n", + "\\begin{document}\n", + "\\definecolor{airforceblue}{rgb}{0.36, 0.54, 0.66}\n", + "\\definecolor{applegreen}{rgb}{0.55, 0.71, 0.0}\n", + "\\definecolor{atomictangerine}{rgb}{1.0, 0.6, 0.4}\n", + "\\begin{equation*} \\bm{\\mbox{Base manifold (three dimensional)}} \\end{equation*}\n", + "\\begin{equation*} \\bm{\\mbox{Metric tensor (cartesian coordinates - norm = False)}} \\end{equation*}\n", + "\\begin{equation*} g = \\left [ \\begin{array}{ccc} 1 & 0 & 0 \\\\ 0 & 1 & 0 \\\\ 0 & 0 & 1 \\end{array}\\right ] \\end{equation*}\n", + "\\begin{equation*} \\ \\end{equation*}\n", + "\\begin{equation*} \\bm{\\mbox{Two dimensioanal submanifold - Unit sphere}} \\end{equation*}\n", + "\\begin{equation*} \\text{Basis not normalised} \\end{equation*}\n", + "\\begin{equation*} (\\theta,\\phi)\\rightarrow (r,\\theta,\\phi) = \\left [ 1, \\quad {\\color{airforceblue}\\theta}, \\quad {\\color{applegreen}\\phi}\\right ] \\end{equation*}\n", + "\\begin{equation*} e_\\theta \\cdot e_\\theta = 1 \\end{equation*}\n", + "\\begin{equation*} e_\\phi \\cdot e_\\phi = {\\sin{\\left ({\\color{airforceblue}\\theta} \\right )}}^{2} \\end{equation*}\n", + "\\begin{equation*} g = \\left [ \\begin{array}{cc} 1 & 0 \\\\ 0 & {\\sin{\\left ({\\color{airforceblue}\\theta} \\right )}}^{2} \\end{array}\\right ] \\end{equation*}\n", + "\\begin{equation*} \\text{g\\_inv = } \\left[\\begin{matrix}1 & 0\\\\0 & \\frac{1}{\\sin^{2}{\\left ({\\color{airforceblue}\\theta} \\right )}}\\end{matrix}\\right] \\end{equation*}\n", + "\\begin{equation*} \\text{Christoffel symbols of the first kind: } \\end{equation*}\n", + "\\begin{equation*} \\Gamma_{1, \\alpha, \\beta} = \\left[\\begin{matrix}0 & 0\\\\0 & - \\frac{\\sin{\\left (2 {\\color{airforceblue}\\theta} \\right )}}{2}\\end{matrix}\\right] \\quad \\Gamma_{2, \\alpha, \\beta} = \\left[\\begin{matrix}0 & \\frac{\\sin{\\left (2 {\\color{airforceblue}\\theta} \\right )}}{2}\\\\\\frac{\\sin{\\left (2 {\\color{airforceblue}\\theta} \\right )}}{2} & 0\\end{matrix}\\right] \\end{equation*}\n", + "\\begin{equation*} \\text{Christoffel symbols of the second kind: } \\end{equation*}\n", + "\\begin{equation*} \\Gamma^{1}_{\\phantom{1,}\\alpha, \\beta} = \\left[\\begin{matrix}0 & 0\\\\0 & - \\frac{\\sin{\\left (2 {\\color{airforceblue}\\theta} \\right )}}{2}\\end{matrix}\\right] \\quad \\Gamma^{2}_{\\phantom{2,}\\alpha, \\beta} = \\left[\\begin{matrix}0 & \\frac{1}{\\tan{\\left ({\\color{airforceblue}\\theta} \\right )}}\\\\\\frac{1}{\\tan{\\left ({\\color{airforceblue}\\theta} \\right )}} & 0\\end{matrix}\\right] \\end{equation*}\n", + "\\begin{equation*} \\boldsymbol{\\nabla} = \\boldsymbol{e}_{{\\color{airforceblue}\\theta}} \\frac{\\partial}{\\partial {\\color{airforceblue}\\theta}} + \\boldsymbol{e}_{{\\color{applegreen}\\phi}} \\frac{1}{{\\sin{\\left ({\\color{airforceblue}\\theta} \\right )}}^{2}} \\frac{\\partial}{\\partial {\\color{applegreen}\\phi}} \\end{equation*}\n", + "\\begin{equation*} \\boldsymbol{\\nabla} f = \\partial_{{\\color{airforceblue}\\theta}} f \\boldsymbol{e}_{{\\color{airforceblue}\\theta}} + \\frac{\\partial_{{\\color{applegreen}\\phi}} f }{{\\sin{\\left ({\\color{airforceblue}\\theta} \\right )}}^{2}} \\boldsymbol{e}_{{\\color{applegreen}\\phi}} \\end{equation*}\n", + "\\begin{equation*} F = F^{{\\color{airforceblue}\\theta}} \\boldsymbol{e}_{{\\color{airforceblue}\\theta}} + F^{{\\color{applegreen}\\phi}} \\boldsymbol{e}_{{\\color{applegreen}\\phi}} \\end{equation*}\n", + "\\begin{equation*} \\boldsymbol{\\nabla} F = \\left ( \\frac{F^{{\\color{airforceblue}\\theta}} }{\\tan{\\left ({\\color{airforceblue}\\theta} \\right )}} + \\partial_{{\\color{airforceblue}\\theta}} F^{{\\color{airforceblue}\\theta}} + \\partial_{{\\color{applegreen}\\phi}} F^{{\\color{applegreen}\\phi}} \\right ) + \\left ( \\frac{2 F^{{\\color{applegreen}\\phi}} }{\\tan{\\left ({\\color{airforceblue}\\theta} \\right )}} + \\partial_{{\\color{airforceblue}\\theta}} F^{{\\color{applegreen}\\phi}} - \\frac{\\partial_{{\\color{applegreen}\\phi}} F^{{\\color{airforceblue}\\theta}} }{{\\sin{\\left ({\\color{airforceblue}\\theta} \\right )}}^{2}}\\right ) \\boldsymbol{e}_{{\\color{airforceblue}\\theta}}\\wedge \\boldsymbol{e}_{{\\color{applegreen}\\phi}} \\end{equation*}\n", + "\\begin{equation*} \\ \\end{equation*}\n", + "\\begin{equation*} \\mbox{One dimensioanal submanifold} \\end{equation*}\n", + "\\begin{equation*} \\mbox{Basis not normalised} \\end{equation*}\n", + "\\begin{equation*} (\\phi)\\rightarrow (\\theta,\\phi) = \\left [ \\frac{\\pi}{8}, \\quad {\\color{atomictangerine}\\phi}\\right ] \\end{equation*}\n", + "\\begin{equation*} e_\\phi \\cdot e_\\phi = - \\frac{\\sqrt{2}}{4} + \\frac{1}{2} \\end{equation*}\n", + "\\begin{equation*} g = \\left[\\begin{matrix}- \\frac{\\sqrt{2}}{4} + \\frac{1}{2}\\end{matrix}\\right] \\end{equation*}\n", + "\\begin{equation*} \\boldsymbol{\\nabla} = \\boldsymbol{e}_{{\\color{atomictangerine}\\phi}} \\left ( 2 \\sqrt{2} + 4\\right ) \\frac{\\partial}{\\partial {\\color{atomictangerine}\\phi}} \\end{equation*}\n", + "\\begin{equation*} \\nabla h = \\left(2 \\sqrt{2} + 4\\right) \\partial_{{\\color{atomictangerine}\\phi}} h \\boldsymbol{e}_{{\\color{atomictangerine}\\phi}} \\end{equation*}\n", + "\\begin{equation*} H = H^{{\\color{atomictangerine}\\phi}} \\boldsymbol{e}_{{\\color{atomictangerine}\\phi}} \\end{equation*}\n", + "\\begin{equation*} \\nabla H = \\partial_{{\\color{atomictangerine}\\phi}} H^{{\\color{atomictangerine}\\phi}} \\end{equation*}\n", + "\\begin{equation*} \\ \\end{equation*}\n", + "\\end{document}\n" + ] + }, + "metadata": {}, + "output_type": "display_data" } ], "source": [ - "!cat colored_christoffel_symbols.tex" + "check('colored_christoffel_symbols')" ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] } ], "metadata": { @@ -2787,7 +2630,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.6.8" + "version": "3.5.4" } }, "nbformat": 4, diff --git a/examples/ipython/Old Format.ipynb b/examples/ipython/Old Format.ipynb index f552ad18..02e1c059 100644 --- a/examples/ipython/Old Format.ipynb +++ b/examples/ipython/Old Format.ipynb @@ -6,7 +6,28 @@ "metadata": {}, "outputs": [], "source": [ - "%cd -q ../Old Format" + "import subprocess\n", + "import sys\n", + "import os\n", + "from IPython.display import display_pretty\n", + "\n", + "os.chdir('../Old Format')\n", + "\n", + "def check_latex(name):\n", + " # todo: use subprocess.run once we drop Python 2.7\n", + " p = subprocess.Popen([sys.executable, name + '.py'], stderr=subprocess.PIPE, universal_newlines=True)\n", + " try:\n", + " stdout, stderr = p.communicate()\n", + " except:\n", + " p.kill()\n", + " if p.poll():\n", + " raise RuntimeError(\"The script raised an exception:\\n\\n\" + stderr)\n", + "\n", + " with open(name + '.tex', 'r') as f:\n", + " # can't use display.Latex here, it would result in CSS comparisons in the output.\n", + " \n", + " # using `display` forces this to be a separate output to any stdout from above.\n", + " display_pretty(f.read(), raw=True)" ] }, { @@ -18,13 +39,13 @@ "name": "stdout", "output_type": "stream", "text": [ - "3*e_x + 4*e_y\r\n", - "5\r\n", - "25\r\n", - "3*e_x/5 + 4*e_y/5\r\n", - "3*e_x/25 + 4*e_y/25\r\n", - "1\r\n", - "3*e_x/25 + 4*e_y/25\r\n" + "3*e_x + 4*e_y\n", + "5\n", + "25\n", + "3*e_x/5 + 4*e_y/5\n", + "3*e_x/25 + 4*e_y/25\n", + "1\n", + "3*e_x/25 + 4*e_y/25\n" ] } ], @@ -91,523 +112,508 @@ { "cell_type": "code", "execution_count": 5, - "metadata": {}, - "outputs": [], - "source": [ - "!python latex_check.py" - ] - }, - { - "cell_type": "code", - "execution_count": 6, "metadata": { - "collapsed": false, "scrolled": false }, "outputs": [ { - "name": "stdout", - "output_type": "stream", - "text": [ - "\r\n", - "\\documentclass[10pt,fleqn]{report}\r\n", - "\\usepackage[vcentering]{geometry}\r\n", - "\\geometry{papersize={14in,11in},total={13in,10in}}\r\n", - "\r\n", - "\\pagestyle{empty}\r\n", - "\\usepackage[latin1]{inputenc}\r\n", - "\\usepackage{amsmath}\r\n", - "\\usepackage{amsfonts}\r\n", - "\\usepackage{amssymb}\r\n", - "\\usepackage{amsbsy}\r\n", - "\\usepackage{tensor}\r\n", - "\\usepackage{listings}\r\n", - "\\usepackage{color}\r\n", - "\\usepackage{xcolor}\r\n", - "\\usepackage{bm}\r\n", - "\\usepackage{breqn}\r\n", - "\\definecolor{gray}{rgb}{0.95,0.95,0.95}\r\n", - "\\setlength{\\parindent}{0pt}\r\n", - "\\DeclareMathOperator{\\Tr}{Tr}\r\n", - "\\DeclareMathOperator{\\Adj}{Adj}\r\n", - "\\newcommand{\\bfrac}[2]{\\displaystyle\\frac{#1}{#2}}\r\n", - "\\newcommand{\\lp}{\\left (}\r\n", - "\\newcommand{\\rp}{\\right )}\r\n", - "\\newcommand{\\paren}[1]{\\lp {#1} \\rp}\r\n", - "\\newcommand{\\half}{\\frac{1}{2}}\r\n", - "\\newcommand{\\llt}{\\left <}\r\n", - "\\newcommand{\\rgt}{\\right >}\r\n", - "\\newcommand{\\abs}[1]{\\left |{#1}\\right | }\r\n", - "\\newcommand{\\pdiff}[2]{\\bfrac{\\partial {#1}}{\\partial {#2}}}\r\n", - "\\newcommand{\\lbrc}{\\left \\{}\r\n", - "\\newcommand{\\rbrc}{\\right \\}}\r\n", - "\\newcommand{\\W}{\\wedge}\r\n", - "\\newcommand{\\prm}[1]{{#1}'}\r\n", - "\\newcommand{\\ddt}[1]{\\bfrac{d{#1}}{dt}}\r\n", - "\\newcommand{\\R}{\\dagger}\r\n", - "\\newcommand{\\deriv}[3]{\\bfrac{d^{#3}#1}{d{#2}^{#3}}}\r\n", - "\\newcommand{\\grade}[1]{\\left < {#1} \\right >}\r\n", - "\\newcommand{\\f}[2]{{#1}\\lp{#2}\\rp}\r\n", - "\\newcommand{\\eval}[2]{\\left . {#1} \\right |_{#2}}\r\n", - "\\newcommand{\\Nabla}{\\boldsymbol{\\nabla}}\r\n", - "\\newcommand{\\eb}{\\boldsymbol{e}}\r\n", - "\\usepackage{float}\r\n", - "\\floatstyle{plain} % optionally change the style of the new float\r\n", - "\\newfloat{Code}{H}{myc}\r\n", - "\\lstloadlanguages{Python}\r\n", - "\r\n", - "\\begin{document}\r\n", - "\\\\begin{lstlisting}[language=Python,showspaces=false,showstringspaces=false,backgroundcolor=\\color{gray},frame=single]\r\n", - "def basic_multivector_operations_3D():\r\n", - " Print_Function()\r\n", - " (ex,ey,ez) = MV.setup('e*x|y|z')\r\n", - " A = MV('A','mv')\r\n", - " A.Fmt(1,'A')\r\n", - " A.Fmt(2,'A')\r\n", - " A.Fmt(3,'A')\r\n", - " A.even().Fmt(1,'%A_{+}')\r\n", - " A.odd().Fmt(1,'%A_{-}')\r\n", - " X = MV('X','vector')\r\n", - " Y = MV('Y','vector')\r\n", - " print('g_{ij} = ',MV.metric)\r\n", - " X.Fmt(1,'X')\r\n", - " Y.Fmt(1,'Y')\r\n", - " (X*Y).Fmt(2,'X*Y')\r\n", - " (X^Y).Fmt(2,'X^Y')\r\n", - " (X|Y).Fmt(2,'X|Y')\r\n", - " return\r\n", - "\\end{lstlisting}\r\n", - "Code Output:\r\n", - "\\begin{equation*} A = A + A^{x} \\boldsymbol{e}_{x} + A^{y} \\boldsymbol{e}_{y} + A^{z} \\boldsymbol{e}_{z} + A^{xy} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + A^{xz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + A^{yz} \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} + A^{xyz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\r\n", - " \\begin{align*} A = & A \\\\ & + A^{x} \\boldsymbol{e}_{x} + A^{y} \\boldsymbol{e}_{y} + A^{z} \\boldsymbol{e}_{z} \\\\ & + A^{xy} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + A^{xz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + A^{yz} \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\\\ & + A^{xyz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{align*} \r\n", - " \\begin{align*} A = & A \\\\ & + A^{x} \\boldsymbol{e}_{x} \\\\ & + A^{y} \\boldsymbol{e}_{y} \\\\ & + A^{z} \\boldsymbol{e}_{z} \\\\ & + A^{xy} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} \\\\ & + A^{xz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} \\\\ & + A^{yz} \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\\\ & + A^{xyz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{align*} \r\n", - "\\begin{equation*} g_{ij} = \\left [ \\begin{array}{ccc} \\left ( e_{x}\\cdot e_{x}\\right ) & \\left ( e_{x}\\cdot e_{y}\\right ) & \\left ( e_{x}\\cdot e_{z}\\right ) \\\\ \\left ( e_{x}\\cdot e_{y}\\right ) & \\left ( e_{y}\\cdot e_{y}\\right ) & \\left ( e_{y}\\cdot e_{z}\\right ) \\\\ \\left ( e_{x}\\cdot e_{z}\\right ) & \\left ( e_{y}\\cdot e_{z}\\right ) & \\left ( e_{z}\\cdot e_{z}\\right ) \\end{array}\\right ] \\end{equation*}\r\n", - "\\begin{equation*} X = X^{x} \\boldsymbol{e}_{x} + X^{y} \\boldsymbol{e}_{y} + X^{z} \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} Y = Y^{x} \\boldsymbol{e}_{x} + Y^{y} \\boldsymbol{e}_{y} + Y^{z} \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\\\begin{lstlisting}[language=Python,showspaces=false,showstringspaces=false,backgroundcolor=\\color{gray},frame=single]\r\n", - "def basic_multivector_operations_2D():\r\n", - " Print_Function()\r\n", - " (ex,ey) = MV.setup('e*x|y')\r\n", - " print('g_{ij} =',MV.metric)\r\n", - " X = MV('X','vector')\r\n", - " A = MV('A','spinor')\r\n", - " X.Fmt(1,'X')\r\n", - " A.Fmt(1,'A')\r\n", - " (X|A).Fmt(2,'X|A')\r\n", - " (XX).Fmt(2,'A>X')\r\n", - " return\r\n", - "\\end{lstlisting}\r\n", - "Code Output:\r\n", - "\\begin{equation*} g_{ij} = \\left [ \\begin{array}{cc} \\left ( e_{x}\\cdot e_{x}\\right ) & \\left ( e_{x}\\cdot e_{y}\\right ) \\\\ \\left ( e_{x}\\cdot e_{y}\\right ) & \\left ( e_{y}\\cdot e_{y}\\right ) \\end{array}\\right ] \\end{equation*}\r\n", - "\\begin{equation*} X = X^{x} \\boldsymbol{e}_{x} + X^{y} \\boldsymbol{e}_{y} \\end{equation*}\r\n", - "\\begin{equation*} A = A + A^{xy} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} \\end{equation*}\r\n", - "\\\\begin{lstlisting}[language=Python,showspaces=false,showstringspaces=false,backgroundcolor=\\color{gray},frame=single]\r\n", - "def basic_multivector_operations_2D_orthogonal():\r\n", - " Print_Function()\r\n", - " (ex,ey) = MV.setup('e*x|y',metric='[1,1]')\r\n", - " print('g_{ii} =',MV.metric)\r\n", - " X = MV('X','vector')\r\n", - " A = MV('A','spinor')\r\n", - " X.Fmt(1,'X')\r\n", - " A.Fmt(1,'A')\r\n", - " (X*A).Fmt(2,'X*A')\r\n", - " (X|A).Fmt(2,'X|A')\r\n", - " (XA).Fmt(2,'X>A')\r\n", - " (A*X).Fmt(2,'A*X')\r\n", - " (A|X).Fmt(2,'A|X')\r\n", - " (AX).Fmt(2,'A>X')\r\n", - " return\r\n", - "\\end{lstlisting}\r\n", - "Code Output:\r\n", - "\\begin{equation*} g_{ii} = \\left [ \\begin{array}{cc} 1 & 0 \\\\ 0 & 1 \\end{array}\\right ] \\end{equation*}\r\n", - "\\begin{equation*} X = X^{x} \\boldsymbol{e}_{x} + X^{y} \\boldsymbol{e}_{y} \\end{equation*}\r\n", - "\\begin{equation*} A = A + A^{xy} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} \\end{equation*}\r\n", - "\\\\begin{lstlisting}[language=Python,showspaces=false,showstringspaces=false,backgroundcolor=\\color{gray},frame=single]\r\n", - "def check_generalized_BAC_CAB_formulas():\r\n", - " Print_Function()\r\n", - " (a,b,c,d) = MV.setup('a b c d')\r\n", - " print('g_{ij} =',MV.metric)\r\n", - " print('\\\\bm{a|(b*c)} =',a|(b*c))\r\n", - " print('\\\\bm{a|(b^c)} =',a|(b^c))\r\n", - " print('\\\\bm{a|(b^c^d)} =',a|(b^c^d))\r\n", - " print('\\\\bm{a|(b^c)+c|(a^b)+b|(c^a)} =',(a|(b^c))+(c|(a^b))+(b|(c^a)))\r\n", - " print('\\\\bm{a*(b^c)-b*(a^c)+c*(a^b)} =',a*(b^c)-b*(a^c)+c*(a^b))\r\n", - " print('\\\\bm{a*(b^c^d)-b*(a^c^d)+c*(a^b^d)-d*(a^b^c)} =',a*(b^c^d)-b*(a^c^d)+c*(a^b^d)-d*(a^b^c))\r\n", - " print('\\\\bm{(a^b)|(c^d)} =',(a^b)|(c^d))\r\n", - " print('\\\\bm{((a^b)|c)|d} =',((a^b)|c)|d)\r\n", - " print('\\\\bm{(a^b)\\\\times (c^d)} =',Ga.com(a^b,c^d))\r\n", - " return\r\n", - "\\end{lstlisting}\r\n", - "Code Output:\r\n", - "\\begin{equation*} g_{ij} = \\left [ \\begin{array}{cccc} \\left ( a\\cdot a\\right ) & \\left ( a\\cdot b\\right ) & \\left ( a\\cdot c\\right ) & \\left ( a\\cdot d\\right ) \\\\ \\left ( a\\cdot b\\right ) & \\left ( b\\cdot b\\right ) & \\left ( b\\cdot c\\right ) & \\left ( b\\cdot d\\right ) \\\\ \\left ( a\\cdot c\\right ) & \\left ( b\\cdot c\\right ) & \\left ( c\\cdot c\\right ) & \\left ( c\\cdot d\\right ) \\\\ \\left ( a\\cdot d\\right ) & \\left ( b\\cdot d\\right ) & \\left ( c\\cdot d\\right ) & \\left ( d\\cdot d\\right ) \\end{array}\\right ] \\end{equation*}\r\n", - "\\begin{equation*} \\bm{a\\cdot (b c)} = - \\left ( a\\cdot c\\right ) \\boldsymbol{b} + \\left ( a\\cdot b\\right ) \\boldsymbol{c} \\end{equation*}\r\n", - "\\begin{equation*} \\bm{a\\cdot (b\\W c)} = - \\left ( a\\cdot c\\right ) \\boldsymbol{b} + \\left ( a\\cdot b\\right ) \\boldsymbol{c} \\end{equation*}\r\n", - "\\begin{equation*} \\bm{a\\cdot (b\\W c\\W d)} = \\left ( a\\cdot d\\right ) \\boldsymbol{b}\\wedge \\boldsymbol{c} - \\left ( a\\cdot c\\right ) \\boldsymbol{b}\\wedge \\boldsymbol{d} + \\left ( a\\cdot b\\right ) \\boldsymbol{c}\\wedge \\boldsymbol{d} \\end{equation*}\r\n", - "\\begin{equation*} \\bm{a\\cdot (b\\W c)+c\\cdot (a\\W b)+b\\cdot (c\\W a)} = 0 \\end{equation*}\r\n", - "\\begin{equation*} \\bm{a (b\\W c)-b (a\\W c)+c (a\\W b)} = 3 \\boldsymbol{a}\\wedge \\boldsymbol{b}\\wedge \\boldsymbol{c} \\end{equation*}\r\n", - "\\begin{equation*} \\bm{a (b\\W c\\W d)-b (a\\W c\\W d)+c (a\\W b\\W d)-d (a\\W b\\W c)} = 4 \\boldsymbol{a}\\wedge \\boldsymbol{b}\\wedge \\boldsymbol{c}\\wedge \\boldsymbol{d} \\end{equation*}\r\n", - "\\begin{equation*} \\bm{(a\\W b)\\cdot (c\\W d)} = - \\left ( a\\cdot c\\right ) \\left ( b\\cdot d\\right ) + \\left ( a\\cdot d\\right ) \\left ( b\\cdot c\\right ) \\end{equation*}\r\n", - "\\begin{equation*} \\bm{((a\\W b)\\cdot c)\\cdot d} = - \\left ( a\\cdot c\\right ) \\left ( b\\cdot d\\right ) + \\left ( a\\cdot d\\right ) \\left ( b\\cdot c\\right ) \\end{equation*}\r\n", - "\\begin{equation*} \\bm{(a\\W b)\\times (c\\W d)} = - \\left ( b\\cdot d\\right ) \\boldsymbol{a}\\wedge \\boldsymbol{c} + \\left ( b\\cdot c\\right ) \\boldsymbol{a}\\wedge \\boldsymbol{d} + \\left ( a\\cdot d\\right ) \\boldsymbol{b}\\wedge \\boldsymbol{c} - \\left ( a\\cdot c\\right ) \\boldsymbol{b}\\wedge \\boldsymbol{d} \\end{equation*}\r\n", - "\\\\begin{lstlisting}[language=Python,showspaces=false,showstringspaces=false,backgroundcolor=\\color{gray},frame=single]\r\n", - "def rounding_numerical_components():\r\n", - " Print_Function()\r\n", - " (ex,ey,ez) = MV.setup('e_x e_y e_z',metric='[1,1,1]')\r\n", - " X = 1.2*ex+2.34*ey+0.555*ez\r\n", - " Y = 0.333*ex+4*ey+5.3*ez\r\n", - " print('X =',X)\r\n", - " print('Nga(X,2) =',Nga(X,2))\r\n", - " print('X*Y =',X*Y)\r\n", - " print('Nga(X*Y,2) =',Nga(X*Y,2))\r\n", - " return\r\n", - "\\end{lstlisting}\r\n", - "Code Output:\r\n", - "\\begin{equation*} X = 1 \\cdot 2 \\boldsymbol{e}_{x} + 2 \\cdot 34 \\boldsymbol{e}_{y} + 0 \\cdot 555 \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} Nga(X,2) = 1 \\cdot 2 \\boldsymbol{e}_{x} + 2 \\cdot 3 \\boldsymbol{e}_{y} + 0 \\cdot 55 \\boldsymbol{e}_{z} \\end{equation*}\r\n", - " \\begin{align*} X Y = & 12 \\cdot 7011 \\\\ & + 4 \\cdot 02078 \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + 6 \\cdot 175185 \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + 10 \\cdot 182 \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{align*} \r\n", - " \\begin{align*} Nga(X Y,2) = & 13 \\cdot 0 \\\\ & + 4 \\cdot 0 \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + 6 \\cdot 2 \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + 10 \\cdot 0 \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{align*} \r\n", - "\\\\begin{lstlisting}[language=Python,showspaces=false,showstringspaces=false,backgroundcolor=\\color{gray},frame=single]\r\n", - "def derivatives_in_rectangular_coordinates():\r\n", - " Print_Function()\r\n", - " X = (x,y,z) = symbols('x y z')\r\n", - " (ex,ey,ez,grad) = MV.setup('e_x e_y e_z',metric='[1,1,1]',coords=X)\r\n", - " f = MV('f','scalar',fct=True)\r\n", - " A = MV('A','vector',fct=True)\r\n", - " B = MV('B','grade2',fct=True)\r\n", - " C = MV('C','mv')\r\n", - " print('f =',f)\r\n", - " print('A =',A)\r\n", - " print('B =',B)\r\n", - " print('C =',C)\r\n", - " print('grad*f =',grad*f)\r\n", - " print('grad|A =',grad|A)\r\n", - " print('grad*A =',grad*A)\r\n", - " print(-MV.I)\r\n", - " print('-I*(grad^A) =',-MV.I*(grad^A))\r\n", - " print('grad*B =',grad*B)\r\n", - " print('grad^B =',grad^B)\r\n", - " print('grad|B =',grad|B)\r\n", - " return\r\n", - "\\end{lstlisting}\r\n", - "Code Output:\r\n", - "\\begin{equation*} f = f \\end{equation*}\r\n", - "\\begin{equation*} A = A^{x} \\boldsymbol{e}_{x} + A^{y} \\boldsymbol{e}_{y} + A^{z} \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} B = B^{xy} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + B^{xz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + B^{yz} \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\r\n", - " \\begin{align*} C = & C \\\\ & + C^{x} \\boldsymbol{e}_{x} + C^{y} \\boldsymbol{e}_{y} + C^{z} \\boldsymbol{e}_{z} \\\\ & + C^{xy} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + C^{xz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + C^{yz} \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\\\ & + C^{xyz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{align*} \r\n", - "\\begin{equation*} \\boldsymbol{\\nabla} f = \\partial_{x} f \\boldsymbol{e}_{x} + \\partial_{y} f \\boldsymbol{e}_{y} + \\partial_{z} f \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} \\boldsymbol{\\nabla} \\cdot A = \\partial_{x} A^{x} + \\partial_{y} A^{y} + \\partial_{z} A^{z} \\end{equation*}\r\n", - " \\begin{align*} \\boldsymbol{\\nabla} A = & \\left ( \\partial_{x} A^{x} + \\partial_{y} A^{y} + \\partial_{z} A^{z} \\right ) \\\\ & + \\left ( - \\partial_{y} A^{x} + \\partial_{x} A^{y} \\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + \\left ( - \\partial_{z} A^{x} + \\partial_{x} A^{z} \\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + \\left ( - \\partial_{z} A^{y} + \\partial_{y} A^{z} \\right ) \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{align*} \r\n", - "\\begin{equation*} - \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} -I (\\boldsymbol{\\nabla} \\W A) = \\left ( - \\partial_{z} A^{y} + \\partial_{y} A^{z} \\right ) \\boldsymbol{e}_{x} + \\left ( \\partial_{z} A^{x} - \\partial_{x} A^{z} \\right ) \\boldsymbol{e}_{y} + \\left ( - \\partial_{y} A^{x} + \\partial_{x} A^{y} \\right ) \\boldsymbol{e}_{z} \\end{equation*}\r\n", - " \\begin{align*} \\boldsymbol{\\nabla} B = & \\left ( - \\partial_{y} B^{xy} - \\partial_{z} B^{xz} \\right ) \\boldsymbol{e}_{x} + \\left ( \\partial_{x} B^{xy} - \\partial_{z} B^{yz} \\right ) \\boldsymbol{e}_{y} + \\left ( \\partial_{x} B^{xz} + \\partial_{y} B^{yz} \\right ) \\boldsymbol{e}_{z} \\\\ & + \\left ( \\partial_{z} B^{xy} - \\partial_{y} B^{xz} + \\partial_{x} B^{yz} \\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{align*} \r\n", - "\\begin{equation*} \\boldsymbol{\\nabla} \\W B = \\left ( \\partial_{z} B^{xy} - \\partial_{y} B^{xz} + \\partial_{x} B^{yz} \\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} \\boldsymbol{\\nabla} \\cdot B = \\left ( - \\partial_{y} B^{xy} - \\partial_{z} B^{xz} \\right ) \\boldsymbol{e}_{x} + \\left ( \\partial_{x} B^{xy} - \\partial_{z} B^{yz} \\right ) \\boldsymbol{e}_{y} + \\left ( \\partial_{x} B^{xz} + \\partial_{y} B^{yz} \\right ) \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\\\begin{lstlisting}[language=Python,showspaces=false,showstringspaces=false,backgroundcolor=\\color{gray},frame=single]\r\n", - "def derivatives_in_spherical_coordinates():\r\n", - " Print_Function()\r\n", - " X = (r,th,phi) = symbols('r theta phi')\r\n", - " curv = [[r*cos(phi)*sin(th),r*sin(phi)*sin(th),r*cos(th)],[1,r,r*sin(th)]]\r\n", - " (er,eth,ephi,grad) = MV.setup('e_r e_theta e_phi',metric='[1,1,1]',coords=X,curv=curv)\r\n", - " f = MV('f','scalar',fct=True)\r\n", - " A = MV('A','vector',fct=True)\r\n", - " B = MV('B','grade2',fct=True)\r\n", - " print('f =',f)\r\n", - " print('A =',A)\r\n", - " print('B =',B)\r\n", - " print('grad*f =',grad*f)\r\n", - " print('grad|A =',grad|A)\r\n", - " print('-I*(grad^A) =',(-MV.I*(grad^A)).simplify())\r\n", - " print('grad^B =',grad^B)\r\n", - "\\end{lstlisting}\r\n", - "Code Output:\r\n", - "\\begin{equation*} f = f \\end{equation*}\r\n", - "\\begin{equation*} A = A^{r} \\boldsymbol{e}_{r} + A^{\\theta } \\boldsymbol{e}_{\\theta } + A^{\\phi } \\boldsymbol{e}_{\\phi } \\end{equation*}\r\n", - "\\begin{equation*} B = B^{r\\theta } \\boldsymbol{e}_{r}\\wedge \\boldsymbol{e}_{\\theta } + B^{r\\phi } \\boldsymbol{e}_{r}\\wedge \\boldsymbol{e}_{\\phi } + B^{\\theta \\phi } \\boldsymbol{e}_{\\theta }\\wedge \\boldsymbol{e}_{\\phi } \\end{equation*}\r\n", - "\\begin{equation*} \\boldsymbol{\\nabla} f = \\partial_{r} f \\boldsymbol{e}_{r} + \\frac{\\partial_{\\theta } f }{r^{2}} \\boldsymbol{e}_{\\theta } + \\frac{\\partial_{\\phi } f }{r^{2} {\\sin{\\left (\\theta \\right )}}^{2}} \\boldsymbol{e}_{\\phi } \\end{equation*}\r\n", - "\\begin{equation*} \\boldsymbol{\\nabla} \\cdot A = \\frac{A^{\\theta } }{\\tan{\\left (\\theta \\right )}} + \\partial_{\\phi } A^{\\phi } + \\partial_{r} A^{r} + \\partial_{\\theta } A^{\\theta } + \\frac{2 A^{r} }{r} \\end{equation*}\r\n", - "\\begin{equation*} -I (\\boldsymbol{\\nabla} \\W A) = \\frac{\\sqrt{r^{4} {\\sin{\\left (\\theta \\right )}}^{2}} \\left(\\frac{2 A^{\\phi } }{\\tan{\\left (\\theta \\right )}} + \\partial_{\\theta } A^{\\phi } - \\frac{\\partial_{\\phi } A^{\\theta } }{{\\sin{\\left (\\theta \\right )}}^{2}}\\right)}{r^{2}} \\boldsymbol{e}_{r} + \\frac{- r^{2} {\\sin{\\left (\\theta \\right )}}^{2} \\partial_{r} A^{\\phi } - 2 r A^{\\phi } {\\sin{\\left (\\theta \\right )}}^{2} + \\partial_{\\phi } A^{r} }{\\sqrt{r^{4} {\\sin{\\left (\\theta \\right )}}^{2}}} \\boldsymbol{e}_{\\theta } + \\frac{r^{2} \\partial_{r} A^{\\theta } + 2 r A^{\\theta } - \\partial_{\\theta } A^{r} }{\\sqrt{r^{4} {\\sin{\\left (\\theta \\right )}}^{2}}} \\boldsymbol{e}_{\\phi } \\end{equation*}\r\n", - "\\begin{equation*} \\boldsymbol{\\nabla} \\W B = \\frac{r^{2} \\partial_{r} B^{\\theta \\phi } + 4 r B^{\\theta \\phi } - \\frac{2 B^{r\\phi } }{\\tan{\\left (\\theta \\right )}} - \\partial_{\\theta } B^{r\\phi } + \\frac{\\partial_{\\phi } B^{r\\theta } }{{\\sin{\\left (\\theta \\right )}}^{2}}}{r^{2}} \\boldsymbol{e}_{r}\\wedge \\boldsymbol{e}_{\\theta }\\wedge \\boldsymbol{e}_{\\phi } \\end{equation*}\r\n", - "\\\\begin{lstlisting}[language=Python,showspaces=false,showstringspaces=false,backgroundcolor=\\color{gray},frame=single]\r\n", - "def conformal_representations_of_circles_lines_spheres_and_planes():\r\n", - " Print_Function()\r\n", - " global n,nbar\r\n", - " metric = '1 0 0 0 0,0 1 0 0 0,0 0 1 0 0,0 0 0 0 2,0 0 0 2 0'\r\n", - " (e1,e2,e3,n,nbar) = MV.setup('e_1 e_2 e_3 n \\\\bar{n}',metric)\r\n", - " print('g_{ij} =',MV.metric)\r\n", - " e = n+nbar\r\n", - " #conformal representation of points\r\n", - " A = make_vector(e1) # point a = (1,0,0) A = F(a)\r\n", - " B = make_vector(e2) # point b = (0,1,0) B = F(b)\r\n", - " C = make_vector(-e1) # point c = (-1,0,0) C = F(c)\r\n", - " D = make_vector(e3) # point d = (0,0,1) D = F(d)\r\n", - " X = make_vector('x',3)\r\n", - " print('F(a) =',A)\r\n", - " print('F(b) =',B)\r\n", - " print('F(c) =',C)\r\n", - " print('F(d) =',D)\r\n", - " print('F(x) =',X)\r\n", - " print('#a = e1, b = e2, c = -e1, and d = e3')\r\n", - " print('#A = F(a) = 1/2*(a*a*n+2*a-nbar), etc.')\r\n", - " print('#Circle through a, b, and c')\r\n", - " print('Circle: A^B^C^X = 0 =',(A^B^C^X))\r\n", - " print('#Line through a and b')\r\n", - " print('Line : A^B^n^X = 0 =',(A^B^n^X))\r\n", - " print('#Sphere through a, b, c, and d')\r\n", - " print('Sphere: A^B^C^D^X = 0 =',(((A^B)^C)^D)^X)\r\n", - " print('#Plane through a, b, and d')\r\n", - " print('Plane : A^B^n^D^X = 0 =',(A^B^n^D^X))\r\n", - " L = (A^B^e)^X\r\n", - " L.Fmt(3,'Hyperbolic\\\\;\\\\; Circle: (A^B^e)^X = 0')\r\n", - " return\r\n", - "\\end{lstlisting}\r\n", - "Code Output:\r\n", - "\\begin{equation*} g_{ij} = \\left [ \\begin{array}{ccccc} 1 & 0 & 0 & 0 & 0 \\\\ 0 & 1 & 0 & 0 & 0 \\\\ 0 & 0 & 1 & 0 & 0 \\\\ 0 & 0 & 0 & 0 & 2 \\\\ 0 & 0 & 0 & 2 & 0 \\end{array}\\right ] \\end{equation*}\r\n", - "\\begin{equation*} F(a) = \\boldsymbol{e}_{1} + \\frac{1}{2} \\boldsymbol{n} - \\frac{1}{2} \\boldsymbol{\\bar{n}} \\end{equation*}\r\n", - "\\begin{equation*} F(b) = \\boldsymbol{e}_{2} + \\frac{1}{2} \\boldsymbol{n} - \\frac{1}{2} \\boldsymbol{\\bar{n}} \\end{equation*}\r\n", - "\\begin{equation*} F(c) = - \\boldsymbol{e}_{1} + \\frac{1}{2} \\boldsymbol{n} - \\frac{1}{2} \\boldsymbol{\\bar{n}} \\end{equation*}\r\n", - "\\begin{equation*} F(d) = \\boldsymbol{e}_{3} + \\frac{1}{2} \\boldsymbol{n} - \\frac{1}{2} \\boldsymbol{\\bar{n}} \\end{equation*}\r\n", - "\\begin{equation*} F(x) = x_{1} \\boldsymbol{e}_{1} + x_{2} \\boldsymbol{e}_{2} + x_{3} \\boldsymbol{e}_{3} + \\left ( \\frac{{\\left ( x_{1} \\right )}^{2}}{2} + \\frac{{\\left ( x_{2} \\right )}^{2}}{2} + \\frac{{\\left ( x_{3} \\right )}^{2}}{2}\\right ) \\boldsymbol{n} - \\frac{1}{2} \\boldsymbol{\\bar{n}} \\end{equation*}\r\n", - "a = e1, b = e2, c = -e1, and d = e3\r\n", - "A = F(a) = 1/2*(a*a*n+2*a-nbar), etc.\r\n", - "Circle through a, b, and c\r\n", - "\\begin{equation*} Circle: A\\W B\\W C\\W X = 0 = - x_{3} \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{2}\\wedge \\boldsymbol{e}_{3}\\wedge \\boldsymbol{n} + x_{3} \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{2}\\wedge \\boldsymbol{e}_{3}\\wedge \\boldsymbol{\\bar{n}} + \\left ( \\frac{{\\left ( x_{1} \\right )}^{2}}{2} + \\frac{{\\left ( x_{2} \\right )}^{2}}{2} + \\frac{{\\left ( x_{3} \\right )}^{2}}{2} - \\frac{1}{2}\\right ) \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{2}\\wedge \\boldsymbol{n}\\wedge \\boldsymbol{\\bar{n}} \\end{equation*}\r\n", - "Line through a and b\r\n", - "\\begin{equation*} Line : A\\W B\\W n\\W X = 0 = - x_{3} \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{2}\\wedge \\boldsymbol{e}_{3}\\wedge \\boldsymbol{n} + \\left ( \\frac{x_{1}}{2} + \\frac{x_{2}}{2} - \\frac{1}{2}\\right ) \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{2}\\wedge \\boldsymbol{n}\\wedge \\boldsymbol{\\bar{n}} + \\frac{x_{3}}{2} \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{3}\\wedge \\boldsymbol{n}\\wedge \\boldsymbol{\\bar{n}} - \\frac{x_{3}}{2} \\boldsymbol{e}_{2}\\wedge \\boldsymbol{e}_{3}\\wedge \\boldsymbol{n}\\wedge \\boldsymbol{\\bar{n}} \\end{equation*}\r\n", - "Sphere through a, b, c, and d\r\n", - "\\begin{equation*} Sphere: A\\W B\\W C\\W D\\W X = 0 = \\left ( - \\frac{{\\left ( x_{1} \\right )}^{2}}{2} - \\frac{{\\left ( x_{2} \\right )}^{2}}{2} - \\frac{{\\left ( x_{3} \\right )}^{2}}{2} + \\frac{1}{2}\\right ) \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{2}\\wedge \\boldsymbol{e}_{3}\\wedge \\boldsymbol{n}\\wedge \\boldsymbol{\\bar{n}} \\end{equation*}\r\n", - "Plane through a, b, and d\r\n", - "\\begin{equation*} Plane : A\\W B\\W n\\W D\\W X = 0 = \\left ( - \\frac{x_{1}}{2} - \\frac{x_{2}}{2} - \\frac{x_{3}}{2} + \\frac{1}{2}\\right ) \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{2}\\wedge \\boldsymbol{e}_{3}\\wedge \\boldsymbol{n}\\wedge \\boldsymbol{\\bar{n}} \\end{equation*}\r\n", - "\\\\begin{lstlisting}[language=Python,showspaces=false,showstringspaces=false,backgroundcolor=\\color{gray},frame=single]\r\n", - "def properties_of_geometric_objects():\r\n", - " global n,nbar\r\n", - " Print_Function()\r\n", - " metric = '# # # 0 0,'+ \\\r\n", - " '# # # 0 0,'+ \\\r\n", - " '# # # 0 0,'+ \\\r\n", - " '0 0 0 0 2,'+ \\\r\n", - " '0 0 0 2 0'\r\n", - " (p1,p2,p3,n,nbar) = MV.setup('p1 p2 p3 n \\\\bar{n}',metric)\r\n", - " print('g_{ij} =',MV.metric)\r\n", - " P1 = F(p1)\r\n", - " P2 = F(p2)\r\n", - " P3 = F(p3)\r\n", - " print('#%\\\\text{Extracting direction of line from }L = P1\\\\W P2\\\\W n')\r\n", - " L = P1^P2^n\r\n", - " delta = (L|n)|nbar\r\n", - " print('(L|n)|\\\\bar{n} =',delta)\r\n", - " print('#%\\\\text{Extracting plane of circle from }C = P1\\\\W P2\\\\W P3')\r\n", - " C = P1^P2^P3\r\n", - " delta = ((C^n)|n)|nbar\r\n", - " print('((C^n)|n)|\\\\bar{n}=',delta)\r\n", - " print('(p2-p1)^(p3-p1)=',(p2-p1)^(p3-p1))\r\n", - " return\r\n", - "\\end{lstlisting}\r\n", - "Code Output:\r\n", - "\\begin{equation*} g_{ij} = \\left [ \\begin{array}{ccccc} \\left ( p_{1}\\cdot p_{1}\\right ) & \\left ( p_{1}\\cdot p_{2}\\right ) & \\left ( p_{1}\\cdot p_{3}\\right ) & 0 & 0 \\\\ \\left ( p_{1}\\cdot p_{2}\\right ) & \\left ( p_{2}\\cdot p_{2}\\right ) & \\left ( p_{2}\\cdot p_{3}\\right ) & 0 & 0 \\\\ \\left ( p_{1}\\cdot p_{3}\\right ) & \\left ( p_{2}\\cdot p_{3}\\right ) & \\left ( p_{3}\\cdot p_{3}\\right ) & 0 & 0 \\\\ 0 & 0 & 0 & 0 & 2 \\\\ 0 & 0 & 0 & 2 & 0 \\end{array}\\right ] \\end{equation*}\r\n", - "\\begin{equation*} \\text{Extracting direction of line from }L = P1\\W P2\\W n \\end{equation*}\r\n", - " \\begin{align*} (L\\cdot n)\\cdot \\bar{n} = & 2 \\boldsymbol{p}_{1} \\\\ & -2 \\boldsymbol{p}_{2} \\end{align*} \r\n", - "\\begin{equation*} \\text{Extracting plane of circle from }C = P1\\W P2\\W P3 \\end{equation*}\r\n", - " \\begin{align*} ((C\\W n)\\cdot n)\\cdot \\bar{n}= & 2 \\boldsymbol{p}_{1}\\wedge \\boldsymbol{p}_{2} \\\\ & -2 \\boldsymbol{p}_{1}\\wedge \\boldsymbol{p}_{3} \\\\ & + 2 \\boldsymbol{p}_{2}\\wedge \\boldsymbol{p}_{3} \\end{align*} \r\n", - " \\begin{align*} (p2-p1)\\W (p3-p1)= & \\boldsymbol{p}_{1}\\wedge \\boldsymbol{p}_{2} \\\\ & - \\boldsymbol{p}_{1}\\wedge \\boldsymbol{p}_{3} \\\\ & + \\boldsymbol{p}_{2}\\wedge \\boldsymbol{p}_{3} \\end{align*} \r\n", - "\\\\begin{lstlisting}[language=Python,showspaces=false,showstringspaces=false,backgroundcolor=\\color{gray},frame=single]\r\n", - "def extracting_vectors_from_conformal_2_blade():\r\n", - " Print_Function()\r\n", - " print(r'B = P1\\W P2')\r\n", - " metric = '0 -1 #,'+ \\\r\n", - " '-1 0 #,'+ \\\r\n", - " '# # #'\r\n", - " (P1,P2,a) = MV.setup('P1 P2 a',metric)\r\n", - " print('g_{ij} =',MV.metric)\r\n", - " B = P1^P2\r\n", - " Bsq = B*B\r\n", - " print('%B^{2} =',Bsq)\r\n", - " ap = a-(a^B)*B\r\n", - " print(\"a' = a-(a^B)*B =\",ap)\r\n", - " Ap = ap+ap*B\r\n", - " Am = ap-ap*B\r\n", - " print(\"A+ = a'+a'*B =\",Ap)\r\n", - " print(\"A- = a'-a'*B =\",Am)\r\n", - " print('%(A+)^{2} =',Ap*Ap)\r\n", - " print('%(A-)^{2} =',Am*Am)\r\n", - " aB = a|B\r\n", - " print('a|B =',aB)\r\n", - " return\r\n", - "\\end{lstlisting}\r\n", - "Code Output:\r\n", - "\\begin{equation*} B = P1\\W P2 \\end{equation*}\r\n", - "\\begin{equation*} g_{ij} = \\left [ \\begin{array}{ccc} 0 & -1 & \\left ( P_{1}\\cdot a\\right ) \\\\ -1 & 0 & \\left ( P_{2}\\cdot a\\right ) \\\\ \\left ( P_{1}\\cdot a\\right ) & \\left ( P_{2}\\cdot a\\right ) & \\left ( a\\cdot a\\right ) \\end{array}\\right ] \\end{equation*}\r\n", - "\\begin{equation*} B^{2} = 1 \\end{equation*}\r\n", - " \\begin{align*} a' = a-(a\\W B) B = & - \\left ( P_{2}\\cdot a\\right ) \\boldsymbol{P}_{1} \\\\ & - \\left ( P_{1}\\cdot a\\right ) \\boldsymbol{P}_{2} \\end{align*} \r\n", - "\\begin{equation*} A+ = a'+a' B = - 2 \\left ( P_{2}\\cdot a\\right ) \\boldsymbol{P}_{1} \\end{equation*}\r\n", - "\\begin{equation*} A- = a'-a' B = - 2 \\left ( P_{1}\\cdot a\\right ) \\boldsymbol{P}_{2} \\end{equation*}\r\n", - "\\begin{equation*} (A+)^{2} = 0 \\end{equation*}\r\n", - "\\begin{equation*} (A-)^{2} = 0 \\end{equation*}\r\n", - " \\begin{align*} a\\cdot B = & - \\left ( P_{2}\\cdot a\\right ) \\boldsymbol{P}_{1} \\\\ & + \\left ( P_{1}\\cdot a\\right ) \\boldsymbol{P}_{2} \\end{align*} \r\n", - "\\\\begin{lstlisting}[language=Python,showspaces=false,showstringspaces=false,backgroundcolor=\\color{gray},frame=single]\r\n", - "def reciprocal_frame_test():\r\n", - " Print_Function()\r\n", - " metric = '1 # #,'+ \\\r\n", - " '# 1 #,'+ \\\r\n", - " '# # 1'\r\n", - " (e1,e2,e3) = MV.setup('e1 e2 e3',metric)\r\n", - " print('g_{ij} =',MV.metric)\r\n", - " E = e1^e2^e3\r\n", - " Esq = (E*E).scalar()\r\n", - " print('E =',E)\r\n", - " print('%E^{2} =',Esq)\r\n", - " Esq_inv = 1/Esq\r\n", - " E1 = (e2^e3)*E\r\n", - " E2 = (-1)*(e1^e3)*E\r\n", - " E3 = (e1^e2)*E\r\n", - " print('E1 = (e2^e3)*E =',E1)\r\n", - " print('E2 =-(e1^e3)*E =',E2)\r\n", - " print('E3 = (e1^e2)*E =',E3)\r\n", - " w = (E1|e2)\r\n", - " w = w.expand()\r\n", - " print('E1|e2 =',w)\r\n", - " w = (E1|e3)\r\n", - " w = w.expand()\r\n", - " print('E1|e3 =',w)\r\n", - " w = (E2|e1)\r\n", - " w = w.expand()\r\n", - " print('E2|e1 =',w)\r\n", - " w = (E2|e3)\r\n", - " w = w.expand()\r\n", - " print('E2|e3 =',w)\r\n", - " w = (E3|e1)\r\n", - " w = w.expand()\r\n", - " print('E3|e1 =',w)\r\n", - " w = (E3|e2)\r\n", - " w = w.expand()\r\n", - " print('E3|e2 =',w)\r\n", - " w = (E1|e1)\r\n", - " w = (w.expand()).scalar()\r\n", - " Esq = expand(Esq)\r\n", - " print('%(E1\\\\cdot e1)/E^{2} =',simplify(w/Esq))\r\n", - " w = (E2|e2)\r\n", - " w = (w.expand()).scalar()\r\n", - " print('%(E2\\\\cdot e2)/E^{2} =',simplify(w/Esq))\r\n", - " w = (E3|e3)\r\n", - " w = (w.expand()).scalar()\r\n", - " print('%(E3\\\\cdot e3)/E^{2} =',simplify(w/Esq))\r\n", - " return\r\n", - "\\end{lstlisting}\r\n", - "Code Output:\r\n", - "\\begin{equation*} g_{ij} = \\left [ \\begin{array}{ccc} 1 & \\left ( e_{1}\\cdot e_{2}\\right ) & \\left ( e_{1}\\cdot e_{3}\\right ) \\\\ \\left ( e_{1}\\cdot e_{2}\\right ) & 1 & \\left ( e_{2}\\cdot e_{3}\\right ) \\\\ \\left ( e_{1}\\cdot e_{3}\\right ) & \\left ( e_{2}\\cdot e_{3}\\right ) & 1 \\end{array}\\right ] \\end{equation*}\r\n", - "\\begin{equation*} E = \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{2}\\wedge \\boldsymbol{e}_{3} \\end{equation*}\r\n", - "\\begin{equation*} E^{2} = \\left ( e_{1}\\cdot e_{2}\\right ) ^{2} - 2 \\left ( e_{1}\\cdot e_{2}\\right ) \\left ( e_{1}\\cdot e_{3}\\right ) \\left ( e_{2}\\cdot e_{3}\\right ) + \\left ( e_{1}\\cdot e_{3}\\right ) ^{2} + \\left ( e_{2}\\cdot e_{3}\\right ) ^{2} - 1 \\end{equation*}\r\n", - " \\begin{align*} E1 = (e2\\W e3) E = & \\left ( \\left ( e_{2}\\cdot e_{3}\\right ) ^{2} - 1\\right ) \\boldsymbol{e}_{1} \\\\ & + \\left ( \\left ( e_{1}\\cdot e_{2}\\right ) - \\left ( e_{1}\\cdot e_{3}\\right ) \\left ( e_{2}\\cdot e_{3}\\right ) \\right ) \\boldsymbol{e}_{2} \\\\ & + \\left ( - \\left ( e_{1}\\cdot e_{2}\\right ) \\left ( e_{2}\\cdot e_{3}\\right ) + \\left ( e_{1}\\cdot e_{3}\\right ) \\right ) \\boldsymbol{e}_{3} \\end{align*} \r\n", - " \\begin{align*} E2 =-(e1\\W e3) E = & \\left ( \\left ( e_{1}\\cdot e_{2}\\right ) - \\left ( e_{1}\\cdot e_{3}\\right ) \\left ( e_{2}\\cdot e_{3}\\right ) \\right ) \\boldsymbol{e}_{1} \\\\ & + \\left ( \\left ( e_{1}\\cdot e_{3}\\right ) ^{2} - 1\\right ) \\boldsymbol{e}_{2} \\\\ & + \\left ( - \\left ( e_{1}\\cdot e_{2}\\right ) \\left ( e_{1}\\cdot e_{3}\\right ) + \\left ( e_{2}\\cdot e_{3}\\right ) \\right ) \\boldsymbol{e}_{3} \\end{align*} \r\n", - " \\begin{align*} E3 = (e1\\W e2) E = & \\left ( - \\left ( e_{1}\\cdot e_{2}\\right ) \\left ( e_{2}\\cdot e_{3}\\right ) + \\left ( e_{1}\\cdot e_{3}\\right ) \\right ) \\boldsymbol{e}_{1} \\\\ & + \\left ( - \\left ( e_{1}\\cdot e_{2}\\right ) \\left ( e_{1}\\cdot e_{3}\\right ) + \\left ( e_{2}\\cdot e_{3}\\right ) \\right ) \\boldsymbol{e}_{2} \\\\ & + \\left ( \\left ( e_{1}\\cdot e_{2}\\right ) ^{2} - 1\\right ) \\boldsymbol{e}_{3} \\end{align*} \r\n", - "\\begin{equation*} E1\\cdot e2 = 0 \\end{equation*}\r\n", - "\\begin{equation*} E1\\cdot e3 = 0 \\end{equation*}\r\n", - "\\begin{equation*} E2\\cdot e1 = 0 \\end{equation*}\r\n", - "\\begin{equation*} E2\\cdot e3 = 0 \\end{equation*}\r\n", - "\\begin{equation*} E3\\cdot e1 = 0 \\end{equation*}\r\n", - "\\begin{equation*} E3\\cdot e2 = 0 \\end{equation*}\r\n", - "\\begin{equation*} (E1\\cdot e1)/E^{2} = 1 \\end{equation*}\r\n", - "\\begin{equation*} (E2\\cdot e2)/E^{2} = 1 \\end{equation*}\r\n", - "\\begin{equation*} (E3\\cdot e3)/E^{2} = 1 \\end{equation*}\r\n", - "\\end{document}\r\n" - ] + "data": { + "text/plain": [ + "\n", + "\\documentclass[10pt,fleqn]{report}\n", + "\\usepackage[vcentering]{geometry}\n", + "\\geometry{papersize={14in,11in},total={13in,10in}}\n", + "\n", + "\\pagestyle{empty}\n", + "\\usepackage[latin1]{inputenc}\n", + "\\usepackage{amsmath}\n", + "\\usepackage{amsfonts}\n", + "\\usepackage{amssymb}\n", + "\\usepackage{amsbsy}\n", + "\\usepackage{tensor}\n", + "\\usepackage{listings}\n", + "\\usepackage{color}\n", + "\\usepackage{xcolor}\n", + "\\usepackage{bm}\n", + "\\usepackage{breqn}\n", + "\\definecolor{gray}{rgb}{0.95,0.95,0.95}\n", + "\\setlength{\\parindent}{0pt}\n", + "\\DeclareMathOperator{\\Tr}{Tr}\n", + "\\DeclareMathOperator{\\Adj}{Adj}\n", + "\\newcommand{\\bfrac}[2]{\\displaystyle\\frac{#1}{#2}}\n", + "\\newcommand{\\lp}{\\left (}\n", + "\\newcommand{\\rp}{\\right )}\n", + "\\newcommand{\\paren}[1]{\\lp {#1} \\rp}\n", + "\\newcommand{\\half}{\\frac{1}{2}}\n", + "\\newcommand{\\llt}{\\left <}\n", + "\\newcommand{\\rgt}{\\right >}\n", + "\\newcommand{\\abs}[1]{\\left |{#1}\\right | }\n", + "\\newcommand{\\pdiff}[2]{\\bfrac{\\partial {#1}}{\\partial {#2}}}\n", + "\\newcommand{\\lbrc}{\\left \\{}\n", + "\\newcommand{\\rbrc}{\\right \\}}\n", + "\\newcommand{\\W}{\\wedge}\n", + "\\newcommand{\\prm}[1]{{#1}'}\n", + "\\newcommand{\\ddt}[1]{\\bfrac{d{#1}}{dt}}\n", + "\\newcommand{\\R}{\\dagger}\n", + "\\newcommand{\\deriv}[3]{\\bfrac{d^{#3}#1}{d{#2}^{#3}}}\n", + "\\newcommand{\\grade}[1]{\\left < {#1} \\right >}\n", + "\\newcommand{\\f}[2]{{#1}\\lp{#2}\\rp}\n", + "\\newcommand{\\eval}[2]{\\left . {#1} \\right |_{#2}}\n", + "\\newcommand{\\Nabla}{\\boldsymbol{\\nabla}}\n", + "\\newcommand{\\eb}{\\boldsymbol{e}}\n", + "\\usepackage{float}\n", + "\\floatstyle{plain} % optionally change the style of the new float\n", + "\\newfloat{Code}{H}{myc}\n", + "\\lstloadlanguages{Python}\n", + "\n", + "\\begin{document}\n", + "\\\\begin{lstlisting}[language=Python,showspaces=false,showstringspaces=false,backgroundcolor=\\color{gray},frame=single]\n", + "def basic_multivector_operations_3D():\n", + " Print_Function()\n", + " (ex,ey,ez) = MV.setup('e*x|y|z')\n", + " A = MV('A','mv')\n", + " A.Fmt(1,'A')\n", + " A.Fmt(2,'A')\n", + " A.Fmt(3,'A')\n", + " A.even().Fmt(1,'%A_{+}')\n", + " A.odd().Fmt(1,'%A_{-}')\n", + " X = MV('X','vector')\n", + " Y = MV('Y','vector')\n", + " print('g_{ij} = ',MV.metric)\n", + " X.Fmt(1,'X')\n", + " Y.Fmt(1,'Y')\n", + " (X*Y).Fmt(2,'X*Y')\n", + " (X^Y).Fmt(2,'X^Y')\n", + " (X|Y).Fmt(2,'X|Y')\n", + " return\n", + "\\end{lstlisting}\n", + "Code Output:\n", + "\\begin{equation*} A = A + A^{x} \\boldsymbol{e}_{x} + A^{y} \\boldsymbol{e}_{y} + A^{z} \\boldsymbol{e}_{z} + A^{xy} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + A^{xz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + A^{yz} \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} + A^{xyz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\n", + " \\begin{align*} A = & A \\\\ & + A^{x} \\boldsymbol{e}_{x} + A^{y} \\boldsymbol{e}_{y} + A^{z} \\boldsymbol{e}_{z} \\\\ & + A^{xy} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + A^{xz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + A^{yz} \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\\\ & + A^{xyz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{align*} \n", + " \\begin{align*} A = & A \\\\ & + A^{x} \\boldsymbol{e}_{x} \\\\ & + A^{y} \\boldsymbol{e}_{y} \\\\ & + A^{z} \\boldsymbol{e}_{z} \\\\ & + A^{xy} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} \\\\ & + A^{xz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} \\\\ & + A^{yz} \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\\\ & + A^{xyz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{align*} \n", + "\\begin{equation*} g_{ij} = \\left [ \\begin{array}{ccc} \\left ( e_{x}\\cdot e_{x}\\right ) & \\left ( e_{x}\\cdot e_{y}\\right ) & \\left ( e_{x}\\cdot e_{z}\\right ) \\\\ \\left ( e_{x}\\cdot e_{y}\\right ) & \\left ( e_{y}\\cdot e_{y}\\right ) & \\left ( e_{y}\\cdot e_{z}\\right ) \\\\ \\left ( e_{x}\\cdot e_{z}\\right ) & \\left ( e_{y}\\cdot e_{z}\\right ) & \\left ( e_{z}\\cdot e_{z}\\right ) \\end{array}\\right ] \\end{equation*}\n", + "\\begin{equation*} X = X^{x} \\boldsymbol{e}_{x} + X^{y} \\boldsymbol{e}_{y} + X^{z} \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} Y = Y^{x} \\boldsymbol{e}_{x} + Y^{y} \\boldsymbol{e}_{y} + Y^{z} \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\\\begin{lstlisting}[language=Python,showspaces=false,showstringspaces=false,backgroundcolor=\\color{gray},frame=single]\n", + "def basic_multivector_operations_2D():\n", + " Print_Function()\n", + " (ex,ey) = MV.setup('e*x|y')\n", + " print('g_{ij} =',MV.metric)\n", + " X = MV('X','vector')\n", + " A = MV('A','spinor')\n", + " X.Fmt(1,'X')\n", + " A.Fmt(1,'A')\n", + " (X|A).Fmt(2,'X|A')\n", + " (XX).Fmt(2,'A>X')\n", + " return\n", + "\\end{lstlisting}\n", + "Code Output:\n", + "\\begin{equation*} g_{ij} = \\left [ \\begin{array}{cc} \\left ( e_{x}\\cdot e_{x}\\right ) & \\left ( e_{x}\\cdot e_{y}\\right ) \\\\ \\left ( e_{x}\\cdot e_{y}\\right ) & \\left ( e_{y}\\cdot e_{y}\\right ) \\end{array}\\right ] \\end{equation*}\n", + "\\begin{equation*} X = X^{x} \\boldsymbol{e}_{x} + X^{y} \\boldsymbol{e}_{y} \\end{equation*}\n", + "\\begin{equation*} A = A + A^{xy} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} \\end{equation*}\n", + "\\\\begin{lstlisting}[language=Python,showspaces=false,showstringspaces=false,backgroundcolor=\\color{gray},frame=single]\n", + "def basic_multivector_operations_2D_orthogonal():\n", + " Print_Function()\n", + " (ex,ey) = MV.setup('e*x|y',metric='[1,1]')\n", + " print('g_{ii} =',MV.metric)\n", + " X = MV('X','vector')\n", + " A = MV('A','spinor')\n", + " X.Fmt(1,'X')\n", + " A.Fmt(1,'A')\n", + " (X*A).Fmt(2,'X*A')\n", + " (X|A).Fmt(2,'X|A')\n", + " (XA).Fmt(2,'X>A')\n", + " (A*X).Fmt(2,'A*X')\n", + " (A|X).Fmt(2,'A|X')\n", + " (AX).Fmt(2,'A>X')\n", + " return\n", + "\\end{lstlisting}\n", + "Code Output:\n", + "\\begin{equation*} g_{ii} = \\left [ \\begin{array}{cc} 1 & 0 \\\\ 0 & 1 \\end{array}\\right ] \\end{equation*}\n", + "\\begin{equation*} X = X^{x} \\boldsymbol{e}_{x} + X^{y} \\boldsymbol{e}_{y} \\end{equation*}\n", + "\\begin{equation*} A = A + A^{xy} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} \\end{equation*}\n", + "\\\\begin{lstlisting}[language=Python,showspaces=false,showstringspaces=false,backgroundcolor=\\color{gray},frame=single]\n", + "def check_generalized_BAC_CAB_formulas():\n", + " Print_Function()\n", + " (a,b,c,d) = MV.setup('a b c d')\n", + " print('g_{ij} =',MV.metric)\n", + " print('\\\\bm{a|(b*c)} =',a|(b*c))\n", + " print('\\\\bm{a|(b^c)} =',a|(b^c))\n", + " print('\\\\bm{a|(b^c^d)} =',a|(b^c^d))\n", + " print('\\\\bm{a|(b^c)+c|(a^b)+b|(c^a)} =',(a|(b^c))+(c|(a^b))+(b|(c^a)))\n", + " print('\\\\bm{a*(b^c)-b*(a^c)+c*(a^b)} =',a*(b^c)-b*(a^c)+c*(a^b))\n", + " print('\\\\bm{a*(b^c^d)-b*(a^c^d)+c*(a^b^d)-d*(a^b^c)} =',a*(b^c^d)-b*(a^c^d)+c*(a^b^d)-d*(a^b^c))\n", + " print('\\\\bm{(a^b)|(c^d)} =',(a^b)|(c^d))\n", + " print('\\\\bm{((a^b)|c)|d} =',((a^b)|c)|d)\n", + " print('\\\\bm{(a^b)\\\\times (c^d)} =',Ga.com(a^b,c^d))\n", + " return\n", + "\\end{lstlisting}\n", + "Code Output:\n", + "\\begin{equation*} g_{ij} = \\left [ \\begin{array}{cccc} \\left ( a\\cdot a\\right ) & \\left ( a\\cdot b\\right ) & \\left ( a\\cdot c\\right ) & \\left ( a\\cdot d\\right ) \\\\ \\left ( a\\cdot b\\right ) & \\left ( b\\cdot b\\right ) & \\left ( b\\cdot c\\right ) & \\left ( b\\cdot d\\right ) \\\\ \\left ( a\\cdot c\\right ) & \\left ( b\\cdot c\\right ) & \\left ( c\\cdot c\\right ) & \\left ( c\\cdot d\\right ) \\\\ \\left ( a\\cdot d\\right ) & \\left ( b\\cdot d\\right ) & \\left ( c\\cdot d\\right ) & \\left ( d\\cdot d\\right ) \\end{array}\\right ] \\end{equation*}\n", + "\\begin{equation*} \\bm{a\\cdot (b c)} = - \\left ( a\\cdot c\\right ) \\boldsymbol{b} + \\left ( a\\cdot b\\right ) \\boldsymbol{c} \\end{equation*}\n", + "\\begin{equation*} \\bm{a\\cdot (b\\W c)} = - \\left ( a\\cdot c\\right ) \\boldsymbol{b} + \\left ( a\\cdot b\\right ) \\boldsymbol{c} \\end{equation*}\n", + "\\begin{equation*} \\bm{a\\cdot (b\\W c\\W d)} = \\left ( a\\cdot d\\right ) \\boldsymbol{b}\\wedge \\boldsymbol{c} - \\left ( a\\cdot c\\right ) \\boldsymbol{b}\\wedge \\boldsymbol{d} + \\left ( a\\cdot b\\right ) \\boldsymbol{c}\\wedge \\boldsymbol{d} \\end{equation*}\n", + "\\begin{equation*} \\bm{a\\cdot (b\\W c)+c\\cdot (a\\W b)+b\\cdot (c\\W a)} = 0 \\end{equation*}\n", + "\\begin{equation*} \\bm{a (b\\W c)-b (a\\W c)+c (a\\W b)} = 3 \\boldsymbol{a}\\wedge \\boldsymbol{b}\\wedge \\boldsymbol{c} \\end{equation*}\n", + "\\begin{equation*} \\bm{a (b\\W c\\W d)-b (a\\W c\\W d)+c (a\\W b\\W d)-d (a\\W b\\W c)} = 4 \\boldsymbol{a}\\wedge \\boldsymbol{b}\\wedge \\boldsymbol{c}\\wedge \\boldsymbol{d} \\end{equation*}\n", + "\\begin{equation*} \\bm{(a\\W b)\\cdot (c\\W d)} = - \\left ( a\\cdot c\\right ) \\left ( b\\cdot d\\right ) + \\left ( a\\cdot d\\right ) \\left ( b\\cdot c\\right ) \\end{equation*}\n", + "\\begin{equation*} \\bm{((a\\W b)\\cdot c)\\cdot d} = - \\left ( a\\cdot c\\right ) \\left ( b\\cdot d\\right ) + \\left ( a\\cdot d\\right ) \\left ( b\\cdot c\\right ) \\end{equation*}\n", + "\\begin{equation*} \\bm{(a\\W b)\\times (c\\W d)} = - \\left ( b\\cdot d\\right ) \\boldsymbol{a}\\wedge \\boldsymbol{c} + \\left ( b\\cdot c\\right ) \\boldsymbol{a}\\wedge \\boldsymbol{d} + \\left ( a\\cdot d\\right ) \\boldsymbol{b}\\wedge \\boldsymbol{c} - \\left ( a\\cdot c\\right ) \\boldsymbol{b}\\wedge \\boldsymbol{d} \\end{equation*}\n", + "\\\\begin{lstlisting}[language=Python,showspaces=false,showstringspaces=false,backgroundcolor=\\color{gray},frame=single]\n", + "def rounding_numerical_components():\n", + " Print_Function()\n", + " (ex,ey,ez) = MV.setup('e_x e_y e_z',metric='[1,1,1]')\n", + " X = 1.2*ex+2.34*ey+0.555*ez\n", + " Y = 0.333*ex+4*ey+5.3*ez\n", + " print('X =',X)\n", + " print('Nga(X,2) =',Nga(X,2))\n", + " print('X*Y =',X*Y)\n", + " print('Nga(X*Y,2) =',Nga(X*Y,2))\n", + " return\n", + "\\end{lstlisting}\n", + "Code Output:\n", + "\\begin{equation*} X = 1 \\cdot 2 \\boldsymbol{e}_{x} + 2 \\cdot 34 \\boldsymbol{e}_{y} + 0 \\cdot 555 \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} Nga(X,2) = 1 \\cdot 2 \\boldsymbol{e}_{x} + 2 \\cdot 3 \\boldsymbol{e}_{y} + 0 \\cdot 55 \\boldsymbol{e}_{z} \\end{equation*}\n", + " \\begin{align*} X Y = & 12 \\cdot 7011 \\\\ & + 4 \\cdot 02078 \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + 6 \\cdot 175185 \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + 10 \\cdot 182 \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{align*} \n", + " \\begin{align*} Nga(X Y,2) = & 13 \\cdot 0 \\\\ & + 4 \\cdot 0 \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + 6 \\cdot 2 \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + 10 \\cdot 0 \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{align*} \n", + "\\\\begin{lstlisting}[language=Python,showspaces=false,showstringspaces=false,backgroundcolor=\\color{gray},frame=single]\n", + "def derivatives_in_rectangular_coordinates():\n", + " Print_Function()\n", + " X = (x,y,z) = symbols('x y z')\n", + " (ex,ey,ez,grad) = MV.setup('e_x e_y e_z',metric='[1,1,1]',coords=X)\n", + " f = MV('f','scalar',fct=True)\n", + " A = MV('A','vector',fct=True)\n", + " B = MV('B','grade2',fct=True)\n", + " C = MV('C','mv')\n", + " print('f =',f)\n", + " print('A =',A)\n", + " print('B =',B)\n", + " print('C =',C)\n", + " print('grad*f =',grad*f)\n", + " print('grad|A =',grad|A)\n", + " print('grad*A =',grad*A)\n", + " print(-MV.I)\n", + " print('-I*(grad^A) =',-MV.I*(grad^A))\n", + " print('grad*B =',grad*B)\n", + " print('grad^B =',grad^B)\n", + " print('grad|B =',grad|B)\n", + " return\n", + "\\end{lstlisting}\n", + "Code Output:\n", + "\\begin{equation*} f = f \\end{equation*}\n", + "\\begin{equation*} A = A^{x} \\boldsymbol{e}_{x} + A^{y} \\boldsymbol{e}_{y} + A^{z} \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} B = B^{xy} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + B^{xz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + B^{yz} \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\n", + " \\begin{align*} C = & C \\\\ & + C^{x} \\boldsymbol{e}_{x} + C^{y} \\boldsymbol{e}_{y} + C^{z} \\boldsymbol{e}_{z} \\\\ & + C^{xy} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + C^{xz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + C^{yz} \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\\\ & + C^{xyz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{align*} \n", + "\\begin{equation*} \\boldsymbol{\\nabla} f = \\partial_{x} f \\boldsymbol{e}_{x} + \\partial_{y} f \\boldsymbol{e}_{y} + \\partial_{z} f \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} \\boldsymbol{\\nabla} \\cdot A = \\partial_{x} A^{x} + \\partial_{y} A^{y} + \\partial_{z} A^{z} \\end{equation*}\n", + " \\begin{align*} \\boldsymbol{\\nabla} A = & \\left ( \\partial_{x} A^{x} + \\partial_{y} A^{y} + \\partial_{z} A^{z} \\right ) \\\\ & + \\left ( - \\partial_{y} A^{x} + \\partial_{x} A^{y} \\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + \\left ( - \\partial_{z} A^{x} + \\partial_{x} A^{z} \\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + \\left ( - \\partial_{z} A^{y} + \\partial_{y} A^{z} \\right ) \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{align*} \n", + "\\begin{equation*} - \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} -I (\\boldsymbol{\\nabla} \\W A) = \\left ( - \\partial_{z} A^{y} + \\partial_{y} A^{z} \\right ) \\boldsymbol{e}_{x} + \\left ( \\partial_{z} A^{x} - \\partial_{x} A^{z} \\right ) \\boldsymbol{e}_{y} + \\left ( - \\partial_{y} A^{x} + \\partial_{x} A^{y} \\right ) \\boldsymbol{e}_{z} \\end{equation*}\n", + " \\begin{align*} \\boldsymbol{\\nabla} B = & \\left ( - \\partial_{y} B^{xy} - \\partial_{z} B^{xz} \\right ) \\boldsymbol{e}_{x} + \\left ( \\partial_{x} B^{xy} - \\partial_{z} B^{yz} \\right ) \\boldsymbol{e}_{y} + \\left ( \\partial_{x} B^{xz} + \\partial_{y} B^{yz} \\right ) \\boldsymbol{e}_{z} \\\\ & + \\left ( \\partial_{z} B^{xy} - \\partial_{y} B^{xz} + \\partial_{x} B^{yz} \\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{align*} \n", + "\\begin{equation*} \\boldsymbol{\\nabla} \\W B = \\left ( \\partial_{z} B^{xy} - \\partial_{y} B^{xz} + \\partial_{x} B^{yz} \\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} \\boldsymbol{\\nabla} \\cdot B = \\left ( - \\partial_{y} B^{xy} - \\partial_{z} B^{xz} \\right ) \\boldsymbol{e}_{x} + \\left ( \\partial_{x} B^{xy} - \\partial_{z} B^{yz} \\right ) \\boldsymbol{e}_{y} + \\left ( \\partial_{x} B^{xz} + \\partial_{y} B^{yz} \\right ) \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\\\begin{lstlisting}[language=Python,showspaces=false,showstringspaces=false,backgroundcolor=\\color{gray},frame=single]\n", + "def derivatives_in_spherical_coordinates():\n", + " Print_Function()\n", + " X = (r,th,phi) = symbols('r theta phi')\n", + " curv = [[r*cos(phi)*sin(th),r*sin(phi)*sin(th),r*cos(th)],[1,r,r*sin(th)]]\n", + " (er,eth,ephi,grad) = MV.setup('e_r e_theta e_phi',metric='[1,1,1]',coords=X,curv=curv)\n", + " f = MV('f','scalar',fct=True)\n", + " A = MV('A','vector',fct=True)\n", + " B = MV('B','grade2',fct=True)\n", + " print('f =',f)\n", + " print('A =',A)\n", + " print('B =',B)\n", + " print('grad*f =',grad*f)\n", + " print('grad|A =',grad|A)\n", + " print('-I*(grad^A) =',(-MV.I*(grad^A)).simplify())\n", + " print('grad^B =',grad^B)\n", + "\\end{lstlisting}\n", + "Code Output:\n", + "\\begin{equation*} f = f \\end{equation*}\n", + "\\begin{equation*} A = A^{r} \\boldsymbol{e}_{r} + A^{\\theta } \\boldsymbol{e}_{\\theta } + A^{\\phi } \\boldsymbol{e}_{\\phi } \\end{equation*}\n", + "\\begin{equation*} B = B^{r\\theta } \\boldsymbol{e}_{r}\\wedge \\boldsymbol{e}_{\\theta } + B^{r\\phi } \\boldsymbol{e}_{r}\\wedge \\boldsymbol{e}_{\\phi } + B^{\\theta \\phi } \\boldsymbol{e}_{\\theta }\\wedge \\boldsymbol{e}_{\\phi } \\end{equation*}\n", + "\\begin{equation*} \\boldsymbol{\\nabla} f = \\partial_{r} f \\boldsymbol{e}_{r} + \\frac{\\partial_{\\theta } f }{r^{2}} \\boldsymbol{e}_{\\theta } + \\frac{\\partial_{\\phi } f }{r^{2} {\\sin{\\left (\\theta \\right )}}^{2}} \\boldsymbol{e}_{\\phi } \\end{equation*}\n", + "\\begin{equation*} \\boldsymbol{\\nabla} \\cdot A = \\frac{A^{\\theta } }{\\tan{\\left (\\theta \\right )}} + \\partial_{\\phi } A^{\\phi } + \\partial_{r} A^{r} + \\partial_{\\theta } A^{\\theta } + \\frac{2 A^{r} }{r} \\end{equation*}\n", + "\\begin{equation*} -I (\\boldsymbol{\\nabla} \\W A) = \\frac{\\sqrt{r^{4} {\\sin{\\left (\\theta \\right )}}^{2}} \\left(\\frac{2 A^{\\phi } }{\\tan{\\left (\\theta \\right )}} + \\partial_{\\theta } A^{\\phi } - \\frac{\\partial_{\\phi } A^{\\theta } }{{\\sin{\\left (\\theta \\right )}}^{2}}\\right)}{r^{2}} \\boldsymbol{e}_{r} + \\frac{- r^{2} {\\sin{\\left (\\theta \\right )}}^{2} \\partial_{r} A^{\\phi } - 2 r A^{\\phi } {\\sin{\\left (\\theta \\right )}}^{2} + \\partial_{\\phi } A^{r} }{\\sqrt{r^{4} {\\sin{\\left (\\theta \\right )}}^{2}}} \\boldsymbol{e}_{\\theta } + \\frac{r^{2} \\partial_{r} A^{\\theta } + 2 r A^{\\theta } - \\partial_{\\theta } A^{r} }{\\sqrt{r^{4} {\\sin{\\left (\\theta \\right )}}^{2}}} \\boldsymbol{e}_{\\phi } \\end{equation*}\n", + "\\begin{equation*} \\boldsymbol{\\nabla} \\W B = \\frac{r^{2} \\partial_{r} B^{\\theta \\phi } + 4 r B^{\\theta \\phi } - \\frac{2 B^{r\\phi } }{\\tan{\\left (\\theta \\right )}} - \\partial_{\\theta } B^{r\\phi } + \\frac{\\partial_{\\phi } B^{r\\theta } }{{\\sin{\\left (\\theta \\right )}}^{2}}}{r^{2}} \\boldsymbol{e}_{r}\\wedge \\boldsymbol{e}_{\\theta }\\wedge \\boldsymbol{e}_{\\phi } \\end{equation*}\n", + "\\\\begin{lstlisting}[language=Python,showspaces=false,showstringspaces=false,backgroundcolor=\\color{gray},frame=single]\n", + "def conformal_representations_of_circles_lines_spheres_and_planes():\n", + " Print_Function()\n", + " global n,nbar\n", + " metric = '1 0 0 0 0,0 1 0 0 0,0 0 1 0 0,0 0 0 0 2,0 0 0 2 0'\n", + " (e1,e2,e3,n,nbar) = MV.setup('e_1 e_2 e_3 n \\\\bar{n}',metric)\n", + " print('g_{ij} =',MV.metric)\n", + " e = n+nbar\n", + " #conformal representation of points\n", + " A = make_vector(e1) # point a = (1,0,0) A = F(a)\n", + " B = make_vector(e2) # point b = (0,1,0) B = F(b)\n", + " C = make_vector(-e1) # point c = (-1,0,0) C = F(c)\n", + " D = make_vector(e3) # point d = (0,0,1) D = F(d)\n", + " X = make_vector('x',3)\n", + " print('F(a) =',A)\n", + " print('F(b) =',B)\n", + " print('F(c) =',C)\n", + " print('F(d) =',D)\n", + " print('F(x) =',X)\n", + " print('#a = e1, b = e2, c = -e1, and d = e3')\n", + " print('#A = F(a) = 1/2*(a*a*n+2*a-nbar), etc.')\n", + " print('#Circle through a, b, and c')\n", + " print('Circle: A^B^C^X = 0 =',(A^B^C^X))\n", + " print('#Line through a and b')\n", + " print('Line : A^B^n^X = 0 =',(A^B^n^X))\n", + " print('#Sphere through a, b, c, and d')\n", + " print('Sphere: A^B^C^D^X = 0 =',(((A^B)^C)^D)^X)\n", + " print('#Plane through a, b, and d')\n", + " print('Plane : A^B^n^D^X = 0 =',(A^B^n^D^X))\n", + " L = (A^B^e)^X\n", + " L.Fmt(3,'Hyperbolic\\\\;\\\\; Circle: (A^B^e)^X = 0')\n", + " return\n", + "\\end{lstlisting}\n", + "Code Output:\n", + "\\begin{equation*} g_{ij} = \\left [ \\begin{array}{ccccc} 1 & 0 & 0 & 0 & 0 \\\\ 0 & 1 & 0 & 0 & 0 \\\\ 0 & 0 & 1 & 0 & 0 \\\\ 0 & 0 & 0 & 0 & 2 \\\\ 0 & 0 & 0 & 2 & 0 \\end{array}\\right ] \\end{equation*}\n", + "\\begin{equation*} F(a) = \\boldsymbol{e}_{1} + \\frac{1}{2} \\boldsymbol{n} - \\frac{1}{2} \\boldsymbol{\\bar{n}} \\end{equation*}\n", + "\\begin{equation*} F(b) = \\boldsymbol{e}_{2} + \\frac{1}{2} \\boldsymbol{n} - \\frac{1}{2} \\boldsymbol{\\bar{n}} \\end{equation*}\n", + "\\begin{equation*} F(c) = - \\boldsymbol{e}_{1} + \\frac{1}{2} \\boldsymbol{n} - \\frac{1}{2} \\boldsymbol{\\bar{n}} \\end{equation*}\n", + "\\begin{equation*} F(d) = \\boldsymbol{e}_{3} + \\frac{1}{2} \\boldsymbol{n} - \\frac{1}{2} \\boldsymbol{\\bar{n}} \\end{equation*}\n", + "\\begin{equation*} F(x) = x_{1} \\boldsymbol{e}_{1} + x_{2} \\boldsymbol{e}_{2} + x_{3} \\boldsymbol{e}_{3} + \\left ( \\frac{{\\left ( x_{1} \\right )}^{2}}{2} + \\frac{{\\left ( x_{2} \\right )}^{2}}{2} + \\frac{{\\left ( x_{3} \\right )}^{2}}{2}\\right ) \\boldsymbol{n} - \\frac{1}{2} \\boldsymbol{\\bar{n}} \\end{equation*}\n", + "a = e1, b = e2, c = -e1, and d = e3\n", + "A = F(a) = 1/2*(a*a*n+2*a-nbar), etc.\n", + "Circle through a, b, and c\n", + "\\begin{equation*} Circle: A\\W B\\W C\\W X = 0 = - x_{3} \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{2}\\wedge \\boldsymbol{e}_{3}\\wedge \\boldsymbol{n} + x_{3} \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{2}\\wedge \\boldsymbol{e}_{3}\\wedge \\boldsymbol{\\bar{n}} + \\left ( \\frac{{\\left ( x_{1} \\right )}^{2}}{2} + \\frac{{\\left ( x_{2} \\right )}^{2}}{2} + \\frac{{\\left ( x_{3} \\right )}^{2}}{2} - \\frac{1}{2}\\right ) \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{2}\\wedge \\boldsymbol{n}\\wedge \\boldsymbol{\\bar{n}} \\end{equation*}\n", + "Line through a and b\n", + "\\begin{equation*} Line : A\\W B\\W n\\W X = 0 = - x_{3} \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{2}\\wedge \\boldsymbol{e}_{3}\\wedge \\boldsymbol{n} + \\left ( \\frac{x_{1}}{2} + \\frac{x_{2}}{2} - \\frac{1}{2}\\right ) \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{2}\\wedge \\boldsymbol{n}\\wedge \\boldsymbol{\\bar{n}} + \\frac{x_{3}}{2} \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{3}\\wedge \\boldsymbol{n}\\wedge \\boldsymbol{\\bar{n}} - \\frac{x_{3}}{2} \\boldsymbol{e}_{2}\\wedge \\boldsymbol{e}_{3}\\wedge \\boldsymbol{n}\\wedge \\boldsymbol{\\bar{n}} \\end{equation*}\n", + "Sphere through a, b, c, and d\n", + "\\begin{equation*} Sphere: A\\W B\\W C\\W D\\W X = 0 = \\left ( - \\frac{{\\left ( x_{1} \\right )}^{2}}{2} - \\frac{{\\left ( x_{2} \\right )}^{2}}{2} - \\frac{{\\left ( x_{3} \\right )}^{2}}{2} + \\frac{1}{2}\\right ) \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{2}\\wedge \\boldsymbol{e}_{3}\\wedge \\boldsymbol{n}\\wedge \\boldsymbol{\\bar{n}} \\end{equation*}\n", + "Plane through a, b, and d\n", + "\\begin{equation*} Plane : A\\W B\\W n\\W D\\W X = 0 = \\left ( - \\frac{x_{1}}{2} - \\frac{x_{2}}{2} - \\frac{x_{3}}{2} + \\frac{1}{2}\\right ) \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{2}\\wedge \\boldsymbol{e}_{3}\\wedge \\boldsymbol{n}\\wedge \\boldsymbol{\\bar{n}} \\end{equation*}\n", + "\\\\begin{lstlisting}[language=Python,showspaces=false,showstringspaces=false,backgroundcolor=\\color{gray},frame=single]\n", + "def properties_of_geometric_objects():\n", + " global n,nbar\n", + " Print_Function()\n", + " metric = '# # # 0 0,'+ \\\n", + " '# # # 0 0,'+ \\\n", + " '# # # 0 0,'+ \\\n", + " '0 0 0 0 2,'+ \\\n", + " '0 0 0 2 0'\n", + " (p1,p2,p3,n,nbar) = MV.setup('p1 p2 p3 n \\\\bar{n}',metric)\n", + " print('g_{ij} =',MV.metric)\n", + " P1 = F(p1)\n", + " P2 = F(p2)\n", + " P3 = F(p3)\n", + " print('#%\\\\text{Extracting direction of line from }L = P1\\\\W P2\\\\W n')\n", + " L = P1^P2^n\n", + " delta = (L|n)|nbar\n", + " print('(L|n)|\\\\bar{n} =',delta)\n", + " print('#%\\\\text{Extracting plane of circle from }C = P1\\\\W P2\\\\W P3')\n", + " C = P1^P2^P3\n", + " delta = ((C^n)|n)|nbar\n", + " print('((C^n)|n)|\\\\bar{n}=',delta)\n", + " print('(p2-p1)^(p3-p1)=',(p2-p1)^(p3-p1))\n", + " return\n", + "\\end{lstlisting}\n", + "Code Output:\n", + "\\begin{equation*} g_{ij} = \\left [ \\begin{array}{ccccc} \\left ( p_{1}\\cdot p_{1}\\right ) & \\left ( p_{1}\\cdot p_{2}\\right ) & \\left ( p_{1}\\cdot p_{3}\\right ) & 0 & 0 \\\\ \\left ( p_{1}\\cdot p_{2}\\right ) & \\left ( p_{2}\\cdot p_{2}\\right ) & \\left ( p_{2}\\cdot p_{3}\\right ) & 0 & 0 \\\\ \\left ( p_{1}\\cdot p_{3}\\right ) & \\left ( p_{2}\\cdot p_{3}\\right ) & \\left ( p_{3}\\cdot p_{3}\\right ) & 0 & 0 \\\\ 0 & 0 & 0 & 0 & 2 \\\\ 0 & 0 & 0 & 2 & 0 \\end{array}\\right ] \\end{equation*}\n", + "\\begin{equation*} \\text{Extracting direction of line from }L = P1\\W P2\\W n \\end{equation*}\n", + " \\begin{align*} (L\\cdot n)\\cdot \\bar{n} = & 2 \\boldsymbol{p}_{1} \\\\ & -2 \\boldsymbol{p}_{2} \\end{align*} \n", + "\\begin{equation*} \\text{Extracting plane of circle from }C = P1\\W P2\\W P3 \\end{equation*}\n", + " \\begin{align*} ((C\\W n)\\cdot n)\\cdot \\bar{n}= & 2 \\boldsymbol{p}_{1}\\wedge \\boldsymbol{p}_{2} \\\\ & -2 \\boldsymbol{p}_{1}\\wedge \\boldsymbol{p}_{3} \\\\ & + 2 \\boldsymbol{p}_{2}\\wedge \\boldsymbol{p}_{3} \\end{align*} \n", + " \\begin{align*} (p2-p1)\\W (p3-p1)= & \\boldsymbol{p}_{1}\\wedge \\boldsymbol{p}_{2} \\\\ & - \\boldsymbol{p}_{1}\\wedge \\boldsymbol{p}_{3} \\\\ & + \\boldsymbol{p}_{2}\\wedge \\boldsymbol{p}_{3} \\end{align*} \n", + "\\\\begin{lstlisting}[language=Python,showspaces=false,showstringspaces=false,backgroundcolor=\\color{gray},frame=single]\n", + "def extracting_vectors_from_conformal_2_blade():\n", + " Print_Function()\n", + " print(r'B = P1\\W P2')\n", + " metric = '0 -1 #,'+ \\\n", + " '-1 0 #,'+ \\\n", + " '# # #'\n", + " (P1,P2,a) = MV.setup('P1 P2 a',metric)\n", + " print('g_{ij} =',MV.metric)\n", + " B = P1^P2\n", + " Bsq = B*B\n", + " print('%B^{2} =',Bsq)\n", + " ap = a-(a^B)*B\n", + " print(\"a' = a-(a^B)*B =\",ap)\n", + " Ap = ap+ap*B\n", + " Am = ap-ap*B\n", + " print(\"A+ = a'+a'*B =\",Ap)\n", + " print(\"A- = a'-a'*B =\",Am)\n", + " print('%(A+)^{2} =',Ap*Ap)\n", + " print('%(A-)^{2} =',Am*Am)\n", + " aB = a|B\n", + " print('a|B =',aB)\n", + " return\n", + "\\end{lstlisting}\n", + "Code Output:\n", + "\\begin{equation*} B = P1\\W P2 \\end{equation*}\n", + "\\begin{equation*} g_{ij} = \\left [ \\begin{array}{ccc} 0 & -1 & \\left ( P_{1}\\cdot a\\right ) \\\\ -1 & 0 & \\left ( P_{2}\\cdot a\\right ) \\\\ \\left ( P_{1}\\cdot a\\right ) & \\left ( P_{2}\\cdot a\\right ) & \\left ( a\\cdot a\\right ) \\end{array}\\right ] \\end{equation*}\n", + "\\begin{equation*} B^{2} = 1 \\end{equation*}\n", + " \\begin{align*} a' = a-(a\\W B) B = & - \\left ( P_{2}\\cdot a\\right ) \\boldsymbol{P}_{1} \\\\ & - \\left ( P_{1}\\cdot a\\right ) \\boldsymbol{P}_{2} \\end{align*} \n", + "\\begin{equation*} A+ = a'+a' B = - 2 \\left ( P_{2}\\cdot a\\right ) \\boldsymbol{P}_{1} \\end{equation*}\n", + "\\begin{equation*} A- = a'-a' B = - 2 \\left ( P_{1}\\cdot a\\right ) \\boldsymbol{P}_{2} \\end{equation*}\n", + "\\begin{equation*} (A+)^{2} = 0 \\end{equation*}\n", + "\\begin{equation*} (A-)^{2} = 0 \\end{equation*}\n", + " \\begin{align*} a\\cdot B = & - \\left ( P_{2}\\cdot a\\right ) \\boldsymbol{P}_{1} \\\\ & + \\left ( P_{1}\\cdot a\\right ) \\boldsymbol{P}_{2} \\end{align*} \n", + "\\\\begin{lstlisting}[language=Python,showspaces=false,showstringspaces=false,backgroundcolor=\\color{gray},frame=single]\n", + "def reciprocal_frame_test():\n", + " Print_Function()\n", + " metric = '1 # #,'+ \\\n", + " '# 1 #,'+ \\\n", + " '# # 1'\n", + " (e1,e2,e3) = MV.setup('e1 e2 e3',metric)\n", + " print('g_{ij} =',MV.metric)\n", + " E = e1^e2^e3\n", + " Esq = (E*E).scalar()\n", + " print('E =',E)\n", + " print('%E^{2} =',Esq)\n", + " Esq_inv = 1/Esq\n", + " E1 = (e2^e3)*E\n", + " E2 = (-1)*(e1^e3)*E\n", + " E3 = (e1^e2)*E\n", + " print('E1 = (e2^e3)*E =',E1)\n", + " print('E2 =-(e1^e3)*E =',E2)\n", + " print('E3 = (e1^e2)*E =',E3)\n", + " w = (E1|e2)\n", + " w = w.expand()\n", + " print('E1|e2 =',w)\n", + " w = (E1|e3)\n", + " w = w.expand()\n", + " print('E1|e3 =',w)\n", + " w = (E2|e1)\n", + " w = w.expand()\n", + " print('E2|e1 =',w)\n", + " w = (E2|e3)\n", + " w = w.expand()\n", + " print('E2|e3 =',w)\n", + " w = (E3|e1)\n", + " w = w.expand()\n", + " print('E3|e1 =',w)\n", + " w = (E3|e2)\n", + " w = w.expand()\n", + " print('E3|e2 =',w)\n", + " w = (E1|e1)\n", + " w = (w.expand()).scalar()\n", + " Esq = expand(Esq)\n", + " print('%(E1\\\\cdot e1)/E^{2} =',simplify(w/Esq))\n", + " w = (E2|e2)\n", + " w = (w.expand()).scalar()\n", + " print('%(E2\\\\cdot e2)/E^{2} =',simplify(w/Esq))\n", + " w = (E3|e3)\n", + " w = (w.expand()).scalar()\n", + " print('%(E3\\\\cdot e3)/E^{2} =',simplify(w/Esq))\n", + " return\n", + "\\end{lstlisting}\n", + "Code Output:\n", + "\\begin{equation*} g_{ij} = \\left [ \\begin{array}{ccc} 1 & \\left ( e_{1}\\cdot e_{2}\\right ) & \\left ( e_{1}\\cdot e_{3}\\right ) \\\\ \\left ( e_{1}\\cdot e_{2}\\right ) & 1 & \\left ( e_{2}\\cdot e_{3}\\right ) \\\\ \\left ( e_{1}\\cdot e_{3}\\right ) & \\left ( e_{2}\\cdot e_{3}\\right ) & 1 \\end{array}\\right ] \\end{equation*}\n", + "\\begin{equation*} E = \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{2}\\wedge \\boldsymbol{e}_{3} \\end{equation*}\n", + "\\begin{equation*} E^{2} = \\left ( e_{1}\\cdot e_{2}\\right ) ^{2} - 2 \\left ( e_{1}\\cdot e_{2}\\right ) \\left ( e_{1}\\cdot e_{3}\\right ) \\left ( e_{2}\\cdot e_{3}\\right ) + \\left ( e_{1}\\cdot e_{3}\\right ) ^{2} + \\left ( e_{2}\\cdot e_{3}\\right ) ^{2} - 1 \\end{equation*}\n", + " \\begin{align*} E1 = (e2\\W e3) E = & \\left ( \\left ( e_{2}\\cdot e_{3}\\right ) ^{2} - 1\\right ) \\boldsymbol{e}_{1} \\\\ & + \\left ( \\left ( e_{1}\\cdot e_{2}\\right ) - \\left ( e_{1}\\cdot e_{3}\\right ) \\left ( e_{2}\\cdot e_{3}\\right ) \\right ) \\boldsymbol{e}_{2} \\\\ & + \\left ( - \\left ( e_{1}\\cdot e_{2}\\right ) \\left ( e_{2}\\cdot e_{3}\\right ) + \\left ( e_{1}\\cdot e_{3}\\right ) \\right ) \\boldsymbol{e}_{3} \\end{align*} \n", + " \\begin{align*} E2 =-(e1\\W e3) E = & \\left ( \\left ( e_{1}\\cdot e_{2}\\right ) - \\left ( e_{1}\\cdot e_{3}\\right ) \\left ( e_{2}\\cdot e_{3}\\right ) \\right ) \\boldsymbol{e}_{1} \\\\ & + \\left ( \\left ( e_{1}\\cdot e_{3}\\right ) ^{2} - 1\\right ) \\boldsymbol{e}_{2} \\\\ & + \\left ( - \\left ( e_{1}\\cdot e_{2}\\right ) \\left ( e_{1}\\cdot e_{3}\\right ) + \\left ( e_{2}\\cdot e_{3}\\right ) \\right ) \\boldsymbol{e}_{3} \\end{align*} \n", + " \\begin{align*} E3 = (e1\\W e2) E = & \\left ( - \\left ( e_{1}\\cdot e_{2}\\right ) \\left ( e_{2}\\cdot e_{3}\\right ) + \\left ( e_{1}\\cdot e_{3}\\right ) \\right ) \\boldsymbol{e}_{1} \\\\ & + \\left ( - \\left ( e_{1}\\cdot e_{2}\\right ) \\left ( e_{1}\\cdot e_{3}\\right ) + \\left ( e_{2}\\cdot e_{3}\\right ) \\right ) \\boldsymbol{e}_{2} \\\\ & + \\left ( \\left ( e_{1}\\cdot e_{2}\\right ) ^{2} - 1\\right ) \\boldsymbol{e}_{3} \\end{align*} \n", + "\\begin{equation*} E1\\cdot e2 = 0 \\end{equation*}\n", + "\\begin{equation*} E1\\cdot e3 = 0 \\end{equation*}\n", + "\\begin{equation*} E2\\cdot e1 = 0 \\end{equation*}\n", + "\\begin{equation*} E2\\cdot e3 = 0 \\end{equation*}\n", + "\\begin{equation*} E3\\cdot e1 = 0 \\end{equation*}\n", + "\\begin{equation*} E3\\cdot e2 = 0 \\end{equation*}\n", + "\\begin{equation*} (E1\\cdot e1)/E^{2} = 1 \\end{equation*}\n", + "\\begin{equation*} (E2\\cdot e2)/E^{2} = 1 \\end{equation*}\n", + "\\begin{equation*} (E3\\cdot e3)/E^{2} = 1 \\end{equation*}\n", + "\\end{document}\n" + ] + }, + "metadata": {}, + "output_type": "display_data" } ], "source": [ - "!cat latex_check.tex" - ] - }, - { - "cell_type": "code", - "execution_count": 7, - "metadata": {}, - "outputs": [], - "source": [ - "!python matrix_latex.py" + "check_latex('latex_check')" ] }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 6, "metadata": {}, "outputs": [ { - "name": "stdout", - "output_type": "stream", - "text": [ - "\r\n", - "\\documentclass[10pt,fleqn]{report}\r\n", - "\\usepackage[vcentering]{geometry}\r\n", - "\\geometry{papersize={14in,11in},total={13in,10in}}\r\n", - "\r\n", - "\\pagestyle{empty}\r\n", - "\\usepackage[latin1]{inputenc}\r\n", - "\\usepackage{amsmath}\r\n", - "\\usepackage{amsfonts}\r\n", - "\\usepackage{amssymb}\r\n", - "\\usepackage{amsbsy}\r\n", - "\\usepackage{tensor}\r\n", - "\\usepackage{listings}\r\n", - "\\usepackage{color}\r\n", - "\\usepackage{xcolor}\r\n", - "\\usepackage{bm}\r\n", - "\\usepackage{breqn}\r\n", - "\\definecolor{gray}{rgb}{0.95,0.95,0.95}\r\n", - "\\setlength{\\parindent}{0pt}\r\n", - "\\DeclareMathOperator{\\Tr}{Tr}\r\n", - "\\DeclareMathOperator{\\Adj}{Adj}\r\n", - "\\newcommand{\\bfrac}[2]{\\displaystyle\\frac{#1}{#2}}\r\n", - "\\newcommand{\\lp}{\\left (}\r\n", - "\\newcommand{\\rp}{\\right )}\r\n", - "\\newcommand{\\paren}[1]{\\lp {#1} \\rp}\r\n", - "\\newcommand{\\half}{\\frac{1}{2}}\r\n", - "\\newcommand{\\llt}{\\left <}\r\n", - "\\newcommand{\\rgt}{\\right >}\r\n", - "\\newcommand{\\abs}[1]{\\left |{#1}\\right | }\r\n", - "\\newcommand{\\pdiff}[2]{\\bfrac{\\partial {#1}}{\\partial {#2}}}\r\n", - "\\newcommand{\\lbrc}{\\left \\{}\r\n", - "\\newcommand{\\rbrc}{\\right \\}}\r\n", - "\\newcommand{\\W}{\\wedge}\r\n", - "\\newcommand{\\prm}[1]{{#1}'}\r\n", - "\\newcommand{\\ddt}[1]{\\bfrac{d{#1}}{dt}}\r\n", - "\\newcommand{\\R}{\\dagger}\r\n", - "\\newcommand{\\deriv}[3]{\\bfrac{d^{#3}#1}{d{#2}^{#3}}}\r\n", - "\\newcommand{\\grade}[1]{\\left < {#1} \\right >}\r\n", - "\\newcommand{\\f}[2]{{#1}\\lp{#2}\\rp}\r\n", - "\\newcommand{\\eval}[2]{\\left . {#1} \\right |_{#2}}\r\n", - "\\newcommand{\\Nabla}{\\boldsymbol{\\nabla}}\r\n", - "\\newcommand{\\eb}{\\boldsymbol{e}}\r\n", - "\\usepackage{float}\r\n", - "\\floatstyle{plain} % optionally change the style of the new float\r\n", - "\\newfloat{Code}{H}{myc}\r\n", - "\\lstloadlanguages{Python}\r\n", - "\r\n", - "\\begin{document}\r\n", - "\\begin{equation*} \\left [ \\begin{array}{cc} 1 & 2 \\\\ 3 & 4 \\end{array}\\right ] \\left [ \\begin{array}{c} 5 \\\\ 6 \\end{array}\\right ] = \\left [ \\begin{array}{c} 17 \\\\ 39 \\end{array}\\right ] \\end{equation*}\r\n", - "\\begin{equation*} \\left [ \\begin{array}{cc} x^{3} & y^{3} \\end{array}\\right ] \\left [ \\begin{array}{cc} x^{2} & 2 x y \\\\ 2 x y & y^{2} \\end{array}\\right ] = \\left [ \\begin{array}{cc} x^{5} + 2 x y^{4} & 2 x^{4} y + y^{5} \\end{array}\\right ] \\end{equation*}\r\n", - "\\end{document}\r\n" - ] + "data": { + "text/plain": [ + "\n", + "\\documentclass[10pt,fleqn]{report}\n", + "\\usepackage[vcentering]{geometry}\n", + "\\geometry{papersize={14in,11in},total={13in,10in}}\n", + "\n", + "\\pagestyle{empty}\n", + "\\usepackage[latin1]{inputenc}\n", + "\\usepackage{amsmath}\n", + "\\usepackage{amsfonts}\n", + "\\usepackage{amssymb}\n", + "\\usepackage{amsbsy}\n", + "\\usepackage{tensor}\n", + "\\usepackage{listings}\n", + "\\usepackage{color}\n", + "\\usepackage{xcolor}\n", + "\\usepackage{bm}\n", + "\\usepackage{breqn}\n", + "\\definecolor{gray}{rgb}{0.95,0.95,0.95}\n", + "\\setlength{\\parindent}{0pt}\n", + "\\DeclareMathOperator{\\Tr}{Tr}\n", + "\\DeclareMathOperator{\\Adj}{Adj}\n", + "\\newcommand{\\bfrac}[2]{\\displaystyle\\frac{#1}{#2}}\n", + "\\newcommand{\\lp}{\\left (}\n", + "\\newcommand{\\rp}{\\right )}\n", + "\\newcommand{\\paren}[1]{\\lp {#1} \\rp}\n", + "\\newcommand{\\half}{\\frac{1}{2}}\n", + "\\newcommand{\\llt}{\\left <}\n", + "\\newcommand{\\rgt}{\\right >}\n", + "\\newcommand{\\abs}[1]{\\left |{#1}\\right | }\n", + "\\newcommand{\\pdiff}[2]{\\bfrac{\\partial {#1}}{\\partial {#2}}}\n", + "\\newcommand{\\lbrc}{\\left \\{}\n", + "\\newcommand{\\rbrc}{\\right \\}}\n", + "\\newcommand{\\W}{\\wedge}\n", + "\\newcommand{\\prm}[1]{{#1}'}\n", + "\\newcommand{\\ddt}[1]{\\bfrac{d{#1}}{dt}}\n", + "\\newcommand{\\R}{\\dagger}\n", + "\\newcommand{\\deriv}[3]{\\bfrac{d^{#3}#1}{d{#2}^{#3}}}\n", + "\\newcommand{\\grade}[1]{\\left < {#1} \\right >}\n", + "\\newcommand{\\f}[2]{{#1}\\lp{#2}\\rp}\n", + "\\newcommand{\\eval}[2]{\\left . {#1} \\right |_{#2}}\n", + "\\newcommand{\\Nabla}{\\boldsymbol{\\nabla}}\n", + "\\newcommand{\\eb}{\\boldsymbol{e}}\n", + "\\usepackage{float}\n", + "\\floatstyle{plain} % optionally change the style of the new float\n", + "\\newfloat{Code}{H}{myc}\n", + "\\lstloadlanguages{Python}\n", + "\n", + "\\begin{document}\n", + "\\begin{equation*} \\left [ \\begin{array}{cc} 1 & 2 \\\\ 3 & 4 \\end{array}\\right ] \\left [ \\begin{array}{c} 5 \\\\ 6 \\end{array}\\right ] = \\left [ \\begin{array}{c} 17 \\\\ 39 \\end{array}\\right ] \\end{equation*}\n", + "\\begin{equation*} \\left [ \\begin{array}{cc} x^{3} & y^{3} \\end{array}\\right ] \\left [ \\begin{array}{cc} x^{2} & 2 x y \\\\ 2 x y & y^{2} \\end{array}\\right ] = \\left [ \\begin{array}{cc} x^{5} + 2 x y^{4} & 2 x^{4} y + y^{5} \\end{array}\\right ] \\end{equation*}\n", + "\\end{document}\n" + ] + }, + "metadata": {}, + "output_type": "display_data" } ], "source": [ - "!cat matrix_latex.tex" + "check_latex('matrix_latex')" ] }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 7, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "v__1\u001b[0m*\u001b[0;34me_1\u001b[0m + v__2\u001b[0m*\u001b[0;34me_2\u001b[0m + v__3\u001b[0m*\u001b[0;34me_3\u001b[0m\r\n", - "v__1\u001b[0m*\u001b[0;34me_1\u001b[0m + v__2\u001b[0m*\u001b[0;34me_2\u001b[0m + v__3\u001b[0m*\u001b[0;34me_3\u001b[0m\r\n", - "v__x\u001b[0m*\u001b[0;34me_x\u001b[0m + v__y\u001b[0m*\u001b[0;34me_y\u001b[0m + v__z\u001b[0m*\u001b[0;34me_z\u001b[0m\r\n", - "v__x*\u001b[0;34me_x\u001b[0m + v__y*\u001b[0;34me_y\u001b[0m + v__z*\u001b[0;34me_z\u001b[0m\r\n" + "v__1\u001b[0m*\u001b[0;34me_1\u001b[0m + v__2\u001b[0m*\u001b[0;34me_2\u001b[0m + v__3\u001b[0m*\u001b[0;34me_3\u001b[0m\n", + "v__1\u001b[0m*\u001b[0;34me_1\u001b[0m + v__2\u001b[0m*\u001b[0;34me_2\u001b[0m + v__3\u001b[0m*\u001b[0;34me_3\u001b[0m\n", + "v__x\u001b[0m*\u001b[0;34me_x\u001b[0m + v__y\u001b[0m*\u001b[0;34me_y\u001b[0m + v__z\u001b[0m*\u001b[0;34me_z\u001b[0m\n", + "v__x*\u001b[0;34me_x\u001b[0m + v__y*\u001b[0;34me_y\u001b[0m + v__z*\u001b[0;34me_z\u001b[0m\n" ] } ], @@ -617,308 +623,288 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 8, "metadata": {}, - "outputs": [], - "source": [ - "!python physics_check_latex.py" - ] - }, - { - "cell_type": "code", - "execution_count": 11, - "metadata": { - "collapsed": false, - "scrolled": false - }, "outputs": [ { - "name": "stdout", - "output_type": "stream", - "text": [ - "\r\n", - "\\documentclass[10pt,fleqn]{report}\r\n", - "\\usepackage[vcentering]{geometry}\r\n", - "\\geometry{papersize={14in,11in},total={13in,10in}}\r\n", - "\r\n", - "\\pagestyle{empty}\r\n", - "\\usepackage[latin1]{inputenc}\r\n", - "\\usepackage{amsmath}\r\n", - "\\usepackage{amsfonts}\r\n", - "\\usepackage{amssymb}\r\n", - "\\usepackage{amsbsy}\r\n", - "\\usepackage{tensor}\r\n", - "\\usepackage{listings}\r\n", - "\\usepackage{color}\r\n", - "\\usepackage{xcolor}\r\n", - "\\usepackage{bm}\r\n", - "\\usepackage{breqn}\r\n", - "\\definecolor{gray}{rgb}{0.95,0.95,0.95}\r\n", - "\\setlength{\\parindent}{0pt}\r\n", - "\\DeclareMathOperator{\\Tr}{Tr}\r\n", - "\\DeclareMathOperator{\\Adj}{Adj}\r\n", - "\\newcommand{\\bfrac}[2]{\\displaystyle\\frac{#1}{#2}}\r\n", - "\\newcommand{\\lp}{\\left (}\r\n", - "\\newcommand{\\rp}{\\right )}\r\n", - "\\newcommand{\\paren}[1]{\\lp {#1} \\rp}\r\n", - "\\newcommand{\\half}{\\frac{1}{2}}\r\n", - "\\newcommand{\\llt}{\\left <}\r\n", - "\\newcommand{\\rgt}{\\right >}\r\n", - "\\newcommand{\\abs}[1]{\\left |{#1}\\right | }\r\n", - "\\newcommand{\\pdiff}[2]{\\bfrac{\\partial {#1}}{\\partial {#2}}}\r\n", - "\\newcommand{\\lbrc}{\\left \\{}\r\n", - "\\newcommand{\\rbrc}{\\right \\}}\r\n", - "\\newcommand{\\W}{\\wedge}\r\n", - "\\newcommand{\\prm}[1]{{#1}'}\r\n", - "\\newcommand{\\ddt}[1]{\\bfrac{d{#1}}{dt}}\r\n", - "\\newcommand{\\R}{\\dagger}\r\n", - "\\newcommand{\\deriv}[3]{\\bfrac{d^{#3}#1}{d{#2}^{#3}}}\r\n", - "\\newcommand{\\grade}[1]{\\left < {#1} \\right >}\r\n", - "\\newcommand{\\f}[2]{{#1}\\lp{#2}\\rp}\r\n", - "\\newcommand{\\eval}[2]{\\left . {#1} \\right |_{#2}}\r\n", - "\\newcommand{\\Nabla}{\\boldsymbol{\\nabla}}\r\n", - "\\newcommand{\\eb}{\\boldsymbol{e}}\r\n", - "\\usepackage{float}\r\n", - "\\floatstyle{plain} % optionally change the style of the new float\r\n", - "\\newfloat{Code}{H}{myc}\r\n", - "\\lstloadlanguages{Python}\r\n", - "\r\n", - "\\begin{document}\r\n", - "\\\\begin{lstlisting}[language=Python,showspaces=false,showstringspaces=false,backgroundcolor=\\color{gray},frame=single]\r\n", - "def Maxwells_Equations_in_Geometric_Calculus():\r\n", - " Print_Function()\r\n", - " X = symbols('t x y z')\r\n", - " (g0,g1,g2,g3,grad) = MV.setup('gamma*t|x|y|z',metric='[1,-1,-1,-1]',coords=X)\r\n", - " I = MV.I\r\n", - " B = MV('B','vector',fct=True)\r\n", - " E = MV('E','vector',fct=True)\r\n", - " B.set_coef(1,0,0)\r\n", - " E.set_coef(1,0,0)\r\n", - " B *= g0\r\n", - " E *= g0\r\n", - " J = MV('J','vector',fct=True)\r\n", - " F = E+I*B\r\n", - " print(r'\\text{Pseudo Scalar\\;\\;}I =',I)\r\n", - " print('\\\\text{Magnetic Field Bi-Vector\\\\;\\\\;} B = \\\\bm{B\\\\gamma_{t}} =',B)\r\n", - " print('\\\\text{Electric Field Bi-Vector\\\\;\\\\;} E = \\\\bm{E\\\\gamma_{t}} =',E)\r\n", - " print('\\\\text{Electromagnetic Field Bi-Vector\\\\;\\\\;} F = E+IB =',F)\r\n", - " print('%\\\\text{Four Current Density\\\\;\\\\;} J =',J)\r\n", - " gradF = grad*F\r\n", - " print('#Geometric Derivative of Electomagnetic Field Bi-Vector')\r\n", - " gradF.Fmt(3,'grad*F')\r\n", - " print('#Maxwell Equations')\r\n", - " print('grad*F = J')\r\n", - " print('#Div $E$ and Curl $H$ Equations')\r\n", - " (gradF.grade(1)-J).Fmt(3,'%\\\\grade{\\\\nabla F}_{1} -J = 0')\r\n", - " print('#Curl $E$ and Div $B$ equations')\r\n", - " (gradF.grade(3)).Fmt(3,'%\\\\grade{\\\\nabla F}_{3} = 0')\r\n", - " return\r\n", - "\\end{lstlisting}\r\n", - "Code Output:\r\n", - "\\begin{equation*} \\text{Pseudo Scalar\\;\\;}I = \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{x}\\wedge \\boldsymbol{\\gamma }_{y}\\wedge \\boldsymbol{\\gamma }_{z} \\end{equation*}\r\n", - "\\begin{equation*} \\text{Magnetic Field Bi-Vector\\;\\;} B = \\bm{B\\gamma_{t}} = - B^{x} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{x} - B^{y} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{y} - B^{z} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{z} \\end{equation*}\r\n", - "\\begin{equation*} \\text{Electric Field Bi-Vector\\;\\;} E = \\bm{E\\gamma_{t}} = - E^{x} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{x} - E^{y} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{y} - E^{z} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{z} \\end{equation*}\r\n", - "\\begin{equation*} \\text{Electromagnetic Field Bi-Vector\\;\\;} F = E+IB = - E^{x} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{x} - E^{y} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{y} - E^{z} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{z} - B^{z} \\boldsymbol{\\gamma }_{x}\\wedge \\boldsymbol{\\gamma }_{y} + B^{y} \\boldsymbol{\\gamma }_{x}\\wedge \\boldsymbol{\\gamma }_{z} - B^{x} \\boldsymbol{\\gamma }_{y}\\wedge \\boldsymbol{\\gamma }_{z} \\end{equation*}\r\n", - "\\begin{equation*} \\text{Four Current Density\\;\\;} J = J^{t} \\boldsymbol{\\gamma }_{t} + J^{x} \\boldsymbol{\\gamma }_{x} + J^{y} \\boldsymbol{\\gamma }_{y} + J^{z} \\boldsymbol{\\gamma }_{z} \\end{equation*}\r\n", - "Geometric Derivative of Electomagnetic Field Bi-Vector\r\n", - "Maxwell Equations\r\n", - "\\begin{equation*} \\boldsymbol{\\nabla} F = J \\end{equation*}\r\n", - "Div $E$ and Curl $H$ Equations\r\n", - "Curl $E$ and Div $B$ equations\r\n", - "\\\\begin{lstlisting}[language=Python,showspaces=false,showstringspaces=false,backgroundcolor=\\color{gray},frame=single]\r\n", - "def Dirac_Equation_in_Geometric_Calculus():\r\n", - " Print_Function()\r\n", - " vars = symbols('t x y z')\r\n", - " (g0,g1,g2,g3,grad) = MV.setup('gamma*t|x|y|z',metric='[1,-1,-1,-1]',coords=vars)\r\n", - " I = MV.I\r\n", - " (m,e) = symbols('m e')\r\n", - " psi = MV('psi','spinor',fct=True)\r\n", - " A = MV('A','vector',fct=True)\r\n", - " sig_z = g3*g0\r\n", - " print('\\\\text{4-Vector Potential\\\\;\\\\;}\\\\bm{A} =',A)\r\n", - " print('\\\\text{8-component real spinor\\\\;\\\\;}\\\\bm{\\\\psi} =',psi)\r\n", - " dirac_eq = (grad*psi)*I*sig_z-e*A*psi-m*psi*g0\r\n", - " dirac_eq.simplify()\r\n", - " dirac_eq.Fmt(3,r'%\\text{Dirac Equation\\;\\;}\\nabla \\bm{\\psi} I \\sigma_{z}-e\\bm{A}\\bm{\\psi}-m\\bm{\\psi}\\gamma_{t} = 0')\r\n", - " return\r\n", - "\\end{lstlisting}\r\n", - "Code Output:\r\n", - " \\begin{align*} \\text{4-Vector Potential\\;\\;}\\bm{A} = & A^{t} \\boldsymbol{\\gamma }_{t} \\\\ & + A^{x} \\boldsymbol{\\gamma }_{x} \\\\ & + A^{y} \\boldsymbol{\\gamma }_{y} \\\\ & + A^{z} \\boldsymbol{\\gamma }_{z} \\end{align*} \r\n", - " \\begin{align*} \\text{8-component real spinor\\;\\;}\\bm{\\psi} = & \\psi \\\\ & + \\psi ^{tx} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{x} \\\\ & + \\psi ^{ty} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{y} \\\\ & + \\psi ^{tz} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{z} \\\\ & + \\psi ^{xy} \\boldsymbol{\\gamma }_{x}\\wedge \\boldsymbol{\\gamma }_{y} \\\\ & + \\psi ^{xz} \\boldsymbol{\\gamma }_{x}\\wedge \\boldsymbol{\\gamma }_{z} \\\\ & + \\psi ^{yz} \\boldsymbol{\\gamma }_{y}\\wedge \\boldsymbol{\\gamma }_{z} \\\\ & + \\psi ^{txyz} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{x}\\wedge \\boldsymbol{\\gamma }_{y}\\wedge \\boldsymbol{\\gamma }_{z} \\end{align*} \r\n", - "\\\\begin{lstlisting}[language=Python,showspaces=false,showstringspaces=false,backgroundcolor=\\color{gray},frame=single]\r\n", - "def Lorentz_Tranformation_in_Geometric_Algebra():\r\n", - " Print_Function()\r\n", - " (alpha,beta,gamma) = symbols('alpha beta gamma')\r\n", - " (x,t,xp,tp) = symbols(\"x t x' t'\")\r\n", - " (g0,g1) = MV.setup('gamma*t|x',metric='[1,-1]')\r\n", - " from sympy import sinh,cosh\r\n", - " R = cosh(alpha/2)+sinh(alpha/2)*(g0^g1)\r\n", - " X = t*g0+x*g1\r\n", - " Xp = tp*g0+xp*g1\r\n", - " print('R =',R)\r\n", - " print(r\"#%t\\bm{\\gamma_{t}}+x\\bm{\\gamma_{x}} = t'\\bm{\\gamma'_{t}}+x'\\bm{\\gamma'_{x}} = R\\lp t'\\bm{\\gamma_{t}}+x'\\bm{\\gamma_{x}}\\rp R^{\\dagger}\")\r\n", - " Xpp = R*Xp*R.rev()\r\n", - " Xpp = Xpp.collect()\r\n", - " Xpp = Xpp.subs({2*sinh(alpha/2)*cosh(alpha/2):sinh(alpha),sinh(alpha/2)**2+cosh(alpha/2)**2:cosh(alpha)})\r\n", - " print(r\"%t\\bm{\\gamma_{t}}+x\\bm{\\gamma_{x}} =\",Xpp)\r\n", - " Xpp = Xpp.subs({sinh(alpha):gamma*beta,cosh(alpha):gamma})\r\n", - " print(r'%\\f{\\sinh}{\\alpha} = \\gamma\\beta')\r\n", - " print(r'%\\f{\\cosh}{\\alpha} = \\gamma')\r\n", - " print(r\"%t\\bm{\\gamma_{t}}+x\\bm{\\gamma_{x}} =\",Xpp.collect())\r\n", - " return\r\n", - "\\end{lstlisting}\r\n", - "Code Output:\r\n", - " \\begin{align*} R = & \\cosh{\\left (\\frac{\\alpha }{2} \\right )} \\\\ & + \\sinh{\\left (\\frac{\\alpha }{2} \\right )} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{x} \\end{align*} \r\n", - "\\begin{equation*} t\\bm{\\gamma_{t}}+x\\bm{\\gamma_{x}} = t'\\bm{\\gamma'_{t}}+x'\\bm{\\gamma'_{x}} = R\\lp t'\\bm{\\gamma_{t}}+x'\\bm{\\gamma_{x}}\\rp R^{\\dagger} \\end{equation*}\r\n", - " \\begin{align*} t\\bm{\\gamma_{t}}+x\\bm{\\gamma_{x}} = & \\left ( 2 t' {\\sinh{\\left (\\frac{\\alpha }{2} \\right )}}^{2} + t' - x' \\sinh{\\left (\\alpha \\right )}\\right ) \\boldsymbol{\\gamma }_{t} \\\\ & + \\left ( - t' \\sinh{\\left (\\alpha \\right )} + 2 x' {\\sinh{\\left (\\frac{\\alpha }{2} \\right )}}^{2} + x'\\right ) \\boldsymbol{\\gamma }_{x} \\end{align*} \r\n", - "\\begin{equation*} \\f{\\sinh}{\\alpha} = \\gamma\\beta \\end{equation*}\r\n", - "\\begin{equation*} \\f{\\cosh}{\\alpha} = \\gamma \\end{equation*}\r\n", - " \\begin{align*} t\\bm{\\gamma_{t}}+x\\bm{\\gamma_{x}} = & \\left ( - \\beta \\gamma x' + 2 t' {\\sinh{\\left (\\frac{\\alpha }{2} \\right )}}^{2} + t'\\right ) \\boldsymbol{\\gamma }_{t} \\\\ & + \\left ( - \\beta \\gamma t' + 2 x' {\\sinh{\\left (\\frac{\\alpha }{2} \\right )}}^{2} + x'\\right ) \\boldsymbol{\\gamma }_{x} \\end{align*} \r\n", - "\r\n", - "\\end{document}\r\n" - ] + "data": { + "text/plain": [ + "\n", + "\\documentclass[10pt,fleqn]{report}\n", + "\\usepackage[vcentering]{geometry}\n", + "\\geometry{papersize={14in,11in},total={13in,10in}}\n", + "\n", + "\\pagestyle{empty}\n", + "\\usepackage[latin1]{inputenc}\n", + "\\usepackage{amsmath}\n", + "\\usepackage{amsfonts}\n", + "\\usepackage{amssymb}\n", + "\\usepackage{amsbsy}\n", + "\\usepackage{tensor}\n", + "\\usepackage{listings}\n", + "\\usepackage{color}\n", + "\\usepackage{xcolor}\n", + "\\usepackage{bm}\n", + "\\usepackage{breqn}\n", + "\\definecolor{gray}{rgb}{0.95,0.95,0.95}\n", + "\\setlength{\\parindent}{0pt}\n", + "\\DeclareMathOperator{\\Tr}{Tr}\n", + "\\DeclareMathOperator{\\Adj}{Adj}\n", + "\\newcommand{\\bfrac}[2]{\\displaystyle\\frac{#1}{#2}}\n", + "\\newcommand{\\lp}{\\left (}\n", + "\\newcommand{\\rp}{\\right )}\n", + "\\newcommand{\\paren}[1]{\\lp {#1} \\rp}\n", + "\\newcommand{\\half}{\\frac{1}{2}}\n", + "\\newcommand{\\llt}{\\left <}\n", + "\\newcommand{\\rgt}{\\right >}\n", + "\\newcommand{\\abs}[1]{\\left |{#1}\\right | }\n", + "\\newcommand{\\pdiff}[2]{\\bfrac{\\partial {#1}}{\\partial {#2}}}\n", + "\\newcommand{\\lbrc}{\\left \\{}\n", + "\\newcommand{\\rbrc}{\\right \\}}\n", + "\\newcommand{\\W}{\\wedge}\n", + "\\newcommand{\\prm}[1]{{#1}'}\n", + "\\newcommand{\\ddt}[1]{\\bfrac{d{#1}}{dt}}\n", + "\\newcommand{\\R}{\\dagger}\n", + "\\newcommand{\\deriv}[3]{\\bfrac{d^{#3}#1}{d{#2}^{#3}}}\n", + "\\newcommand{\\grade}[1]{\\left < {#1} \\right >}\n", + "\\newcommand{\\f}[2]{{#1}\\lp{#2}\\rp}\n", + "\\newcommand{\\eval}[2]{\\left . {#1} \\right |_{#2}}\n", + "\\newcommand{\\Nabla}{\\boldsymbol{\\nabla}}\n", + "\\newcommand{\\eb}{\\boldsymbol{e}}\n", + "\\usepackage{float}\n", + "\\floatstyle{plain} % optionally change the style of the new float\n", + "\\newfloat{Code}{H}{myc}\n", + "\\lstloadlanguages{Python}\n", + "\n", + "\\begin{document}\n", + "\\\\begin{lstlisting}[language=Python,showspaces=false,showstringspaces=false,backgroundcolor=\\color{gray},frame=single]\n", + "def Maxwells_Equations_in_Geometric_Calculus():\n", + " Print_Function()\n", + " X = symbols('t x y z')\n", + " (g0,g1,g2,g3,grad) = MV.setup('gamma*t|x|y|z',metric='[1,-1,-1,-1]',coords=X)\n", + " I = MV.I\n", + " B = MV('B','vector',fct=True)\n", + " E = MV('E','vector',fct=True)\n", + " B.set_coef(1,0,0)\n", + " E.set_coef(1,0,0)\n", + " B *= g0\n", + " E *= g0\n", + " J = MV('J','vector',fct=True)\n", + " F = E+I*B\n", + " print(r'\\text{Pseudo Scalar\\;\\;}I =',I)\n", + " print('\\\\text{Magnetic Field Bi-Vector\\\\;\\\\;} B = \\\\bm{B\\\\gamma_{t}} =',B)\n", + " print('\\\\text{Electric Field Bi-Vector\\\\;\\\\;} E = \\\\bm{E\\\\gamma_{t}} =',E)\n", + " print('\\\\text{Electromagnetic Field Bi-Vector\\\\;\\\\;} F = E+IB =',F)\n", + " print('%\\\\text{Four Current Density\\\\;\\\\;} J =',J)\n", + " gradF = grad*F\n", + " print('#Geometric Derivative of Electomagnetic Field Bi-Vector')\n", + " gradF.Fmt(3,'grad*F')\n", + " print('#Maxwell Equations')\n", + " print('grad*F = J')\n", + " print('#Div $E$ and Curl $H$ Equations')\n", + " (gradF.grade(1)-J).Fmt(3,'%\\\\grade{\\\\nabla F}_{1} -J = 0')\n", + " print('#Curl $E$ and Div $B$ equations')\n", + " (gradF.grade(3)).Fmt(3,'%\\\\grade{\\\\nabla F}_{3} = 0')\n", + " return\n", + "\\end{lstlisting}\n", + "Code Output:\n", + "\\begin{equation*} \\text{Pseudo Scalar\\;\\;}I = \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{x}\\wedge \\boldsymbol{\\gamma }_{y}\\wedge \\boldsymbol{\\gamma }_{z} \\end{equation*}\n", + "\\begin{equation*} \\text{Magnetic Field Bi-Vector\\;\\;} B = \\bm{B\\gamma_{t}} = - B^{x} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{x} - B^{y} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{y} - B^{z} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{z} \\end{equation*}\n", + "\\begin{equation*} \\text{Electric Field Bi-Vector\\;\\;} E = \\bm{E\\gamma_{t}} = - E^{x} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{x} - E^{y} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{y} - E^{z} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{z} \\end{equation*}\n", + "\\begin{equation*} \\text{Electromagnetic Field Bi-Vector\\;\\;} F = E+IB = - E^{x} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{x} - E^{y} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{y} - E^{z} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{z} - B^{z} \\boldsymbol{\\gamma }_{x}\\wedge \\boldsymbol{\\gamma }_{y} + B^{y} \\boldsymbol{\\gamma }_{x}\\wedge \\boldsymbol{\\gamma }_{z} - B^{x} \\boldsymbol{\\gamma }_{y}\\wedge \\boldsymbol{\\gamma }_{z} \\end{equation*}\n", + "\\begin{equation*} \\text{Four Current Density\\;\\;} J = J^{t} \\boldsymbol{\\gamma }_{t} + J^{x} \\boldsymbol{\\gamma }_{x} + J^{y} \\boldsymbol{\\gamma }_{y} + J^{z} \\boldsymbol{\\gamma }_{z} \\end{equation*}\n", + "Geometric Derivative of Electomagnetic Field Bi-Vector\n", + "Maxwell Equations\n", + "\\begin{equation*} \\boldsymbol{\\nabla} F = J \\end{equation*}\n", + "Div $E$ and Curl $H$ Equations\n", + "Curl $E$ and Div $B$ equations\n", + "\\\\begin{lstlisting}[language=Python,showspaces=false,showstringspaces=false,backgroundcolor=\\color{gray},frame=single]\n", + "def Dirac_Equation_in_Geometric_Calculus():\n", + " Print_Function()\n", + " vars = symbols('t x y z')\n", + " (g0,g1,g2,g3,grad) = MV.setup('gamma*t|x|y|z',metric='[1,-1,-1,-1]',coords=vars)\n", + " I = MV.I\n", + " (m,e) = symbols('m e')\n", + " psi = MV('psi','spinor',fct=True)\n", + " A = MV('A','vector',fct=True)\n", + " sig_z = g3*g0\n", + " print('\\\\text{4-Vector Potential\\\\;\\\\;}\\\\bm{A} =',A)\n", + " print('\\\\text{8-component real spinor\\\\;\\\\;}\\\\bm{\\\\psi} =',psi)\n", + " dirac_eq = (grad*psi)*I*sig_z-e*A*psi-m*psi*g0\n", + " dirac_eq.simplify()\n", + " dirac_eq.Fmt(3,r'%\\text{Dirac Equation\\;\\;}\\nabla \\bm{\\psi} I \\sigma_{z}-e\\bm{A}\\bm{\\psi}-m\\bm{\\psi}\\gamma_{t} = 0')\n", + " return\n", + "\\end{lstlisting}\n", + "Code Output:\n", + " \\begin{align*} \\text{4-Vector Potential\\;\\;}\\bm{A} = & A^{t} \\boldsymbol{\\gamma }_{t} \\\\ & + A^{x} \\boldsymbol{\\gamma }_{x} \\\\ & + A^{y} \\boldsymbol{\\gamma }_{y} \\\\ & + A^{z} \\boldsymbol{\\gamma }_{z} \\end{align*} \n", + " \\begin{align*} \\text{8-component real spinor\\;\\;}\\bm{\\psi} = & \\psi \\\\ & + \\psi ^{tx} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{x} \\\\ & + \\psi ^{ty} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{y} \\\\ & + \\psi ^{tz} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{z} \\\\ & + \\psi ^{xy} \\boldsymbol{\\gamma }_{x}\\wedge \\boldsymbol{\\gamma }_{y} \\\\ & + \\psi ^{xz} \\boldsymbol{\\gamma }_{x}\\wedge \\boldsymbol{\\gamma }_{z} \\\\ & + \\psi ^{yz} \\boldsymbol{\\gamma }_{y}\\wedge \\boldsymbol{\\gamma }_{z} \\\\ & + \\psi ^{txyz} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{x}\\wedge \\boldsymbol{\\gamma }_{y}\\wedge \\boldsymbol{\\gamma }_{z} \\end{align*} \n", + "\\\\begin{lstlisting}[language=Python,showspaces=false,showstringspaces=false,backgroundcolor=\\color{gray},frame=single]\n", + "def Lorentz_Tranformation_in_Geometric_Algebra():\n", + " Print_Function()\n", + " (alpha,beta,gamma) = symbols('alpha beta gamma')\n", + " (x,t,xp,tp) = symbols(\"x t x' t'\")\n", + " (g0,g1) = MV.setup('gamma*t|x',metric='[1,-1]')\n", + " from sympy import sinh,cosh\n", + " R = cosh(alpha/2)+sinh(alpha/2)*(g0^g1)\n", + " X = t*g0+x*g1\n", + " Xp = tp*g0+xp*g1\n", + " print('R =',R)\n", + " print(r\"#%t\\bm{\\gamma_{t}}+x\\bm{\\gamma_{x}} = t'\\bm{\\gamma'_{t}}+x'\\bm{\\gamma'_{x}} = R\\lp t'\\bm{\\gamma_{t}}+x'\\bm{\\gamma_{x}}\\rp R^{\\dagger}\")\n", + " Xpp = R*Xp*R.rev()\n", + " Xpp = Xpp.collect()\n", + " Xpp = Xpp.subs({2*sinh(alpha/2)*cosh(alpha/2):sinh(alpha),sinh(alpha/2)**2+cosh(alpha/2)**2:cosh(alpha)})\n", + " print(r\"%t\\bm{\\gamma_{t}}+x\\bm{\\gamma_{x}} =\",Xpp)\n", + " Xpp = Xpp.subs({sinh(alpha):gamma*beta,cosh(alpha):gamma})\n", + " print(r'%\\f{\\sinh}{\\alpha} = \\gamma\\beta')\n", + " print(r'%\\f{\\cosh}{\\alpha} = \\gamma')\n", + " print(r\"%t\\bm{\\gamma_{t}}+x\\bm{\\gamma_{x}} =\",Xpp.collect())\n", + " return\n", + "\\end{lstlisting}\n", + "Code Output:\n", + " \\begin{align*} R = & \\cosh{\\left (\\frac{\\alpha }{2} \\right )} \\\\ & + \\sinh{\\left (\\frac{\\alpha }{2} \\right )} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{x} \\end{align*} \n", + "\\begin{equation*} t\\bm{\\gamma_{t}}+x\\bm{\\gamma_{x}} = t'\\bm{\\gamma'_{t}}+x'\\bm{\\gamma'_{x}} = R\\lp t'\\bm{\\gamma_{t}}+x'\\bm{\\gamma_{x}}\\rp R^{\\dagger} \\end{equation*}\n", + " \\begin{align*} t\\bm{\\gamma_{t}}+x\\bm{\\gamma_{x}} = & \\left ( 2 t' {\\sinh{\\left (\\frac{\\alpha }{2} \\right )}}^{2} + t' - x' \\sinh{\\left (\\alpha \\right )}\\right ) \\boldsymbol{\\gamma }_{t} \\\\ & + \\left ( - t' \\sinh{\\left (\\alpha \\right )} + 2 x' {\\sinh{\\left (\\frac{\\alpha }{2} \\right )}}^{2} + x'\\right ) \\boldsymbol{\\gamma }_{x} \\end{align*} \n", + "\\begin{equation*} \\f{\\sinh}{\\alpha} = \\gamma\\beta \\end{equation*}\n", + "\\begin{equation*} \\f{\\cosh}{\\alpha} = \\gamma \\end{equation*}\n", + " \\begin{align*} t\\bm{\\gamma_{t}}+x\\bm{\\gamma_{x}} = & \\left ( - \\beta \\gamma x' + 2 t' {\\sinh{\\left (\\frac{\\alpha }{2} \\right )}}^{2} + t'\\right ) \\boldsymbol{\\gamma }_{t} \\\\ & + \\left ( - \\beta \\gamma t' + 2 x' {\\sinh{\\left (\\frac{\\alpha }{2} \\right )}}^{2} + x'\\right ) \\boldsymbol{\\gamma }_{x} \\end{align*} \n", + "\n", + "\\end{document}\n" + ] + }, + "metadata": {}, + "output_type": "display_data" } ], "source": [ - "!cat physics_check_latex.tex" + "check_latex('physics_check_latex')" ] }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 9, "metadata": {}, - "outputs": [], - "source": [ - "!python print_check_latex.py" - ] - }, - { - "cell_type": "code", - "execution_count": 13, - "metadata": { - "collapsed": false, - "scrolled": false - }, "outputs": [ { - "name": "stdout", - "output_type": "stream", - "text": [ - "\r\n", - "\\documentclass[10pt,fleqn]{report}\r\n", - "\\usepackage[vcentering]{geometry}\r\n", - "\\geometry{papersize={14in,11in},total={13in,10in}}\r\n", - "\r\n", - "\\pagestyle{empty}\r\n", - "\\usepackage[latin1]{inputenc}\r\n", - "\\usepackage{amsmath}\r\n", - "\\usepackage{amsfonts}\r\n", - "\\usepackage{amssymb}\r\n", - "\\usepackage{amsbsy}\r\n", - "\\usepackage{tensor}\r\n", - "\\usepackage{listings}\r\n", - "\\usepackage{color}\r\n", - "\\usepackage{xcolor}\r\n", - "\\usepackage{bm}\r\n", - "\\usepackage{breqn}\r\n", - "\\definecolor{gray}{rgb}{0.95,0.95,0.95}\r\n", - "\\setlength{\\parindent}{0pt}\r\n", - "\\DeclareMathOperator{\\Tr}{Tr}\r\n", - "\\DeclareMathOperator{\\Adj}{Adj}\r\n", - "\\newcommand{\\bfrac}[2]{\\displaystyle\\frac{#1}{#2}}\r\n", - "\\newcommand{\\lp}{\\left (}\r\n", - "\\newcommand{\\rp}{\\right )}\r\n", - "\\newcommand{\\paren}[1]{\\lp {#1} \\rp}\r\n", - "\\newcommand{\\half}{\\frac{1}{2}}\r\n", - "\\newcommand{\\llt}{\\left <}\r\n", - "\\newcommand{\\rgt}{\\right >}\r\n", - "\\newcommand{\\abs}[1]{\\left |{#1}\\right | }\r\n", - "\\newcommand{\\pdiff}[2]{\\bfrac{\\partial {#1}}{\\partial {#2}}}\r\n", - "\\newcommand{\\lbrc}{\\left \\{}\r\n", - "\\newcommand{\\rbrc}{\\right \\}}\r\n", - "\\newcommand{\\W}{\\wedge}\r\n", - "\\newcommand{\\prm}[1]{{#1}'}\r\n", - "\\newcommand{\\ddt}[1]{\\bfrac{d{#1}}{dt}}\r\n", - "\\newcommand{\\R}{\\dagger}\r\n", - "\\newcommand{\\deriv}[3]{\\bfrac{d^{#3}#1}{d{#2}^{#3}}}\r\n", - "\\newcommand{\\grade}[1]{\\left < {#1} \\right >}\r\n", - "\\newcommand{\\f}[2]{{#1}\\lp{#2}\\rp}\r\n", - "\\newcommand{\\eval}[2]{\\left . {#1} \\right |_{#2}}\r\n", - "\\newcommand{\\Nabla}{\\boldsymbol{\\nabla}}\r\n", - "\\newcommand{\\eb}{\\boldsymbol{e}}\r\n", - "\\usepackage{float}\r\n", - "\\floatstyle{plain} % optionally change the style of the new float\r\n", - "\\newfloat{Code}{H}{myc}\r\n", - "\\lstloadlanguages{Python}\r\n", - "\r\n", - "\\begin{document}\r\n", - "\\begin{equation*} \\bm{A} = A + A^{x} \\boldsymbol{e}_{x} + A^{y} \\boldsymbol{e}_{y} + A^{z} \\boldsymbol{e}_{z} + A^{xy} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + A^{xz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + A^{yz} \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} + A^{xyz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\r\n", - " \\begin{align*} \\bm{A} = & A \\\\ & + A^{x} \\boldsymbol{e}_{x} + A^{y} \\boldsymbol{e}_{y} + A^{z} \\boldsymbol{e}_{z} \\\\ & + A^{xy} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + A^{xz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + A^{yz} \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\\\ & + A^{xyz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{align*} \r\n", - " \\begin{align*} \\bm{A} = & A \\\\ & + A^{x} \\boldsymbol{e}_{x} \\\\ & + A^{y} \\boldsymbol{e}_{y} \\\\ & + A^{z} \\boldsymbol{e}_{z} \\\\ & + A^{xy} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} \\\\ & + A^{xz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} \\\\ & + A^{yz} \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\\\ & + A^{xyz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{align*} \r\n", - " \\begin{align*} \\bm{A} = & A^{x} \\boldsymbol{e}_{x} \\\\ & + A^{y} \\boldsymbol{e}_{y} \\\\ & + A^{z} \\boldsymbol{e}_{z} \\end{align*} \r\n", - " \\begin{align*} \\bm{B} = & B^{xy} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} \\\\ & + B^{xz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} \\\\ & + B^{yz} \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{align*} \r\n", - " \\begin{align*} \\boldsymbol{\\nabla} f = & \\partial_{x} f \\boldsymbol{e}_{x} \\\\ & + \\partial_{y} f \\boldsymbol{e}_{y} \\\\ & + \\partial_{z} f \\boldsymbol{e}_{z} \\end{align*} \r\n", - "\\begin{equation*} \\boldsymbol{\\nabla} \\cdot \\bm{A} = \\partial_{x} A^{x} + \\partial_{y} A^{y} + \\partial_{z} A^{z} \\end{equation*}\r\n", - " \\begin{align*} \\boldsymbol{\\nabla} \\bm{A} = & \\left ( \\partial_{x} A^{x} + \\partial_{y} A^{y} + \\partial_{z} A^{z} \\right ) \\\\ & + \\left ( - \\partial_{y} A^{x} + \\partial_{x} A^{y} \\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} \\\\ & + \\left ( - \\partial_{z} A^{x} + \\partial_{x} A^{z} \\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} \\\\ & + \\left ( - \\partial_{z} A^{y} + \\partial_{y} A^{z} \\right ) \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{align*} \r\n", - " \\begin{align*} -I (\\boldsymbol{\\nabla} \\W \\bm{A}) = & \\left ( - \\partial_{z} A^{y} + \\partial_{y} A^{z} \\right ) \\boldsymbol{e}_{x} \\\\ & + \\left ( \\partial_{z} A^{x} - \\partial_{x} A^{z} \\right ) \\boldsymbol{e}_{y} \\\\ & + \\left ( - \\partial_{y} A^{x} + \\partial_{x} A^{y} \\right ) \\boldsymbol{e}_{z} \\end{align*} \r\n", - " \\begin{align*} \\boldsymbol{\\nabla} \\bm{B} = & \\left ( - \\partial_{y} B^{xy} - \\partial_{z} B^{xz} \\right ) \\boldsymbol{e}_{x} \\\\ & + \\left ( \\partial_{x} B^{xy} - \\partial_{z} B^{yz} \\right ) \\boldsymbol{e}_{y} \\\\ & + \\left ( \\partial_{x} B^{xz} + \\partial_{y} B^{yz} \\right ) \\boldsymbol{e}_{z} \\\\ & + \\left ( \\partial_{z} B^{xy} - \\partial_{y} B^{xz} + \\partial_{x} B^{yz} \\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{align*} \r\n", - "\\begin{equation*} \\boldsymbol{\\nabla} \\W \\bm{B} = \\left ( \\partial_{z} B^{xy} - \\partial_{y} B^{xz} + \\partial_{x} B^{yz} \\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\r\n", - " \\begin{align*} \\boldsymbol{\\nabla} \\cdot \\bm{B} = & \\left ( - \\partial_{y} B^{xy} - \\partial_{z} B^{xz} \\right ) \\boldsymbol{e}_{x} \\\\ & + \\left ( \\partial_{x} B^{xy} - \\partial_{z} B^{yz} \\right ) \\boldsymbol{e}_{y} \\\\ & + \\left ( \\partial_{x} B^{xz} + \\partial_{y} B^{yz} \\right ) \\boldsymbol{e}_{z} \\end{align*} \r\n", - "\\begin{equation*} g_{ij} = \\left [ \\begin{array}{cccc} \\left ( a\\cdot a\\right ) & \\left ( a\\cdot b\\right ) & \\left ( a\\cdot c\\right ) & \\left ( a\\cdot d\\right ) \\\\ \\left ( a\\cdot b\\right ) & \\left ( b\\cdot b\\right ) & \\left ( b\\cdot c\\right ) & \\left ( b\\cdot d\\right ) \\\\ \\left ( a\\cdot c\\right ) & \\left ( b\\cdot c\\right ) & \\left ( c\\cdot c\\right ) & \\left ( c\\cdot d\\right ) \\\\ \\left ( a\\cdot d\\right ) & \\left ( b\\cdot d\\right ) & \\left ( c\\cdot d\\right ) & \\left ( d\\cdot d\\right ) \\end{array}\\right ] \\end{equation*}\r\n", - " \\begin{align*} \\bm{a\\cdot (b c)} = & - \\left ( a\\cdot c\\right ) \\boldsymbol{b} \\\\ & + \\left ( a\\cdot b\\right ) \\boldsymbol{c} \\end{align*} \r\n", - " \\begin{align*} \\bm{a\\cdot (b\\W c)} = & - \\left ( a\\cdot c\\right ) \\boldsymbol{b} \\\\ & + \\left ( a\\cdot b\\right ) \\boldsymbol{c} \\end{align*} \r\n", - " \\begin{align*} \\bm{a\\cdot (b\\W c\\W d)} = & \\left ( a\\cdot d\\right ) \\boldsymbol{b}\\wedge \\boldsymbol{c} \\\\ & - \\left ( a\\cdot c\\right ) \\boldsymbol{b}\\wedge \\boldsymbol{d} \\\\ & + \\left ( a\\cdot b\\right ) \\boldsymbol{c}\\wedge \\boldsymbol{d} \\end{align*} \r\n", - "\\begin{equation*} \\bm{a\\cdot (b\\W c)+c\\cdot (a\\W b)+b\\cdot (c\\W a)} = 0 \\end{equation*}\r\n", - "\\begin{equation*} \\bm{a (b\\W c)-b (a\\W c)+c (a\\W b)} = 3 \\boldsymbol{a}\\wedge \\boldsymbol{b}\\wedge \\boldsymbol{c} \\end{equation*}\r\n", - "\\begin{equation*} \\bm{a (b\\W c\\W d)-b (a\\W c\\W d)+c (a\\W b\\W d)-d (a\\W b\\W c)} = 4 \\boldsymbol{a}\\wedge \\boldsymbol{b}\\wedge \\boldsymbol{c}\\wedge \\boldsymbol{d} \\end{equation*}\r\n", - "\\begin{equation*} \\bm{(a\\W b)\\cdot (c\\W d)} = - \\left ( a\\cdot c\\right ) \\left ( b\\cdot d\\right ) + \\left ( a\\cdot d\\right ) \\left ( b\\cdot c\\right ) \\end{equation*}\r\n", - "\\begin{equation*} \\bm{((a\\W b)\\cdot c)\\cdot d} = - \\left ( a\\cdot c\\right ) \\left ( b\\cdot d\\right ) + \\left ( a\\cdot d\\right ) \\left ( b\\cdot c\\right ) \\end{equation*}\r\n", - " \\begin{align*} \\bm{(a\\W b)\\times (c\\W d)} = & - \\left ( b\\cdot d\\right ) \\boldsymbol{a}\\wedge \\boldsymbol{c} \\\\ & + \\left ( b\\cdot c\\right ) \\boldsymbol{a}\\wedge \\boldsymbol{d} \\\\ & + \\left ( a\\cdot d\\right ) \\boldsymbol{b}\\wedge \\boldsymbol{c} \\\\ & - \\left ( a\\cdot c\\right ) \\boldsymbol{b}\\wedge \\boldsymbol{d} \\end{align*} \r\n", - "\\begin{equation*} E = \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{2}\\wedge \\boldsymbol{e}_{3} \\end{equation*}\r\n", - "\\begin{equation*} E^{2} = \\left ( e_{1}\\cdot e_{2}\\right ) ^{2} - 2 \\left ( e_{1}\\cdot e_{2}\\right ) \\left ( e_{1}\\cdot e_{3}\\right ) \\left ( e_{2}\\cdot e_{3}\\right ) + \\left ( e_{1}\\cdot e_{3}\\right ) ^{2} + \\left ( e_{2}\\cdot e_{3}\\right ) ^{2} - 1 \\end{equation*}\r\n", - " \\begin{align*} E1 = (e2\\W e3) E = & \\left ( \\left ( e_{2}\\cdot e_{3}\\right ) ^{2} - 1\\right ) \\boldsymbol{e}_{1} \\\\ & + \\left ( \\left ( e_{1}\\cdot e_{2}\\right ) - \\left ( e_{1}\\cdot e_{3}\\right ) \\left ( e_{2}\\cdot e_{3}\\right ) \\right ) \\boldsymbol{e}_{2} \\\\ & + \\left ( - \\left ( e_{1}\\cdot e_{2}\\right ) \\left ( e_{2}\\cdot e_{3}\\right ) + \\left ( e_{1}\\cdot e_{3}\\right ) \\right ) \\boldsymbol{e}_{3} \\end{align*} \r\n", - " \\begin{align*} E2 =-(e1\\W e3) E = & \\left ( \\left ( e_{1}\\cdot e_{2}\\right ) - \\left ( e_{1}\\cdot e_{3}\\right ) \\left ( e_{2}\\cdot e_{3}\\right ) \\right ) \\boldsymbol{e}_{1} \\\\ & + \\left ( \\left ( e_{1}\\cdot e_{3}\\right ) ^{2} - 1\\right ) \\boldsymbol{e}_{2} \\\\ & + \\left ( - \\left ( e_{1}\\cdot e_{2}\\right ) \\left ( e_{1}\\cdot e_{3}\\right ) + \\left ( e_{2}\\cdot e_{3}\\right ) \\right ) \\boldsymbol{e}_{3} \\end{align*} \r\n", - " \\begin{align*} E3 = (e1\\W e2) E = & \\left ( - \\left ( e_{1}\\cdot e_{2}\\right ) \\left ( e_{2}\\cdot e_{3}\\right ) + \\left ( e_{1}\\cdot e_{3}\\right ) \\right ) \\boldsymbol{e}_{1} \\\\ & + \\left ( - \\left ( e_{1}\\cdot e_{2}\\right ) \\left ( e_{1}\\cdot e_{3}\\right ) + \\left ( e_{2}\\cdot e_{3}\\right ) \\right ) \\boldsymbol{e}_{2} \\\\ & + \\left ( \\left ( e_{1}\\cdot e_{2}\\right ) ^{2} - 1\\right ) \\boldsymbol{e}_{3} \\end{align*} \r\n", - "\\begin{equation*} E1\\cdot e2 = 0 \\end{equation*}\r\n", - "\\begin{equation*} E1\\cdot e3 = 0 \\end{equation*}\r\n", - "\\begin{equation*} E2\\cdot e1 = 0 \\end{equation*}\r\n", - "\\begin{equation*} E2\\cdot e3 = 0 \\end{equation*}\r\n", - "\\begin{equation*} E3\\cdot e1 = 0 \\end{equation*}\r\n", - "\\begin{equation*} E3\\cdot e2 = 0 \\end{equation*}\r\n", - "\\begin{equation*} (E1\\cdot e1)/E^{2} = 1 \\end{equation*}\r\n", - "\\begin{equation*} (E2\\cdot e2)/E^{2} = 1 \\end{equation*}\r\n", - "\\begin{equation*} (E3\\cdot e3)/E^{2} = 1 \\end{equation*}\r\n", - " \\begin{align*} A = & A^{r} \\boldsymbol{e}_{r} \\\\ & + A^{\\theta } \\boldsymbol{e}_{\\theta } \\\\ & + A^{\\phi } \\boldsymbol{e}_{\\phi } \\end{align*} \r\n", - " \\begin{align*} B = & B^{r\\theta } \\boldsymbol{e}_{r}\\wedge \\boldsymbol{e}_{\\theta } \\\\ & + B^{r\\phi } \\boldsymbol{e}_{r}\\wedge \\boldsymbol{e}_{\\phi } \\\\ & + B^{\\theta \\phi } \\boldsymbol{e}_{\\theta }\\wedge \\boldsymbol{e}_{\\phi } \\end{align*} \r\n", - " \\begin{align*} \\boldsymbol{\\nabla} f = & \\partial_{r} f \\boldsymbol{e}_{r} \\\\ & + \\frac{\\partial_{\\theta } f }{r^{2}} \\boldsymbol{e}_{\\theta } \\\\ & + \\frac{\\partial_{\\phi } f }{r^{2} {\\sin{\\left (\\theta \\right )}}^{2}} \\boldsymbol{e}_{\\phi } \\end{align*} \r\n", - "\\begin{equation*} \\boldsymbol{\\nabla} \\cdot A = \\frac{A^{\\theta } }{\\tan{\\left (\\theta \\right )}} + \\partial_{\\phi } A^{\\phi } + \\partial_{r} A^{r} + \\partial_{\\theta } A^{\\theta } + \\frac{2 A^{r} }{r} \\end{equation*}\r\n", - " \\begin{align*} -I (\\boldsymbol{\\nabla} \\W A) = & \\frac{\\sqrt{r^{4} {\\sin{\\left (\\theta \\right )}}^{2}} \\left(\\frac{2 A^{\\phi } }{\\tan{\\left (\\theta \\right )}} + \\partial_{\\theta } A^{\\phi } - \\frac{\\partial_{\\phi } A^{\\theta } }{{\\sin{\\left (\\theta \\right )}}^{2}}\\right)}{r^{2}} \\boldsymbol{e}_{r} \\\\ & + \\frac{- r^{2} {\\sin{\\left (\\theta \\right )}}^{2} \\partial_{r} A^{\\phi } - 2 r A^{\\phi } {\\sin{\\left (\\theta \\right )}}^{2} + \\partial_{\\phi } A^{r} }{\\sqrt{r^{4} {\\sin{\\left (\\theta \\right )}}^{2}}} \\boldsymbol{e}_{\\theta } \\\\ & + \\frac{r^{2} \\partial_{r} A^{\\theta } + 2 r A^{\\theta } - \\partial_{\\theta } A^{r} }{\\sqrt{r^{4} {\\sin{\\left (\\theta \\right )}}^{2}}} \\boldsymbol{e}_{\\phi } \\end{align*} \r\n", - "\\begin{equation*} \\boldsymbol{\\nabla} \\W B = \\frac{r^{2} \\partial_{r} B^{\\theta \\phi } + 4 r B^{\\theta \\phi } - \\frac{2 B^{r\\phi } }{\\tan{\\left (\\theta \\right )}} - \\partial_{\\theta } B^{r\\phi } + \\frac{\\partial_{\\phi } B^{r\\theta } }{{\\sin{\\left (\\theta \\right )}}^{2}}}{r^{2}} \\boldsymbol{e}_{r}\\wedge \\boldsymbol{e}_{\\theta }\\wedge \\boldsymbol{e}_{\\phi } \\end{equation*}\r\n", - " \\begin{align*} B = \\bm{B\\gamma_{t}} = & - B^{x} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{x} \\\\ & - B^{y} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{y} \\\\ & - B^{z} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{z} \\end{align*} \r\n", - " \\begin{align*} E = \\bm{E\\gamma_{t}} = & - E^{x} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{x} \\\\ & - E^{y} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{y} \\\\ & - E^{z} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{z} \\end{align*} \r\n", - " \\begin{align*} F = E+IB = & - E^{x} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{x} \\\\ & - E^{y} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{y} \\\\ & - E^{z} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{z} \\\\ & - B^{z} \\boldsymbol{\\gamma }_{x}\\wedge \\boldsymbol{\\gamma }_{y} \\\\ & + B^{y} \\boldsymbol{\\gamma }_{x}\\wedge \\boldsymbol{\\gamma }_{z} \\\\ & - B^{x} \\boldsymbol{\\gamma }_{y}\\wedge \\boldsymbol{\\gamma }_{z} \\end{align*} \r\n", - " \\begin{align*} J = & J^{t} \\boldsymbol{\\gamma }_{t} \\\\ & + J^{x} \\boldsymbol{\\gamma }_{x} \\\\ & + J^{y} \\boldsymbol{\\gamma }_{y} \\\\ & + J^{z} \\boldsymbol{\\gamma }_{z} \\end{align*} \r\n", - "\\begin{equation*} \\boldsymbol{\\nabla} F = J \\end{equation*}\r\n", - " \\begin{align*} R = & \\cosh{\\left (\\frac{\\alpha }{2} \\right )} \\\\ & + \\sinh{\\left (\\frac{\\alpha }{2} \\right )} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{x} \\end{align*} \r\n", - "\\begin{equation*} t\\bm{\\gamma_{t}}+x\\bm{\\gamma_{x}} = t'\\bm{\\gamma'_{t}}+x'\\bm{\\gamma'_{x}} = R\\lp t'\\bm{\\gamma_{t}}+x'\\bm{\\gamma_{x}}\\rp R^{\\dagger} \\end{equation*}\r\n", - " \\begin{align*} t\\bm{\\gamma_{t}}+x\\bm{\\gamma_{x}} = & \\left ( 2 t' {\\sinh{\\left (\\frac{\\alpha }{2} \\right )}}^{2} + t' - x' \\sinh{\\left (\\alpha \\right )}\\right ) \\boldsymbol{\\gamma }_{t} \\\\ & + \\left ( - t' \\sinh{\\left (\\alpha \\right )} + 2 x' {\\sinh{\\left (\\frac{\\alpha }{2} \\right )}}^{2} + x'\\right ) \\boldsymbol{\\gamma }_{x} \\end{align*} \r\n", - "\\begin{equation*} \\f{\\sinh}{\\alpha} = \\gamma\\beta \\end{equation*}\r\n", - "\\begin{equation*} \\f{\\cosh}{\\alpha} = \\gamma \\end{equation*}\r\n", - " \\begin{align*} t\\bm{\\gamma_{t}}+x\\bm{\\gamma_{x}} = & \\left ( - \\beta \\gamma x' + 2 t' {\\sinh{\\left (\\frac{\\alpha }{2} \\right )}}^{2} + t'\\right ) \\boldsymbol{\\gamma }_{t} \\\\ & + \\left ( - \\beta \\gamma t' + 2 x' {\\sinh{\\left (\\frac{\\alpha }{2} \\right )}}^{2} + x'\\right ) \\boldsymbol{\\gamma }_{x} \\end{align*} \r\n", - " \\begin{align*} \\bm{A} = & A^{t} \\boldsymbol{\\gamma }_{t} \\\\ & + A^{x} \\boldsymbol{\\gamma }_{x} \\\\ & + A^{y} \\boldsymbol{\\gamma }_{y} \\\\ & + A^{z} \\boldsymbol{\\gamma }_{z} \\end{align*} \r\n", - " \\begin{align*} \\bm{\\psi} = & \\psi \\\\ & + \\psi ^{tx} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{x} \\\\ & + \\psi ^{ty} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{y} \\\\ & + \\psi ^{tz} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{z} \\\\ & + \\psi ^{xy} \\boldsymbol{\\gamma }_{x}\\wedge \\boldsymbol{\\gamma }_{y} \\\\ & + \\psi ^{xz} \\boldsymbol{\\gamma }_{x}\\wedge \\boldsymbol{\\gamma }_{z} \\\\ & + \\psi ^{yz} \\boldsymbol{\\gamma }_{y}\\wedge \\boldsymbol{\\gamma }_{z} \\\\ & + \\psi ^{txyz} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{x}\\wedge \\boldsymbol{\\gamma }_{y}\\wedge \\boldsymbol{\\gamma }_{z} \\end{align*} \r\n", - "\r\n", - "\\end{document}\r\n" - ] + "data": { + "text/plain": [ + "\n", + "\\documentclass[10pt,fleqn]{report}\n", + "\\usepackage[vcentering]{geometry}\n", + "\\geometry{papersize={14in,11in},total={13in,10in}}\n", + "\n", + "\\pagestyle{empty}\n", + "\\usepackage[latin1]{inputenc}\n", + "\\usepackage{amsmath}\n", + "\\usepackage{amsfonts}\n", + "\\usepackage{amssymb}\n", + "\\usepackage{amsbsy}\n", + "\\usepackage{tensor}\n", + "\\usepackage{listings}\n", + "\\usepackage{color}\n", + "\\usepackage{xcolor}\n", + "\\usepackage{bm}\n", + "\\usepackage{breqn}\n", + "\\definecolor{gray}{rgb}{0.95,0.95,0.95}\n", + "\\setlength{\\parindent}{0pt}\n", + "\\DeclareMathOperator{\\Tr}{Tr}\n", + "\\DeclareMathOperator{\\Adj}{Adj}\n", + "\\newcommand{\\bfrac}[2]{\\displaystyle\\frac{#1}{#2}}\n", + "\\newcommand{\\lp}{\\left (}\n", + "\\newcommand{\\rp}{\\right )}\n", + "\\newcommand{\\paren}[1]{\\lp {#1} \\rp}\n", + "\\newcommand{\\half}{\\frac{1}{2}}\n", + "\\newcommand{\\llt}{\\left <}\n", + "\\newcommand{\\rgt}{\\right >}\n", + "\\newcommand{\\abs}[1]{\\left |{#1}\\right | }\n", + "\\newcommand{\\pdiff}[2]{\\bfrac{\\partial {#1}}{\\partial {#2}}}\n", + "\\newcommand{\\lbrc}{\\left \\{}\n", + "\\newcommand{\\rbrc}{\\right \\}}\n", + "\\newcommand{\\W}{\\wedge}\n", + "\\newcommand{\\prm}[1]{{#1}'}\n", + "\\newcommand{\\ddt}[1]{\\bfrac{d{#1}}{dt}}\n", + "\\newcommand{\\R}{\\dagger}\n", + "\\newcommand{\\deriv}[3]{\\bfrac{d^{#3}#1}{d{#2}^{#3}}}\n", + "\\newcommand{\\grade}[1]{\\left < {#1} \\right >}\n", + "\\newcommand{\\f}[2]{{#1}\\lp{#2}\\rp}\n", + "\\newcommand{\\eval}[2]{\\left . {#1} \\right |_{#2}}\n", + "\\newcommand{\\Nabla}{\\boldsymbol{\\nabla}}\n", + "\\newcommand{\\eb}{\\boldsymbol{e}}\n", + "\\usepackage{float}\n", + "\\floatstyle{plain} % optionally change the style of the new float\n", + "\\newfloat{Code}{H}{myc}\n", + "\\lstloadlanguages{Python}\n", + "\n", + "\\begin{document}\n", + "\\begin{equation*} \\bm{A} = A + A^{x} \\boldsymbol{e}_{x} + A^{y} \\boldsymbol{e}_{y} + A^{z} \\boldsymbol{e}_{z} + A^{xy} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + A^{xz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + A^{yz} \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} + A^{xyz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\n", + " \\begin{align*} \\bm{A} = & A \\\\ & + A^{x} \\boldsymbol{e}_{x} + A^{y} \\boldsymbol{e}_{y} + A^{z} \\boldsymbol{e}_{z} \\\\ & + A^{xy} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + A^{xz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + A^{yz} \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\\\ & + A^{xyz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{align*} \n", + " \\begin{align*} \\bm{A} = & A \\\\ & + A^{x} \\boldsymbol{e}_{x} \\\\ & + A^{y} \\boldsymbol{e}_{y} \\\\ & + A^{z} \\boldsymbol{e}_{z} \\\\ & + A^{xy} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} \\\\ & + A^{xz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} \\\\ & + A^{yz} \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\\\ & + A^{xyz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{align*} \n", + " \\begin{align*} \\bm{A} = & A^{x} \\boldsymbol{e}_{x} \\\\ & + A^{y} \\boldsymbol{e}_{y} \\\\ & + A^{z} \\boldsymbol{e}_{z} \\end{align*} \n", + " \\begin{align*} \\bm{B} = & B^{xy} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} \\\\ & + B^{xz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} \\\\ & + B^{yz} \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{align*} \n", + " \\begin{align*} \\boldsymbol{\\nabla} f = & \\partial_{x} f \\boldsymbol{e}_{x} \\\\ & + \\partial_{y} f \\boldsymbol{e}_{y} \\\\ & + \\partial_{z} f \\boldsymbol{e}_{z} \\end{align*} \n", + "\\begin{equation*} \\boldsymbol{\\nabla} \\cdot \\bm{A} = \\partial_{x} A^{x} + \\partial_{y} A^{y} + \\partial_{z} A^{z} \\end{equation*}\n", + " \\begin{align*} \\boldsymbol{\\nabla} \\bm{A} = & \\left ( \\partial_{x} A^{x} + \\partial_{y} A^{y} + \\partial_{z} A^{z} \\right ) \\\\ & + \\left ( - \\partial_{y} A^{x} + \\partial_{x} A^{y} \\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} \\\\ & + \\left ( - \\partial_{z} A^{x} + \\partial_{x} A^{z} \\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} \\\\ & + \\left ( - \\partial_{z} A^{y} + \\partial_{y} A^{z} \\right ) \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{align*} \n", + " \\begin{align*} -I (\\boldsymbol{\\nabla} \\W \\bm{A}) = & \\left ( - \\partial_{z} A^{y} + \\partial_{y} A^{z} \\right ) \\boldsymbol{e}_{x} \\\\ & + \\left ( \\partial_{z} A^{x} - \\partial_{x} A^{z} \\right ) \\boldsymbol{e}_{y} \\\\ & + \\left ( - \\partial_{y} A^{x} + \\partial_{x} A^{y} \\right ) \\boldsymbol{e}_{z} \\end{align*} \n", + " \\begin{align*} \\boldsymbol{\\nabla} \\bm{B} = & \\left ( - \\partial_{y} B^{xy} - \\partial_{z} B^{xz} \\right ) \\boldsymbol{e}_{x} \\\\ & + \\left ( \\partial_{x} B^{xy} - \\partial_{z} B^{yz} \\right ) \\boldsymbol{e}_{y} \\\\ & + \\left ( \\partial_{x} B^{xz} + \\partial_{y} B^{yz} \\right ) \\boldsymbol{e}_{z} \\\\ & + \\left ( \\partial_{z} B^{xy} - \\partial_{y} B^{xz} + \\partial_{x} B^{yz} \\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{align*} \n", + "\\begin{equation*} \\boldsymbol{\\nabla} \\W \\bm{B} = \\left ( \\partial_{z} B^{xy} - \\partial_{y} B^{xz} + \\partial_{x} B^{yz} \\right ) \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\n", + " \\begin{align*} \\boldsymbol{\\nabla} \\cdot \\bm{B} = & \\left ( - \\partial_{y} B^{xy} - \\partial_{z} B^{xz} \\right ) \\boldsymbol{e}_{x} \\\\ & + \\left ( \\partial_{x} B^{xy} - \\partial_{z} B^{yz} \\right ) \\boldsymbol{e}_{y} \\\\ & + \\left ( \\partial_{x} B^{xz} + \\partial_{y} B^{yz} \\right ) \\boldsymbol{e}_{z} \\end{align*} \n", + "\\begin{equation*} g_{ij} = \\left [ \\begin{array}{cccc} \\left ( a\\cdot a\\right ) & \\left ( a\\cdot b\\right ) & \\left ( a\\cdot c\\right ) & \\left ( a\\cdot d\\right ) \\\\ \\left ( a\\cdot b\\right ) & \\left ( b\\cdot b\\right ) & \\left ( b\\cdot c\\right ) & \\left ( b\\cdot d\\right ) \\\\ \\left ( a\\cdot c\\right ) & \\left ( b\\cdot c\\right ) & \\left ( c\\cdot c\\right ) & \\left ( c\\cdot d\\right ) \\\\ \\left ( a\\cdot d\\right ) & \\left ( b\\cdot d\\right ) & \\left ( c\\cdot d\\right ) & \\left ( d\\cdot d\\right ) \\end{array}\\right ] \\end{equation*}\n", + " \\begin{align*} \\bm{a\\cdot (b c)} = & - \\left ( a\\cdot c\\right ) \\boldsymbol{b} \\\\ & + \\left ( a\\cdot b\\right ) \\boldsymbol{c} \\end{align*} \n", + " \\begin{align*} \\bm{a\\cdot (b\\W c)} = & - \\left ( a\\cdot c\\right ) \\boldsymbol{b} \\\\ & + \\left ( a\\cdot b\\right ) \\boldsymbol{c} \\end{align*} \n", + " \\begin{align*} \\bm{a\\cdot (b\\W c\\W d)} = & \\left ( a\\cdot d\\right ) \\boldsymbol{b}\\wedge \\boldsymbol{c} \\\\ & - \\left ( a\\cdot c\\right ) \\boldsymbol{b}\\wedge \\boldsymbol{d} \\\\ & + \\left ( a\\cdot b\\right ) \\boldsymbol{c}\\wedge \\boldsymbol{d} \\end{align*} \n", + "\\begin{equation*} \\bm{a\\cdot (b\\W c)+c\\cdot (a\\W b)+b\\cdot (c\\W a)} = 0 \\end{equation*}\n", + "\\begin{equation*} \\bm{a (b\\W c)-b (a\\W c)+c (a\\W b)} = 3 \\boldsymbol{a}\\wedge \\boldsymbol{b}\\wedge \\boldsymbol{c} \\end{equation*}\n", + "\\begin{equation*} \\bm{a (b\\W c\\W d)-b (a\\W c\\W d)+c (a\\W b\\W d)-d (a\\W b\\W c)} = 4 \\boldsymbol{a}\\wedge \\boldsymbol{b}\\wedge \\boldsymbol{c}\\wedge \\boldsymbol{d} \\end{equation*}\n", + "\\begin{equation*} \\bm{(a\\W b)\\cdot (c\\W d)} = - \\left ( a\\cdot c\\right ) \\left ( b\\cdot d\\right ) + \\left ( a\\cdot d\\right ) \\left ( b\\cdot c\\right ) \\end{equation*}\n", + "\\begin{equation*} \\bm{((a\\W b)\\cdot c)\\cdot d} = - \\left ( a\\cdot c\\right ) \\left ( b\\cdot d\\right ) + \\left ( a\\cdot d\\right ) \\left ( b\\cdot c\\right ) \\end{equation*}\n", + " \\begin{align*} \\bm{(a\\W b)\\times (c\\W d)} = & - \\left ( b\\cdot d\\right ) \\boldsymbol{a}\\wedge \\boldsymbol{c} \\\\ & + \\left ( b\\cdot c\\right ) \\boldsymbol{a}\\wedge \\boldsymbol{d} \\\\ & + \\left ( a\\cdot d\\right ) \\boldsymbol{b}\\wedge \\boldsymbol{c} \\\\ & - \\left ( a\\cdot c\\right ) \\boldsymbol{b}\\wedge \\boldsymbol{d} \\end{align*} \n", + "\\begin{equation*} E = \\boldsymbol{e}_{1}\\wedge \\boldsymbol{e}_{2}\\wedge \\boldsymbol{e}_{3} \\end{equation*}\n", + "\\begin{equation*} E^{2} = \\left ( e_{1}\\cdot e_{2}\\right ) ^{2} - 2 \\left ( e_{1}\\cdot e_{2}\\right ) \\left ( e_{1}\\cdot e_{3}\\right ) \\left ( e_{2}\\cdot e_{3}\\right ) + \\left ( e_{1}\\cdot e_{3}\\right ) ^{2} + \\left ( e_{2}\\cdot e_{3}\\right ) ^{2} - 1 \\end{equation*}\n", + " \\begin{align*} E1 = (e2\\W e3) E = & \\left ( \\left ( e_{2}\\cdot e_{3}\\right ) ^{2} - 1\\right ) \\boldsymbol{e}_{1} \\\\ & + \\left ( \\left ( e_{1}\\cdot e_{2}\\right ) - \\left ( e_{1}\\cdot e_{3}\\right ) \\left ( e_{2}\\cdot e_{3}\\right ) \\right ) \\boldsymbol{e}_{2} \\\\ & + \\left ( - \\left ( e_{1}\\cdot e_{2}\\right ) \\left ( e_{2}\\cdot e_{3}\\right ) + \\left ( e_{1}\\cdot e_{3}\\right ) \\right ) \\boldsymbol{e}_{3} \\end{align*} \n", + " \\begin{align*} E2 =-(e1\\W e3) E = & \\left ( \\left ( e_{1}\\cdot e_{2}\\right ) - \\left ( e_{1}\\cdot e_{3}\\right ) \\left ( e_{2}\\cdot e_{3}\\right ) \\right ) \\boldsymbol{e}_{1} \\\\ & + \\left ( \\left ( e_{1}\\cdot e_{3}\\right ) ^{2} - 1\\right ) \\boldsymbol{e}_{2} \\\\ & + \\left ( - \\left ( e_{1}\\cdot e_{2}\\right ) \\left ( e_{1}\\cdot e_{3}\\right ) + \\left ( e_{2}\\cdot e_{3}\\right ) \\right ) \\boldsymbol{e}_{3} \\end{align*} \n", + " \\begin{align*} E3 = (e1\\W e2) E = & \\left ( - \\left ( e_{1}\\cdot e_{2}\\right ) \\left ( e_{2}\\cdot e_{3}\\right ) + \\left ( e_{1}\\cdot e_{3}\\right ) \\right ) \\boldsymbol{e}_{1} \\\\ & + \\left ( - \\left ( e_{1}\\cdot e_{2}\\right ) \\left ( e_{1}\\cdot e_{3}\\right ) + \\left ( e_{2}\\cdot e_{3}\\right ) \\right ) \\boldsymbol{e}_{2} \\\\ & + \\left ( \\left ( e_{1}\\cdot e_{2}\\right ) ^{2} - 1\\right ) \\boldsymbol{e}_{3} \\end{align*} \n", + "\\begin{equation*} E1\\cdot e2 = 0 \\end{equation*}\n", + "\\begin{equation*} E1\\cdot e3 = 0 \\end{equation*}\n", + "\\begin{equation*} E2\\cdot e1 = 0 \\end{equation*}\n", + "\\begin{equation*} E2\\cdot e3 = 0 \\end{equation*}\n", + "\\begin{equation*} E3\\cdot e1 = 0 \\end{equation*}\n", + "\\begin{equation*} E3\\cdot e2 = 0 \\end{equation*}\n", + "\\begin{equation*} (E1\\cdot e1)/E^{2} = 1 \\end{equation*}\n", + "\\begin{equation*} (E2\\cdot e2)/E^{2} = 1 \\end{equation*}\n", + "\\begin{equation*} (E3\\cdot e3)/E^{2} = 1 \\end{equation*}\n", + " \\begin{align*} A = & A^{r} \\boldsymbol{e}_{r} \\\\ & + A^{\\theta } \\boldsymbol{e}_{\\theta } \\\\ & + A^{\\phi } \\boldsymbol{e}_{\\phi } \\end{align*} \n", + " \\begin{align*} B = & B^{r\\theta } \\boldsymbol{e}_{r}\\wedge \\boldsymbol{e}_{\\theta } \\\\ & + B^{r\\phi } \\boldsymbol{e}_{r}\\wedge \\boldsymbol{e}_{\\phi } \\\\ & + B^{\\theta \\phi } \\boldsymbol{e}_{\\theta }\\wedge \\boldsymbol{e}_{\\phi } \\end{align*} \n", + " \\begin{align*} \\boldsymbol{\\nabla} f = & \\partial_{r} f \\boldsymbol{e}_{r} \\\\ & + \\frac{\\partial_{\\theta } f }{r^{2}} \\boldsymbol{e}_{\\theta } \\\\ & + \\frac{\\partial_{\\phi } f }{r^{2} {\\sin{\\left (\\theta \\right )}}^{2}} \\boldsymbol{e}_{\\phi } \\end{align*} \n", + "\\begin{equation*} \\boldsymbol{\\nabla} \\cdot A = \\frac{A^{\\theta } }{\\tan{\\left (\\theta \\right )}} + \\partial_{\\phi } A^{\\phi } + \\partial_{r} A^{r} + \\partial_{\\theta } A^{\\theta } + \\frac{2 A^{r} }{r} \\end{equation*}\n", + " \\begin{align*} -I (\\boldsymbol{\\nabla} \\W A) = & \\frac{\\sqrt{r^{4} {\\sin{\\left (\\theta \\right )}}^{2}} \\left(\\frac{2 A^{\\phi } }{\\tan{\\left (\\theta \\right )}} + \\partial_{\\theta } A^{\\phi } - \\frac{\\partial_{\\phi } A^{\\theta } }{{\\sin{\\left (\\theta \\right )}}^{2}}\\right)}{r^{2}} \\boldsymbol{e}_{r} \\\\ & + \\frac{- r^{2} {\\sin{\\left (\\theta \\right )}}^{2} \\partial_{r} A^{\\phi } - 2 r A^{\\phi } {\\sin{\\left (\\theta \\right )}}^{2} + \\partial_{\\phi } A^{r} }{\\sqrt{r^{4} {\\sin{\\left (\\theta \\right )}}^{2}}} \\boldsymbol{e}_{\\theta } \\\\ & + \\frac{r^{2} \\partial_{r} A^{\\theta } + 2 r A^{\\theta } - \\partial_{\\theta } A^{r} }{\\sqrt{r^{4} {\\sin{\\left (\\theta \\right )}}^{2}}} \\boldsymbol{e}_{\\phi } \\end{align*} \n", + "\\begin{equation*} \\boldsymbol{\\nabla} \\W B = \\frac{r^{2} \\partial_{r} B^{\\theta \\phi } + 4 r B^{\\theta \\phi } - \\frac{2 B^{r\\phi } }{\\tan{\\left (\\theta \\right )}} - \\partial_{\\theta } B^{r\\phi } + \\frac{\\partial_{\\phi } B^{r\\theta } }{{\\sin{\\left (\\theta \\right )}}^{2}}}{r^{2}} \\boldsymbol{e}_{r}\\wedge \\boldsymbol{e}_{\\theta }\\wedge \\boldsymbol{e}_{\\phi } \\end{equation*}\n", + " \\begin{align*} B = \\bm{B\\gamma_{t}} = & - B^{x} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{x} \\\\ & - B^{y} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{y} \\\\ & - B^{z} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{z} \\end{align*} \n", + " \\begin{align*} E = \\bm{E\\gamma_{t}} = & - E^{x} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{x} \\\\ & - E^{y} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{y} \\\\ & - E^{z} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{z} \\end{align*} \n", + " \\begin{align*} F = E+IB = & - E^{x} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{x} \\\\ & - E^{y} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{y} \\\\ & - E^{z} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{z} \\\\ & - B^{z} \\boldsymbol{\\gamma }_{x}\\wedge \\boldsymbol{\\gamma }_{y} \\\\ & + B^{y} \\boldsymbol{\\gamma }_{x}\\wedge \\boldsymbol{\\gamma }_{z} \\\\ & - B^{x} \\boldsymbol{\\gamma }_{y}\\wedge \\boldsymbol{\\gamma }_{z} \\end{align*} \n", + " \\begin{align*} J = & J^{t} \\boldsymbol{\\gamma }_{t} \\\\ & + J^{x} \\boldsymbol{\\gamma }_{x} \\\\ & + J^{y} \\boldsymbol{\\gamma }_{y} \\\\ & + J^{z} \\boldsymbol{\\gamma }_{z} \\end{align*} \n", + "\\begin{equation*} \\boldsymbol{\\nabla} F = J \\end{equation*}\n", + " \\begin{align*} R = & \\cosh{\\left (\\frac{\\alpha }{2} \\right )} \\\\ & + \\sinh{\\left (\\frac{\\alpha }{2} \\right )} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{x} \\end{align*} \n", + "\\begin{equation*} t\\bm{\\gamma_{t}}+x\\bm{\\gamma_{x}} = t'\\bm{\\gamma'_{t}}+x'\\bm{\\gamma'_{x}} = R\\lp t'\\bm{\\gamma_{t}}+x'\\bm{\\gamma_{x}}\\rp R^{\\dagger} \\end{equation*}\n", + " \\begin{align*} t\\bm{\\gamma_{t}}+x\\bm{\\gamma_{x}} = & \\left ( 2 t' {\\sinh{\\left (\\frac{\\alpha }{2} \\right )}}^{2} + t' - x' \\sinh{\\left (\\alpha \\right )}\\right ) \\boldsymbol{\\gamma }_{t} \\\\ & + \\left ( - t' \\sinh{\\left (\\alpha \\right )} + 2 x' {\\sinh{\\left (\\frac{\\alpha }{2} \\right )}}^{2} + x'\\right ) \\boldsymbol{\\gamma }_{x} \\end{align*} \n", + "\\begin{equation*} \\f{\\sinh}{\\alpha} = \\gamma\\beta \\end{equation*}\n", + "\\begin{equation*} \\f{\\cosh}{\\alpha} = \\gamma \\end{equation*}\n", + " \\begin{align*} t\\bm{\\gamma_{t}}+x\\bm{\\gamma_{x}} = & \\left ( - \\beta \\gamma x' + 2 t' {\\sinh{\\left (\\frac{\\alpha }{2} \\right )}}^{2} + t'\\right ) \\boldsymbol{\\gamma }_{t} \\\\ & + \\left ( - \\beta \\gamma t' + 2 x' {\\sinh{\\left (\\frac{\\alpha }{2} \\right )}}^{2} + x'\\right ) \\boldsymbol{\\gamma }_{x} \\end{align*} \n", + " \\begin{align*} \\bm{A} = & A^{t} \\boldsymbol{\\gamma }_{t} \\\\ & + A^{x} \\boldsymbol{\\gamma }_{x} \\\\ & + A^{y} \\boldsymbol{\\gamma }_{y} \\\\ & + A^{z} \\boldsymbol{\\gamma }_{z} \\end{align*} \n", + " \\begin{align*} \\bm{\\psi} = & \\psi \\\\ & + \\psi ^{tx} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{x} \\\\ & + \\psi ^{ty} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{y} \\\\ & + \\psi ^{tz} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{z} \\\\ & + \\psi ^{xy} \\boldsymbol{\\gamma }_{x}\\wedge \\boldsymbol{\\gamma }_{y} \\\\ & + \\psi ^{xz} \\boldsymbol{\\gamma }_{x}\\wedge \\boldsymbol{\\gamma }_{z} \\\\ & + \\psi ^{yz} \\boldsymbol{\\gamma }_{y}\\wedge \\boldsymbol{\\gamma }_{z} \\\\ & + \\psi ^{txyz} \\boldsymbol{\\gamma }_{t}\\wedge \\boldsymbol{\\gamma }_{x}\\wedge \\boldsymbol{\\gamma }_{y}\\wedge \\boldsymbol{\\gamma }_{z} \\end{align*} \n", + "\n", + "\\end{document}\n" + ] + }, + "metadata": {}, + "output_type": "display_data" } ], "source": [ - "!cat print_check_latex.tex" + "check_latex('print_check_latex')" ] }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 10, "metadata": {}, "outputs": [ { @@ -944,9 +930,8 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 11, "metadata": { - "collapsed": false, "scrolled": false }, "outputs": [ @@ -1027,7 +1012,7 @@ "s*grad = \\boldsymbol{e}_{x}*s {\\left (x,y,z \\right )} \\frac{\\partial}{\\partial x} + \\boldsymbol{e}_{y}*s {\\left (x,y,z \\right )} \\frac{\\partial}{\\partial y} + \\boldsymbol{e}_{z}*s {\\left (x,y,z \\right )} \\frac{\\partial}{\\partial z}\n", "s^grad = \\boldsymbol{e}_{x}*s {\\left (x,y,z \\right )} \\frac{\\partial}{\\partial x} + \\boldsymbol{e}_{y}*s {\\left (x,y,z \\right )} \\frac{\\partial}{\\partial y} + \\boldsymbol{e}_{z}*s {\\left (x,y,z \\right )} \\frac{\\partial}{\\partial z}\n", "sgrad = \n", + "s>grad = 0 \n", "s*s = s**2\n", "s^s = s**2\n", "sgrad = \\boldsymbol{e}_{x}*(b^{xy} {\\left (x,y,z \\right )} \\frac{\\partial}{\\partial y} + b^{xz} {\\left (x,y,z \\right )} \\frac{\\partial}{\\partial z}) + \\boldsymbol{e}_{y}*(- b^{xy} {\\left (x,y,z \\right )} \\frac{\\partial}{\\partial x} + b^{yz} {\\left (x,y,z \\right )} \\frac{\\partial}{\\partial z}) + \\boldsymbol{e}_{z}*(- b^{xz} {\\left (x,y,z \\right )} \\frac{\\partial}{\\partial x} - b^{yz} {\\left (x,y,z \\right )} \\frac{\\partial}{\\partial y})\n", "b*s = b__xy*s*e_x^e_y + b__xz*s*e_x^e_z + b__yz*s*e_y^e_z\n", "b^s = b__xy*s*e_x^e_y + b__xz*s*e_x^e_z + b__yz*s*e_y^e_z\n", @@ -1100,7 +1085,7 @@ "s*grad = \\boldsymbol{e}_{x}*(\\frac{\\left ( e_{y}\\cdot e_{y}\\right ) s {\\left (x,y \\right )}}{\\left ( e_{x}\\cdot e_{x}\\right ) \\left ( e_{y}\\cdot e_{y}\\right ) - \\left ( e_{x}\\cdot e_{y}\\right ) ^{2}} \\frac{\\partial}{\\partial x} - \\frac{\\left ( e_{x}\\cdot e_{y}\\right ) s {\\left (x,y \\right )}}{\\left ( e_{x}\\cdot e_{x}\\right ) \\left ( e_{y}\\cdot e_{y}\\right ) - \\left ( e_{x}\\cdot e_{y}\\right ) ^{2}} \\frac{\\partial}{\\partial y}) + \\boldsymbol{e}_{y}*(- \\frac{\\left ( e_{x}\\cdot e_{y}\\right ) s {\\left (x,y \\right )}}{\\left ( e_{x}\\cdot e_{x}\\right ) \\left ( e_{y}\\cdot e_{y}\\right ) - \\left ( e_{x}\\cdot e_{y}\\right ) ^{2}} \\frac{\\partial}{\\partial x} + \\frac{\\left ( e_{x}\\cdot e_{x}\\right ) s {\\left (x,y \\right )}}{\\left ( e_{x}\\cdot e_{x}\\right ) \\left ( e_{y}\\cdot e_{y}\\right ) - \\left ( e_{x}\\cdot e_{y}\\right ) ^{2}} \\frac{\\partial}{\\partial y})\n", "s^grad = \\boldsymbol{e}_{x}*(\\frac{\\left ( e_{y}\\cdot e_{y}\\right ) s {\\left (x,y \\right )}}{\\left ( e_{x}\\cdot e_{x}\\right ) \\left ( e_{y}\\cdot e_{y}\\right ) - \\left ( e_{x}\\cdot e_{y}\\right ) ^{2}} \\frac{\\partial}{\\partial x} - \\frac{\\left ( e_{x}\\cdot e_{y}\\right ) s {\\left (x,y \\right )}}{\\left ( e_{x}\\cdot e_{x}\\right ) \\left ( e_{y}\\cdot e_{y}\\right ) - \\left ( e_{x}\\cdot e_{y}\\right ) ^{2}} \\frac{\\partial}{\\partial y}) + \\boldsymbol{e}_{y}*(- \\frac{\\left ( e_{x}\\cdot e_{y}\\right ) s {\\left (x,y \\right )}}{\\left ( e_{x}\\cdot e_{x}\\right ) \\left ( e_{y}\\cdot e_{y}\\right ) - \\left ( e_{x}\\cdot e_{y}\\right ) ^{2}} \\frac{\\partial}{\\partial x} + \\frac{\\left ( e_{x}\\cdot e_{x}\\right ) s {\\left (x,y \\right )}}{\\left ( e_{x}\\cdot e_{x}\\right ) \\left ( e_{y}\\cdot e_{y}\\right ) - \\left ( e_{x}\\cdot e_{y}\\right ) ^{2}} \\frac{\\partial}{\\partial y})\n", "sgrad = \n", + "s>grad = 0 \n", "s*s = s**2\n", "s^s = s**2\n", "s}\r\n", - "\\newcommand{\\abs}[1]{\\left |{#1}\\right | }\r\n", - "\\newcommand{\\pdiff}[2]{\\bfrac{\\partial {#1}}{\\partial {#2}}}\r\n", - "\\newcommand{\\lbrc}{\\left \\{}\r\n", - "\\newcommand{\\rbrc}{\\right \\}}\r\n", - "\\newcommand{\\W}{\\wedge}\r\n", - "\\newcommand{\\prm}[1]{{#1}'}\r\n", - "\\newcommand{\\ddt}[1]{\\bfrac{d{#1}}{dt}}\r\n", - "\\newcommand{\\R}{\\dagger}\r\n", - "\\newcommand{\\deriv}[3]{\\bfrac{d^{#3}#1}{d{#2}^{#3}}}\r\n", - "\\newcommand{\\grade}[1]{\\left < {#1} \\right >}\r\n", - "\\newcommand{\\f}[2]{{#1}\\lp{#2}\\rp}\r\n", - "\\newcommand{\\eval}[2]{\\left . {#1} \\right |_{#2}}\r\n", - "\\newcommand{\\Nabla}{\\boldsymbol{\\nabla}}\r\n", - "\\newcommand{\\eb}{\\boldsymbol{e}}\r\n", - "\\usepackage{float}\r\n", - "\\floatstyle{plain} % optionally change the style of the new float\r\n", - "\\newfloat{Code}{H}{myc}\r\n", - "\\lstloadlanguages{Python}\r\n", - "\r\n", - "\\begin{document}\r\n", - "\\begin{equation*} a = a^{x} \\boldsymbol{e}_{x} + a^{y} \\boldsymbol{e}_{y} + a^{z} \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} b = \\boldsymbol{e}_{x} + \\boldsymbol{e}_{y} + \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} c = c^{w} \\boldsymbol{e}_{w} + c^{x} \\boldsymbol{e}_{x} + c^{y} \\boldsymbol{e}_{y} + c^{z} \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} a\\mbox{ reflect in }xy = a^{x} \\boldsymbol{e}_{x} + a^{y} \\boldsymbol{e}_{y} - a^{z} \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} a\\mbox{ reflect in }yz = - a^{x} \\boldsymbol{e}_{x} + a^{y} \\boldsymbol{e}_{y} + a^{z} \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} a\\mbox{ reflect in }zx = a^{x} \\boldsymbol{e}_{x} - a^{y} \\boldsymbol{e}_{y} + a^{z} \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} a\\mbox{ reflect in plane }(x=y) = a^{y} \\boldsymbol{e}_{x} + a^{x} \\boldsymbol{e}_{y} + a^{z} \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} b\\mbox{ reflect in plane }(x+y+z=0) = - \\boldsymbol{e}_{x} - \\boldsymbol{e}_{y} - \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} \\mbox{Reflect in }\\bm{e}_{x} = a^{x} \\boldsymbol{e}_{x} - a^{y} \\boldsymbol{e}_{y} - a^{z} \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} \\mbox{Reflect in }\\bm{e}_{y} = - a^{x} \\boldsymbol{e}_{x} + a^{y} \\boldsymbol{e}_{y} - a^{z} \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} \\mbox{Reflect in }\\bm{e}_{z} = - a^{x} \\boldsymbol{e}_{x} - a^{y} \\boldsymbol{e}_{y} + a^{z} \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} c\\mbox{ reflect in }xy = - c^{w} \\boldsymbol{e}_{w} + c^{x} \\boldsymbol{e}_{x} + c^{y} \\boldsymbol{e}_{y} - c^{z} \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} c\\mbox{ reflect in }xyz = - c^{w} \\boldsymbol{e}_{w} + c^{x} \\boldsymbol{e}_{x} + c^{y} \\boldsymbol{e}_{y} + c^{z} \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} wx\\mbox{ reflect in }yz = \\boldsymbol{e}_{w}\\wedge \\boldsymbol{e}_{x} \\end{equation*}\r\n", - "\\begin{equation*} wx\\mbox{ reflect in }xy = - \\boldsymbol{e}_{w}\\wedge \\boldsymbol{e}_{x} \\end{equation*}\r\n", - "\\end{document}\r\n" - ] + "data": { + "text/plain": [ + "\n", + "\\documentclass[10pt,fleqn]{report}\n", + "\\usepackage[vcentering]{geometry}\n", + "\\geometry{papersize={14in,11in},total={13in,10in}}\n", + "\n", + "\\pagestyle{empty}\n", + "\\usepackage[latin1]{inputenc}\n", + "\\usepackage{amsmath}\n", + "\\usepackage{amsfonts}\n", + "\\usepackage{amssymb}\n", + "\\usepackage{amsbsy}\n", + "\\usepackage{tensor}\n", + "\\usepackage{listings}\n", + "\\usepackage{color}\n", + "\\usepackage{xcolor}\n", + "\\usepackage{bm}\n", + "\\usepackage{breqn}\n", + "\\definecolor{gray}{rgb}{0.95,0.95,0.95}\n", + "\\setlength{\\parindent}{0pt}\n", + "\\DeclareMathOperator{\\Tr}{Tr}\n", + "\\DeclareMathOperator{\\Adj}{Adj}\n", + "\\newcommand{\\bfrac}[2]{\\displaystyle\\frac{#1}{#2}}\n", + "\\newcommand{\\lp}{\\left (}\n", + "\\newcommand{\\rp}{\\right )}\n", + "\\newcommand{\\paren}[1]{\\lp {#1} \\rp}\n", + "\\newcommand{\\half}{\\frac{1}{2}}\n", + "\\newcommand{\\llt}{\\left <}\n", + "\\newcommand{\\rgt}{\\right >}\n", + "\\newcommand{\\abs}[1]{\\left |{#1}\\right | }\n", + "\\newcommand{\\pdiff}[2]{\\bfrac{\\partial {#1}}{\\partial {#2}}}\n", + "\\newcommand{\\lbrc}{\\left \\{}\n", + "\\newcommand{\\rbrc}{\\right \\}}\n", + "\\newcommand{\\W}{\\wedge}\n", + "\\newcommand{\\prm}[1]{{#1}'}\n", + "\\newcommand{\\ddt}[1]{\\bfrac{d{#1}}{dt}}\n", + "\\newcommand{\\R}{\\dagger}\n", + "\\newcommand{\\deriv}[3]{\\bfrac{d^{#3}#1}{d{#2}^{#3}}}\n", + "\\newcommand{\\grade}[1]{\\left < {#1} \\right >}\n", + "\\newcommand{\\f}[2]{{#1}\\lp{#2}\\rp}\n", + "\\newcommand{\\eval}[2]{\\left . {#1} \\right |_{#2}}\n", + "\\newcommand{\\Nabla}{\\boldsymbol{\\nabla}}\n", + "\\newcommand{\\eb}{\\boldsymbol{e}}\n", + "\\usepackage{float}\n", + "\\floatstyle{plain} % optionally change the style of the new float\n", + "\\newfloat{Code}{H}{myc}\n", + "\\lstloadlanguages{Python}\n", + "\n", + "\\begin{document}\n", + "\\begin{equation*} a = a^{x} \\boldsymbol{e}_{x} + a^{y} \\boldsymbol{e}_{y} + a^{z} \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} b = \\boldsymbol{e}_{x} + \\boldsymbol{e}_{y} + \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} c = c^{w} \\boldsymbol{e}_{w} + c^{x} \\boldsymbol{e}_{x} + c^{y} \\boldsymbol{e}_{y} + c^{z} \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} a\\mbox{ reflect in }xy = a^{x} \\boldsymbol{e}_{x} + a^{y} \\boldsymbol{e}_{y} - a^{z} \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} a\\mbox{ reflect in }yz = - a^{x} \\boldsymbol{e}_{x} + a^{y} \\boldsymbol{e}_{y} + a^{z} \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} a\\mbox{ reflect in }zx = a^{x} \\boldsymbol{e}_{x} - a^{y} \\boldsymbol{e}_{y} + a^{z} \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} a\\mbox{ reflect in plane }(x=y) = a^{y} \\boldsymbol{e}_{x} + a^{x} \\boldsymbol{e}_{y} + a^{z} \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} b\\mbox{ reflect in plane }(x+y+z=0) = - \\boldsymbol{e}_{x} - \\boldsymbol{e}_{y} - \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} \\mbox{Reflect in }\\bm{e}_{x} = a^{x} \\boldsymbol{e}_{x} - a^{y} \\boldsymbol{e}_{y} - a^{z} \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} \\mbox{Reflect in }\\bm{e}_{y} = - a^{x} \\boldsymbol{e}_{x} + a^{y} \\boldsymbol{e}_{y} - a^{z} \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} \\mbox{Reflect in }\\bm{e}_{z} = - a^{x} \\boldsymbol{e}_{x} - a^{y} \\boldsymbol{e}_{y} + a^{z} \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} c\\mbox{ reflect in }xy = - c^{w} \\boldsymbol{e}_{w} + c^{x} \\boldsymbol{e}_{x} + c^{y} \\boldsymbol{e}_{y} - c^{z} \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} c\\mbox{ reflect in }xyz = - c^{w} \\boldsymbol{e}_{w} + c^{x} \\boldsymbol{e}_{x} + c^{y} \\boldsymbol{e}_{y} + c^{z} \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} wx\\mbox{ reflect in }yz = \\boldsymbol{e}_{w}\\wedge \\boldsymbol{e}_{x} \\end{equation*}\n", + "\\begin{equation*} wx\\mbox{ reflect in }xy = - \\boldsymbol{e}_{w}\\wedge \\boldsymbol{e}_{x} \\end{equation*}\n", + "\\end{document}\n" + ] + }, + "metadata": {}, + "output_type": "display_data" } ], "source": [ - "!cat reflect_test.tex" - ] - }, - { - "cell_type": "code", - "execution_count": 18, - "metadata": {}, - "outputs": [], - "source": [ - "!python simple_check_latex.py" + "check_latex('reflect_test')" ] }, { "cell_type": "code", - "execution_count": 19, + "execution_count": 13, "metadata": {}, "outputs": [ { - "name": "stdout", - "output_type": "stream", - "text": [ - "\r\n", - "\\documentclass[10pt,fleqn]{report}\r\n", - "\\usepackage[vcentering]{geometry}\r\n", - "\\geometry{papersize={14in,11in},total={13in,10in}}\r\n", - "\r\n", - "\\pagestyle{empty}\r\n", - "\\usepackage[latin1]{inputenc}\r\n", - "\\usepackage{amsmath}\r\n", - "\\usepackage{amsfonts}\r\n", - "\\usepackage{amssymb}\r\n", - "\\usepackage{amsbsy}\r\n", - "\\usepackage{tensor}\r\n", - "\\usepackage{listings}\r\n", - "\\usepackage{color}\r\n", - "\\usepackage{xcolor}\r\n", - "\\usepackage{bm}\r\n", - "\\usepackage{breqn}\r\n", - "\\definecolor{gray}{rgb}{0.95,0.95,0.95}\r\n", - "\\setlength{\\parindent}{0pt}\r\n", - "\\DeclareMathOperator{\\Tr}{Tr}\r\n", - "\\DeclareMathOperator{\\Adj}{Adj}\r\n", - "\\newcommand{\\bfrac}[2]{\\displaystyle\\frac{#1}{#2}}\r\n", - "\\newcommand{\\lp}{\\left (}\r\n", - "\\newcommand{\\rp}{\\right )}\r\n", - "\\newcommand{\\paren}[1]{\\lp {#1} \\rp}\r\n", - "\\newcommand{\\half}{\\frac{1}{2}}\r\n", - "\\newcommand{\\llt}{\\left <}\r\n", - "\\newcommand{\\rgt}{\\right >}\r\n", - "\\newcommand{\\abs}[1]{\\left |{#1}\\right | }\r\n", - "\\newcommand{\\pdiff}[2]{\\bfrac{\\partial {#1}}{\\partial {#2}}}\r\n", - "\\newcommand{\\lbrc}{\\left \\{}\r\n", - "\\newcommand{\\rbrc}{\\right \\}}\r\n", - "\\newcommand{\\W}{\\wedge}\r\n", - "\\newcommand{\\prm}[1]{{#1}'}\r\n", - "\\newcommand{\\ddt}[1]{\\bfrac{d{#1}}{dt}}\r\n", - "\\newcommand{\\R}{\\dagger}\r\n", - "\\newcommand{\\deriv}[3]{\\bfrac{d^{#3}#1}{d{#2}^{#3}}}\r\n", - "\\newcommand{\\grade}[1]{\\left < {#1} \\right >}\r\n", - "\\newcommand{\\f}[2]{{#1}\\lp{#2}\\rp}\r\n", - "\\newcommand{\\eval}[2]{\\left . {#1} \\right |_{#2}}\r\n", - "\\newcommand{\\Nabla}{\\boldsymbol{\\nabla}}\r\n", - "\\newcommand{\\eb}{\\boldsymbol{e}}\r\n", - "\\usepackage{float}\r\n", - "\\floatstyle{plain} % optionally change the style of the new float\r\n", - "\\newfloat{Code}{H}{myc}\r\n", - "\\lstloadlanguages{Python}\r\n", - "\r\n", - "\\begin{document}\r\n", - "\\begin{equation*} g_{ij} = \\left [ \\begin{array}{ccc} \\left ( e_{x}\\cdot e_{x}\\right ) & \\left ( e_{x}\\cdot e_{y}\\right ) & \\left ( e_{x}\\cdot e_{z}\\right ) \\\\ \\left ( e_{x}\\cdot e_{y}\\right ) & \\left ( e_{y}\\cdot e_{y}\\right ) & \\left ( e_{y}\\cdot e_{z}\\right ) \\\\ \\left ( e_{x}\\cdot e_{z}\\right ) & \\left ( e_{y}\\cdot e_{z}\\right ) & \\left ( e_{z}\\cdot e_{z}\\right ) \\end{array}\\right ] \\end{equation*}\r\n", - "\\begin{equation*} A = A + A^{x} \\boldsymbol{e}_{x} + A^{y} \\boldsymbol{e}_{y} + A^{z} \\boldsymbol{e}_{z} + A^{xy} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + A^{xz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + A^{yz} \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} + A^{xyz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\r\n", - " \\begin{align*} A = & A \\\\ & + A^{x} \\boldsymbol{e}_{x} + A^{y} \\boldsymbol{e}_{y} + A^{z} \\boldsymbol{e}_{z} \\\\ & + A^{xy} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + A^{xz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + A^{yz} \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\\\ & + A^{xyz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{align*} \r\n", - " \\begin{align*} A = & A \\\\ & + A^{x} \\boldsymbol{e}_{x} \\\\ & + A^{y} \\boldsymbol{e}_{y} \\\\ & + A^{z} \\boldsymbol{e}_{z} \\\\ & + A^{xy} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} \\\\ & + A^{xz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} \\\\ & + A^{yz} \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\\\ & + A^{xyz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{align*} \r\n", - "\\begin{equation*} X = X^{x} \\boldsymbol{e}_{x} + X^{y} \\boldsymbol{e}_{y} + X^{z} \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} Y = Y^{x} \\boldsymbol{e}_{x} + Y^{y} \\boldsymbol{e}_{y} + Y^{z} \\boldsymbol{e}_{z} \\end{equation*}\r\n", - "\\begin{equation*} g_{ij} = \\left [ \\begin{array}{cc} \\left ( e_{x}\\cdot e_{x}\\right ) & \\left ( e_{x}\\cdot e_{y}\\right ) \\\\ \\left ( e_{x}\\cdot e_{y}\\right ) & \\left ( e_{y}\\cdot e_{y}\\right ) \\end{array}\\right ] \\end{equation*}\r\n", - "\\begin{equation*} X = X^{x} \\boldsymbol{e}_{x} + X^{y} \\boldsymbol{e}_{y} \\end{equation*}\r\n", - "\\begin{equation*} A = A + A^{xy} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} \\end{equation*}\r\n", - "\\end{document}\r\n" - ] + "data": { + "text/plain": [ + "\n", + "\\documentclass[10pt,fleqn]{report}\n", + "\\usepackage[vcentering]{geometry}\n", + "\\geometry{papersize={14in,11in},total={13in,10in}}\n", + "\n", + "\\pagestyle{empty}\n", + "\\usepackage[latin1]{inputenc}\n", + "\\usepackage{amsmath}\n", + "\\usepackage{amsfonts}\n", + "\\usepackage{amssymb}\n", + "\\usepackage{amsbsy}\n", + "\\usepackage{tensor}\n", + "\\usepackage{listings}\n", + "\\usepackage{color}\n", + "\\usepackage{xcolor}\n", + "\\usepackage{bm}\n", + "\\usepackage{breqn}\n", + "\\definecolor{gray}{rgb}{0.95,0.95,0.95}\n", + "\\setlength{\\parindent}{0pt}\n", + "\\DeclareMathOperator{\\Tr}{Tr}\n", + "\\DeclareMathOperator{\\Adj}{Adj}\n", + "\\newcommand{\\bfrac}[2]{\\displaystyle\\frac{#1}{#2}}\n", + "\\newcommand{\\lp}{\\left (}\n", + "\\newcommand{\\rp}{\\right )}\n", + "\\newcommand{\\paren}[1]{\\lp {#1} \\rp}\n", + "\\newcommand{\\half}{\\frac{1}{2}}\n", + "\\newcommand{\\llt}{\\left <}\n", + "\\newcommand{\\rgt}{\\right >}\n", + "\\newcommand{\\abs}[1]{\\left |{#1}\\right | }\n", + "\\newcommand{\\pdiff}[2]{\\bfrac{\\partial {#1}}{\\partial {#2}}}\n", + "\\newcommand{\\lbrc}{\\left \\{}\n", + "\\newcommand{\\rbrc}{\\right \\}}\n", + "\\newcommand{\\W}{\\wedge}\n", + "\\newcommand{\\prm}[1]{{#1}'}\n", + "\\newcommand{\\ddt}[1]{\\bfrac{d{#1}}{dt}}\n", + "\\newcommand{\\R}{\\dagger}\n", + "\\newcommand{\\deriv}[3]{\\bfrac{d^{#3}#1}{d{#2}^{#3}}}\n", + "\\newcommand{\\grade}[1]{\\left < {#1} \\right >}\n", + "\\newcommand{\\f}[2]{{#1}\\lp{#2}\\rp}\n", + "\\newcommand{\\eval}[2]{\\left . {#1} \\right |_{#2}}\n", + "\\newcommand{\\Nabla}{\\boldsymbol{\\nabla}}\n", + "\\newcommand{\\eb}{\\boldsymbol{e}}\n", + "\\usepackage{float}\n", + "\\floatstyle{plain} % optionally change the style of the new float\n", + "\\newfloat{Code}{H}{myc}\n", + "\\lstloadlanguages{Python}\n", + "\n", + "\\begin{document}\n", + "\\begin{equation*} g_{ij} = \\left [ \\begin{array}{ccc} \\left ( e_{x}\\cdot e_{x}\\right ) & \\left ( e_{x}\\cdot e_{y}\\right ) & \\left ( e_{x}\\cdot e_{z}\\right ) \\\\ \\left ( e_{x}\\cdot e_{y}\\right ) & \\left ( e_{y}\\cdot e_{y}\\right ) & \\left ( e_{y}\\cdot e_{z}\\right ) \\\\ \\left ( e_{x}\\cdot e_{z}\\right ) & \\left ( e_{y}\\cdot e_{z}\\right ) & \\left ( e_{z}\\cdot e_{z}\\right ) \\end{array}\\right ] \\end{equation*}\n", + "\\begin{equation*} A = A + A^{x} \\boldsymbol{e}_{x} + A^{y} \\boldsymbol{e}_{y} + A^{z} \\boldsymbol{e}_{z} + A^{xy} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + A^{xz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + A^{yz} \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} + A^{xyz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{equation*}\n", + " \\begin{align*} A = & A \\\\ & + A^{x} \\boldsymbol{e}_{x} + A^{y} \\boldsymbol{e}_{y} + A^{z} \\boldsymbol{e}_{z} \\\\ & + A^{xy} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} + A^{xz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} + A^{yz} \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\\\ & + A^{xyz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{align*} \n", + " \\begin{align*} A = & A \\\\ & + A^{x} \\boldsymbol{e}_{x} \\\\ & + A^{y} \\boldsymbol{e}_{y} \\\\ & + A^{z} \\boldsymbol{e}_{z} \\\\ & + A^{xy} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} \\\\ & + A^{xz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{z} \\\\ & + A^{yz} \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\\\ & + A^{xyz} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y}\\wedge \\boldsymbol{e}_{z} \\end{align*} \n", + "\\begin{equation*} X = X^{x} \\boldsymbol{e}_{x} + X^{y} \\boldsymbol{e}_{y} + X^{z} \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} Y = Y^{x} \\boldsymbol{e}_{x} + Y^{y} \\boldsymbol{e}_{y} + Y^{z} \\boldsymbol{e}_{z} \\end{equation*}\n", + "\\begin{equation*} g_{ij} = \\left [ \\begin{array}{cc} \\left ( e_{x}\\cdot e_{x}\\right ) & \\left ( e_{x}\\cdot e_{y}\\right ) \\\\ \\left ( e_{x}\\cdot e_{y}\\right ) & \\left ( e_{y}\\cdot e_{y}\\right ) \\end{array}\\right ] \\end{equation*}\n", + "\\begin{equation*} X = X^{x} \\boldsymbol{e}_{x} + X^{y} \\boldsymbol{e}_{y} \\end{equation*}\n", + "\\begin{equation*} A = A + A^{xy} \\boldsymbol{e}_{x}\\wedge \\boldsymbol{e}_{y} \\end{equation*}\n", + "\\end{document}\n" + ] + }, + "metadata": {}, + "output_type": "display_data" } ], "source": [ - "!cat simple_check_latex.tex" + "check_latex('simple_check_latex')" ] }, { "cell_type": "code", - "execution_count": 20, + "execution_count": 14, "metadata": {}, "outputs": [ { @@ -1329,109 +1300,101 @@ }, { "cell_type": "code", - "execution_count": 21, - "metadata": {}, - "outputs": [], - "source": [ - "!python spherical_latex.py" - ] - }, - { - "cell_type": "code", - "execution_count": 22, + "execution_count": 15, "metadata": {}, "outputs": [ { - "name": "stdout", - "output_type": "stream", - "text": [ - "\r\n", - "\\documentclass[10pt,fleqn]{report}\r\n", - "\\usepackage[vcentering]{geometry}\r\n", - "\\geometry{papersize={14in,11in},total={13in,10in}}\r\n", - "\r\n", - "\\pagestyle{empty}\r\n", - "\\usepackage[latin1]{inputenc}\r\n", - "\\usepackage{amsmath}\r\n", - "\\usepackage{amsfonts}\r\n", - "\\usepackage{amssymb}\r\n", - "\\usepackage{amsbsy}\r\n", - "\\usepackage{tensor}\r\n", - "\\usepackage{listings}\r\n", - "\\usepackage{color}\r\n", - "\\usepackage{xcolor}\r\n", - "\\usepackage{bm}\r\n", - "\\usepackage{breqn}\r\n", - "\\definecolor{gray}{rgb}{0.95,0.95,0.95}\r\n", - "\\setlength{\\parindent}{0pt}\r\n", - "\\DeclareMathOperator{\\Tr}{Tr}\r\n", - "\\DeclareMathOperator{\\Adj}{Adj}\r\n", - "\\newcommand{\\bfrac}[2]{\\displaystyle\\frac{#1}{#2}}\r\n", - "\\newcommand{\\lp}{\\left (}\r\n", - "\\newcommand{\\rp}{\\right )}\r\n", - "\\newcommand{\\paren}[1]{\\lp {#1} \\rp}\r\n", - "\\newcommand{\\half}{\\frac{1}{2}}\r\n", - "\\newcommand{\\llt}{\\left <}\r\n", - "\\newcommand{\\rgt}{\\right >}\r\n", - "\\newcommand{\\abs}[1]{\\left |{#1}\\right | }\r\n", - "\\newcommand{\\pdiff}[2]{\\bfrac{\\partial {#1}}{\\partial {#2}}}\r\n", - "\\newcommand{\\lbrc}{\\left \\{}\r\n", - "\\newcommand{\\rbrc}{\\right \\}}\r\n", - "\\newcommand{\\W}{\\wedge}\r\n", - "\\newcommand{\\prm}[1]{{#1}'}\r\n", - "\\newcommand{\\ddt}[1]{\\bfrac{d{#1}}{dt}}\r\n", - "\\newcommand{\\R}{\\dagger}\r\n", - "\\newcommand{\\deriv}[3]{\\bfrac{d^{#3}#1}{d{#2}^{#3}}}\r\n", - "\\newcommand{\\grade}[1]{\\left < {#1} \\right >}\r\n", - "\\newcommand{\\f}[2]{{#1}\\lp{#2}\\rp}\r\n", - "\\newcommand{\\eval}[2]{\\left . {#1} \\right |_{#2}}\r\n", - "\\newcommand{\\Nabla}{\\boldsymbol{\\nabla}}\r\n", - "\\newcommand{\\eb}{\\boldsymbol{e}}\r\n", - "\\usepackage{float}\r\n", - "\\floatstyle{plain} % optionally change the style of the new float\r\n", - "\\newfloat{Code}{H}{myc}\r\n", - "\\lstloadlanguages{Python}\r\n", - "\r\n", - "\\begin{document}\r\n", - "\\\\begin{lstlisting}[language=Python,showspaces=false,showstringspaces=false,backgroundcolor=\\color{gray},frame=single]\r\n", - "def derivatives_in_spherical_coordinates():\r\n", - " Print_Function()\r\n", - " X = (r,th,phi) = symbols('r theta phi')\r\n", - " curv = [[r*cos(phi)*sin(th),r*sin(phi)*sin(th),r*cos(th)],[1,r,r*sin(th)]]\r\n", - " (er,eth,ephi,grad) = MV.setup('e_r e_theta e_phi',metric='[1,1,1]',coords=X,curv=curv)\r\n", - " f = MV('f','scalar',fct=True)\r\n", - " A = MV('A','vector',fct=True)\r\n", - " B = MV('B','grade2',fct=True)\r\n", - " print('f =',f)\r\n", - " print('A =',A)\r\n", - " print('B =',B)\r\n", - " print('grad*f =',grad*f)\r\n", - " print('grad|A =',grad|A)\r\n", - " print('-I*(grad^A) =',-MV.I*(grad^A))\r\n", - " print('grad^B =',grad^B)\r\n", - " return\r\n", - "\\end{lstlisting}\r\n", - "Code Output:\r\n", - "\\begin{equation*} f = f \\end{equation*}\r\n", - "\\begin{equation*} A = A^{r} \\boldsymbol{e}_{r} + A^{\\theta } \\boldsymbol{e}_{\\theta } + A^{\\phi } \\boldsymbol{e}_{\\phi } \\end{equation*}\r\n", - "\\begin{equation*} B = B^{r\\theta } \\boldsymbol{e}_{r}\\wedge \\boldsymbol{e}_{\\theta } + B^{r\\phi } \\boldsymbol{e}_{r}\\wedge \\boldsymbol{e}_{\\phi } + B^{\\theta \\phi } \\boldsymbol{e}_{\\theta }\\wedge \\boldsymbol{e}_{\\phi } \\end{equation*}\r\n", - "\\begin{equation*} \\boldsymbol{\\nabla} f = \\partial_{r} f \\boldsymbol{e}_{r} + \\frac{\\partial_{\\theta } f }{r^{2}} \\boldsymbol{e}_{\\theta } + \\frac{\\partial_{\\phi } f }{r^{2} {\\sin{\\left (\\theta \\right )}}^{2}} \\boldsymbol{e}_{\\phi } \\end{equation*}\r\n", - "\\begin{equation*} \\boldsymbol{\\nabla} \\cdot A = \\frac{A^{\\theta } }{\\tan{\\left (\\theta \\right )}} + \\partial_{\\phi } A^{\\phi } + \\partial_{r} A^{r} + \\partial_{\\theta } A^{\\theta } + \\frac{2 A^{r} }{r} \\end{equation*}\r\n", - "\\begin{equation*} -I (\\boldsymbol{\\nabla} \\W A) = \\frac{\\sqrt{r^{4} {\\sin{\\left (\\theta \\right )}}^{2}} \\left(\\frac{2 A^{\\phi } }{\\tan{\\left (\\theta \\right )}} + \\partial_{\\theta } A^{\\phi } - \\frac{\\partial_{\\phi } A^{\\theta } }{{\\sin{\\left (\\theta \\right )}}^{2}}\\right)}{r^{2}} \\boldsymbol{e}_{r} + \\frac{- r^{2} {\\sin{\\left (\\theta \\right )}}^{2} \\partial_{r} A^{\\phi } - 2 r A^{\\phi } {\\sin{\\left (\\theta \\right )}}^{2} + \\partial_{\\phi } A^{r} }{\\sqrt{r^{4} {\\sin{\\left (\\theta \\right )}}^{2}}} \\boldsymbol{e}_{\\theta } + \\frac{r^{2} \\partial_{r} A^{\\theta } + 2 r A^{\\theta } - \\partial_{\\theta } A^{r} }{\\sqrt{r^{4} {\\sin{\\left (\\theta \\right )}}^{2}}} \\boldsymbol{e}_{\\phi } \\end{equation*}\r\n", - "\\begin{equation*} \\boldsymbol{\\nabla} \\W B = \\frac{r^{2} \\partial_{r} B^{\\theta \\phi } + 4 r B^{\\theta \\phi } - \\frac{2 B^{r\\phi } }{\\tan{\\left (\\theta \\right )}} - \\partial_{\\theta } B^{r\\phi } + \\frac{\\partial_{\\phi } B^{r\\theta } }{{\\sin{\\left (\\theta \\right )}}^{2}}}{r^{2}} \\boldsymbol{e}_{r}\\wedge \\boldsymbol{e}_{\\theta }\\wedge \\boldsymbol{e}_{\\phi } \\end{equation*}\r\n", - "\\end{document}\r\n" - ] + "data": { + "text/plain": [ + "\n", + "\\documentclass[10pt,fleqn]{report}\n", + "\\usepackage[vcentering]{geometry}\n", + "\\geometry{papersize={14in,11in},total={13in,10in}}\n", + "\n", + "\\pagestyle{empty}\n", + "\\usepackage[latin1]{inputenc}\n", + "\\usepackage{amsmath}\n", + "\\usepackage{amsfonts}\n", + "\\usepackage{amssymb}\n", + "\\usepackage{amsbsy}\n", + "\\usepackage{tensor}\n", + "\\usepackage{listings}\n", + "\\usepackage{color}\n", + "\\usepackage{xcolor}\n", + "\\usepackage{bm}\n", + "\\usepackage{breqn}\n", + "\\definecolor{gray}{rgb}{0.95,0.95,0.95}\n", + "\\setlength{\\parindent}{0pt}\n", + "\\DeclareMathOperator{\\Tr}{Tr}\n", + "\\DeclareMathOperator{\\Adj}{Adj}\n", + "\\newcommand{\\bfrac}[2]{\\displaystyle\\frac{#1}{#2}}\n", + "\\newcommand{\\lp}{\\left (}\n", + "\\newcommand{\\rp}{\\right )}\n", + "\\newcommand{\\paren}[1]{\\lp {#1} \\rp}\n", + "\\newcommand{\\half}{\\frac{1}{2}}\n", + "\\newcommand{\\llt}{\\left <}\n", + "\\newcommand{\\rgt}{\\right >}\n", + "\\newcommand{\\abs}[1]{\\left |{#1}\\right | }\n", + "\\newcommand{\\pdiff}[2]{\\bfrac{\\partial {#1}}{\\partial {#2}}}\n", + "\\newcommand{\\lbrc}{\\left \\{}\n", + "\\newcommand{\\rbrc}{\\right \\}}\n", + "\\newcommand{\\W}{\\wedge}\n", + "\\newcommand{\\prm}[1]{{#1}'}\n", + "\\newcommand{\\ddt}[1]{\\bfrac{d{#1}}{dt}}\n", + "\\newcommand{\\R}{\\dagger}\n", + "\\newcommand{\\deriv}[3]{\\bfrac{d^{#3}#1}{d{#2}^{#3}}}\n", + "\\newcommand{\\grade}[1]{\\left < {#1} \\right >}\n", + "\\newcommand{\\f}[2]{{#1}\\lp{#2}\\rp}\n", + "\\newcommand{\\eval}[2]{\\left . {#1} \\right |_{#2}}\n", + "\\newcommand{\\Nabla}{\\boldsymbol{\\nabla}}\n", + "\\newcommand{\\eb}{\\boldsymbol{e}}\n", + "\\usepackage{float}\n", + "\\floatstyle{plain} % optionally change the style of the new float\n", + "\\newfloat{Code}{H}{myc}\n", + "\\lstloadlanguages{Python}\n", + "\n", + "\\begin{document}\n", + "\\\\begin{lstlisting}[language=Python,showspaces=false,showstringspaces=false,backgroundcolor=\\color{gray},frame=single]\n", + "def derivatives_in_spherical_coordinates():\n", + " Print_Function()\n", + " X = (r,th,phi) = symbols('r theta phi')\n", + " curv = [[r*cos(phi)*sin(th),r*sin(phi)*sin(th),r*cos(th)],[1,r,r*sin(th)]]\n", + " (er,eth,ephi,grad) = MV.setup('e_r e_theta e_phi',metric='[1,1,1]',coords=X,curv=curv)\n", + " f = MV('f','scalar',fct=True)\n", + " A = MV('A','vector',fct=True)\n", + " B = MV('B','grade2',fct=True)\n", + " print('f =',f)\n", + " print('A =',A)\n", + " print('B =',B)\n", + " print('grad*f =',grad*f)\n", + " print('grad|A =',grad|A)\n", + " print('-I*(grad^A) =',-MV.I*(grad^A))\n", + " print('grad^B =',grad^B)\n", + " return\n", + "\\end{lstlisting}\n", + "Code Output:\n", + "\\begin{equation*} f = f \\end{equation*}\n", + "\\begin{equation*} A = A^{r} \\boldsymbol{e}_{r} + A^{\\theta } \\boldsymbol{e}_{\\theta } + A^{\\phi } \\boldsymbol{e}_{\\phi } \\end{equation*}\n", + "\\begin{equation*} B = B^{r\\theta } \\boldsymbol{e}_{r}\\wedge \\boldsymbol{e}_{\\theta } + B^{r\\phi } \\boldsymbol{e}_{r}\\wedge \\boldsymbol{e}_{\\phi } + B^{\\theta \\phi } \\boldsymbol{e}_{\\theta }\\wedge \\boldsymbol{e}_{\\phi } \\end{equation*}\n", + "\\begin{equation*} \\boldsymbol{\\nabla} f = \\partial_{r} f \\boldsymbol{e}_{r} + \\frac{\\partial_{\\theta } f }{r^{2}} \\boldsymbol{e}_{\\theta } + \\frac{\\partial_{\\phi } f }{r^{2} {\\sin{\\left (\\theta \\right )}}^{2}} \\boldsymbol{e}_{\\phi } \\end{equation*}\n", + "\\begin{equation*} \\boldsymbol{\\nabla} \\cdot A = \\frac{A^{\\theta } }{\\tan{\\left (\\theta \\right )}} + \\partial_{\\phi } A^{\\phi } + \\partial_{r} A^{r} + \\partial_{\\theta } A^{\\theta } + \\frac{2 A^{r} }{r} \\end{equation*}\n", + "\\begin{equation*} -I (\\boldsymbol{\\nabla} \\W A) = \\frac{\\sqrt{r^{4} {\\sin{\\left (\\theta \\right )}}^{2}} \\left(\\frac{2 A^{\\phi } }{\\tan{\\left (\\theta \\right )}} + \\partial_{\\theta } A^{\\phi } - \\frac{\\partial_{\\phi } A^{\\theta } }{{\\sin{\\left (\\theta \\right )}}^{2}}\\right)}{r^{2}} \\boldsymbol{e}_{r} + \\frac{- r^{2} {\\sin{\\left (\\theta \\right )}}^{2} \\partial_{r} A^{\\phi } - 2 r A^{\\phi } {\\sin{\\left (\\theta \\right )}}^{2} + \\partial_{\\phi } A^{r} }{\\sqrt{r^{4} {\\sin{\\left (\\theta \\right )}}^{2}}} \\boldsymbol{e}_{\\theta } + \\frac{r^{2} \\partial_{r} A^{\\theta } + 2 r A^{\\theta } - \\partial_{\\theta } A^{r} }{\\sqrt{r^{4} {\\sin{\\left (\\theta \\right )}}^{2}}} \\boldsymbol{e}_{\\phi } \\end{equation*}\n", + "\\begin{equation*} \\boldsymbol{\\nabla} \\W B = \\frac{r^{2} \\partial_{r} B^{\\theta \\phi } + 4 r B^{\\theta \\phi } - \\frac{2 B^{r\\phi } }{\\tan{\\left (\\theta \\right )}} - \\partial_{\\theta } B^{r\\phi } + \\frac{\\partial_{\\phi } B^{r\\theta } }{{\\sin{\\left (\\theta \\right )}}^{2}}}{r^{2}} \\boldsymbol{e}_{r}\\wedge \\boldsymbol{e}_{\\theta }\\wedge \\boldsymbol{e}_{\\phi } \\end{equation*}\n", + "\\end{document}\n" + ] + }, + "metadata": {}, + "output_type": "display_data" } ], "source": [ - "!cat spherical_latex.tex" + "check_latex('spherical_latex')" ] }, { "cell_type": "code", - "execution_count": 23, + "execution_count": 16, "metadata": { - "collapsed": false, "scrolled": false }, "outputs": [ @@ -1587,13 +1550,6 @@ "source": [ "!python terminal_check.py" ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] } ], "metadata": { @@ -1612,7 +1568,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.7.1" + "version": "3.5.4" } }, "nbformat": 4, diff --git a/examples/ipython/Terminal.ipynb b/examples/ipython/Terminal.ipynb index 832a855e..6ae50ca4 100644 --- a/examples/ipython/Terminal.ipynb +++ b/examples/ipython/Terminal.ipynb @@ -131,11 +131,11 @@ "[(\u001b[0;34mX\u001b[0m.\u001b[0;34me\u001b[0m), (\u001b[0;34mY\u001b[0m.\u001b[0;34me\u001b[0m), 1]])\n", "(X^Y)**2 = (\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)**2\n", "B = \u001b[0;34mX\u001b[0m^\u001b[0;34mY\u001b[0m - (\u001b[0;34mY\u001b[0m.\u001b[0;34me\u001b[0m)*\u001b[0;34mX\u001b[0m^\u001b[0;34me\u001b[0m + (\u001b[0;34mX\u001b[0m.\u001b[0;34me\u001b[0m)*\u001b[0;34mY\u001b[0m^\u001b[0;34me\u001b[0m\n", - "B**2 = 3*(\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)**2 - 2*(\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)*(\u001b[0;34mX\u001b[0m.\u001b[0;34me\u001b[0m)*(\u001b[0;34mY\u001b[0m.\u001b[0;34me\u001b[0m) + 2*(\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)*(\u001b[0;34mX\u001b[0m.\u001b[0;34me\u001b[0m)*\u001b[0;34mY\u001b[0m^\u001b[0;34me\u001b[0m - 2*(\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)*(\u001b[0;34mX\u001b[0m.\u001b[0;34me\u001b[0m)*((\u001b[0;34mY\u001b[0m.\u001b[0;34me\u001b[0m) + \u001b[0;34mY\u001b[0m^\u001b[0;34me\u001b[0m) - 2*(\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)*(\u001b[0;34mY\u001b[0m.\u001b[0;34me\u001b[0m)*\u001b[0;34mX\u001b[0m^\u001b[0;34me\u001b[0m + 2*(\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)*(\u001b[0;34mY\u001b[0m.\u001b[0;34me\u001b[0m)*((\u001b[0;34mX\u001b[0m.\u001b[0;34me\u001b[0m) + \u001b[0;34mX\u001b[0m^\u001b[0;34me\u001b[0m) + 2*(\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)*\u001b[0;34mX\u001b[0m^\u001b[0;34mY\u001b[0m - 2*(\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)*((\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m) + \u001b[0;34mX\u001b[0m^\u001b[0;34mY\u001b[0m)\n", + "B**2 = (\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)**2 - 2*(\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)*(\u001b[0;34mX\u001b[0m.\u001b[0;34me\u001b[0m)*(\u001b[0;34mY\u001b[0m.\u001b[0;34me\u001b[0m)\n", "#L = X^Y^e is a non-euclidian line\n", "B = L*e = \u001b[0;34mX\u001b[0m^\u001b[0;34mY\u001b[0m - (\u001b[0;34mY\u001b[0m.\u001b[0;34me\u001b[0m)*\u001b[0;34mX\u001b[0m^\u001b[0;34me\u001b[0m + (\u001b[0;34mX\u001b[0m.\u001b[0;34me\u001b[0m)*\u001b[0;34mY\u001b[0m^\u001b[0;34me\u001b[0m\n", "B*e*B.rev() = (\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)*(-(\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m) + 2*(\u001b[0;34mX\u001b[0m.\u001b[0;34me\u001b[0m)*(\u001b[0;34mY\u001b[0m.\u001b[0;34me\u001b[0m))*\u001b[0;34me\u001b[0m\n", - "B**2 = (\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)*((\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m) - 2*(\u001b[0;34mX\u001b[0m.\u001b[0;34me\u001b[0m)*(\u001b[0;34mY\u001b[0m.\u001b[0;34me\u001b[0m))\n", + "B**2 = (\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)**2 - 2*(\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)*(\u001b[0;34mX\u001b[0m.\u001b[0;34me\u001b[0m)*(\u001b[0;34mY\u001b[0m.\u001b[0;34me\u001b[0m)\n", "L**2 = (\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)**2 - 2*(\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)*(\u001b[0;34mX\u001b[0m.\u001b[0;34me\u001b[0m)*(\u001b[0;34mY\u001b[0m.\u001b[0;34me\u001b[0m)\n", "s = sinh(alpha/2) and c = cosh(alpha/2)\n", "exp(alpha*B/(2*|B|)) = c\n", @@ -146,9 +146,9 @@ "Objective is to determine value of C = cosh(alpha) such that W = 0\n", "Z|Y = (\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)**3*(1/B)**2*s**2 - 4*(\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)**2*(\u001b[0;34mX\u001b[0m.\u001b[0;34me\u001b[0m)*(\u001b[0;34mY\u001b[0m.\u001b[0;34me\u001b[0m)*(1/B)**2*s**2 + 2*(\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)**2*(1/B)*c*s + 4*(\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)*(\u001b[0;34mX\u001b[0m.\u001b[0;34me\u001b[0m)**2*(\u001b[0;34mY\u001b[0m.\u001b[0;34me\u001b[0m)**2*(1/B)**2*s**2 - 4*(\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)*(\u001b[0;34mX\u001b[0m.\u001b[0;34me\u001b[0m)*(\u001b[0;34mY\u001b[0m.\u001b[0;34me\u001b[0m)*(1/B)*c*s + (\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)*c**2\n", "S = sinh(alpha) and C = cosh(alpha)\n", - "W = (\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)*(1/B)*C*sqrt((\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)**2 - 2*(\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)*(\u001b[0;34mX\u001b[0m.\u001b[0;34me\u001b[0m)*(\u001b[0;34mY\u001b[0m.\u001b[0;34me\u001b[0m)) - (\u001b[0;34mX\u001b[0m.\u001b[0;34me\u001b[0m)*(\u001b[0;34mY\u001b[0m.\u001b[0;34me\u001b[0m)*(1/B)*C*sqrt((\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)**2 - 2*(\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)*(\u001b[0;34mX\u001b[0m.\u001b[0;34me\u001b[0m)*(\u001b[0;34mY\u001b[0m.\u001b[0;34me\u001b[0m)) + (\u001b[0;34mX\u001b[0m.\u001b[0;34me\u001b[0m)*(\u001b[0;34mY\u001b[0m.\u001b[0;34me\u001b[0m)*(1/B)*sqrt((\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)**2 - 2*(\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)*(\u001b[0;34mX\u001b[0m.\u001b[0;34me\u001b[0m)*(\u001b[0;34mY\u001b[0m.\u001b[0;34me\u001b[0m)) + S*sqrt((\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)**2 - 2*(\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)*(\u001b[0;34mX\u001b[0m.\u001b[0;34me\u001b[0m)*(\u001b[0;34mY\u001b[0m.\u001b[0;34me\u001b[0m))\n", - "Scalar Coefficient = (\u001b[0;34mX\u001b[0m.\u001b[0;34me\u001b[0m)*(\u001b[0;34mY\u001b[0m.\u001b[0;34me\u001b[0m)*(1/B)*sqrt((\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)**2 - 2*(\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)*(\u001b[0;34mX\u001b[0m.\u001b[0;34me\u001b[0m)*(\u001b[0;34mY\u001b[0m.\u001b[0;34me\u001b[0m))\n", - "Cosh Coefficient = (\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)*(1/B)*sqrt((\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)**2 - 2*(\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)*(\u001b[0;34mX\u001b[0m.\u001b[0;34me\u001b[0m)*(\u001b[0;34mY\u001b[0m.\u001b[0;34me\u001b[0m)) - (\u001b[0;34mX\u001b[0m.\u001b[0;34me\u001b[0m)*(\u001b[0;34mY\u001b[0m.\u001b[0;34me\u001b[0m)*(1/B)*sqrt((\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)**2 - 2*(\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)*(\u001b[0;34mX\u001b[0m.\u001b[0;34me\u001b[0m)*(\u001b[0;34mY\u001b[0m.\u001b[0;34me\u001b[0m))\n", + "W = (\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)*C - (\u001b[0;34mX\u001b[0m.\u001b[0;34me\u001b[0m)*(\u001b[0;34mY\u001b[0m.\u001b[0;34me\u001b[0m)*C + (\u001b[0;34mX\u001b[0m.\u001b[0;34me\u001b[0m)*(\u001b[0;34mY\u001b[0m.\u001b[0;34me\u001b[0m) + S*sqrt((\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)**2 - 2*(\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)*(\u001b[0;34mX\u001b[0m.\u001b[0;34me\u001b[0m)*(\u001b[0;34mY\u001b[0m.\u001b[0;34me\u001b[0m))\n", + "Scalar Coefficient = (\u001b[0;34mX\u001b[0m.\u001b[0;34me\u001b[0m)*(\u001b[0;34mY\u001b[0m.\u001b[0;34me\u001b[0m)\n", + "Cosh Coefficient = (\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m) - (\u001b[0;34mX\u001b[0m.\u001b[0;34me\u001b[0m)*(\u001b[0;34mY\u001b[0m.\u001b[0;34me\u001b[0m)\n", "Sinh Coefficient = sqrt((\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)**2 - 2*(\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)*(\u001b[0;34mX\u001b[0m.\u001b[0;34me\u001b[0m)*(\u001b[0;34mY\u001b[0m.\u001b[0;34me\u001b[0m))\n", "|B| = sqrt((\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)**2 - 2*(\u001b[0;34mX\u001b[0m.\u001b[0;34mY\u001b[0m)*(\u001b[0;34mX\u001b[0m.\u001b[0;34me\u001b[0m)*(\u001b[0;34mY\u001b[0m.\u001b[0;34me\u001b[0m))\n", "Require a*C**2+b*C+c = 0\n", diff --git a/examples/ipython/dop.ipynb b/examples/ipython/dop.ipynb index c5054f5e..43c8f67e 100644 --- a/examples/ipython/dop.ipynb +++ b/examples/ipython/dop.ipynb @@ -118,10 +118,10 @@ { "data": { "text/latex": [ - "\\begin{equation*} \\partial^{2}_{y} f + \\partial^{2}_{z} f \\end{equation*}" + "\\begin{equation*} \\partial^{2}_{x} f + \\partial^{2}_{y} f + \\partial^{2}_{z} f \\end{equation*}" ], "text/plain": [ - "\\partial^{2}_{y} f + \\partial^{2}_{z} f " + "\\partial^{2}_{x} f + \\partial^{2}_{y} f + \\partial^{2}_{z} f " ] }, "execution_count": 6, diff --git a/examples/ipython/inner_product.ipynb b/examples/ipython/inner_product.ipynb index ca90b981..2cc96498 100644 --- a/examples/ipython/inner_product.ipynb +++ b/examples/ipython/inner_product.ipynb @@ -81,10 +81,10 @@ { "data": { "text/latex": [ - "$$0$$" + "\\begin{equation*} 0 \\end{equation*}" ], "text/plain": [ - "0" + " 0 " ] }, "execution_count": 6, @@ -104,10 +104,10 @@ { "data": { "text/latex": [ - "$$0$$" + "\\begin{equation*} 0 \\end{equation*}" ], "text/plain": [ - "0" + " 0 " ] }, "execution_count": 7, @@ -127,10 +127,10 @@ { "data": { "text/latex": [ - "$$0$$" + "\\begin{equation*} 0 \\end{equation*}" ], "text/plain": [ - "0" + " 0 " ] }, "execution_count": 8, @@ -150,10 +150,10 @@ { "data": { "text/latex": [ - "$$0$$" + "\\begin{equation*} 0 \\end{equation*}" ], "text/plain": [ - "0" + " 0 " ] }, "execution_count": 9, diff --git a/galgebra/__init__.py b/galgebra/__init__.py index 5a29635b..0d975537 100644 --- a/galgebra/__init__.py +++ b/galgebra/__init__.py @@ -22,3 +22,4 @@ from __future__ import absolute_import, division from __future__ import print_function +from ._version import __version__ diff --git a/galgebra/_version.py b/galgebra/_version.py new file mode 100644 index 00000000..fa9dc68e --- /dev/null +++ b/galgebra/_version.py @@ -0,0 +1,8 @@ +# Package versioning solution originally found here: +# http://stackoverflow.com/q/458550 + +# Store the version here so: +# 1) we don't load dependencies by storing it in __init__.py +# 2) we can import it in setup.py for the same reason +# 3) we can import it into your module +__version__ = '0.4.4' diff --git a/galgebra/deprecated.py b/galgebra/deprecated.py index 5f42e7db..6efed748 100644 --- a/galgebra/deprecated.py +++ b/galgebra/deprecated.py @@ -1,6 +1,6 @@ import copy from itertools import combinations -from sympy import trigsimp +from sympy import trigsimp, S from . import ga from .mv import Mv from . import utils @@ -38,8 +38,11 @@ def setup(basis, metric=None, coords=None, rframe=False, debug=False, curv=(None return list(MV.GA.mv()) - def __init__(self, base, mvtype, fct=False, blade_rep=True): - Mv.__init__(self, base, mvtype, f=fct, ga=MV.GA) + def __init__(self, base, mvtype, fct=None, blade_rep=True): + kwargs = {} + if fct is not None: + kwargs['f'] = fct # only forward this argument if we received it + Mv.__init__(self, base, mvtype, ga=MV.GA, **kwargs) def Fmt(self, fmt=1, title=None): print(Mv.Fmt(self, fmt=fmt, title=title)) @@ -60,7 +63,7 @@ def ReciprocalFrame(basis, mode='norm'): for igrade in index[-2:]: grade = [] for iblade in igrade: - blade = Mv(1, 'scalar', ga=GA) + blade = Mv(S(1), 'scalar', ga=GA) for ibasis in iblade: blade ^= basis[ibasis] blade = blade.trigsimp() @@ -72,7 +75,7 @@ def ReciprocalFrame(basis, mode='norm'): duals = copy.copy(MFbasis[-2]) duals.reverse() - sgn = 1 + sgn = S(1) rbasis = [] for dual in duals: recpv = (sgn * dual * E).trigsimp() diff --git a/galgebra/ga.py b/galgebra/ga.py index 2306f920..48a84d5c 100644 --- a/galgebra/ga.py +++ b/galgebra/ga.py @@ -1,7 +1,7 @@ """ Geometric Algebra (inherits Metric) """ - +import warnings import operator import copy from collections import OrderedDict @@ -12,7 +12,7 @@ from sympy import ( diff, Rational, Symbol, S, Mul, Add, expand, simplify, eye, trigsimp, - symbols, sqrt, numbers, Function + symbols, sqrt, Function ) from . import printer @@ -93,24 +93,12 @@ def update_and_substitute(expr1, expr2, mul_dict): product of ``bases1[i]*bases2[j]`` as a linear combination of scalars and bases of the geometric algebra. """ - if (isinstance(expr1, numbers.Number) or expr1.is_commutative) \ - or (isinstance(expr2, numbers.Number) or expr2.is_commutative): - return expr1 * expr2 (coefs1, bases1) = metric.linear_expand(expr1) (coefs2, bases2) = metric.linear_expand(expr2) expr = S(0) for (coef1, base1) in zip(coefs1, bases1): for (coef2, base2) in zip(coefs2, bases2): - #Special cases where base1 and/or base2 is scalar - if base1 == 1 and base2 == 1: - expr += coef1 * coef2 - elif base1 == 1: - expr += coef1 * coef2 * base2 - elif base2 == 1: - expr += coef1 * coef2 * base1 - else: - key = (base1, base2) - expr += coef1 * coef2 * mul_dict[key] + expr += coef1 * coef2 * mul_dict[base1, base2] return expr @@ -280,20 +268,6 @@ class Ga(metric.Metric): Derivatives of basis functions. Two dimensional list. First entry is differentiating coordinate index. Second entry is basis vector index. Quantities are linear combinations of basis vector symbols. - .. attribute:: Pdop_identity - - Partial differential operator identity (operates on multivector function to return function). - - .. attribute:: Pdiffs - - Dictionary of partial differential operators (operates on multivector functions) for each coordinate - :math:`\{x: \partial_{x}, ...\}` - - .. attribute:: sPds - - Dictionary of scalar partial differential operators (operates on scalar functions) for each coordinate - :math:`\{x: \partial_{x}, ...\}` - .. attribute:: grad Geometric derivative operator from left. ``grad*F`` returns multivector @@ -432,12 +406,6 @@ def __init__(self, bases, **kwargs): if self.coords is not None: self.coord_vec = sum([coord * base for (coord, base) in zip(self.coords, self.basis)]) self._build_reciprocal_basis(self.gsym) - self.Pdop_identity = mv.Pdop({},ga=self) # Identity Pdop = 1 - self.Pdiffs = {} - self.sPds = {} - for x in self.coords: # Partial derivative operator for each coordinate - self.Pdiffs[x] = mv.Pdop({x:1}, ga=self) - self.sPds[x] = mv.Sdop([(S(1), self.Pdiffs[x])], ga=self) self._build_grads() else: self.r_basis_mv = None @@ -479,7 +447,7 @@ def __init__(self, bases, **kwargs): self.a = [] # List of dummy vectors for Mlt calculations self._agrads = {} # cache of gradient operator with respect to vector a self.dslot = -1 # args slot for dervative, -1 for coordinates - self.XOX = self.mv('XOX','vector') # Versor test vector + self._XOX = self.mv('XOX','vector') # cached vector for use in is_versor def make_grad(self, a, cmpflg=False): # make gradient operator with respect to vector a @@ -519,20 +487,49 @@ def I_inv(self): @property def mv_I(self): # This exists for backwards compatibility. Note this is not `I()`! + # galgebra 0.4.5 + warnings.warn( + "`ga.mv_I` is deprecated, use `ga.E()` instead, or perhaps `ga.I()`", + DeprecationWarning, stacklevel=2) # default pseudoscalar return self.E() @property def mv_x(self): # This exists for backwards compatibility. + # galgebra 0.4.5 + warnings.warn( + "`ga.mv_x` is deprecated, use `ga.mv(your_name, 'vector')` instead", + DeprecationWarning, stacklevel=2) # testing vectors - return Mv('XxXx', 'vector', ga=self) + return mv.Mv('XxXx', 'vector', ga=self) def X(self): return self.mv(sum([coord*base for (coord, base) in zip(self.coords, self.basis)])) - def sdop(self, coefs, pdiffs=None): - return mv.Sdop(coefs, pdiffs, ga=self) + @property + def Pdiffs(self): + # galgebra 0.4.5 + warnings.warn( + "ga.Pdiffs[x] is deprecated, use `ga.pdop(x)` instead", + DeprecationWarning, stacklevel=2) + return {x: self.pdop(x) for x in self.coords} + + @property + def sPds(self): + # galgebra 0.4.5 + warnings.warn( + "ga.sPds[x] is deprecated, use `ga.sdop(x)` instead", + DeprecationWarning, stacklevel=2) + return {x: self.sdop(x) for x in self.coords} + + @property + def Pdop_identity(self): + # galgebra 0.4.5 + warnings.warn( + "ga.Pdop_identity is deprecated, use `ga.pdop({})` instead", + DeprecationWarning, stacklevel=2) + return self.pdop({}) def mv(self, root=None, *args, **kwargs): """ @@ -542,7 +539,8 @@ def mv(self, root=None, *args, **kwargs): if root is None: # Return ga basis and compute grad and rgrad return self.mv_basis - kwargs['ga'] = self + # ensure that ga is not already in kwargs + kwargs = dict(ga=self, **kwargs) if not utils.isstr(root): return mv.Mv(root, *args, **kwargs) @@ -559,8 +557,8 @@ def mv(self, root=None, *args, **kwargs): mvtype_lst = args[0].split(' ') if len(root_lst) != len(mvtype_lst): raise ValueError('In Ga.mv() for multiple multivectors and ' + - 'multivector types incompatible args ' + - str(root_lst) + ' and ' + str(mvtype_lst)) + 'multivector types incompatible args ' + + str(root_lst) + ' and ' + str(mvtype_lst)) mv_lst = [] for (root, mv_type) in zip(root_lst, mvtype_lst): @@ -617,7 +615,7 @@ def _build_grads(self): if self.norm: r_basis = [x / e_norm for (x, e_norm) in zip(self.r_basis_mv, self.e_norm)] - pdx = [self.Pdiffs[x] for x in self.coords] + pdx = [self.pdop(x) for x in self.coords] self.grad = mv.Dop(r_basis, pdx, ga=self) self.rgrad = mv.Dop(r_basis, pdx, ga=self, cmpflg=True) @@ -627,13 +625,17 @@ def grads(self): raise ValueError("Ga must have been initialized with coords to compute grads") return self.grad, self.rgrad + def pdop(self, *args, **kwargs): + """ Shorthand to construct a :class:`~galgebra.mv.Pdop` for this algebra """ + return mv.Pdop(*args, ga=self, **kwargs) + def dop(self, *args, **kwargs): - """ - Instanciate and return a multivector differential operator for - this, 'self', geometric algebra. - """ - kwargs['ga'] = self - return mv.Dop(*args, **kwargs) + """ Shorthand to construct a :class:`~galgebra.mv.Dop` for this algebra """ + return mv.Dop(*args, ga=self, **kwargs) + + def sdop(self, *args, **kwargs): + """ Shorthand to construct a :class:`~galgebra.mv.Sdop` for this algebra """ + return mv.Sdop(*args, ga=self, **kwargs) def lt(self, *args, **kwargs): """ @@ -644,25 +646,22 @@ def lt(self, *args, **kwargs): self._lt_flg = True (self.lt_coords, self.lt_x) = lt.Lt.setup(ga=self) - kwargs['ga'] = self - return lt.Lt(*args, **kwargs) + return lt.Lt(*args, ga=self, **kwargs) def sm(self, *args, **kwargs): """ Instanciate and return a submanifold for this geometric algebra. See :class:`Sm` for instantiation inputs. """ - kwargs['ga'] = self - SM = Sm(*args, **kwargs) - return SM + return Sm(*args, ga=self, **kwargs) def parametric(self, coords): if not isinstance(coords, list): raise TypeError('In Ga.parametric coords = ' + str(coords) + - ' is not a list.') + ' is not a list.') if len(coords) != self.n: raise ValueError('In Ga.parametric number of parametric functions' + - ' not equal to number of coordinates.') + ' not equal to number of coordinates.') self.par_coords = {} @@ -867,16 +866,16 @@ def _build_bases(self, sign_and_indexes=None): if self.debug: printer.oprint('indexes', self.indexes, 'list(indexes)', self._all_indexes_lst, - 'blades', self.blades, 'list(blades)', self._all_blades_lst, - 'blades_to_indexes_dict', self.blades_to_indexes_dict, - 'indexes_to_blades_dict', self.indexes_to_blades_dict, - 'blades_to_grades_dict', self.blades_to_grades_dict, - 'blade_super_scripts', self.blade_super_scripts) + 'blades', self.blades, 'list(blades)', self._all_blades_lst, + 'blades_to_indexes_dict', self.blades_to_indexes_dict, + 'indexes_to_blades_dict', self.indexes_to_blades_dict, + 'blades_to_grades_dict', self.blades_to_grades_dict, + 'blade_super_scripts', self.blade_super_scripts) if not self.is_ortho: printer.oprint('bases', self.bases, 'list(bases)', self._all_bases_lst, - 'bases_to_indexes_dict', self.bases_to_indexes_dict, - 'indexes_to_bases_dict', self.indexes_to_bases_dict, - 'bases_to_grades_dict', self.bases_to_grades_dict) + 'bases_to_indexes_dict', self.bases_to_indexes_dict, + 'indexes_to_bases_dict', self.indexes_to_bases_dict, + 'bases_to_grades_dict', self.bases_to_grades_dict) # create the Mv wrappers self._all_mv_blades_lst = [ @@ -1084,7 +1083,7 @@ def reduce_basis_loop(g, blst): @staticmethod def blade_reduce(lst): - sgn = 1 + sgn = S(1) for i in range(1, len(lst)): save = lst[i] j = i @@ -1094,7 +1093,7 @@ def blade_reduce(lst): j -= 1 lst[j] = save if lst[j] == lst[j - 1]: - return 0, None + return S(0), None return sgn, lst def wedge_product_basis_blades(self, blade12): # blade12 = blade1*blade2 @@ -1106,15 +1105,37 @@ def wedge_product_basis_blades(self, blade12): # blade12 = blade1*blade2 index12 = list(index1 + index2) if len(index12) > self.n: - return 0 + return S(0) (sgn, wedge12) = Ga.blade_reduce(index12) if sgn != 0: return(sgn * sign1 * sign2 * self.indexes_to_blades_dict[tuple(wedge12)]) else: - return 0 + return S(0) #****** Dot (|) product, reft (<) and right (>) contractions ******# + def _dot_product_grade(self, grade1, grade2, mode): + """ + Get the grade to select from the geometric product, for a given + dot product + """ + if mode == '|': + if grade1 == 0 or grade2 == 0: + return None + return abs(grade1 - grade2) + elif mode == '<': + grade = grade2 - grade1 + if grade < 0: + return None + return grade + elif mode == '>': + grade = grade1 - grade2 + if grade < 0: + return None + return grade + else: + raise ValueError('mode={!r} not allowed'.format(mode)) + def dot_product_basis_blades(self, blade12, mode): # dot (|), left (<), and right (>) products # dot product for orthogonal basis @@ -1122,22 +1143,14 @@ def dot_product_basis_blades(self, blade12, mode): sign1, index1 = self.blades_to_indexes_dict[blade1] sign2, index2 = self.blades_to_indexes_dict[blade2] index = list(index1 + index2) - grade1 = len(index1) - grade2 = len(index2) - if mode == '|': - grade = abs(grade1 - grade2) - elif mode == '<': - grade = grade2 - grade1 - if grade < 0: - return 0 - elif mode == '>': - grade = grade1 - grade2 - if grade < 0: - return 0 + grade = self._dot_product_grade(len(index1), len(index2), mode=mode) + if grade is None: + return zero + n = len(index) sgn = sign1 * sign2 - result = 1 + result = S(1) ordered = False while n > grade: ordered = True @@ -1149,7 +1162,7 @@ def dot_product_basis_blades(self, blade12, mode): if index1 == index2: n -= 2 if n < grade: - return 0 + return zero result *= self.g[index1, index1] index = index[:i1] + index[i2 + 1:] elif index1 > index2: @@ -1163,7 +1176,7 @@ def dot_product_basis_blades(self, blade12, mode): if ordered: break if n > grade: - return 0 + return zero else: if index == []: return sgn * result @@ -1187,27 +1200,11 @@ def non_orthogonal_dot_product_basis_blades(self, blade12, mode): # blade12 = ( # grades of input blades grade1 = self.blades_to_grades_dict[blade1] grade2 = self.blades_to_grades_dict[blade2] - if mode == '|': - grade_dot = abs(grade2 - grade1) - if grade_dot in grade_dict: - return grade_dict[grade_dot] - else: - return zero - elif mode == '<': - grade_contract = grade2 - grade1 - if grade_contract in grade_dict: - return grade_dict[grade_contract] - else: - return zero - elif mode == '>': - grade_contract = grade1 - grade2 - if grade_contract in grade_dict: - return grade_dict[grade_contract] - else: - return zero - else: - raise ValueError('"' + str(mode) + '" not allowed ' - 'dot mode in non_orthogonal_dot_basis') + + grade = self._dot_product_grade(grade1, grade2, mode=mode) + if grade is None: + return zero + return grade_dict.get(grade, zero) ############# Non-Orthogonal Tables and Dictionaries ############### @@ -1329,73 +1326,34 @@ def Mul(self, A, B, mode='*'): # Unifies all products into one function return self.mul(A, B) elif mode == '^': return self.wedge(A, B) + elif mode == '|': + return self.hestenes_dot(A, B) + elif mode == '<': + return self.left_contract(A, B) + elif mode == '>': + return self.right_contract(A, B) else: - return self._dot(A, B, mode=mode) + raise ValueError('Unknown multiplication operator {!r}', mode) def mul(self, A, B): # geometric (*) product of blade representations - if A == 0 or B == 0: - return 0 return update_and_substitute(A, B, self.mul_table_dict) def wedge(self, A, B): # wedge assumes A and B are in blade rep # wedge product is same for both orthogonal and non-orthogonal for A and B in blade rep - if A == 0 or B == 0: - return 0 return update_and_substitute(A, B, self.wedge_table_dict) - - def _dot(self, A, B, mode): - if A == 0 or B == 0: - return 0 - - if mode == '|': # Hestenes dot product - A = self.remove_scalar_part(A) - B = self.remove_scalar_part(B) - return update_and_substitute(A, B, self.dot_table_dict) - elif mode == '<' or mode == '>': - r""" - Let :math:`A = a + A'` and :math:`B = b + B'` where :math:`a` and - :math:`b` are the scalar parts of :math:`A` and :math:`B`, and - :math:`A'` and :math:`B'` are the remaining parts of :math:`A` and - :math:`B`. Then we have: - - .. math:: - - (a+A') \rfloor (b+B') &= a(b+B') + A' \rfloor B' \\ - (a+A') \lfloor (b+B') &= b(a+A') + A' \lfloor B' - - We use these relations to reduce :math:`A \rfloor B` (``AB``). - """ - (a, Ap) = self.split_multivector(A) # Ap = A' - (b, Bp) = self.split_multivector(B) # Bp = B' - if mode == '<': # Left contraction - if Ap != 0 and Bp != 0: # Neither nc part of A or B is zero - prod = update_and_substitute(Ap, Bp, self.left_contract_table_dict) - return prod + a * B - else: # Ap or Bp is zero - return a * B - elif mode == '>': # Right contraction - if Ap != 0 and Bp != 0: # Neither nc part of A or B is zero - prod = update_and_substitute(Ap, Bp, self.right_contract_table_dict) - return prod + b * A - else: # Ap or Bp is zero - return b * A - else: - raise ValueError('"' + str(mode) + '" not a legal mode in dot') - def hestenes_dot(self, A, B): r""" compute the hestenes dot product, :math:`A \bullet B` """ - return self._dot(A, B, mode='|') + return update_and_substitute(A, B, self.dot_table_dict) def left_contract(self, A, B): r""" compute the left contraction, :math:`A \rfloor B` """ - return self._dot(A, B, mode='<') + return update_and_substitute(A, B, self.left_contract_table_dict) def right_contract(self, A, B): r""" compute the right contraction, :math:`A \lfloor B` """ - return self._dot(A, B, mode='>') + return update_and_substitute(A, B, self.right_contract_table_dict) def dot(self, A, B): r""" @@ -1403,7 +1361,11 @@ def dot(self, A, B): The :attr:`dot_mode` attribute determines which of these is used. """ - return self._dot(A, B, mode=self.dot_mode) + # forbid something silly like setting dot_mode to the wedge or geometric + # product + if self.dot_mode in '^*': + raise ValueError('"' + str(self.dot_mode) + '" not a legal mode in dot') + return self.Mul(A, B, mode=self.dot_mode) ######################## Helper Functions ########################## @@ -1761,9 +1723,9 @@ def er_blade(self, er, blade, mode='*', left=True): return self.wedge(blade, er) else: if left: - return self._dot(er, blade, mode=mode) + return self.Mul(er, blade, mode=mode) else: - return self._dot(blade, er, mode=mode) + return self.Mul(blade, er, mode=mode) def blade_derivation(self, blade, ib): """ @@ -1808,9 +1770,6 @@ def blade_derivation(self, blade, ib): self._dbases[key] = db return db - def pdop(self,*args): - return mv.Pdop(args,ga=self) - def pDiff(self, A, coord): """ Compute partial derivative of multivector function 'A' with @@ -1852,12 +1811,7 @@ def pDiff(self, A, coord): c, nc = term.args_cnc(split_1=False) x = self.blade_derivation(nc[0], coord) if x != zero: - if len(c) == 1: - dA += c[0] * x - elif len(c) == 0: - dA += x - else: - dA += reduce(operator.mul, c, one) * x + dA += reduce(operator.mul, c, x) return dA @@ -2082,7 +2036,7 @@ def __init__(self, *args, **kwargs): if len(u) != n_base: raise ValueError('In submanifold dimension of base manifold' + - ' not equal to dimension of mapping.') + ' not equal to dimension of mapping.') dxdu = [] for x_i in u: tmp = [] diff --git a/galgebra/lt.py b/galgebra/lt.py index 6850f087..068b8117 100644 --- a/galgebra/lt.py +++ b/galgebra/lt.py @@ -43,7 +43,7 @@ def Symbolic_Matrix(root,coords=None,mode='g',f=False,sub=True): if not f: mat[row,col] = Symbol(element,real=True) else: - mat[row,col] = Function(element)(*coords) + mat[row,col] = Function(element)(*coords) elif mode == 's': # Symmetric symbolic matrix for row in n_range: @@ -57,7 +57,7 @@ def Symbolic_Matrix(root,coords=None,mode='g',f=False,sub=True): if not f: mat[row,col] = Symbol(element,real=True) else: - mat[row,col] = Function(element)(*coords) + mat[row,col] = Function(element)(*coords) elif mode == 'a': # Asymmetric symbolic matrix for row in n_range: @@ -75,7 +75,7 @@ def Symbolic_Matrix(root,coords=None,mode='g',f=False,sub=True): if not f: mat[row,col] = sign * Symbol(element,real=True) else: - mat[row,col] = sign * Function(element)(*coords) + mat[row,col] = sign * Function(element)(*coords) else: raise ValueError('In Symbolic_Matrix mode = ' + str(mode)) else: @@ -219,8 +219,8 @@ def __init__(self, *args, **kwargs): raise ValueError('In Spinor input for Lt, S*S.rev() not a scalar!\n') elif utils.isstr(mat_rep): # String input - Amat = Symbolic_Matrix(mat_rep, coords=self.Ga.coords,mode=self.mode,f=self.fct_flg) - self.__init__(Amat, ga=self.Ga) + Amat = Symbolic_Matrix(mat_rep, coords=self.Ga.coords,mode=self.mode,f=self.fct_flg) + self.__init__(Amat, ga=self.Ga) else: # Linear multivector function input # F is a multivector function to be tested for linearity @@ -239,7 +239,7 @@ def __init__(self, *args, **kwargs): def __call__(self, v, obj=False): if isinstance(v, mv.Mv) and self.Ga.name != v.Ga.name: - raise ValueError('In Lt call Lt and argument refer to different vector spaces') + raise ValueError('In Lt call Lt and argument refer to different vector spaces') if self.spinor: if not isinstance(v, mv.Mv): diff --git a/galgebra/metric.py b/galgebra/metric.py index 1ea2ad76..9ee25f91 100644 --- a/galgebra/metric.py +++ b/galgebra/metric.py @@ -24,7 +24,7 @@ def apply_function_list(f,x): return f(x) -def linear_expand(expr, mode=True): +def linear_expand(expr): if isinstance(expr, Expr): expr = expand(expr) @@ -58,10 +58,13 @@ def linear_expand(expr, mode=True): else: bases.append(base) coefs.append(coef) - if mode: - return (coefs, bases) - else: - return list(zip(coefs, bases)) + return (coefs, bases) + + +def linear_expand_terms(expr): + coefs, bases = linear_expand(expr) + return zip(coefs, bases) + def collect(A, nc_list): """ @@ -206,8 +209,7 @@ def apply(expr): @staticmethod def applymv(mv): - mv.obj = Simp.apply(mv.obj) - return mv + return Mv(Simp.apply(mv.obj), ga=mv.Ga) class Metric(object): @@ -420,8 +422,8 @@ def _build_derivatives_of_basis(self): # Derivatives of basis vectors from Chri # \frac{\partial e_{j}}{\partial x^{i}} = \Gamma_{ijk} e^{k} de = [[ sum([Gamma_ijk * e__k for (Gamma_ijk, e__k) in zip(dG[i][j], self.r_symbols)]) - for j in n_range] - for i in n_range] + for j in n_range + ] for i in n_range] if self.debug: printer.oprint('D_{i}e^{j}', de) diff --git a/galgebra/mv.py b/galgebra/mv.py index 8e967f2c..3e2c075a 100644 --- a/galgebra/mv.py +++ b/galgebra/mv.py @@ -6,6 +6,8 @@ import numbers import operator from functools import reduce, cmp_to_key +import sys +import warnings from sympy import ( Symbol, Function, S, expand, Add, @@ -19,6 +21,7 @@ from . import metric from . import utils from .printer import ZERO_STR +from .utils import _KwargParser ONE = S(1) ZERO = S(0) @@ -61,10 +64,6 @@ class Mv(object): fmt = 1 latex_flg = False restore = False - init_slots = {'f': (False, 'True if function of coordinates'), - 'ga': (None, 'Geometric algebra to be used with multivectors'), - 'coords': (None, 'Coordinates to be used with multivector function'), - 'recp': (None, 'Normalization for reciprocal vector')} dual_mode_lst = ['+I','I+','+Iinv','Iinv+','-I','I-','-Iinv','Iinv-'] @staticmethod @@ -186,21 +185,24 @@ def add_superscript(root, s): return root return '{}__{}'.format(root, s) grade = __grade + kw = _KwargParser('_make_grade', kwargs) if utils.isstr(__name_or_coeffs): name = __name_or_coeffs - if isinstance(kwargs['f'], bool) and not kwargs['f']: #Is a constant mulitvector function - return sum([Symbol(add_superscript(name, super_script), real=True) * base - for (super_script, base) in zip(ga.blade_super_scripts[grade], ga.blades[grade])]) - - else: - if isinstance(kwargs['f'], bool): #Is a multivector function of all coordinates + f = kw.pop('f', False) + kw.reject_remaining() + if isinstance(f, bool): + if f: # Is a multivector function of all coordinates return sum([Function(add_superscript(name, super_script), real=True)(*ga.coords) * base - for (super_script, base) in zip(ga.blade_super_scripts[grade], ga.blades[grade])]) - else: #Is a multivector function of tuple kwargs['f'] variables - return sum([Function(add_superscript(name, super_script), real=True)(*kwargs['f']) * base - for (super_script, base) in zip(ga.blade_super_scripts[grade], ga.blades[grade])]) + for (super_script, base) in zip(ga.blade_super_scripts[grade], ga.blades[grade])]) + else: # Is a constant multivector function + return sum([Symbol(add_superscript(name, super_script), real=True) * base + for (super_script, base) in zip(ga.blade_super_scripts[grade], ga.blades[grade])]) + else: # Is a multivector function of tuple f variables + return sum([Function(add_superscript(name, super_script), real=True)(*f) * base + for (super_script, base) in zip(ga.blade_super_scripts[grade], ga.blades[grade])]) elif isinstance(__name_or_coeffs, (list, tuple)): coeffs = __name_or_coeffs + kw.reject_remaining() if len(coeffs) <= len(ga.blades[grade]): return sum([coef * base for (coef, base) in zip(coeffs, ga.blades[grade][:len(coeffs)])]) @@ -255,10 +257,12 @@ def _make_spinor(ga, __name, **kwargs): )) @staticmethod - def _make_odd(ga, __name_or_coeffs, **kwargs): + def _make_odd(ga, __name, **kwargs): """ Make a general odd multivector """ + if not isinstance(__name, str): + raise TypeError("Must be a string") return reduce(operator.add, ( - Mv._make_grade(ga, __name_or_coeffs, grade, **kwargs) + Mv._make_grade(ga, __name, grade, **kwargs) for grade in range(1, ga.n + 1, 2) ), S(0)) # base case needed in case n == 0 @@ -267,14 +271,74 @@ def _make_odd(ga, __name_or_coeffs, **kwargs): _make_even = _make_spinor def __init__(self, *args, **kwargs): + """ + __init__(self, *args, ga, recp=None, **kwargs) + + Note this constructor is overloaded, based on the type and number of + positional arguments: + + .. class:: Mv(*, ga, recp=None) + + Create a zero multivector + .. class:: Mv(expr, /, *, ga, recp=None) + + Create a multivector from an existing vector or sympy expression + .. class:: Mv(coeffs, grade, /, ga, recp=None) + + Create a multivector constant with a given grade + .. class:: Mv(name, category, /, *cat_args, ga, recp=None, f=False) + + Create a multivector constant with a given category + .. class:: Mv(name, grade, /, ga, recp=None, f=False) + + Create a multivector variable or function of a given grade + .. class:: Mv(coeffs, category, /, *cat_args, ga, recp=None) + + Create a multivector variable or function of a given category + + + ``*`` and ``/`` in the signatures above are python + 3.8 syntax, and respectively indicate the boundaries between + positional-only, normal, and keyword-only arguments. + + Parameters + ---------- + ga : ~galgebra.ga.Ga + Geometric algebra to be used with multivectors + recp : object, optional + Normalization for reciprocal vector. Unused. + name : str + Name of this multivector, if it is a variable or function + coeffs : sequence + Sequence of coefficients for the given category. + This is only meaningful + category : str + One of: - if 'ga' not in kwargs: - raise ValueError("Geometric algebra key inplut 'ga' required") + * ``"grade"`` - this takes an additional argument, the grade to + create, in ``cat_args`` + * ``"scalar"`` + * ``"vector"`` + * ``"bivector"`` / ``"grade2"`` + * ``"pseudo"`` + * ``"mv"`` + * ``"even"`` / ``"spinor"`` + * ``"odd"`` - kwargs = metric.test_init_slots(Mv.init_slots, **kwargs) + f : bool, tuple + True if function of coordinates, or a tuple of those coordinates. + Only valid if a name is passed - self.Ga = kwargs.pop('ga') - self.recp = kwargs.pop('recp') # Normalization for reciprocal vectors + coords : + This argument is always accepted but ignored. + + It is incorrectly described internally as the coordinates to be + used with multivector functions. + """ + kw = _KwargParser('__init__', kwargs) + self.Ga = kw.pop('ga') + self.recp = kw.pop('recp', None) # not used + kw.pop('coords', None) # ignored self.char_Mv = False self.i_grade = None # if pure grade mv, grade value @@ -288,6 +352,7 @@ def __init__(self, *args, **kwargs): if len(args) == 0: # default constructor 0 self.obj = S(0) self.i_grade = 0 + kw.reject_remaining() elif len(args) == 1 and not utils.isstr(args[0]): # copy constructor x = args[0] if isinstance(x, Mv): @@ -301,6 +366,7 @@ def __init__(self, *args, **kwargs): self.obj = S(x) self.is_blade_rep = True self.characterise_Mv() + kw.reject_remaining() else: if utils.isstr(args[1]): make_args = list(args) @@ -523,18 +589,15 @@ def __mul__(self, A): def __rmul__(self, A): return Mv(expand(A * self.obj), ga=self.Ga) - def __div__(self, A): - if isinstance(A,Mv): - return self * A.inv() - else: - return self * (S(1)/A) - def __truediv__(self, A): if isinstance(A,Mv): return self * A.inv() else: return self * (S(1)/A) + if sys.version_info.major < 3: + __div__ = __truediv__ + def __str__(self): if printer.GaLatexPrinter.latex_flg: Printer = printer.GaLatexPrinter @@ -555,10 +618,12 @@ def Mv_str(self): global print_replace_old, print_replace_new if self.i_grade == 0: return str(self.obj) - self.obj = expand(self.obj) - self.char_Mv = False - self.characterise_Mv() - self.obj = metric.Simp.apply(self.obj) + + # note: this just replaces `self` for the rest of this function + obj = expand(self.obj) + obj = metric.Simp.apply(obj) + self = Mv(obj, ga=self.Ga) + if self.is_blade_rep or self.Ga.is_ortho: base_keys = self.Ga._all_blades_lst grade_keys = self.Ga.blades_to_grades_dict @@ -573,10 +638,7 @@ def Mv_str(self): grade0 = S(0) for arg in args: c, nc = arg.args_cnc() - if len(c) > 0: - c = reduce(operator.mul, c) - else: - c = S(1) + c = reduce(operator.mul, c, S(1)) if len(nc) > 0: base = nc[0] if base in base_keys: @@ -625,11 +687,13 @@ def Mv_latex_str(self): if self.obj == 0: return ZERO_STR - self.first_line = True + # todo: use the nonlocal keyword here instead once we drop python 2 + class first_line: + value = True def append_plus(c_str): - if self.first_line: - self.first_line = False + if first_line.value: + first_line.value = False return c_str else: c_str = c_str.strip() @@ -639,9 +703,10 @@ def append_plus(c_str): return ' + ' + c_str # str representation of multivector - self.obj = expand(self.obj) - self.characterise_Mv() - self.obj = metric.Simp.apply(self.obj) + # note: this just replaces `self` for the rest of this function + obj = expand(self.obj) + obj = metric.Simp.apply(obj) + self = Mv(obj, ga=self.Ga) if self.obj == S(0): return ZERO_STR @@ -660,10 +725,7 @@ def append_plus(c_str): grade0 = S(0) for arg in args: c, nc = arg.args_cnc(split_1=False) - if len(c) > 0: - c = reduce(operator.mul, c) - else: - c = S(1) + c = reduce(operator.mul, c, S(1)) if len(nc) > 0: base = nc[0] if base in base_keys: @@ -708,7 +770,7 @@ def append_plus(c_str): elif printer.GaLatexPrinter.fmt == 2: # One grade per line if grade != old_grade: old_grade = grade - if not self.first_line: + if not first_line.value: lines.append(s) s = append_plus(cb_str) else: @@ -763,11 +825,8 @@ def __or__(self, A): # dot (|) product return A.Mul(self, A, op='|') self = self.blade_rep() - if self.is_scalar() or A.is_scalar(): - return S(0) A = A.blade_rep() - self_dot_A = Mv(self.Ga.hestenes_dot(self.obj, A.obj), ga=self.Ga) - return self_dot_A + return Mv(self.Ga.hestenes_dot(self.obj, A.obj), ga=self.Ga) def __ror__(self, A): # dot (|) product if not isinstance(A, Mv): @@ -858,21 +917,19 @@ def collect(self,deep=False): self.obj = self.obj.collect(c) return self """ - coefs, bases = metric.linear_expand(self.obj) obj_dict = {} - for (coef, base) in zip(coefs, bases): + for coef, base in metric.linear_expand_terms(self.obj): if base in list(obj_dict.keys()): obj_dict[base] += coef else: obj_dict[base] = coef - obj = 0 + obj = S(0) for base in list(obj_dict.keys()): if deep: obj += collect(obj_dict[base])*base else: obj += obj_dict[base]*base - self.obj = obj - return(self) + return Mv(obj, ga=self.Ga) def is_scalar(self): @@ -932,7 +989,7 @@ def is_versor(self): if not test.is_scalar(): return self.versor_flg # see if self*x*self.rev() returns a vector for x an arbitrary vector - test = self * self.Ga.XOX * self.rev() + test = self * self.Ga._XOX * self.rev() self.versor_flg = test.is_vector() return self.versor_flg @@ -950,17 +1007,12 @@ def get_grade(self, r): return Mv(self.Ga.get_grade(self.obj, r), ga=self.Ga) def components(self): - (coefs, bases) = metric.linear_expand(self.obj) - cb = list(zip(coefs, bases)) + cb = metric.linear_expand_terms(self.obj) cb = sorted(cb, key=lambda x: self.Ga._all_blades_lst.index(x[1])) - terms = [] - for (coef, base) in cb: - terms.append(self.Ga.mv(coef * base)) - return terms + return [self.Ga.mv(coef * base) for (coef, base) in cb] def get_coefs(self, grade): - (coefs, bases) = metric.linear_expand(self.obj) - cb = list(zip(coefs, bases)) + cb = metric.linear_expand_terms(self.obj) cb = sorted(cb, key=lambda x: self.Ga.blades[grade].index(x[1])) (coefs, bases) = list(zip(*cb)) return coefs @@ -1008,9 +1060,8 @@ def proj(self, bases_lst): part of multivector with the same bases as in the bases_lst. """ bases_lst = [x.obj for x in bases_lst] - (coefs, bases) = metric.linear_expand(self.obj) obj = 0 - for (coef, base) in zip(coefs, bases): + for coef, base in metric.linear_expand_terms(self.obj): if base in bases_lst: obj += coef * base return Mv(obj, ga=self.Ga) @@ -1044,29 +1095,24 @@ def rev(self): __invert__ = rev # allow `~x` to call x.rev() def diff(self, coord): - Dself = Mv(ga=self.Ga) if self.Ga.coords is None: - Dself.obj = diff(self.obj, coord) - return Dself + obj = diff(self.obj, coord) elif coord not in self.Ga.coords: if self.Ga.par_coords is None: - Dself.obj = diff(self.obj, coord) + obj = diff(self.obj, coord) elif coord not in self.Ga.par_coords: - Dself.obj = diff(self.obj, coord) + obj = diff(self.obj, coord) else: - Dself.obj = diff(self.obj, coord) + obj = diff(self.obj, coord) for x_coord in self.Ga.coords: f = self.Ga.par_coords[x_coord] if f != S(0): tmp1 = self.Ga.pDiff(self.obj, x_coord) tmp2 = diff(f, coord) - Dself.obj += tmp1 * tmp2 - Dself.characterise_Mv() - return Dself + obj += tmp1 * tmp2 else: - Dself.obj = self.Ga.pDiff(self.obj, coord) - Dself.characterise_Mv() - return Dself + obj = self.Ga.pDiff(self.obj, coord) + return Mv(obj, ga=self.Ga) def pdiff(self, var): return Mv(self.Ga.pDiff(self.obj, var), ga=self.Ga) @@ -1286,9 +1332,8 @@ def inv(self): raise TypeError('In inv() for self =' + str(self) + 'self, or self*self or self*self.rev() is not a scalar') def func(self, fct): # Apply function, fct, to each coefficient of multivector - (coefs, bases) = metric.linear_expand(self.obj) s = S(0) - for (coef, base) in zip(coefs, bases): + for coef, base in metric.linear_expand_terms(self.obj): s += fct(coef) * base fct_self = Mv(s, ga=self.Ga) fct_self.characterise_Mv() @@ -1298,45 +1343,33 @@ def trigsimp(self): return self.func(trigsimp) def simplify(self, modes=simplify): - (coefs, bases) = metric.linear_expand(self.obj) + if not isinstance(modes, (list, tuple)): + modes = [modes] + obj = S(0) - if isinstance(modes, list) or isinstance(modes, tuple): - for (coef, base) in zip(coefs, bases): - for mode in modes: - coef = mode(coef) - obj += coef * base - else: - for (coef, base) in zip(coefs, bases): - obj += modes(coef) * base - self.obj = obj - return self + for coef, base in metric.linear_expand_terms(self.obj): + for mode in modes: + coef = mode(coef) + obj += coef * base + return Mv(obj, ga=self.Ga) def subs(self, d): # For each scalar coef of the multivector apply substitution argument d - (coefs, bases) = metric.linear_expand(self.obj) - obj = S(0) - for (coef, base) in zip(coefs, bases): - obj += coef.subs(d) * base - #self.obj = obj - #return self - return self.Ga.mv(obj) + obj = sum(( + coef.subs(d) * base for coef, base in metric.linear_expand_terms(self.obj) + ), S(0)) + return Mv(obj, ga=self.Ga) def expand(self): - coefs,bases = metric.linear_expand(self.obj) - new_coefs = [] - for coef in coefs: - new_coefs.append(expand(coef)) - obj = 0 - for coef,base in zip(new_coefs,bases): - obj += coef * base - self.obj = obj - return self + obj = sum(( + expand(coef) * base for coef, base in metric.linear_expand_terms(self.obj) + ), S(0)) + return Mv(obj, ga=self.Ga) def list(self): - (coefs, bases) = metric.linear_expand(self.obj) indexes = [] key_coefs = [] - for (coef, base) in zip(coefs, bases): + for coef, base in metric.linear_expand_terms(self.obj): if base in self.Ga.basis: index = self.Ga.basis.index(base) key_coefs.append((coef, index)) @@ -1394,6 +1427,44 @@ def compare(A,B): else: raise TypeError('In compare both arguments are not multivectors\n') + +def _consolidate_terms(terms): + """ + Remove zero coefs and consolidate coefs with repeated pdiffs. + """ + new_coefs = [] + new_pdiffs = [] + for (coef, pd) in terms: + if coef != S(0): + if pd in new_pdiffs: + index = new_pdiffs.index(pd) + new_coefs[index] += coef + else: + new_coefs.append(coef) + new_pdiffs.append(pd) + return tuple(zip(new_coefs, new_pdiffs)) + + +def _merge_terms(terms1, terms2): + """ Concatenate and consolidate two sets of already-consolidated terms """ + pdiffs1 = [pdiff for _, pdiff in terms1] + pdiffs2 = [pdiff for _, pdiff in terms2] + + pdiffs = pdiffs1 + [x for x in pdiffs2 if x not in pdiffs1] + coefs = len(pdiffs) * [S(0)] + + for coef, pdiff in terms1: + index = pdiffs.index(pdiff) + coefs[index] += coef + + for coef, pdiff in terms2: + index = pdiffs.index(pdiff) + coefs[index] += coef + + # remove zeros + return [(coef, pdiff) for coef, pdiff in zip(coefs, pdiffs) if coef != S(0)] + + ################ Scalar Partial Differential Operator Class ############ class Sdop(object): @@ -1407,27 +1478,18 @@ class Sdop(object): Attributes ---------- - terms : list of tuple - the structure :math:`[(c_{1},D_{1}),(c_{2},D_{2}), ...]` + terms : tuple of tuple + the structure :math:`((c_{1},D_{1}),(c_{2},D_{2}), ...)` """ init_slots = {'ga': (None, 'Associated geometric algebra')} - ga = None str_mode = False - @staticmethod - def setGa(ga): - Sdop.ga = ga - Pdop.setGa(ga) - return - def TSimplify(self): - new_terms = [] - for (coef, pdiff) in self.terms: - new_terms.append((metric.Simp.apply(coef), pdiff)) - self.terms = new_terms - return + return Sdop([ + (metric.Simp.apply(coef), pdiff) for (coef, pdiff) in self.terms + ], ga=self.Ga) @staticmethod def consolidate_coefs(sdop): @@ -1435,47 +1497,28 @@ def consolidate_coefs(sdop): Remove zero coefs and consolidate coefs with repeated pdiffs. """ if isinstance(sdop, Sdop): - terms = sdop.terms - else: - terms = sdop - - new_coefs = [] - new_pdiffs = [] - for (coef, pd) in terms: - if coef != S(0): - if pd in new_pdiffs: - index = new_pdiffs.index(pd) - new_coefs[index] += coef - else: - new_coefs.append(coef) - new_pdiffs.append(pd) - new_terms = list(zip(new_coefs, new_pdiffs)) - - if isinstance(sdop, Sdop): - return Sdop(new_terms, ga=sdop.Ga) + return Sdop(_consolidate_terms(sdop.terms), ga=sdop.Ga) else: - return new_terms + return _consolidate_terms(sdop) def simplify(self, modes=simplify): - coefs, pdiffs = list(zip(*self.terms)) - new_coefs = [] - for coef in coefs: - new_coefs.append(metric.apply_function_list(modes,coef)) - self.terms = list(zip(new_coefs,pdiffs)) - return self + return Sdop([ + (metric.apply_function_list(modes, coef), pdiff) + for coef, pdiff in self.terms + ], ga=self.Ga) - def sort_terms(self): + def _with_sorted_terms(self): # self.terms.sort(key=operator.itemgetter(1), cmp=Pdop.compare) # terms are in the form of (coef, pdiff) # so we need to first extract pdiff and then use Pdop.compare to compare - self.terms.sort(key=cmp_to_key(lambda term1, term2 : Pdop.compare(term1[1], term2[1]))) - return + new_terms = sorted(self.terms, key=cmp_to_key(lambda term1, term2 : Pdop.compare(term1[1], term2[1]))) + return Sdop(new_terms, ga=self.Ga) def Sdop_str(self): if len(self.terms) == 0: return ZERO_STR - self.sort_terms() + self = self._with_sorted_terms() s = '' for (coef, pdop) in self.terms: coef_str = printer.latex(coef) @@ -1503,7 +1546,7 @@ def Sdop_latex_str(self): if len(self.terms) == 0: return ZERO_STR - self.sort_terms() + self = self._with_sorted_terms() s = '' for (coef, pdop) in self.terms: @@ -1550,107 +1593,78 @@ def __init__(self, *args, **kwargs): self.Ga = kwargs['ga'] # Associated geometric algebra (coords) if self.Ga is None: - if Sdop.ga is None: - raise ValueError('In Sdop.__init__ self.Ga must be defined.') - else: - self.Ga = Sdop.ga + raise ValueError('In Sdop.__init__ self.Ga must be defined.') - if len(args[0]) == 0: # identity Dop - self.terms = [(S(1), self.Ga.Pdop_identity)] - elif len(args[0]) == 1 and isinstance(args[0],Symbol): # Simple Pdop of order 1 - self.terms = [(S(1), self.Ga.pdop(args[0]))] + if len(args) == 1 and isinstance(args[0],Symbol): # Simple Pdop of order 1 + self.terms = ((S(1), Pdop(args[0], ga=self.Ga)),) else: if len(args) == 2 and isinstance(args[0],list) and isinstance(args[1],list): if len(args[0]) != len(args[1]): raise ValueError('In Sdop.__init__ coefficent list and Pdop list must be same length.') - self.terms = list(zip(args[0],args[1])) - elif len(args) == 1 and isinstance(args[0],list): - self.terms = args[0] + self.terms = tuple(zip(args[0], args[1])) + elif len(args) == 1 and isinstance(args[0], (list, tuple)): + self.terms = tuple(args[0]) else: raise ValueError('In Sdop.__init__ length of args must be 1 or 2 args = '+str(args)) def __call__(self, arg): if isinstance(arg, Sdop): if self.Ga != arg.Ga: - raise ValueError('In Sdop.__call__ self.Ga != arg.Ga.') + raise ValueError( + 'When chaining scalar differential operators, self.Ga != arg.Ga.') terms = [] for (coef, pdiff) in self.terms: new_terms = pdiff(arg.terms) - new_terms = [ (coef * x[0], x[1]) for x in new_terms] + new_terms = [(coef * c, p) for c, p in new_terms] terms += new_terms - return Sdop(terms, ga=self.Ga) + product = Sdop(terms, ga=self.Ga) + return Sdop.consolidate_coefs(product) else: - return sum([x[0] * x[1](arg) for x in self.terms]) + return sum([coef * pdiff(arg) for coef, pdiff in self.terms], S(0)) def __neg__(self): - return Sdop([(-x[0], x[1]) for x in self.terms], ga=self.Ga) + return Sdop([(-coef, pdiff) for coef, pdiff in self.terms], ga=self.Ga) @staticmethod def Add(sdop1, sdop2): - if isinstance(sdop1, Sdop) and isinstance(sdop1, Sdop): + if isinstance(sdop1, Sdop) and isinstance(sdop2, Sdop): if sdop1.Ga != sdop2.Ga: raise ValueError('In Sdop.Add sdop1.Ga != sdop2.Ga.') - coefs1, pdiffs1 = list(zip(*sdop1.terms)) - coefs2, pdiffs2 = list(zip(*sdop2.terms)) - - pdiffs1 = list(pdiffs1) - pdiffs2 = list(pdiffs2) - - pdiffs = pdiffs1 + [x for x in pdiffs2 if x not in pdiffs1] - coefs = len(pdiffs) * [S(0)] - - for pdiff in pdiffs1: - index = pdiffs.index(pdiff) - coef = coefs1[pdiffs1.index(pdiff)] - coefs[index] += coef - - for pdiff in pdiffs2: - index = pdiffs.index(pdiff) - coef = coefs2[pdiffs2.index(pdiff)] - coefs[index] += coef - - sdop_sum = Sdop(coefs, pdiffs, ga=sdop1.Ga) - elif isinstance(sdop1, Sdop): - coefs, pdiffs = list(zip(*sdop1.terms)) - if sdop1.Ga.Pdop_identity in pdiffs: - index = pdiffs.index(sdop1.Ga.Pdop_identity) - coef[index] += sdop2 + return Sdop(_merge_terms(sdop1.terms, sdop2.terms), ga=sdop1.Ga) + else: + # convert values to multiplicative operators + if isinstance(sdop1, Sdop): + if not isinstance(sdop2, Mv): + sdop2 = sdop1.Ga.mv(sdop2) + sdop2 = Sdop([(sdop2, Pdop({}, ga=sdop1.Ga))], ga=sdop1.Ga) + elif isinstance(sdop2, Sdop): + if not isinstance(sdop1, Mv): + sdop1 = sdop2.Ga.mv(sdop1) + sdop1 = Sdop([(sdop1, Pdop({}, ga=sdop2.Ga))], ga=sdop2.Ga) else: - coef.append(sdop2) - pdiff.append(sdop1.Ga.Pdop_identity) - return Sdop(coefs, pdiffs, ga=sdop1.Ga) - else: - coefs, pdiffs = list(zip(*sdop2.terms)) - if sdop2.Ga.Pdop_identity in pdiffs: - index = pdiffs.index(sdop2.Ga.Pdop_identity) - coef[index] += sdop1 - else: - coef.append(sdop1) - pdiff.append(sdop2.Ga.Pdop_identity) - sdop_sum = Sdop(coefs, pdiffs, ga=sdop2.Ga) + raise TypeError("Neither argument is a Dop instance") + return Sdop.Add(sdop1, sdop2) - return Sdop.consolidate_coefs(sdop_sum) + def __eq__(self, other): + if isinstance(other, Sdop): + if self.Ga != other.Ga: + return NotImplemented - def __eq__(self, sdop): - if isinstance(sdop, Sdop): - if self.Ga != sdop.Ga: - return False - self = Sdop.consolidate_coefs(self) - sdop = Sdop.consolidate_coefs(sdop) - if len(self.terms) != len(sdop.terms): - return False - if set(self.terms) != set(sdop.terms): - return False - return True + diff = self - other + return len(diff.terms) == 0 else: - return False + return NotImplemented + + if sys.version_info.major < 3: + def __ne__(self, other): + return not (self == other) def __add__(self, sdop): return Sdop.Add(self, sdop) def __radd__(self, sdop): - return Sdop(self, sdop) + return Sdop.Add(sdop, self) def __sub__(self, sdop): return Sdop.Add(self, -sdop) @@ -1659,27 +1673,11 @@ def __rsub__(self, sdop): return Sdop.Add(-self, sdop) def __mul__(self, sdopr): - sdopl = self - if isinstance(sdopl, Sdop) and isinstance(sdopr, Sdop): - if sdopl.Ga != sdopr.Ga: - raise ValueError('In Sdop.__mul__ Sdop arguments are not from same geometric algebra') - terms = [] - for (coef, pdiff) in sdopl.terms: - Dsdopl = pdiff(sdopr.terms) # list of terms - Dsdopl = [(coef * x[0], x[1]) for x in Dsdopl] - terms += Dsdopl - product = Sdop(terms, ga=sdopl.Ga) - return Sdop.consolidate_coefs(product) - else: - if not isinstance(sdopl, Sdop): # sdopl is a scalar - terms = [(sdopl * x[0], x[1]) for x in sdopr.terms] - product = Sdop(terms, ga=sdopr.Ga) # returns Sdop - return Sdop.consolidate_coefs(product) - else: # sdopr is a scalar or a multivector - return sum([x[0] * x[1](sdopr) for x in sdopl.terms]) # returns scalar - - def __rmul__(self,sdop): - terms = [(sdop * x[0], x[1]) for x in self.terms] + # alias for applying the operator + return self.__call__(sdopr) + + def __rmul__(self, sdop): + terms = [(sdop * coef, pdiff) for coef, pdiff in self.terms] return Sdop(terms, ga=self.Ga) #################### Partial Derivative Operator Class ################# @@ -1699,21 +1697,16 @@ class Pdop(object): Attributes ---------- pdiffs : dict - a dictionary where coordinates are keys and key value are the number of + A dictionary where coordinates are keys and key value are the number of times one differentiates with respect to the key. order : int - total number of differentiations + Total number of differentiations. + When this is zero (i.e. when :attr:`pdiffs` is ``{}``) then this object + is the identity operator, and returns its operand unchanged. """ - ga = None - init_slots = {'ga': (None, 'Associated geometric algebra')} - @staticmethod - def setGa(ga): - Pdop.ga = ga - return - @staticmethod def compare(pdop1, pdop2): # compare two Pdops if pdop1.order > pdop2.order: @@ -1747,7 +1740,11 @@ def __eq__(self,A): return True return False - def __init__(self, *args, **kwargs): + if sys.version_info.major < 3: + def __ne__(self, other): + return not (self == other) + + def __init__(self, __arg, **kwargs): """ The partial differential operator is a partial derivative with respect to a set of real symbols (variables). The allowed @@ -1761,25 +1758,25 @@ def __init__(self, *args, **kwargs): kwargs = metric.test_init_slots(Pdop.init_slots, **kwargs) self.Ga = kwargs['ga'] # Associated geometric algebra - self.order = 0 if self.Ga is None: - if Pdop.ga is None: - raise ValueError('In Pdop.__init__ self.Ga must be defined.') - else: - self.Ga = Pdop.ga # use geometric algebra of class Pdop - - if args[0] is None: # Pdop is the identity (1) - self.pdiffs = {} - elif isinstance(args[0], dict): # Pdop defined by dictionary - self.pdiffs = args[0] - elif isinstance(args[0],Symbol): # First order derivative with respect to symbol - self.pdiffs = {args[0]:1} + raise ValueError('In Pdop.__init__ self.Ga must be defined.') + + # galgebra 0.4.5 + if __arg is None: + warnings.warn( + "`Pdop(None)` is deprecated, use `Pdop({})` instead", + DeprecationWarning, stacklevel=2) + __arg = {} + + if isinstance(__arg, dict): # Pdop defined by dictionary + self.pdiffs = __arg + elif isinstance(__arg, Symbol): # First order derivative with respect to symbol + self.pdiffs = {__arg: 1} else: - raise ValueError('In pdop args = ', str(args)) + raise TypeError('A dictionary or symbol is required, got {!r}'.format(__arg)) - for x in list(self.pdiffs.keys()): - self.order += self.pdiffs[x] + self.order = sum(self.pdiffs.values()) def factor(self): """ @@ -1793,14 +1790,13 @@ def factor(self): if self.order == 1: return S(0), self else: - x = list(self.pdiffs.keys())[0] - self.order -= 1 - n = self.pdiffs[x] + new_pdiffs = self.pdiffs.copy() + x, n = next(iter(new_pdiffs.items())) if n == 1: - del self.pdiffs[x] + del new_pdiffs[x] else: - self.pdiffs[x] -= 1 - return self, self.Ga.Pdiffs[x] + new_pdiffs[x] -= 1 + return Pdop(new_pdiffs, ga=self.Ga), Pdop(x, ga=self.Ga) def __call__(self, arg): """ @@ -1836,9 +1832,9 @@ def __call__(self, arg): arg = diff(arg,x,self.pdiffs[x]) return arg # derivative is sympy expression - elif isinstance(arg, list): # arg is list of tuples (coef, partial derivative) - D = copy.deepcopy(self) - terms = copy.deepcopy(arg) + elif isinstance(arg, (list, tuple)): # arg is list of tuples (coef, partial derivative) + terms = list(arg) + D = self while True: D, D0 = D.factor() for k, term in enumerate(terms): @@ -1967,19 +1963,6 @@ class Dop(object): 'debug': (False, 'True to print out debugging information'), 'fmt_dop': (1, '1 for normal dop partial derivative formating')} - ga = None - - - @staticmethod - def setGa(ga): # set geometric algebra globally for all Dop's - Dop.ga = ga - Sdop.setGa(ga) - return - - @staticmethod - def flatten_one_level(lst): - return [inner for outer in lst for inner in outer] - def __init__(self, *args, **kwargs): kwargs = metric.test_init_slots(Dop.init_slots, **kwargs) @@ -1988,74 +1971,48 @@ def __init__(self, *args, **kwargs): self.Ga = kwargs['ga'] if self.Ga is None: - if Dop.ga is None: - raise ValueError('In Dop.__init__ self.Ga must be defined.') - else: - self.Ga = Dop.ga + raise ValueError('In Dop.__init__ self.Ga must be defined.') self.dop_fmt = kwargs['fmt_dop'] # Partial derivative output format (default 1) self.title = None - if len(args[0]) == 0: # identity Dop - self.terms = [(S(1),self.Ga.Pdop_identity)] - else: - if len(args) == 2: - if len(args[0]) != len(args[1]): - raise ValueError('In Dop.__init__ coefficent list and Pdop list must be same length.') - self.terms = list(zip(args[0],args[1])) - elif len(args) == 1: - if isinstance(args[0][0][0], Mv): # Mv expansion [(Mv, Pdop)] - self.terms = args[0] - elif isinstance(args[0][0][0], Sdop): # Sdop expansion [(Sdop, Mv)] - coefs = [] - pdiffs = [] - for (sdop, mv) in args[0]: - for (coef, pdiff) in sdop.terms: - if pdiff in pdiffs: - index = pdiffs.index(pdiff) - coefs[index] += coef * mv - else: - pdiffs.append(pdiff) - coefs.append(coef * mv) - self.terms = list(zip(coefs, pdiffs)) - else: - raise ValueError('In Dop.__init__ args[0] form not allowed. args = ' + str(args)) + if len(args) == 2: + coefs, pdiffs = args + if len(coefs) != len(pdiffs): + raise ValueError('In Dop.__init__ coefficent list and Pdop list must be same length.') + self.terms = tuple(zip(coefs, pdiffs)) + elif len(args) == 1: + arg, = args + if len(arg) == 0: + self.terms = () + elif isinstance(arg[0][0], Mv): # Mv expansion [(Mv, Pdop)] + self.terms = tuple(arg) + elif isinstance(arg[0][0], Sdop): # Sdop expansion [(Sdop, Mv)] + self.terms = _consolidate_terms( + (coef * mv, pdiff) + for (sdop, mv) in arg + for (coef, pdiff) in sdop.terms + ) else: - raise ValueError('In Dop.__init__ length of args must be 1 or 2.') + raise ValueError('In Dop.__init__ args[0] form not allowed. args = ' + str(args)) + else: + raise ValueError('In Dop.__init__ length of args must be 1 or 2.') def simplify(self, modes=simplify): """ Simplify each multivector coefficient of a partial derivative """ - new_coefs = [] - new_pd = [] - for (coef, pd) in self.terms: - tmp = coef.simplify(modes=modes) - new_coefs.append(tmp) - new_pd.append(pd) - self.terms = list(zip(new_coefs, new_pd)) - return Dop(new_coefs, new_pd, ga=self.Ga, cmpflg=self.cmpflg) + return Dop( + [(coef.simplify(modes=modes), pd) for coef, pd in self.terms], + ga=self.Ga, cmpflg=self.cmpflg + ) def consolidate_coefs(self): """ Remove zero coefs and consolidate coefs with repeated pdiffs. """ - new_coefs = [] - new_pdiffs = [] - for (coef, pd) in self.terms: - if isinstance(coef, Mv) and coef.is_scalar(): - coef = coef.obj - if coef != S(0): - if pd in new_pdiffs: - index = new_pdiffs.index(pd) - new_coefs[index] += coef - else: - new_coefs.append(coef) - new_pdiffs.append(pd) - - self.terms = list(zip(new_coefs, new_pdiffs)) - return Dop(new_coefs, new_pdiffs, ga=self.Ga, cmpflg=self.cmpflg) + return Dop(_consolidate_terms(self.terms), ga=self.Ga, cmpflg=self.cmpflg) def blade_rep(self): @@ -2063,7 +2020,7 @@ def blade_rep(self): coefs = N * [[]] bases = N * [0] for term in self.terms: - for (coef, base) in metric.linear_expand(self.terms[0].obj, mode=False): + for coef, base in metric.linear_expand_terms(self.terms[0].obj): index = self.blades.index(base) coefs[index] = coef bases[index] = base @@ -2078,35 +2035,19 @@ def Add(dop1, dop2): if dop1.cmpflg != dop2.cmpflg: raise ValueError('In Dop.Add complement flags have different values: %s vs. %s' % (dop1.cmpflg, dop2.cmpflg)) - coefs1, pdiffs1 = list(zip(*dop1.terms)) - coefs2, pdiffs2 = list(zip(*dop2.terms)) - - pdiffs1 = list(pdiffs1) - pdiffs2 = list(pdiffs2) - - pdiffs = pdiffs1 + [x for x in pdiffs2 if x not in pdiffs1] - coefs = len(pdiffs) * [S(0)] - - for pdiff in pdiffs1: - index = pdiffs.index(pdiff) - coef = coefs1[pdiffs1.index(pdiff)] - coefs[index] += coef - - for pdiff in pdiffs2: - index = pdiffs.index(pdiff) - coef = coefs2[pdiffs2.index(pdiff)] - coefs[index] += coef - - return Dop(coefs, pdiffs, cmpflg=dop1.cmpflg, ga=dop1.Ga) + return Dop(_merge_terms(dop1.terms, dop2.terms), cmpflg=dop1.cmpflg, ga=dop1.Ga) else: - if isinstance(dop1, Dop): # dop1 is Dop + # convert values to multiplicative operators + if isinstance(dop1, Dop): if not isinstance(dop2, Mv): dop2 = dop1.Ga.mv(dop2) - dop2 = Dop([dop2], [dop1.Ga.Pdop_identity], cmpflg=dop1.cmpflg, ga=dop1.Ga) - else: # dop2 is Dop + dop2 = Dop([(dop2, Pdop({}, ga=dop1.Ga))], cmpflg=dop1.cmpflg, ga=dop1.Ga) + elif isinstance(dop2, Dop): if not isinstance(dop1, Mv): dop1 = dop2.Ga.mv(dop1) - dop1 = Dop([dop1], [dop2.Ga.Pdop_identity], cmpflg=dop2.cmpflg, ga=dop2.Ga) + dop1 = Dop([(dop1, Pdop({}, ga=dop2.Ga))], cmpflg=dop2.cmpflg, ga=dop2.Ga) + else: + raise TypeError("Neither argument is a Dop instance") return Dop.Add(dop1, dop2) def __add__(self, dop): @@ -2116,15 +2057,10 @@ def __radd__(self, dop): return Dop.Add(dop, self) def __neg__(self): - - coefs, pdiffs = list(zip(*self.terms)) - - coefs = [-x for x in coefs] - - neg = Dop(coefs, pdiffs, ga=self.Ga, - cmpflg=self.cmpflg) - - return neg + return Dop( + [(-coef, pdiff) for coef, pdiff in self.terms], + ga=self.Ga, cmpflg=self.cmpflg + ) def __sub__(self, dop): return Dop.Add(self, -dop) @@ -2140,72 +2076,69 @@ def Mul(dopl, dopr, op='*'): # General multiplication of Dop's if isinstance(dopl, Dop) and isinstance(dopr, Dop): if dopl.Ga != dopr.Ga: raise ValueError('In Dop.Mul Dop arguments are not from same geometric algebra') + ga = dopl.Ga if dopl.cmpflg != dopr.cmpflg: raise ValueError('In Dop.Mul Dop arguments do not have same cmplfg') if not dopl.cmpflg: # dopl and dopr operate on right argument terms = [] for (coef, pdiff) in dopl.terms: #Apply each dopl term to dopr Ddopl = pdiff(dopr.terms) # list of terms - Ddopl = [(Mv.Mul(coef, x[0], op=op), x[1]) for x in Ddopl] + Ddopl = [(Mv.Mul(coef, c, op=op), p) for c, p in Ddopl] terms += Ddopl - product = Dop(terms, ga=dopl.Ga) + product = Dop(terms, ga=ga) else: # dopl and dopr operate on left argument terms = [] for (coef, pdiff) in dopr.terms: Ddopr = pdiff(dopl.terms) # list of terms - Ddopr = [(Mv.Mul(x[0], coef, op=op), x[1]) for x in Ddopr] + Ddopr = [(Mv.Mul(c, coef, op=op), p) for c, p in Ddopr] terms += Ddopr - product = Dop(terms, ga=dopr.Ga, cmpflg=True) + product = Dop(terms, ga=ga, cmpflg=True) else: if not isinstance(dopl, Dop): # dopl is a scalar or Mv and dopr is Dop if isinstance(dopl, Mv) and dopl.Ga != dopr.Ga: raise ValueError('In Dop.Mul Dop arguments are not from same geometric algebra') else: dopl = dopr.Ga.mv(dopl) + ga = dopl.Ga if not dopr.cmpflg: # dopr operates on right argument - terms = [(Mv.Mul(dopl, x[0], op=op), x[1]) for x in dopr.terms] - return Dop(terms, ga=dopr.Ga) # returns Dop + terms = [(Mv.Mul(dopl, coef, op=op), pdiff) for coef, pdiff in dopr.terms] + return Dop(terms, ga=ga) # returns Dop else: - product = sum([Mv.Mul(x[1](dopl), x[0], op=op) for x in dopr.terms]) # returns multivector + product = sum([Mv.Mul(pdiff(dopl), coef, op=op) for coef, pdiff in dopr.terms], Mv(0, ga=ga)) # returns multivector else: # dopr is a scalar or a multivector if isinstance(dopr, Mv) and dopl.Ga != dopr.Ga: raise ValueError('In Dop.Mul Dop arguments are not from same geometric algebra') + ga = dopl.Ga if not dopl.cmpflg: # dopl operates on right argument - return sum([Mv.Mul(x[0], x[1](dopr), op=op) for x in dopl.terms]) # returns multivector + return sum([Mv.Mul(coef, pdiff(dopr), op=op) for coef, pdiff in dopl.terms], Mv(0, ga=ga)) # returns multivector else: - terms = [(Mv.Mul(x[0], dopr, op=op), x[1]) for x in dopl.terms] + terms = [(Mv.Mul(coef, dopr, op=op), pdiff) for coef, pdiff in dopl.terms] product = Dop(terms, ga=dopl.Ga, cmpflg=True) # returns Dop complement if isinstance(product, Dop): - product.consolidate_coefs() + product = product.consolidate_coefs() return product def TSimplify(self): - new_terms = [] - for (coef, pdiff) in self.terms: - new_terms.append((metric.Simp.apply(coef), pdiff)) - self.terms = new_terms - return + return Dop([ + (metric.Simp.apply(coef), pdiff) for (coef, pdiff) in self.terms + ], ga=self.Ga) - def __div__(self, a): - if isinstance(a, (Mv, Dop)): - raise TypeError('!!!!Can only divide Dop by sympy scalar expression!!!!') - else: - return (1/a) * self + def __truediv__(self, dopr): + if isinstance(dopr, (Dop, Mv)): + raise TypeError('In Dop.__truediv__ dopr must be a sympy scalar.') + return Dop([ + (coef / dopr, pdiff) for (coef, pdiff) in self.terms + ], ga=self.Ga, cmpflg=self.cmpflg) + + if sys.version_info.major < 3: + __div__ = __truediv__ def __mul__(self, dopr): # * geometric product return Dop.Mul(self, dopr, op='*') - def __truediv__(self, dopr): - if isinstance(dopr, (Dop, Mv)): - raise ValueError('In Dop.__truediv__ dopr must be a sympy scalar.') - terms = [] - for term in self.terms: - terms.append((term[0]/dopr,term[1])) - return Dop(terms, ga= self.Ga) - def __rmul__(self, dopl): # * geometric product return Dop.Mul(dopl, self, op='*') @@ -2227,20 +2160,19 @@ def __lt__(self, dopr): # < left contraction def __gt__(self, dopr): # > right contraction return Dop.Mul(self, dopr, op='>') - def __eq__(self, dop): - if isinstance(dop, Dop): - if self.Ga != dop.Ga: - return False + def __eq__(self, other): + if isinstance(other, Dop): + if self.Ga != other.Ga: + return NotImplemented - self = Sdop.consolidate_coefs(self) - dop = Sdop.consolidate_coefs(dop) - if len(self.terms) != len(dop.terms): - return False - if set(self.terms) != set(dop.terms): - return False - return True + diff = self - other + return len(diff.terms) == 0 else: - return False + return NotImplemented + + if sys.version_info.major < 3: + def __ne__(self, other): + return not (self == other) def __str__(self): if printer.GaLatexPrinter.latex_flg: @@ -2266,27 +2198,19 @@ def _repr_latex_(self): return latex_str def is_scalar(self): - for x in self.terms: - if isinstance(x[0], Mv) and not x[0].is_scalar(): + for coef, pdiff in self.terms: + if isinstance(coef, Mv) and not coef.is_scalar(): return False return True def components(self): - dop_lst = [] - for (sdop, base) in self.Dop_mv_expand(): - new_coefs = [] - new_pdiffs = [] - for (coef, pdiff) in sdop.terms: - if pdiff in new_pdiffs: - index = new_pdiffs.index(pdiff) - new_coefs[index] += coef * base - else: - new_pdiffs.append(pdiff) - new_coefs.append(coef * base) - new_coefs = [Mv(x, ga=self.Ga) for x in new_coefs] - terms = list(zip(new_coefs, new_pdiffs)) - dop_lst.append(Dop(terms, ga=self.Ga)) - return tuple(dop_lst) + return tuple( + Dop(_consolidate_terms( + (Mv(coef * base, ga=self.Ga), pdiff) + for (coef, pdiff) in sdop.terms + ), ga=self.Ga) + for (sdop, base) in self.Dop_mv_expand() + ) def Dop_mv_expand(self, modes=None): coefs = [] @@ -2295,8 +2219,7 @@ def Dop_mv_expand(self, modes=None): for (coef, pdiff) in self.terms: if isinstance(coef, Mv) and not coef.is_scalar(): - mv_terms = metric.linear_expand(coef.obj, mode=False) - for (mv_coef, mv_base) in mv_terms: + for mv_coef, mv_base in metric.linear_expand_terms(coef.obj): if mv_base in bases: index = bases.index(mv_base) coefs[index] += Sdop([(mv_coef, pdiff)], ga=self.Ga) @@ -2431,29 +2354,15 @@ def Fmt(self, fmt=1, title=None, dop_fmt=None): else: return s - @staticmethod - def basic(ga): - r_basis = list(ga.r_basis) - - if not ga.is_ortho: - r_basis = [x / ga.e_sq for x in r_basis] - if ga.norm: - r_basis = [x / e_norm for (x, e_norm) in zip(r_basis, ga.e_norm)] - - ga.lgrad = Dop(r_basis, ga.pdx, ga=ga) - ga.rgrad = Dop(r_basis, ga.pdx, ga=ga, cmpflg=true) - return ga.lgrad, ga.rgrad ################################# Alan Macdonald's additions ######################### def Nga(x, prec=5): if isinstance(x, Mv): - Px = Mv(x, ga=x.Ga) - Px.obj = Nsympy(x.obj, prec) - return(Px) + return Mv(Nsympy(x.obj, prec), ga=x.Ga) else: - return(Nsympy(x, prec)) + return Nsympy(x, prec) def printeigen(M): # Print eigenvalues, multiplicities, eigenvectors of M. diff --git a/galgebra/utils.py b/galgebra/utils.py index 24e0cd82..e7e7cfa8 100644 --- a/galgebra/utils.py +++ b/galgebra/utils.py @@ -32,3 +32,45 @@ def flatten(x): def isstr(s): return isinstance(s, string_types) + + +class _KwargParser: + """ + Helper function to emulate Python 3 keyword-only arguments. + + Use as:: + + def func(x1, **kwargs): + kw = KwargParser('func', kwargs) + a = kw.pop('a') + b = kw.pop('b', 2) + kw.reject_remaining() + ... + + To emulate the Python 3 syntax:: + + def func(x1, *, a, b=2): + ... + """ + def __init__(self, func_name, kwargs): + self._func_name = func_name + self._kwargs = kwargs + + def pop(self, arg_name, *default): + try: + return self._kwargs.pop(arg_name, *default) + except KeyError: + pass + raise TypeError( + '{}() missing required keyword-only argument {!r}' + .format(self._func_name, arg_name) + ) + + def reject_remaining(self): + if self._kwargs: + # match the error message to what Python 3 produces + bad_arg = next(iter(self._kwargs)) + raise TypeError( + '{}() got an unexpected keyword argument {!r}' + .format(self._func_name, bad_arg) + ) diff --git a/setup.py b/setup.py index 74960b85..7f1511cb 100644 --- a/setup.py +++ b/setup.py @@ -1,14 +1,17 @@ #!/usr/bin/env python from setuptools import setup, find_packages from distutils.core import Extension +import os + +version_path = os.path.join('galgebra', '_version.py') +exec(open(version_path).read()) -VERSION = '0.4.4' LONG_DESCRIPTION = """ Symbolic Geometric Algebra/Calculus package for SymPy. BSD License. """ setup(name='galgebra', - version=VERSION, + version=__version__, description='Symbolic Geometric Algebra/Calculus package for SymPy.', author='Alan Bromborsky', author_email='hadfield.hugo@gmail.com', @@ -17,6 +20,8 @@ packages=find_packages(), package_dir={'galgebra':'galgebra'}, install_requires = ['sympy'], + # 2.7 or >=3.5 + python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*', long_description=LONG_DESCRIPTION, classifiers=[ 'Development Status :: 4 - Beta', @@ -26,6 +31,8 @@ 'Natural Language :: English', 'Operating System :: OS Independent', 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', 'Topic :: Scientific/Engineering :: Mathematics', 'Topic :: Scientific/Engineering :: Physics']) diff --git a/test/.nbval_sanitize.cfg b/test/.nbval_sanitize.cfg index 72336bee..177c3bde 100644 --- a/test/.nbval_sanitize.cfg +++ b/test/.nbval_sanitize.cfg @@ -10,3 +10,29 @@ replace: $ regex: \s*\$\s* replace: $ + +[sympy printing changes] +regex: \\left \( +replace: \\left( +regex: \\right \) +replace: \\right) +regex: \\left \[ +replace: \\left[ +regex: \\right \] +replace: \\right] + +# note hacks to avoid trailing spaces which editors may trim +regex: , \\quad( ) +replace: , \ \1 + +# sympy 1.5 seems to reorder a few additions compared to 1.3 +regex: \\begin\{matrix}- \\frac\{\\sqrt\{2}}\{4} \+ \\frac\{1}\{2}\\end\{matrix} +replace: \\begin{matrix}\\frac{1}{2} - \\frac{\\sqrt{2}}{4}\\end{matrix} +regex: =( +)- \\frac\{\\sqrt\{2}}\{4} \+ \\frac\{1}\{2}(?=\$| \\end\{equation\*}) +replace: =\1\\frac{1}{2} - \\frac{\\sqrt{2}}{4} + +regex: \{- \\left\( e_\{E}\\cdot e_\{B}\\right\) \^\{2} \+ 1\} +replace: {1 - \\left( e_{E}\\cdot e_{B}\\right) ^{2}} + +regex: eu\.ev_r = -1/2 \+ 1/2(?=\n) +replace: eu.ev_r = 1/2 - 1/2 diff --git a/test/test_differential_ops.py b/test/test_differential_ops.py new file mode 100644 index 00000000..d97c33a1 --- /dev/null +++ b/test/test_differential_ops.py @@ -0,0 +1,203 @@ +from sympy import symbols, S +import pytest + +from galgebra.ga import Ga +from galgebra.mv import Dop, Sdop, Pdop + + +class TestDop(object): + + def test_associativity_and_distributivity(self): + coords = x, y, z = symbols('x y z', real=True) + ga, ex, ey, ez = Ga.build('e*x|y|z', g=[1, 1, 1], coords=coords) + v = ga.mv('v', 'vector', f=True) + laplacian = ga.grad * ga.grad + rlaplacian = ga.rgrad * ga.rgrad + + # check addition distributes + assert (laplacian + ga.grad) * v == laplacian * v + ga.grad * v != 0 + assert (laplacian + 1234567) * v == laplacian * v + 1234567 * v != 0 + assert (1234 * ex + ga.grad) * v == 1234 * ex * v + ga.grad * v != 0 + # check subtraction distributes + assert (laplacian - ga.grad) * v == laplacian * v - ga.grad * v != 0 + assert (laplacian - 1234567) * v == laplacian * v - 1234567 * v != 0 + assert (1234 * ex - ga.grad) * v == 1234 * ex * v - ga.grad * v != 0 + # check unary subtraction distributes + assert (-ga.grad) * v == -(ga.grad * v) != 0 + # check division is associative + assert v * (ga.rgrad / 2) == (v * ga.rgrad) / 2 != 0 + # check multiplication is associative + assert (ex * ga.grad) * v == ex * (ga.grad * v) != 0 + assert (20 * ga.grad) * v == 20 * (ga.grad * v) != 0 + assert v * (ga.rgrad * ex) == (v * ga.rgrad) * ex != 0 + assert v * (ga.rgrad * 20) == (v * ga.rgrad) * 20 != 0 + assert (laplacian * ga.grad) * v == laplacian * (ga.grad * v) != 0 + # check wedge is associative + assert (ex ^ ga.grad) ^ v == ex ^ (ga.grad ^ v) != 0 + assert (20 ^ ga.grad) ^ v == 20 ^ (ga.grad ^ v) != 0 + assert v ^ (ga.rgrad ^ ex) == (v ^ ga.rgrad) ^ ex != 0 + assert v ^ (ga.rgrad ^ 20) == (v ^ ga.rgrad) ^ 20 != 0 + + def test_empty_dop(self): + """ Test that dop with zero terms is equivalent to multiplying by zero """ + coords = x, y, z = symbols('x y z', real=True) + ga, ex, ey, ez = Ga.build('e*x|y|z', g=[1, 1, 1], coords=coords) + v = ga.mv('v', 'vector', f=True) + + make_zero = ga.dop([]) + assert make_zero * v == 0 + assert make_zero * make_zero * v == 0 + assert (make_zero + make_zero) * v == 0 + assert (-make_zero) * v == 0 + + def test_misc(self): + """ Other miscellaneous tests """ + coords = x, y, z = symbols('x y z', real=True) + ga, ex, ey, ez = Ga.build('e*x|y|z', g=[1, 1, 1], coords=coords) + v = ga.mv('v', 'vector', f=True) + laplacian = ga.grad * ga.grad + rlaplacian = ga.rgrad * ga.rgrad + + # laplacian is a scalar operator, so applying it from either side + # is the same + assert laplacian * v == v * rlaplacian + + assert laplacian.is_scalar() + assert not ga.grad.is_scalar() + + # test comparison + assert ga.grad == ga.grad + assert not (ga.grad != ga.grad) + assert ga.grad != laplacian + assert not (ga.grad == laplacian) + assert ga.grad != object() + assert not (ga.grad == object()) + + # inconsistent cmpflg, not clear which side the operator goes on + with pytest.raises(ValueError): + ga.grad + ga.rgrad + with pytest.raises(ValueError): + ga.grad * ga.rgrad + + def test_mixed_algebras(self): + coords = x, y, z = symbols('x y z', real=True) + ga1, ex1, ey1, ez1 = Ga.build('e1*x|y|z', g=[1, 1, 1], coords=coords) + ga2, ex2, ey2, ez2 = Ga.build('e2*x|y|z', g=[1, 1, 1], coords=coords) + assert ga1 != ga2 + + v1 = ga1.mv('v', 'vector', f=True) + v2 = ga2.mv('v', 'vector', f=True) + + with pytest.raises(ValueError): + ga1.grad * v2 + with pytest.raises(ValueError): + v1 * ga2.rgrad + with pytest.raises(ValueError): + ga1.grad * ga2.grad + + def test_components(self): + coords = x, y, z = symbols('x y z', real=True) + ga, ex, ey, ez = Ga.build('e*x|y|z', g=[1, 1, 1], coords=coords) + + components = ga.grad.components() + assert components == ( + ex * (ex | ga.grad), + ey * (ey | ga.grad), + ez * (ez | ga.grad), + ) + + +class TestSdop(object): + + def test_deprecation(self): + coords = x, y, z = symbols('x y z', real=True) + ga, ex, ey, ez = Ga.build('e*x|y|z', g=[1, 1, 1], coords=coords) + + with pytest.warns(DeprecationWarning): + ga.sPds + + def test_shorthand(self): + coords = x, y, z = symbols('x y z', real=True) + ga, ex, ey, ez = Ga.build('e*x|y|z', g=[1, 1, 1], coords=coords) + + assert Sdop(x, ga=ga) == Sdop([(S(1), Pdop({x: 1}, ga=ga))], ga=ga) + + def test_empty_sdop(self): + """ Test that sdop with zero terms is equivalent to multiplying by zero """ + coords = x, y, z = symbols('x y z', real=True) + ga, ex, ey, ez = Ga.build('e*x|y|z', g=[1, 1, 1], coords=coords) + v = ga.mv('v', 'vector', f=True) + + make_zero = Sdop([], ga=ga) + assert make_zero * v == 0 + assert make_zero * make_zero * v == 0 + assert (make_zero + make_zero) * v == 0 + assert (-make_zero) * v == 0 + + def test_associativity_and_distributivity(self): + coords = x, y, z = symbols('x y z', real=True) + ga, ex, ey, ez = Ga.build('e*x|y|z', g=[1, 1, 1], coords=coords) + v = ga.mv('v', 'vector', f=True) + laplacian = Sdop((ga.grad * ga.grad).terms, ga=ga) + + # check addition distributes + assert (laplacian + 20) * v == laplacian * v + 20 * v != 0 + assert (20 + laplacian) * v == laplacian * v + 20 * v != 0 + # check subtraction distributes + assert (laplacian - 20) * v == laplacian * v - 20 * v != 0 + assert (20 - laplacian) * v == 20 * v - laplacian * v != 0 + # check unary subtraction distributes + assert (-laplacian) * v == -(laplacian * v) != 0 + # check multiplication is associative + assert (20 * laplacian) * v == 20 * (laplacian * v) != 0 + assert (laplacian * laplacian) * v == laplacian * (laplacian * v) != 0 + + + def test_misc(self): + """ Other miscellaneous tests """ + coords = x, y, z = symbols('x y z', real=True) + ga, ex, ey, ez = Ga.build('e*x|y|z', g=[1, 1, 1], coords=coords) + laplacian = ga.sdop((ga.grad * ga.grad).terms) + lap2 = laplacian*laplacian + + # test comparison + assert lap2 == lap2 + assert not (lap2 != lap2) + assert lap2 != laplacian + assert not (lap2 == laplacian) + assert lap2 != object() + assert not (lap2 == object()) + + +class TestPdop(object): + + def test_deprecation(self): + coords = x, y, z = symbols('x y z', real=True) + ga, ex, ey, ez = Ga.build('e*x|y|z', g=[1, 1, 1], coords=coords) + + # passing `None` is a deprecate way to spell `{}` + with pytest.warns(DeprecationWarning): + p = Pdop(None, ga=ga) + assert p == Pdop({}, ga=ga) + + with pytest.warns(DeprecationWarning): + ga.Pdop_identity + with pytest.warns(DeprecationWarning): + ga.Pdiffs + + def test_misc(self): + """ Other miscellaneous tests """ + coords = x, y, z = symbols('x y z', real=True) + ga, ex, ey, ez = Ga.build('e*x|y|z', g=[1, 1, 1], coords=coords) + + pxa = ga.pdop({x: 1}) + pxb = ga.pdop({x: 1}) + p1 = ga.pdop({}) + + # test comparison + assert pxa == pxb + assert not (pxa != pxb) + assert p1 != pxa + assert not (p1 == pxa) + assert pxa != object() + assert not (pxa == object()) diff --git a/test/test_mv.py b/test/test_mv.py index 94e250f5..b070ec8a 100644 --- a/test/test_mv.py +++ b/test/test_mv.py @@ -1,10 +1,19 @@ import unittest + +import pytest from sympy import Symbol from galgebra.ga import Ga from galgebra import utils class TestMv(unittest.TestCase): + def test_deprecations(self): + ga, e_1, e_2, e_3 = Ga.build('e*1|2|3') + with pytest.warns(DeprecationWarning): + ga.mv_x + with pytest.warns(DeprecationWarning): + ga.mv_I + def test_is_base(self): """ Various tests on several multivectors. @@ -108,8 +117,15 @@ def check(x, expected_grades): check(ga.mv('A', 'odd'), [1, 3]) check(ga.mv('A', 'mv'), [0, 1, 2, 3]) + # value construction + check(ga.mv([1, 2, 3], 'vector'), [1]) + # illegal arguments with self.assertRaises(TypeError): ga.mv('A', 'vector', "too many arguments") with self.assertRaises(TypeError): ga.mv('A', 'grade') # too few arguments + with self.assertRaises(TypeError): + ga.mv('A', 'grade', not_an_argument=True) # invalid kwarg + with self.assertRaises(TypeError): + ga.mv([1, 2, 3], 'vector', f=True) # can't pass f with coefficients diff --git a/test/test_test.py b/test/test_test.py index cf61749c..546cef03 100644 --- a/test/test_test.py +++ b/test/test_test.py @@ -198,13 +198,13 @@ def test_noneuclidian_distance_calculation(self): B = (L*e).expand().blade_rep() # D&L 10.152 assert str(B) == 'X^Y - (Y.e)*X^e + (X.e)*Y^e' Bsq = B*B - assert str(Bsq) == '(X.Y)*((X.Y) - 2*(X.e)*(Y.e))' + assert str(Bsq) == '(X.Y)**2 - 2*(X.Y)*(X.e)*(Y.e)' Bsq = Bsq.scalar() assert str(B) == 'X^Y - (Y.e)*X^e + (X.e)*Y^e' BeBr = B*e*B.rev() assert str(BeBr) == '(X.Y)*(-(X.Y) + 2*(X.e)*(Y.e))*e' - assert str(B*B) == '(X.Y)*((X.Y) - 2*(X.e)*(Y.e))' + assert str(B*B) == '(X.Y)**2 - 2*(X.Y)*(X.e)*(Y.e)' assert str(L*L) == '(X.Y)**2 - 2*(X.Y)*(X.e)*(Y.e)' # D&L 10.153 (s,c,Binv,M,S,C,alpha) = symbols('s c (1/B) M S C alpha') diff --git a/test_requirements.txt b/test_requirements.txt new file mode 100644 index 00000000..ef34e601 --- /dev/null +++ b/test_requirements.txt @@ -0,0 +1,12 @@ +# requirements for CI +sympy == 1.3 +pytest-cov +ipython == 5.8.0; python_version == "2.7" +nbval +pytest-xdist + +# needed by pytest-xdist +pytest >= 4.4.0 + +# pinned until https://github.com/computationalmodelling/nbval/issues/129 is fixed +coverage < 5