Skip to content

Commit

Permalink
linear expansion functions
Browse files Browse the repository at this point in the history
  • Loading branch information
maxmarkov committed Oct 9, 2021
1 parent 4d596f6 commit c34d947
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 62 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ The methodology for these calculations is described in the following references:
DOI: http://dx.doi.org/10.1103/PhysRevLett.101.117201

These articles should be cited if you use this code.

**Note:** the code computes ion- and lattice-mediated contributions to the spin component of magneto-electric response.
It does not compute the orbital component and the electronic contribution to the spin component of magneto-electric
response.

## Examples:
## Computational procedure (example):

We assume that POSCAR file is in the ROOT directory.

Expand Down
120 changes: 60 additions & 60 deletions fdtoolbox/linear_expansion.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,58 +65,58 @@ def born_charges(self):
def magnetic_strengths(self):
return self.B_m_mu, "mu_B A**-1"

# def piezoelectric_stress_tensor(self, ionic=True):
# if ionic is True:
# rval = self.Bhat_alpha_j
# else:
# rval = self.B_alpha_j
# return -EA2_TO_CM2*rval, "C m**-2"
# def piezoelectric_strain_tensor(self, ionic=True):
# if ionic is True:
# sjk = invert_with_warning(self.Bhat_j_k, self.calcset.ROTATIONAL_MODE_THRESHOLD,
# 'Inverting elastic constant matrix resulted in %d soft modes', 3)
# eaj= self.Bhat_alpha_j
# else:
# sjk = invert_with_warning(self.B_j_k, self.calcset.ROTATIONAL_MODE_THRESHOLD,
# 'Inverting elastic constant matrix resulted in %d soft modes', 3)
# eaj= self.B_alpha_j
#
# return -1000*EA2_TO_CM2*dot(sjk, eaj)/EVA3_TO_GPA, "pC N**-1"
# def piezomagnetic_stress_tensor(self, ionic=True):
# if ionic is True:
# rval = self.Bhat_mu_j
# else:
# rval = self.B_mu_j
#
# return -BMA3_TO_AM*rval, "A m**-1"
# def piezomagnetic_strain_tensor(self, ionic=True):
# if ionic is True:
# sjk = invert_with_warning(self.Bhat_j_k, self.calcset.ROTATIONAL_MODE_THRESHOLD,
# 'Inverting elastic constant matrix resulted in %d soft modes', 3)
# mmj = self.Bhat_mu_j
# else:
# sjk = invert_with_warning(self.B_j_k, self.calcset.ROTATIONAL_MODE_THRESHOLD,
# 'Inverting elastic constant matrix resulted in %d soft modes', 3)
# mmj = self.B_mu_j
#
# return -BMEV_TO_T*dot(sjk, mmj), "T-1"
# def elastic_tensor(self, ionic=True):
# if ionic is True:
# rval = self.Bhat_j_k
# else:
# rval = self.B_j_k
# return EVA3_TO_GPA*rval, "GPa"
# def compliance_tensor(self, ionic=True):
# # compliance tensor is an inverted elastic tensor
# cjk = self.elastic_tensor(ionic)[0]
# sjk = invert_with_warning(cjk, self.calcset.ROTATIONAL_MODE_THRESHOLD*EVA3_TO_GPA,
# 'Inverting elastic constant matrix resulted in %d soft modes', 3)
# return 1000*sjk, "TPa**-1"
def piezoelectric_stress_tensor(self, ionic=True):
if ionic is True:
rval = self.Bhat_alpha_j
else:
rval = self.B_alpha_j
return -EA2_TO_CM2*rval, "C m**-2"

#def piezoelectric_strain_tensor(self, ionic=True):
# if ionic is True:
# sjk = invert_with_warning(self.Bhat_j_k, self.calcset.ROTATIONAL_MODE_THRESHOLD,
# 'Inverting elastic constant matrix resulted in %d soft modes', 3)
# eaj= self.Bhat_alpha_j
# else:
# sjk = invert_with_warning(self.B_j_k, self.calcset.ROTATIONAL_MODE_THRESHOLD,
# 'Inverting elastic constant matrix resulted in %d soft modes', 3)
# eaj= self.B_alpha_j
#
# return -1000*EA2_TO_CM2*dot(sjk, eaj)/EVA3_TO_GPA, "pC N**-1"

def piezomagnetic_stress_tensor(self, ionic=True):
if ionic is True:
rval = self.Bhat_mu_j
else:
rval = self.B_mu_j

return -BMA3_TO_AM*rval, "A m**-1"

#def piezomagnetic_strain_tensor(self, ionic=True):
# if ionic is True:
# sjk = invert_with_warning(self.Bhat_j_k, self.calcset.ROTATIONAL_MODE_THRESHOLD,
# 'Inverting elastic constant matrix resulted in %d soft modes', 3)
# mmj = self.Bhat_mu_j
# else:
# sjk = invert_with_warning(self.B_j_k, self.calcset.ROTATIONAL_MODE_THRESHOLD,
# 'Inverting elastic constant matrix resulted in %d soft modes', 3)
# mmj = self.B_mu_j
#
# return -BMEV_TO_T*dot(sjk, mmj), "T-1"

def elastic_tensor(self, ionic=True):
if ionic is True:
rval = self.Bhat_j_k
else:
rval = self.B_j_k
return EVA3_TO_GPA*rval, "GPa"

#def compliance_tensor(self, ionic=True):
# # compliance tensor is an inverted elastic tensor
# cjk = self.elastic_tensor(ionic)[0]
# sjk = invert_with_warning(cjk, self.calcset.ROTATIONAL_MODE_THRESHOLD*EVA3_TO_GPA,
# 'Inverting elastic constant matrix resulted in %d soft modes', 3)
# return 1000*sjk, "TPa**-1"

def magneto_electric_coupling(self, lattice=True):
if lattice is True:
Expand All @@ -126,8 +126,8 @@ def magneto_electric_coupling(self, lattice=True):

return(-1e4*COUPLING_TO_GAUSS*rval, "1e-4 g.u.")

# def force_constant_matrix(self):
# return self.calcset.groundstate.volume*self.B_m_n, "eV Andstrom**-2 "
def force_constant_matrix(self):
return self.calcset.groundstate.volume*self.B_m_n, "eV Andstrom**-2 "

def electric_susceptibility(self, lattice=True):
if lattice is True:
Expand All @@ -136,9 +136,9 @@ def electric_susceptibility(self, lattice=True):
rval = self.Bhat_alpha_beta
return(-EEAEV_TO_EPSILON0*rval, "epsilon0")

# def magnetic_susceptibility(self, lattice=True):
# if lattice is True:
# rval = self.Bgot_mu_nu
# else:
# rval = self.Bhat_mu_nu
# return -1e8*BM2A3EV_TO_1MU0*rval, "1e-8 mu0**-1"
def magnetic_susceptibility(self, lattice=True):
if lattice is True:
rval = self.Bgot_mu_nu
else:
rval = self.Bhat_mu_nu
return -1e8*BM2A3EV_TO_1MU0*rval, "1e-8 mu0**-1"

0 comments on commit c34d947

Please sign in to comment.