def set_onsite_dis(self, alpha): ''' Set uniform onsite disorder. :param alpha: Complex or Real number. Disorder stength. Example usage:: sys.set_onsite_dis(alpha=0.1) ''' error_handling.empty_onsite(self.onsite) error_handling.number(alpha, 'alpha') self.onsite += alpha * rand.uniform(-1., 1., self.lat.sites)
def set_onsite_def(self, onsite_def): ''' Set specific onsite energies. :param onsite_def: Dictionary. key: site indices, val: onsite values. Example usage:: set_onsite_def(0: 1., 1: -1j) ''' error_handling.empty_onsite(self.onsite) error_handling.set_onsite_def(onsite_def, self.lat.sites) for i, o in onsite_def.items(): self.onsite[i] = o