qed_eigs.py 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. ######################################################
  2. #
  3. # Adaptation of phi4 methods for Hamiltonian truncation to QED/Schwinger model
  4. #
  5. ######################################################
  6. import schwinger
  7. import sys
  8. import scipy
  9. import time
  10. import sys
  11. import numpy as np
  12. from scipy.constants import pi
  13. def main(argv):
  14. #if there are too few arguments, print the right syntax and exit
  15. if len(argv) < 3:
  16. print("python qed_genMatrix.py <fname> <g> <Emax>")
  17. sys.exit(-1)
  18. print("Beginning eigenvalue calculation.")
  19. startTime = time.time()
  20. fname = argv[1]
  21. g = float(argv[2])
  22. Emax = float(argv[3])
  23. # Hardcoded parameters
  24. m=1.
  25. sigma = -30.
  26. neigs = 3
  27. b = schwinger.Schwinger()
  28. b.loadMatrix(fname)
  29. b.buildBasis(Emax=Emax)
  30. print(f"full basis size = {b.fullBasis.size}")
  31. print(f"basis size = {b.basis.size}")
  32. b.setcouplings(g)
  33. print(f"Computing raw eigenvalues for g = {g}")
  34. b.computeHamiltonian(ren=False)
  35. print(f"{b.H.toarray()}")
  36. b.computeEigval(sigma=sigma, n=neigs, ren=False)
  37. print("Raw vacuum energy: ", b.vacuumE(ren="raw"))
  38. print("Raw spectrum: ", b.spectrum(ren="raw"))
  39. if __name__ == "__main__":
  40. main(sys.argv)