1 # unit conversions, mostly for standalone usage
2 # TODO avoid importing the "heavy" qpms parts
3 from scipy
.constants
import epsilon_0
as ε_0
, c
, pi
as π
, e
as eV
, hbar
, hbar
as ℏ
, mu_0
as μ_0
7 # "SCUFF FREQUENCY UNIT"
11 #freqs = freqs_weirdunits * c / μm
13 def nm2eV(lambda_nm
, n
= 1):
14 return 2*π
*c
/(n
* lambda_nm
* nm
) / (eV
/ ℏ
)
16 def eV2nm(e_eV
, n
= 1):
17 return 2*π
*c
/(n
* e_eV
* (eV
/ℏ
)) / nm
21 Scuff frequency units to eV.
23 return e_SU
* SU
/ (eV
/ ℏ
)
26 return e_eV
* (eV
/ ℏ
) / SU
28 def SU2nm(e_SU
, n
= 1):
29 return 2*π
*c
/(n
* e_SU
* SU
) / nm
31 def nm2SU(lambda_nm
, n
= 1):
32 return 2*π
*c
/(n
* lambda_nm
* nm
) / SU