def compute_gauge_action_change(self, beta, phase_new, phase_old, staple_dagg): u_new = cmplx_exp(complex(0.0, phase_new)) u_old = cmplx_exp(complex(0.0, phase_old)) term = (u_new - u_old) * staple_dagg return -beta * term.real
def compute_staple_dagg(self, idx, mu): # FIXME: the following line is hardcoded for the case dim=2 nu = int(not mu) # daggered terms phase1 = -self.gauge_links[self.neighbors_table_crossed[idx][mu]][nu] #print(self.neighbors_table_backward[idx][nu]) phase1 -= self.gauge_links[self.neighbors_table_backward[idx][nu]][mu] # non-daggered term phase1 += self.gauge_links[self.neighbors_table_backward[idx][nu]][nu] # non-daggered term phase2 = self.gauge_links[self.neighbors_table_forward[idx][mu]][nu] # daggered terms phase2 -= self.gauge_links[self.neighbors_table_forward[idx][nu]][mu] phase2 -= self.gauge_links[idx][nu] term1 = cmplx_exp(complex(0.0, phase1)) term2 = cmplx_exp(complex(0.0, phase2)) return term1 + term2
# using 1+1 for this simulation sim_params['spacetime_dim'] = 2 # T,X,Y,... sim_params['latt_size_per_dim'] = dims # creating the simulation object sim = Simulation(sim_params) # 1. create a gauge config with top charge = Q #sim.build_U_with_Q(3.0) sim.MARKOV_CHAIN = [sim.gauge_links] #top_charge = sim.compute_topological_charge() # exponentiating the gauge links' phases sim.gauge_links_exp = np.copy(sim.gauge_links) sim.gauge_links_exp = sim.gauge_links_exp.flatten() sim.gauge_links_exp = np.array( [cmplx_exp(complex(0.0, a)) for a in sim.gauge_links_exp]) sim.gauge_links_exp = sim.gauge_links_exp.reshape([sim.nr_latt_sites, 2]) # 2. construct M # after this following line, sim.dirac_matrix is a sparse construction of D # also, we use m=0.0 sim.buildM(sim.gauge_links, 0.0, 0.0) sim.dirac_matrix = sim.dirac_matrix * (-1.0) # 3. call eigensolver evals_all, evecs_all = eig_nonsparse(sim.dirac_matrix.toarray()) # 4. plot spectrum of M X = [x.real for x in evals_all] Y = [y.imag for y in evals_all]
def compute_plaquette_from_phase(self, phase): return cmplx_exp(complex(0.0, phase))