def BGL_form_factor(z, p, phi, a: list):
    """
    Calculates the BGL form factor.
    :param z: BGL expansion parameter.
    :param p: The Blaschke factors containing explicit poles in the q2 region.
    :param phi: Outer functions.
    :param a: Expansion coefficients.
    :return:
    """
    return 1 / (p(z) * phi(z)) * sum([a_i * z ** n for n, a_i in enumerate(a)])