Skip to content

Commit

Permalink
Fix : plot-tool dipole.py (deepmodeling#3134)
Browse files Browse the repository at this point in the history
* Update dipole.py

* Update dipole.py
  • Loading branch information
lyb9812 authored Nov 10, 2023
1 parent 918445e commit 35bd3a7
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions tools/plot-tools/abacus_plot/dipole.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,7 @@ def alpha(self,dirc: int):
efield=self.padding(self.efield_data[dirc])
dipole_fft = np.fft.fft(dipole)
efield_fft = np.fft.fft(efield)
numerator=dipole_fft*efield_fft.conjugate()
denominator=efield_fft*efield_fft.conjugate()
#added to avoid zero division
denominator=0.01*max(denominator)+denominator
alpha = np.abs((numerator/denominator).imag)
alpha = np.abs((dipole_fft/efield_fft).imag)
return alpha

def plot_abs(self, fig: Figure, ax: axes.Axes, directions: list = [0, 1, 2], x_range: list = [], unit: str = 'eV'):
Expand Down

0 comments on commit 35bd3a7

Please sign in to comment.