Skip to content

Commit

Permalink
Release 0.9.8
Browse files Browse the repository at this point in the history
  • Loading branch information
gmatteo committed Sep 12, 2024
1 parent 747ef72 commit 8e2f464
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 21 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
Release 0.9.8:

* Support for python 3.12, scipy 1.14 and numpy 2.0
* Compatibility with pymatgen v2024.9.10
* Abipy can now read magmoms from the GSR file
* Workflows and post-processing tools for photoluminescence calculations.
* Additional tools for post-processing E-PH calculations.

Release 0.9.6:

Expand Down
2 changes: 1 addition & 1 deletion abipy/core/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# release. 'dev' as a _version_extra string means this is a development version
_version_major = 0
_version_minor = 9
_version_micro = 7 # use '' for first of series, number for 1 and above
_version_micro = 8 # use '' for first of series, number for 1 and above
#_version_extra = 'dev'
_version_extra = '' # Uncomment this for full releases

Expand Down
28 changes: 8 additions & 20 deletions abipy/lumi/deltaSCF.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,12 @@

from abipy.core.structure import Structure
from abipy.abilab import abiopen
import matplotlib.pyplot as plt
#from mpl_toolkits.mplot3d import Axes3D
import math
from mpmath import coth
try:
from scipy.integrate import simpson as simps
except ImportError:
from scipy.integrate import simps
#from scipy.special import factorial
from abipy.tools.plotting import get_ax_fig_plt, add_fig_kwargs,get_axarray_fig_plt
import abipy.core.abinit_units as abu

Expand Down Expand Up @@ -396,8 +393,7 @@ def FC_factor_approx(self,n):
approx of same eff frequency in gs and ex and T = 0K.
See eq. (9) of https://doi.org/10.1002/adom.202100649
"""
FC = np.exp(self.S_em()) * self.S_em() ** n / math.factorial(n)
return FC
return np.exp(self.S_em()) * self.S_em() ** n / math.factorial(n)

def lineshape_1D_zero_temp(self,energy_range=[0.5,5],max_m=25,phonon_width=0.01,with_omega_cube=True,normalized='Area'):
"""
Expand Down Expand Up @@ -494,9 +490,7 @@ def get_dataframe(self,label=None):
rows.append(d)
index.append(label)

df=pd.DataFrame(rows,index=index)

return df
return pd.DataFrame(rows,index=index)

def draw_displacements_vesta(self,in_path, mass_weighted = False,
scale_vector=20,width_vector=0.3,color_vector=[255,0,0],centered=True,
Expand Down Expand Up @@ -580,10 +574,8 @@ def draw_displacements_vesta(self,in_path, mass_weighted = False,

print(f"Vesta files created and stored in : \n {os.getcwd()}/{out_path}")

return

@add_fig_kwargs
def displacements_visu(self,a_g=10,**kwargs):
def displacements_visu(self, a_g=10, **kwargs):
"""
Make a 3d visualisation of the displacements induced by the electronic transition =
Difference between ground state and excited state atomic positions.
Expand All @@ -608,16 +600,16 @@ def displacements_visu(self,a_g=10,**kwargs):

M = self.amu_list()*(u**2+v**2+w**2)

fig=plt.figure()
ax, fig, plt = get_ax_fig_plt(ax=None)
ax = fig.add_subplot(111, projection='3d')

ax.quiver(x, y, z,u*a_g,v*a_g,w*a_g, color='k',linewidths=1,**kwargs)
sc = ax.scatter(x, y, z, c=M, marker='o', s=60, cmap="jet",**kwargs)

clb=plt.colorbar(sc)
clb = plt.colorbar(sc)
clb.set_label(r'$\Delta Q^2$ per atom')
return fig

return fig

@add_fig_kwargs
def plot_delta_R_distance(self, defect_symbol,colors=["k","r","g","b","c","m"],ax=None, **kwargs):
Expand Down Expand Up @@ -686,7 +678,7 @@ def plot_delta_F_distance(self, defect_symbol,colors=["k","r","g","b","c","m"],a
return fig

@add_fig_kwargs
def plot_four_BandStructures(self,nscf_files,ax_mat=None,ylims=[-5,5],**kwargs):
def plot_four_BandStructures(self, nscf_files, ax_mat=None, ylims=(-5, 5), **kwargs):
"""
plot the 4 band structures.
nscf_files is the list of Ag, Agstar, Aestar, Ae nscf gsr file paths.
Expand Down Expand Up @@ -726,7 +718,7 @@ def draw_displaced_parabolas(self,ax=None,scale_eff_freq=4,font_size=8, **kwargs
Returns: |matplotlib-Figure|
"""
ax,fig,plt=get_ax_fig_plt(ax=ax)
ax, fig, plt = get_ax_fig_plt(ax=ax)

delta_Q=self.delta_q()
E_zpl=self.E_zpl()
Expand All @@ -741,7 +733,6 @@ def draw_displaced_parabolas(self,ax=None,scale_eff_freq=4,font_size=8, **kwargs
E_gs=0.5*omega_gs_sq.real*(Qs)**2+0 # ref at (0,0)
E_ex=0.5*omega_ex_sq.real*(Qs-delta_Q)**2+ self.E_zpl()# min at (delta_Q,ae_energy)


# parabolas
ax.plot(Qs,E_gs,'k',zorder=1)
ax.plot(Qs,E_ex,'k',zorder=1)
Expand All @@ -753,7 +744,6 @@ def draw_displaced_parabolas(self,ax=None,scale_eff_freq=4,font_size=8, **kwargs
ax.scatter(xs,ys,s=50,color='k',zorder=2)

# arrows

ax.annotate("", xy=(0, E_zpl+0.95*new_FC_ex), xytext=(0, 0),
arrowprops=dict(arrowstyle="->",color="b",lw=1))
ax.annotate(r' $E_{abs}$='+format(self.E_abs(),".2f")+' eV ', xy=(0,(E_zpl+new_FC_ex)/2),ha='left',fontsize=font_size)
Expand Down Expand Up @@ -790,8 +780,6 @@ def draw_displaced_parabolas(self,ax=None,scale_eff_freq=4,font_size=8, **kwargs
arrowprops=dict(arrowstyle="<-",color="k",lw=1.5))
ax.text(x=0.7*delta_Q,y=-new_FC_gs, s='Configuration coordinate Q',fontsize=10,ha='center')


ax.axis('off')

return fig

0 comments on commit 8e2f464

Please sign in to comment.