def calc_orbital_difference(orbital_1: dict, orbital_2: dict) -> float:
    """ Calculate absolute difference of between two orbitals

    If an element exists in one orbital, its difference corresponds to the
    sum of the orbital component.

    Args:
        orbital_1 (dict):
            {"Mg": {"s": 0.1, ...}, "O": {...},..
        orbital_2 (dict):
            {"Al": {"s": 0.02, ...}, "Mg": {"s": 0.1, ...}, "O": {...},..

    Return (float):
        Sum of difference
    """
    element_set = set(list(orbital_1.keys()) + list(orbital_2.keys()))

    difference = 0
    for e in element_set:
        for o in "s", "p", "d", "f":

            try:
                first = orbital_1[e][o]
            except KeyError:
                first = 0

            try:
                second = orbital_2[e][o]
            except KeyError:
                second = 0

            difference += abs(first - second)

    return difference