fork download
  1. import numpy as np
  2. import matplotlib.pyplot as plt
  3.  
  4. # Define the parameters
  5. t = 1.0 # Hopping amplitude
  6. N = 50 # Number of lattice sites
  7. phi = np.pi / 4 # Phase factor (example: pi/4)
  8.  
  9. # Generate the mode indices (1 to N)
  10. n = np.arange(1, N+1)
  11.  
  12. # Calculate the energy dispersion for each mode n
  13. epsilon_n = -4 * t * np.cos(n * np.pi / (N+1)) * np.cos(phi)
  14.  
  15. # Plot the energy dispersion
  16. plt.figure(figsize=(8, 6))
  17. plt.plot(n, epsilon_n, label=r'$\epsilon_n = -4t \cos(\frac{n\pi}{N+1}) \cos(\phi)$')
  18. plt.title("Energy Dispersion in Tight-Binding Chain with Peierls Substitution")
  19. plt.xlabel("Mode index (n)")
  20. plt.ylabel("Energy ($\epsilon_n$)")
  21. plt.grid(True)
  22. plt.legend()
  23. plt.show()
  24.  
Success #stdin #stdout 0.82s 55460KB
stdin
Standard input is empty
stdout
Standard output is empty