Exemple #1
0
 def init_cv_mpo(self):
     cv_mpo = Mpo.finiteT_cv(self.model,
                             1,
                             self.m_max,
                             self.spectratype,
                             percent=1.0)
     return cv_mpo
Exemple #2
0
 def init_mps(self):
     beta = self.temperature.to_beta()
     self.h_mpo = Mpo(self.mol_list)
     if self.spectratype == "abs":
         dipole_mpo = Mpo.onsite(self.mol_list, r"a^\dagger", dipole=True)
         i_mpo = MpDm.max_entangled_gs(self.mol_list)
         tp = ThermalProp(i_mpo, self.h_mpo, exact=True, space='GS')
         tp.evolve(None, 1, beta / 2j)
         ket_mpo = tp.latest_mps
     else:
         impo = MpDm.max_entangled_ex(self.mol_list)
         dipole_mpo = Mpo.onsite(self.mol_list, "a", dipole=True)
         if self.job_name is None:
             job_name = None
         else:
             job_name = self.job_name + "_thermal_prop"
         impo.compress_config = self.compress_config
         tp = ThermalProp(impo,
                          self.h_mpo,
                          evolve_config=self.evolve_config,
                          dump_dir=self.dump_dir,
                          job_name=job_name)
         self._defined_output_path = tp._defined_output_path
         if tp._defined_output_path:
             try:
                 logger.info(
                     f"load density matrix from {self._thermal_dump_path}")
                 ket_mpo = MpDm.load(self.mol_list, self._thermal_dump_path)
                 logger.info(f"density matrix loaded: {ket_mpo}")
             except FileNotFoundError:
                 logger.debug(f"no file found in {self._thermal_dump_path}")
                 tp.evolve(None, self.insteps, beta / 2j)
                 ket_mpo = tp.latest_mps
                 ket_mpo.dump(self._thermal_dump_path)
     self.a_ket_mpo = dipole_mpo.apply(ket_mpo, canonicalise=True)
     self.cv_mpo = Mpo.finiteT_cv(self.mol_list,
                                  1,
                                  self.m_max,
                                  self.spectratype,
                                  percent=1.0)
     self.cv_mps = self.cv_mpo