Reference state: spherica HFB state
Chiral interaction
Evolved Operators:
$$ O(s) = e^{\Omega(s)} O(0)e^{-\Omega(s)} $$
$$ E(s) = \langle \Phi\vert H(s)\vert \Phi\rangle $$ where $s$ the flow parameter.
import pandas as pd
import matplotlib.pyplot as plt
def energy_flow(file,color):
content = []
with open(file,'r') as f:
for cnt, line in enumerate(f):
if 'RESTART' not in line and cnt>5:
content.append(line.split())
features=['s','E','Ecor','E_final','EL3B','dE/ds','Fob_y','norm_eta']
df = pd.DataFrame(content)
df.columns=features
df_num=df[features].astype(float)
plt.plot(df_num['s'],df_num['E'],c=color)
plt.xscale('log')
return df_num
def file2df(file):
content = []
with open(file,'r') as f:
for cnt, line in enumerate(f):
if 'RESTART' not in line and cnt>5:
content.append(line.split())
features=['s','E','Ecor','E_final','EL3B','dE/ds','Fob_y','norm_eta']
df = pd.DataFrame(content)
df.columns=features
df_num=df[features].astype(float)
return df_num
def set_figstyle(xmin,xmax,ymin,ymax,xlabel,ylabel,how):
"""
how -- True: label both sides of y;
False: only label the left side
"""
plt.xlabel(xlabel,fontsize=24)
plt.ylabel(ylabel, fontsize=24)
plt.ylim(ymin,ymax)
plt.xlim(xmin,xmax)
plt.tick_params(which='major',direction='in',length=10,labelsize=20)
plt.tick_params(which='minor',direction='in',length=5,labelsize=20)
plt.tick_params(labelbottom=True, labeltop=False, labelleft=True, labelright=how,
bottom=True, top=False, left=True, right=True)
def comparison2(df1,df2,color1,color2):
plt.plot(df1['s'],df1['E'],c=color1)
plt.plot(df2['s'],df2['E'],c=color2)
plt.xscale('log')
def comparison4(df1,df2,df3,df4,color1,color2,color3,color4,label1,label2,label3,label4):
plt.plot(df1['s'],df1['E'],c=color1,label=label1)
plt.plot(df2['s'],df2['E'],c=color2,label=label2)
plt.plot(df3['s'],df3['E'],c=color3,label=label3)
plt.plot(df4['s'],df4['E'],c=color4,label=label4)
plt.xscale('log')
import plotly
import plotly.graph_objs as go
import plotly.offline as py
plotly.offline.init_notebook_mode(connected=True)
def interactive_comparison2(df1,df2,label1,label2):
plot1 = go.Scatter(x=df1['s'],y=df1['E'],mode = 'lines+markers',name=label1)
plot2 = go.Scatter(x=df2['s'],y=df2['E'],mode = 'markers',name=label2)
layout = go.Layout(
xaxis=dict(
type='log',
# autorange=True,
# showgrid=False,
# zeroline=False,
# showline=False,
# ticks='',
showticklabels=True
),
yaxis=dict(
# autorange=True,
# showgrid=False,
# zeroline=False,
# showline=False,
# ticks='',
showticklabels=True
)
)
data = [plot1,plot2]
fig = go.Figure(data=data, layout=layout)
py.iplot(fig)
def interactive_comparison3(df1,df2,df3,label1,label2,label3):
plot1 = go.Scatter(x=df1['s'],y=df1['E'],mode = 'markers',name=label1)
plot2 = go.Scatter(x=df2['s'],y=df2['E'],mode = 'lines',name=label2)
plot3 = go.Scatter(x=df3['s'],y=df3['E'],mode = 'lines+markers',name=label3)
layout = go.Layout(
xaxis=dict(
type='log',
# autorange=True,
# showgrid=False,
# zeroline=False,
# showline=False,
# ticks='',
showticklabels=True
),
yaxis=dict(
# autorange=True,
# showgrid=False,
# zeroline=False,
# showline=False,
# ticks='',
showticklabels=True
)
)
data = [plot1,plot2,plot3]
fig = go.Figure(data=data, layout=layout)
py.iplot(fig)
def interactive_comparison4(df1,df2,df3,df4,label1,label2,label3,label4):
plot1 = go.Scatter(x=df1['s'],y=df1['E'],mode = 'markers',name=label1)
plot2 = go.Scatter(x=df2['s'],y=df2['E'],mode = 'lines',name=label2)
plot3 = go.Scatter(x=df3['s'],y=df3['E'],mode = 'lines+markers',name=label3)
plot4 = go.Scatter(x=df4['s'],y=df4['E'],mode = 'markers',name=label4)
layout = go.Layout(
xaxis=dict(
type='log',
# autorange=True,
# showgrid=False,
# zeroline=False,
# showline=False,
# ticks='',
showticklabels=True
),
yaxis=dict(
# autorange=True,
# showgrid=False,
# zeroline=False,
# showline=False,
# ticks='',
showticklabels=True
)
)
data = [plot1,plot2,plot3,plot4]
fig = go.Figure(data=data, layout=layout)
py.iplot(fig)
return fig
file1="MR/Mg32_em1.8-2.0_eMax04_lMax04_hwHO016.flow"
file2="MR/sd/Mg32_em1.8-2.0_eMax04_lMax04_hwHO016.flow"
file3="PNP/Mg32_em1.8-2.0_eMax04_lMax04_hwHO016.flow"
file4="beta00/Mg32_em1.8-2.0_eMax04_lMax04_hwHO016.flow"
df_mr_L12 = file2df(file1)
df_mr_L123= file2df(file2)
df_pnp= file2df(file3)
df_mr_gcm4sph= file2df(file4)
fig4 = interactive_comparison4(df_mr_L12,df_mr_L123,df_mr_gcm4sph, df_pnp,
r'MR(w/o L3B)',r'MR(w/L3B)','MR(w/L3B GCM4Sph)','PNP')
comparison4(df_mr_L12,df_mr_L123,df_mr_gcm4sph,df_pnp, 'b','y','g','r',
r'MR(w/o L3B)',r'MR(w/L3B,sd)','MR(w/L3B GCM4Sph,sd)','PNP')
plt.legend(fontsize=14)
set_figstyle(0.01,10,-215,-210,'Flow parameter s',' E [MeV]',True)
It is shown in the above figure that
import plotly.io as pio
pio.write_image(fig4, 'fig4.png')
L3B from PNP calculation
L3b = pd.read_csv("MR/sd/Mg32_em1.8-2.0_eMax04_lMax04_hwHO016.lambda.me3b.gz",delimiter=r'\s+')
L3b.columns=['idx123','idx456','L3B']
L3b.head()
L3b_diag = L3b[L3b['idx123']==L3b['idx456']]
L3b_diag['L3B'].sum()
L3B from GCM4Sph calculation
L3b2 = pd.read_csv("beta00/L3B.dat",delimiter=r'\s+')
L3b2.columns=['idx123','idx456','L3B']
L3b2.head()
L3b2[L3b2['idx123']==L3b2['idx456']].L3B.sum()
L3B_cat = pd.merge(L3b2,L3b,on=['idx123','idx456'],how='outer')
L3B_cat.head()
L3B_cat['diff']=L3B_cat['L3B_x']-L3B_cat['L3B_y']
L3B_cat['ratio']=2*(L3B_cat['L3B_x']-L3B_cat['L3B_y'])/(L3B_cat['L3B_x']+L3B_cat['L3B_y'])
plt.scatter(L3B_cat['L3B_x'],L3B_cat['diff'])
plt.scatter(L3B_cat['L3B_x'],L3B_cat['ratio'])
import seaborn as sns