Riemann surface plot using Python [duplicate]

笑着哭i 提交于 2020-08-09 19:32:45

问题


I have a complex matrix which looks like

H = [[w1-complex(0,g1),k], [k,w2-complex(0,g2)]

and as discussed in this paper,

I want to find the eigenvalues and plot their real and imaginary part on a Riemann surface. It seems that the paper chooses fixed values of g1 and g2 (denoted with Greek letter gamma originally) and uses a detuning parameter delta=(w1-w2)/2 and plots eigenvalues on the k-delta plane. Again, one may choose w2=0 and vary w1 to change delta.

I am attaching the portion of the paper that discusses the plotting.

I couldn't find any discussion on SO that plots Riemann surface plots using Python. Hope the problem is not a duplicate.

I have the following code.

"""
Riemann plot of a non-Hermitian matrix
"""

from mpl_toolkits.mplot3d import Axes3D
from matplotlib import cm
import matplotlib.pyplot as plt
import numpy as np


XR = np.arange(-1, 1, 0.01)
YR = np.arange(-1, 1, 0.01)

delta, kappa = np.meshgrid(XR, YR)

g1 = 0.2; g2 = 0.1
chi = (g1+g2)/2.0
beta = (g1-g2)/2.0
Gamma = delta + 1j*beta

disc = np.sqrt(kappa**2+Gamma**2)

lambda1 = delta-1j*chi+disc 
lambda2 = delta-1j*chi-disc 


F = plt.figure(1)
A = F.gca(projection='3d')
plt.xlabel('$\delta$')
plt.ylabel('$\kappa$')
A.set_zlabel('Re $\lambda$')
S = A.plot_surface( kappa, delta, lambda1.real, rstride=1, cstride=1, cmap=cm.Reds )
S = A.plot_surface( kappa, delta, lambda2.real, rstride=1, cstride=1, cmap=cm.Greys )

F = plt.figure(2)
A = F.gca(projection='3d')
plt.xlabel('$\delta$')
plt.ylabel('$\kappa$')
A.set_zlabel('Im $\lambda$')

S = A.plot_surface(kappa, delta, lambda1.imag, cmap=cm.Reds)
S = A.plot_surface(kappa, delta, lambda2.imag, cmap=cm.Greys)

plt.show()

which produces the following outputs.

Any way to modify it and get the desired results?

来源:https://stackoverflow.com/questions/63078039/riemann-surface-plot-using-python

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!