def nvt_cv(e1, e2, kt, volume = 1.0):

    """Compute (specific) heat capacity in NVT ensemble.

    C_V = 1/kT^2 . ( <E^2> - <E>^2 )
    """

    cv = (1.0/(volume*kt**2))*(e2 - e1*e1)

    return cv