How to use the clifford.Frame function in clifford

To help you get started, we’ve selected a few clifford examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pygae / clifford / test / test_clifford.py View on Github external
def test_innermorphic(self):
        for p, q in [(2, 0), (3, 0), (4, 0)]:
            layout, blades = Cl(p, q)

            A = Frame(layout.randomV(p+q))
            R = layout.randomRotor()
            B = Frame([R*a*~R for a in A])
            self.assertTrue(A.is_innermorphic_to(B))
github pygae / clifford / test / test_clifford.py View on Github external
def test_frame_inv(self):
        for p, q in [(2, 0), (3, 0), (4, 0)]:
            layout, blades = Cl(p, q)
            A = Frame(layout.randomV(p + q))
            self.check_inv(A)
github pygae / clifford / test / test_clifford.py View on Github external
def test_innermorphic(self):
        for p, q in [(2, 0), (3, 0), (4, 0)]:
            layout, blades = Cl(p, q)

            A = Frame(layout.randomV(p+q))
            R = layout.randomRotor()
            B = Frame([R*a*~R for a in A])
            self.assertTrue(A.is_innermorphic_to(B))
github pygae / clifford / clifford / tools / __init__.py View on Github external
try:
        B = Frame(B)
        B_En = B.En
    except Exception:
        pass
    N = len(A)

    # Determine and remove scaling factors caused by homogenization
    if remove_scaling:
        lam = omoh(A, B)
        B = Frame([B[k] * lam[k] for k in range(N)])

    try:
        # compute ratio of volumes for each frame. take Nth root
        A = Frame(A[:])
        B = Frame(B[:])
        alpha = abs(B.En / A.En) ** (1. / N)

        if abs(alpha - 1) > eps:
            spinor = True
            # we have a spinor, remove the scaling (add it back in at the end)
            B = [b / alpha for b in B]
    except Exception:
        # probably  A and B are not pure vector correspondence
        # whatever,  it might still work
        pass

    # Find the Versor

    # store each reflector/rotor  in a list,  make full versor at the
    # end of the loop
    r_list = []
github pygae / clifford / clifford / tools / __init__.py View on Github external
# make copy of original frames, so we can rotate A
    A = A[:]
    B = B[:]

    if len(A) != len(B):
        raise ValueError('len(A)!=len(B)')

    if eps is None:
        eps = global_eps()

    # Determine if we have a spinor
    spinor = False
    # store peudoscalar of frame B, in case known det (see end)
    try:
        B = Frame(B)
        B_En = B.En
    except Exception:
        pass
    N = len(A)

    # Determine and remove scaling factors caused by homogenization
    if remove_scaling:
        lam = omoh(A, B)
        B = Frame([B[k] * lam[k] for k in range(N)])

    try:
        # compute ratio of volumes for each frame. take Nth root
        A = Frame(A[:])
        B = Frame(B[:])
        alpha = abs(B.En / A.En) ** (1. / N)
github pygae / clifford / clifford / tools / __init__.py View on Github external
eps = global_eps()

    # Determine if we have a spinor
    spinor = False
    # store peudoscalar of frame B, in case known det (see end)
    try:
        B = Frame(B)
        B_En = B.En
    except Exception:
        pass
    N = len(A)

    # Determine and remove scaling factors caused by homogenization
    if remove_scaling:
        lam = omoh(A, B)
        B = Frame([B[k] * lam[k] for k in range(N)])

    try:
        # compute ratio of volumes for each frame. take Nth root
        A = Frame(A[:])
        B = Frame(B[:])
        alpha = abs(B.En / A.En) ** (1. / N)

        if abs(alpha - 1) > eps:
            spinor = True
            # we have a spinor, remove the scaling (add it back in at the end)
            B = [b / alpha for b in B]
    except Exception:
        # probably  A and B are not pure vector correspondence
        # whatever,  it might still work
        pass
github pygae / clifford / clifford / tools / __init__.py View on Github external
# store peudoscalar of frame B, in case known det (see end)
    try:
        B = Frame(B)
        B_En = B.En
    except Exception:
        pass
    N = len(A)

    # Determine and remove scaling factors caused by homogenization
    if remove_scaling:
        lam = omoh(A, B)
        B = Frame([B[k] * lam[k] for k in range(N)])

    try:
        # compute ratio of volumes for each frame. take Nth root
        A = Frame(A[:])
        B = Frame(B[:])
        alpha = abs(B.En / A.En) ** (1. / N)

        if abs(alpha - 1) > eps:
            spinor = True
            # we have a spinor, remove the scaling (add it back in at the end)
            B = [b / alpha for b in B]
    except Exception:
        # probably  A and B are not pure vector correspondence
        # whatever,  it might still work
        pass

    # Find the Versor

    # store each reflector/rotor  in a list,  make full versor at the
    # end of the loop