Exemplo n.º 1
0
The reference D&L is "Geometric Algebra for Physicists" by Doran and Lasenby
"""

import sys

from sympy.external import import_module
numpy = import_module('numpy')
if not numpy:
    disabled = True
else:
    sys.path.append('../')
    from sympy.galgebra.GA import set_main, MV, make_symbols, ZERO, ONE, HALF, S
    import sympy
    from sympy import collect, sympify

    set_main(sys.modules[__name__])

def F(x):
    """
    Conformal Mapping Function from 3D Euclidean space to 5D conformal space
    where the images of all maps are null vectors.
    """
    Fx = HALF*((x*x)*n+2*x-nbar)
    #print 'F(x) =',Fx
    return(Fx)

def make_vector(a,n = 3):
    if type(a) == str:
        sym_str = ''
        for i in range(n):
            sym_str += a+str(i)+' '
Exemplo n.º 2
0
try:
    import numpy
    disabled = False
except ImportError:
    #py.test will not execute any tests now
    disabled = True

if not disabled:
    sys.path.append('../')
    from sympy.galgebra.GA import set_main, MV, make_symbols, types, ZERO, ONE, HALF, S
    import sympy
    from sympy import collect, sympify


    set_main(sys.modules[__name__])

def F(x):
    """
    Conformal Mapping Function from 3D euclidian space to 5D conformal space
    where the images of all maps are null vectors.
    """
    Fx = HALF*((x*x)*n+2*x-nbar)
    #print 'F(x) =',Fx
    return(Fx)

def make_vector(a,n = 3):
    if type(a) == types.StringType:
        sym_str = ''
        for i in range(n):
            sym_str += a+str(i)+' '