def summary(self, dry_run=False, format_str=None, filepath=None):
        """
        Format:
            {NUM_OF_ATOMS}: number of atoms
            {NUM_OF_AO}:    number of AOs
            {NUM_OF_MO}:    number of MOs
            {METHOD}:       method
            {IS_CONVERGED}: Whether the SCF is converged or not
            {ITERATION}:    iteration
            {TOTAL_ENERGY}: total energy
            {GRADIENT_RMS}: gradient RMS
        """
        if self.is_finished_scf != True:
            self.calc_sp(dry_run)

        self.cd_work_dir("summary")

        values = {}
        pdfarc = self.get_pdfarchive()
        values["NUM_OF_ATOMS"] = pdfarc.num_of_atoms
        values["NUM_OF_AO"] = pdfarc.num_of_AOs
        values["NUM_OF_MO"] = pdfarc.num_of_MOs
        values["METHOD"] = pdfarc.method
        values["IS_CONVERGED"] = pdfarc.scf_converged
        itr = pdfarc.iterations
        values["ITERATION"] = itr
        values["TOTAL_ENERGY"] = pdfarc.get_total_energy(itr)
        values["GRADIENT_RMS"] = pdfarc.get_gradient_rms()

        if format_str == None:
            format_str = "total energy: {TOTAL_ENERGY} at {ITERATION}"
        output = format_str.format(**values)

        if output[-1] != "\n":
            output += "\n"

        logger.info(output)
        if filepath != None:
            with open(filepath, "a") as f:
                f.write(output)

        self.restore_cwd()
        return output