(debug)
return
Vector.dtau_dict[basis vector symbol,coordinate symbol] = derivative of basis vector as sympy expression
Vector.dtau_dict[basis vector symbol,coordinate symbol] = derivative of basis vector as sympy expression
Vector . dtau_dict [ basis vector symbol coordinate symbol ] = derivative of basis vector as sympy expression
def build_curvilinear_connection(debug):
        """
        Vector.dtau_dict[basis vector symbol,coordinate symbol] = derivative of basis vector as sympy expression
        """

        MV.connection = True
        MV.tangent_norm = Vector.norm
        MV.tangent_derivatives_MV = {}

        rcpr_bases_MV = []

        for (rbase, norm) in zip(MV.rcpr_bases_MV, MV.tangent_norm):
            rcpr_bases_MV.append(rbase / norm)

        MV.rcpr_bases_MV = rcpr_bases_MV

        for key in Vector.dtau_dict.keys():
            MV.tangent_derivatives_MV[key] = MV(Vector.dtau_dict[key])

        if debug:
            oprint('Tangent Vector Derivatives', MV.tangent_derivatives_MV, dict_mode=True)

        MV.left_connection = {}
        MV.right_connection = {}
        MV.left_wedge_connection = {}
        MV.right_wedge_connection = {}
        MV.left_dot_connection = {}
        MV.right_dot_connection = {}

        for base in MV.blades[1]:
            right_result = MV()
            left_result = MV()
            for (coord, rblade) in zip(MV.coords, MV.rcpr_bases_MV):
                left_result += rblade * MV.tangent_derivatives_MV[(base, coord)]
                right_result += MV.tangent_derivatives_MV[(base, coord)] * rblade
            left_result.obj = expand(left_result.obj)
            right_result.obj = expand(right_result.obj)
            left_result.discover_and_set_grade()
            right_result.discover_and_set_grade()
            MV.left_connection[base] = left_result.obj
            MV.right_connection[base] = right_result.obj
            MV.left_wedge_connection[base] = left_result.grade(2).obj
            MV.right_wedge_connection[base] = right_result.grade(2).obj
            MV.left_dot_connection[base] = left_result.grade(0).obj
            MV.right_dot_connection[base] = right_result.grade(0).obj

        for grade in MV.blades[2:]:
            for blade in grade:
                index = MV.blade_to_index[blade]
                N = len(index)
                left_result = MV()
                right_result = MV()
                for (coord, rblade) in zip(MV.coords, MV.rcpr_bases_MV):
                    tmp = MV()
                    for i in range(N):
                        i_pre = index[:i]
                        i_dtan = index[i]
                        i_post = index[i + 1:]
                        base = MV.blades[1][i_dtan]
                        tmp += (MV(MV.index_to_blade[i_pre]) ^ MV.tangent_derivatives_MV[(base, coord)]) ^ MV(MV.index_to_blade[i_post])
                    left_result += rblade * tmp
                    right_result += tmp * rblade
                left_result.discover_and_set_grade()
                right_result.discover_and_set_grade()
                MV.left_connection[blade] = left_result.obj
                MV.right_connection[blade] = right_result.obj
                MV.left_wedge_connection[blade] = left_result.grade(N + 1).obj
                MV.right_wedge_connection[blade] = right_result.grade(N + 1).obj
                MV.left_dot_connection[blade] = left_result.grade(abs(N - 1)).obj
                MV.right_dot_connection[blade] = right_result.grade(abs(N - 1)).obj

        MV.connection = {'left': MV.left_connection, 'right': MV.right_connection,
                         'left_wedge': MV.left_wedge_connection, 'right_wedge': MV.right_wedge_connection,
                         'left_dot': MV.left_dot_connection, 'right_dot': MV.right_dot_connection}
        MV.grad.connection = MV.connection

        if debug:
            oprint('Left Mutlivector Connection', MV.left_connection,
                   'Right Mutlivector Connection', MV.right_connection,
                   'Left Wedge Mutlivector Connection', MV.left_wedge_connection,
                   'Right Wedge Mutlivector Connection', MV.right_wedge_connection,
                   'Left Dot Mutlivector Connection', MV.left_dot_connection,
                   'Right Dot Mutlivector Connection', MV.right_dot_connection, dict_mode=True)
        return
