def rotmol(numpoints, x, u):
    """
        Rotate a molecule

        Parameters
            numpoints:  The number of points in the list (int)
            x:          The input coordinates (list)
            u:          The left rotation matrix (list)
        Returns
            out:        The rotated coordinates out=u * x (list)
    """
    out = []
    for i in range(numpoints):
        out.append([])
        out[i].append(u[0][0] * x[i][0] + u[1][0] * x[i][1] + u[2][0] * x[i][2])
        out[i].append(u[0][1] * x[i][0] + u[1][1] * x[i][1] + u[2][1] * x[i][2])
        out[i].append(u[0][2] * x[i][0] + u[1][2] * x[i][1] + u[2][2] * x[i][2])

    return out