def vector_product(vec1, vec2, do_alignment=True):
    """
    Computes the dot product of two vectors.

    Parameters
    ----------
    vec1, vec2 : ProbabilityVector

    Returns
    -------
    product_scalar : float
    """
    if do_alignment:
        series1, series2 = vec1.series.align(vec2.series)
    else:
        series1, series2 = (vec1.series, vec2.series)
    product_scalar = series1.dot(series2)
    return product_scalar