def test_exact_propagator(dt, space, shift): prop_mpo = Mpo.exact_propagator(holstein_model, -1.0j * dt, space, shift) with open(os.path.join(cur_dir, "test_exact_propagator.pickle"), "rb") as fin: std_dict = pickle.load(fin) std_mpo = std_dict[space] assert prop_mpo == std_mpo
def evolve_exact(self, h_mpo, evolve_dt, space): MPOprop = Mpo.exact_propagator(self.model, -1.0j * evolve_dt, space=space, shift=-h_mpo.offset) # Mpdm is applied on the propagator, different from base method new_mpdm = self.apply(MPOprop, canonicalise=True) new_mpdm.coeff *= np.exp(-1.0j * h_mpo.offset * evolve_dt) return new_mpdm
def evolve_exact(self, old_mpdm: MpDm, evolve_dt): MPOprop = Mpo.exact_propagator(old_mpdm.model, evolve_dt.imag, space=self.space, shift=-self.h_mpo.offset) new_mpdm = MPOprop.apply(old_mpdm, canonicalise=True) # partition function can't be obtained. It's not practical anyway. # The function is too large to be fit into float64 even float128 new_mpdm.normalize(1.0) return new_mpdm