diff --git a/plots/sc_inst.pdf b/plots/sc_inst.pdf index affaf4b8e42afdb7f9ef85a27369ced403889ad2..ca5c01cd265e1cd01686281045051c19491afb4e 100644 Binary files a/plots/sc_inst.pdf and b/plots/sc_inst.pdf differ diff --git a/plots/triangular_sing/sc.py b/plots/triangular_sing/sc.py index 1c139f62059845506ec39b72cd1b7a2a3412ec5f..ad21c655796445517ceef8e72c3d19a1d5080644 100755 --- a/plots/triangular_sing/sc.py +++ b/plots/triangular_sing/sc.py @@ -28,6 +28,56 @@ fig_width = 1.0 * 7.05687 sig = np.array([[[1, 0], [0, 1]], [[0, 1], [1, 0]], [[0, -1j], [1j, 0]], [[1, 0], [0, -1]]]) +def savitzky_golay(y, window_size, order, deriv=0, rate=1): + from math import factorial + + if window_size % 2 != 1 or window_size < 1: + raise TypeError("window_size size must be a positive odd number") + if window_size < order + 2: + raise TypeError("window_size is too small for the polynomials order") + order_range = range(order + 1) + half_window = (window_size - 1) // 2 + # precompute coefficients + b = np.mat([[k**i for i in order_range] + for k in range(-half_window, half_window + 1)]) + m = np.linalg.pinv(b).A[deriv] * rate**deriv * factorial(deriv) + # pad the signal at the extremes with + # values taken from the signal itself + firstvals = y[0] - np.abs(y[1:half_window + 1][::-1] - y[0]) + lastvals = y[-1] + np.abs(y[-half_window - 1:-1][::-1] - y[-1]) + y = np.concatenate((firstvals, y, lastvals)) + return np.convolve(m[::-1], y, mode='valid') + +upper_vH = np.array([ + [0.24921465968586393, 0.42439024390243907], + [0.25130890052356025, 0.4185365853658537], + [0.27434554973821984, 0.35414634146341467], + [0.29424083769633513, 0.3092682926829269], + [0.3172774869109947, 0.2751219512195122], + [0.3413612565445026, 0.24878048780487805], + [0.3633507853403141, 0.22634146341463418], + [0.3832460732984293, 0.2078048780487805], + [0.4020942408376963, 0.19219512195121957], + [0.418848167539267, 0.17853658536585365], + [0.43246073298429333, 0.16487804878048784], + [0.4450261780104713, 0.15414634146341472], + [0.45549738219895286, 0.1453658536585366]]) + +lower_vH = np.array([ + [0.24921465968586393, 0.42536585365853663], + [0.24502617801047116, 0.4204878048780488], + [0.2418848167539267, 0.4], + [0.23350785340314134, 0.38634146341463416], + [0.22722513089005242, 0.3746341463414634], + [0.22094240837696338, 0.3619512195121951], + [0.2178010471204188, 0.3502439024390244], + [0.21465968586387435, 0.33951219512195124], + [0.20942408376963356, 0.33073170731707324], + [0.2010471204188481, 0.3336585365853659], + [0.1968586387434555, 0.3678048780487805], + [0.18219895287958116, 0.40390243902439027], + [0.16335078534031416, 0.3590243902439024]]) + def get_bz_pts(basis, kmesh): border_points = [] @@ -102,9 +152,10 @@ cmap = mpc.LinearSegmentedColormap('CustomColormap', custom_colors) phase = np.load('phase.npy') sing = np.load("sing.npy") -alphas = alphas[:15] -sing = sing[:, :15] -phase = phase[:, :15] +cut = 11 +alphas = alphas[:cut] +sing = sing[:, :cut] +phase = phase[:, :cut] phase = np.array(phase, dtype='float') @@ -125,7 +176,7 @@ image_kw = dict(extent=(fills[0] - 0.5 * dfills, fills[-1] + 0.5 * dfills, im = axs['SC'].imshow(sing[:, ::-1].T, **image_kw, cmap=cmap, vmin=0, vmax=1, aspect='auto') -axs['SC'].set_ylim([np.min(alphas) - 0.02, np.max(alphas) + 0.05]) +axs['SC'].set_ylim([np.min(alphas) - 0.02, np.max(alphas) + 0.02]) axs['SC'].set_xlabel(r'$\nu$', labelpad=1) axs['SC'].set_xlim(0.15 - 2 * dfills, 0.60 + 2 * dfills) @@ -134,8 +185,17 @@ axs['SC'].set_ylabel(r'$\alpha$', labelpad=3) phase[np.where(phase != 1)] = np.nan axs['SC'].imshow(phase[:, ::-1].T, vmin=0, vmax=2, cmap='gray', **image_kw, alpha=0.7) -axs['SC'].text(0.28, 0.5, '\slshape{}(i)SDW', ha='center', va='center', - rotation=90) +# axs['SC'].text(0.28, 0.45, 'magnetic' + '\n' + 'order', #'\slshape{}(i)SDW', +# ha='center', va='center', +# rotation=90) + +alphas_ = np.arange(0, 1.21, 0.1) +# Plot the van Hove singularity line +yhat = savitzky_golay(upper_vH[:, 0], 7, 3) +axs['SC'].plot(yhat, alphas_, linestyle='--', color='gray') + +yhat = savitzky_golay(lower_vH[:, 0], 7, 3) +axs['SC'].plot(yhat, alphas_, linestyle='--', color='gray') cb = plt.colorbar(im, cax=axs['cbar'], fraction=0.046, pad=0.4) cb.set_ticks([0, 1])