def build_curvilinear_connection ( debug ) : MV . connection = True MV . tangent_norm = Vector . norm MV . tangent_derivatives_MV = { } rcpr_bases_MV = [ ] for ( rbase , norm ) in zip ( MV . rcpr_bases_MV , MV . tangent_norm ) : rcpr_bases_MV . append ( rbase / norm ) MV . rcpr_bases_MV = rcpr_bases_MV for key in Vector . dtau_dict . keys ( ) : MV . tangent_derivatives_MV [ key ] = MV ( Vector . dtau_dict [ key ] ) if debug : oprint ( 'Tangent Vector Derivatives' , MV . tangent_derivatives_MV , dict_mode = True ) MV . left_connection = { } MV . right_connection = { } MV . left_wedge_connection = { } MV . right_wedge_connection = { } MV . left_dot_connection = { } MV . right_dot_connection = { } for base in MV . blades [ 1 ] : right_result = MV ( ) left_result = MV ( ) for ( coord , rblade ) in zip ( MV . coords , MV . rcpr_bases_MV ) : left_result += rblade * MV . tangent_derivatives_MV [ ( base , coord ) ] right_result += MV . tangent_derivatives_MV [ ( base , coord ) ] * rblade left_result . obj = expand ( left_result . obj ) right_result . obj = expand ( right_result . obj ) left_result . discover_and_set_grade ( ) right_result . discover_and_set_grade ( ) MV . left_connection [ base ] = left_result . obj MV . right_connection [ base ] = right_result . obj MV . left_wedge_connection [ base ] = left_result . grade ( 2 ) . obj MV . right_wedge_connection [ base ] = right_result . grade ( 2 ) . obj MV . left_dot_connection [ base ] = left_result . grade ( 0 ) . obj MV . right_dot_connection [ base ] = right_result . grade ( 0 ) . obj for grade in MV . blades [ 2 : ] : for blade in grade : index = MV . blade_to_index [ blade ] N = len ( index ) left_result = MV ( ) right_result = MV ( ) for ( coord , rblade ) in zip ( MV . coords , MV . rcpr_bases_MV ) : tmp = MV ( ) for i in range ( N ) : i_pre = index [ : i ] i_dtan = index [ i ] i_post = index [ i + 1 : ] base = MV . blades [ 1 ] [ i_dtan ] tmp += ( MV ( MV . index_to_blade [ i_pre ] ) ^ MV . tangent_derivatives_MV [ ( base , coord ) ] ) ^ MV ( MV . index_to_blade [ i_post ] ) left_result += rblade * tmp right_result += tmp * rblade left_result . discover_and_set_grade ( ) right_result . discover_and_set_grade ( ) MV . left_connection [ blade ] = left_result . obj MV . right_connection [ blade ] = right_result . obj MV . left_wedge_connection [ blade ] = left_result . grade ( N + 1 ) . obj MV . right_wedge_connection [ blade ] = right_result . grade ( N + 1 ) . obj MV . left_dot_connection [ blade ] = left_result . grade ( abs ( N - 1 ) ) . obj MV . right_dot_connection [ blade ] = right_result . grade ( abs ( N - 1 ) ) . obj MV . connection = { 'left' : MV . left_connection , 'right' : MV . right_connection , 'left_wedge' : MV . left_wedge_connection , 'right_wedge' : MV . right_wedge_connection , 'left_dot' : MV . left_dot_connection , 'right_dot' : MV . right_dot_connection } MV . grad . connection = MV . connection if debug : oprint ( 'Left Mutlivector Connection' , MV . left_connection , 'Right Mutlivector Connection' , MV . right_connection , 'Left Wedge Mutlivector Connection' , MV . left_wedge_connection , 'Right Wedge Mutlivector Connection' , MV . right_wedge_connection , 'Left Dot Mutlivector Connection' , MV . left_dot_connection , 'Right Dot Mutlivector Connection' , MV . right_dot_connection , dict_mode = True ) return