fmmgen/generator.py
def generate_L_operators(order, symbols, M_dict, L_dict, source_order=0):
    """
    generate_L_operators(order, symbols, index_dict):

    Generates local expansion operators up to given order.

    Input:
    order, int:
        Maximum order of multipole expansion

    symbols, list:
        List of sympy symbol type objects which define coordinate labels.

    index_dict:
        Forward mapping dictionary between
        monomials of symbols and array indices, generated by generate_mappings
        or otherwise.

    inline_derivs: bool
        Calculate derivatives inline rather than precalculating these.

    Output:
    list:
        List of symbolic local expansion operators up to order.

    Example:
    >>> order = 1
    >>> x, y, z = sp.symbols('x y z')
    >>> map, _ = generate_mappings(order, (x, y, z))
    >>> generate_L_operators(order, (x, y, z), map)
    [M[0, 0]/R - 1.0*x*M[1, 0]/R**3 - 1.0*y*M[2, 0]/R**3 - 1.0*z*M[3, 0]/R**3,
    -1.0*x*M[0, 0]/R**3, -1.0*y*M[0, 0]/R**3, -1.0*z*M[0, 0]/R**3]
    """
    x, y, z = symbols
    L_operators = []
    for n in L_dict.keys():
        L_operators.append(L(n, order, symbols, M_dict, source_order=source_order, eval_derivs=False))

    return L_operators

    generate_L_operators(order, symbols, index_dict):

    Generates local expansion operators up to given order.

    Input:
    order, int:
        Maximum order of multipole expansion

    symbols, list:
        List of sympy symbol type objects which define coordinate labels.

    index_dict:
        Forward mapping dictionary between
        monomials of symbols and array indices, generated by generate_mappings
        or otherwise.

    inline_derivs: bool
        Calculate derivatives inline rather than precalculating these.

    Output:
    list:
        List of symbolic local expansion operators up to order.

    Example:
    >>> order = 1
    >>> x, y, z = sp.symbols('x y z')
    >>> map, _ = generate_mappings(order, (x, y, z))
    >>> generate_L_operators(order, (x, y, z), map)
    [M[0, 0]/R - 1.0*x*M[1, 0]/R**3 - 1.0*y*M[2, 0]/R**3 - 1.0*z*M[3, 0]/R**3,
    -1.0*x*M[0, 0]/R**3, -1.0*y*M[0, 0]/R**3, -1.0*z*M[0, 0]/R**3]
    
generate_L_operators(order, symbols, index_dict):
Generates local expansion operators up to given order.

order, int:
Maximum order of multipole expansion

symbols, list:
List of sympy symbol type objects which define coordinate labels.

Forward mapping dictionary between
monomials of symbols and array indices, generated by generate_mappings
or otherwise.

bool
Calculate derivatives inline rather than precalculating these.

List of symbolic local expansion operators up to order.
generate_L_operators ( order symbols index_dict ) : Generates local expansion operators up to given order . order int : Maximum order of multipole expansion symbols list : List of sympy symbol type objects which define coordinate labels . Forward mapping dictionary between monomials of symbols and array indices generated by generate_mappings or otherwise . bool Calculate derivatives inline rather than precalculating these . List of symbolic local expansion operators up to order .
def generate_L_operators(order, symbols, M_dict, L_dict, source_order=0):
    x, y, z = symbols
    L_operators = []
    for n in L_dict.keys():
        L_operators.append(L(n, order, symbols, M_dict, source_order=source_order, eval_derivs=False))
    return L_operators
def generate_L_operators ( order , symbols , M_dict , L_dict , source_order = 0 ) : x , y , z = symbols L_operators = [ ] for n in L_dict . keys ( ) : L_operators . append ( L ( n , order , symbols , M_dict , source_order = source_order , eval_derivs = False ) ) return L_operators
generate_L_operators(order, symbols, index_dict):
Generates local expansion operators up to given order.
generate_L_operators ( order symbols index_dict ) : Generates local expansion operators up to given order .
"""
    generate_L_operators(order, symbols, index_dict):

    Generates local expansion operators up to given order.

    Input:
    order, int:
        Maximum order of multipole expansion

    symbols, list:
        List of sympy symbol type objects which define coordinate labels.

    index_dict:
        Forward mapping dictionary between
        monomials of symbols and array indices, generated by generate_mappings
        or otherwise.

    inline_derivs: bool
        Calculate derivatives inline rather than precalculating these.

    Output:
    list:
        List of symbolic local expansion operators up to order.

    Example:
    >>> order = 1
    >>> x, y, z = sp.symbols('x y z')
    >>> map, _ = generate_mappings(order, (x, y, z))
    >>> generate_L_operators(order, (x, y, z), map)
    [M[0, 0]/R - 1.0*x*M[1, 0]/R**3 - 1.0*y*M[2, 0]/R**3 - 1.0*z*M[3, 0]/R**3,
    -1.0*x*M[0, 0]/R**3, -1.0*y*M[0, 0]/R**3, -1.0*z*M[0, 0]/R**3]
    """
order
symbols
M_dict
L_dict
source_order
examples
None