Compare commits
2 Commits
7744f040f6
...
346caf3ea0
| Author | SHA1 | Date | |
|---|---|---|---|
|
346caf3ea0
|
|||
|
5bb3a2163f
|
@@ -32,11 +32,16 @@ def gap_integral(
|
||||
return integrate.quad(integrand, 0, debye_frequency)[0]
|
||||
|
||||
|
||||
def equilibrium_gap(temp, debye_frequency, nv):
|
||||
def equilibrium_gap(temp: float, debye_frequency: float, nv: float) -> float:
|
||||
return find_gap(temp, 0, debye_frequency, nv)
|
||||
|
||||
|
||||
def find_gap(temp, mu_star, debye_frequency, nv):
|
||||
def find_gap(
|
||||
temp: float,
|
||||
mu_star: float,
|
||||
debye_frequency: float,
|
||||
nv: float
|
||||
) -> float:
|
||||
nv_inv = 1 / nv
|
||||
sol = scipy.optimize.root(
|
||||
lambda d: gap_integral(temp, d, mu_star, debye_frequency) - nv_inv,
|
||||
@@ -46,7 +51,9 @@ def find_gap(temp, mu_star, debye_frequency, nv):
|
||||
|
||||
|
||||
# this is n * Delta_0, calling it n in this file for brevity
|
||||
def n_integrand_function(xi, temp, delta, mu_star):
|
||||
def n_integrand_function(
|
||||
xi: float, temp: float, delta: float, mu_star: float
|
||||
) -> float:
|
||||
big_e = energy(xi, delta)
|
||||
left = 1 / (1 + numpy.exp((big_e - mu_star) / temp))
|
||||
right = 1 / (1 + numpy.exp(big_e / temp))
|
||||
@@ -54,8 +61,8 @@ def n_integrand_function(xi, temp, delta, mu_star):
|
||||
|
||||
|
||||
# as above, this is brevity n * Delta_0
|
||||
def n_integral(temp, delta, mu_star):
|
||||
def integrand(xi):
|
||||
def n_integral(temp: float, delta: float, mu_star: float) -> float:
|
||||
def integrand(xi: float) -> float:
|
||||
return n_integrand_function(xi, temp, delta, mu_star)
|
||||
intermediate = 20 * numpy.sqrt(delta ** 2 + mu_star ** 2)
|
||||
lower = integrate.quad(integrand, 0, intermediate)[0]
|
||||
|
||||
Reference in New Issue
Block a user