Hamilton's characteristic function