def potentialFunction(self, x):
naturalPotential = self.De * (1 - np.exp(-self.a * (x - self.center)))**2 + self.energyOffset
imaginaryPotential = 0
try:
imaginaryPotentialZeros = np.zeros(x.shape)
except:
if x > self.startOfAbsorbingPotential:
imaginaryPotential = -1.0j *self.strength * np.cosh( (np.real(x) - self.mySpace.xMax)**2 / (self.mySpace.Dx*30)**2)**(-2)
else:
imaginaryPotential = 0
return naturalPotential + imaginaryPotential
if self.absorbingPotential:
imaginaryPotential = -1.0j *self.strength * np.cosh( (np.real(x) - self.mySpace.xMax)**2 / (self.mySpace.Dx*30)**2)**(-2)
imaginaryPotential = np.where(x > self.startOfAbsorbingPotential, imaginaryPotential, imaginaryPotentialZeros)
return naturalPotential + imaginaryPotential
评论列表
文章目录