def gloc(self, iw, mu, siw, siw_gw=None): ziw = (1j * iw + mu)[:, None, None, None, None] * self.eye - siw orbspin.warn_offdiagonal(siw) zeta = orbspin.extract_diagonal(ziw - self.hloc) d2 = self.d[np.newaxis]**2 glociw = 2 * zeta / d2 * (1 - np.sqrt(1 - d2 / zeta**2)) glociw = orbspin.promote_diagonal(glociw) return glociw
def prepare_input(cls, qtty): orbspin.warn_offdiagonal(qtty) qtty = orbspin.extract_diagonal(qtty) if (np.abs(qtty.imag) > 1e-10).any(): warn("Quantity has non-vanishing imaginary part", UserWarning, 2) qtty = qtty.real if qtty.ndim > 2: axes_list = [-2, -1] + range(qtty.ndim - 2) qtty = qtty.transpose(axes_list) return qtty
def gloc(self, iw, mu, siw, siw_gw=None): orbspin.warn_offdiagonal(siw) siw = orbspin.extract_diagonal(siw) zeta = (1j * iw + mu)[:, None, None] - siw # compute integral de N(e)/(zeta - e) glociw = self.integrator( self.dos.transpose(1, 2, 0)[None, :, :, :] / (zeta[:, :, :, None] - self.w[None, None, None, :])) glociw = orbspin.promote_diagonal(glociw) return glociw
#if (equiv_new >= len(atom_list)).any(): #parser.error("invalid atom in array equiv!") if (equiv_new < 0).any(): parser.error("invalid atom in array equiv!") if (equiv_new > np.arange(len(atom_list))).any(): parser.error( "wrong order of array equiv; they have to be in ascending order!") log("Forcing equivalence to: %s", equiv_new) equiv = equiv_new[:] log("Checking if d-d blocks are diagonal in spin and orbital ...") epsoffdiag = cfg["General"]["EPSOFFDIAG"] for iatom, atom in enumerate(atom_list): g0iw_dd = atom.d_downfold(glociw_eq).copy() orbspin.warn_offdiagonal(g0iw_dd, tolerance=epsoffdiag) log("Generating inequivalent atoms ...") ineq_indices = np.unique(equiv) ineq_list = [] for ineq_index in ineq_indices: clones = [ at for iat, at in enumerate(atom_list) if equiv[iat] == ineq_index ] curr_ineq = atoms.InequivalentAtom(clones) ineq_list.append(curr_ineq) log(" inequivalent atom %d: %d clones, starting: %s", ineq_index, len(clones) - 1, ", ".join(str(c.start) for c in clones)) output.ineq_list = ineq_list output.write_quantity("lda-mu", mylattice.mu)