path_plot.py 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. import numpy as np
  2. from rotational_path import PairRotationalPath, PathEnergyPlot
  3. import expansion
  4. from parameters import ModelParams
  5. from pathlib import Path
  6. zero_to_pi_half = np.linspace(0, np.pi/2, 100, endpoint=True)
  7. pi_half_to_pi = np.linspace(np.pi/2, np.pi, 100, endpoint=True)
  8. QuadPath = PairRotationalPath()
  9. QuadPath.set_default_x_axis(zero_to_pi_half)
  10. QuadPath.add_euler(beta1=np.pi/2, beta2=zero_to_pi_half)
  11. QuadPath.add_euler(beta1=zero_to_pi_half[::-1], beta2=zero_to_pi_half[::-1])
  12. QuadPath.add_euler(beta1=zero_to_pi_half)
  13. QuadPath.add_euler(beta1=zero_to_pi_half[::-1], beta2=zero_to_pi_half)
  14. QuadPath.add_euler(beta1=np.pi/2, beta2=zero_to_pi_half, alpha2=np.pi/2)
  15. QuadPath.add_euler(beta1=np.pi/2, beta2=np.pi/2, alpha1=zero_to_pi_half[::-1])
  16. DipolePath = PairRotationalPath()
  17. DipolePath.set_default_x_axis(zero_to_pi_half)
  18. DipolePath.add_euler(beta1=pi_half_to_pi[::-1])
  19. DipolePath.add_euler(beta1=zero_to_pi_half[::-1])
  20. DipolePath.add_euler(beta1=zero_to_pi_half, beta2=zero_to_pi_half)
  21. DipolePath.add_euler(beta1=np.pi/2, beta2=np.pi/2, alpha1=zero_to_pi_half)
  22. DipolePath.add_euler(beta1=np.pi/2, alpha1=np.pi/2, beta2=pi_half_to_pi)
  23. DipolePath.add_euler(beta1=np.pi/2, beta2=pi_half_to_pi[::-1], alpha2=np.pi)
  24. DipolePath.add_euler(beta1=zero_to_pi_half[::-1], beta2=pi_half_to_pi, alpha2=np.pi)
  25. DipolePath.add_euler(beta1=zero_to_pi_half, beta2=pi_half_to_pi[::-1], alpha2=np.pi)
  26. DipolePath.add_euler(beta1=pi_half_to_pi, beta2=zero_to_pi_half[::-1], alpha2=np.pi)
  27. DipolePath2 = PairRotationalPath()
  28. DipolePath2.set_default_x_axis(zero_to_pi_half)
  29. DipolePath2.add_euler(beta1=pi_half_to_pi[::-1])
  30. DipolePath2.add_euler(beta1=zero_to_pi_half[::-1])
  31. DipolePath2.add_euler(beta1=zero_to_pi_half, beta2=zero_to_pi_half)
  32. DipolePath2.add_euler(beta1=np.pi/2, beta2=np.pi/2, alpha1=zero_to_pi_half)
  33. DipolePath2.add_euler(beta1=np.pi/2, alpha1=np.pi/2, beta2=pi_half_to_pi)
  34. DipolePath2.add_euler(beta1=zero_to_pi_half[::-1], beta2=pi_half_to_pi[::-1])
  35. DipolePath2.add_euler(beta1=zero_to_pi_half[::-1], beta2=np.pi)
  36. DipolePath2.add_euler(beta1=zero_to_pi_half, beta2=pi_half_to_pi[::-1], alpha2=np.pi)
  37. DipolePath2.add_euler(beta1=pi_half_to_pi, beta2=zero_to_pi_half[::-1], alpha2=np.pi)
  38. if __name__ == '__main__':
  39. params = ModelParams(R=150, kappaR=3)
  40. # ex1 = expansion.MappedExpansionQuad(np.array([0.35, 0.44, 0.6]), params.kappaR, 0.001, max_l=20)
  41. # ex1 = expansion.Expansion24(sigma2=0.001, sigma4=0)
  42. # ex1 = expansion.Expansion(l_array=np.array([1]), coefs=expansion.rot_sym_expansion(np.array([1]), np.array([0.001])))
  43. # ex1 = expansion.GaussianCharges(omega_k=np.array([[0, 0], [np.pi, 0]]), lambda_k=np.array([5]), sigma1=0.001, l_max=10)
  44. ex1 = expansion.GaussianCharges(omega_k=np.array([np.pi, 0]), lambda_k=np.array([1, 5, 10, 15]), sigma1=0.001, l_max=10)
  45. ex2 = ex1.clone()
  46. path_plot = PathEnergyPlot(ex1, ex2, DipolePath2, dist=2., params=params)
  47. path_plot.plot(labels=[rf'$\lambda$={l}' for l in [1, 5, 10, 15]],
  48. # norm_euler_angles={'beta1': np.pi/2}
  49. )
  50. # path_plot.plot_sections(save_as=Path('/home/andraz/ChargedShells/Figures/dipole_path2.png'))