Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pylab as plt
- import numpy as np
- '''
- plot A_k(w) = 1 / [(w - cos(k))^2 + gamma^2]
- with k on the x-axis and w on the y-axis
- '''
- # sample data
- side = np.linspace(-np.pi, np.pi, 1<<9)
- X, Y = np.meshgrid(side, side) # x = momentum, y = frequency
- g0 = 1
- Z = 1 / ((Y - np.cos(X))**2 + g0**2) # z = spectrum
- # plot the density map using nearest-neighbor interpolation
- plt.pcolormesh(X, Y, Z)
- plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement