def lambda2(field, method=None):
    """
    Computes the lambda2 criterion of the field.

    Parameters
    ----------
    field : Field2D
    method: str, optional
        A method for calculation of the lambda2 criterion. Valid options are:
        ...

    Returns
    -------
    Field2D

    Author(s)
    ---------
    Jia Cheng Hu
    """
    ddx = field.ddx(method)
    ddy = field.ddy(method)
    return (ddx.u(0)+ddy.u(1))**2 - 4*(ddx.u(0)*ddy.u(1) - ddy.u(0)*ddx.u(1))