defectpl.defectpl¶
Photoluminescence
dataclass
¶
Photoluminescence(frequencies, eigenvectors, masses, EZPL, dR=None, dF=None, resolution=1000, max_energy=5.0, sigma=0.006, gamma=2.0, temperature=0.0)
Bases: MSONable
Core engine for first-principles photoluminescence lineshape calculations.
Implements the generating-function formalism of Alkauskas et al. (New J. Phys. 16, 073026, 2014) to compute the full multi-phonon PL spectrum of a point defect from DFT inputs.
Two input modes are supported:
- Displacement mode — supply
dR(atomic displacements between ground and excited equilibrium geometries). - Force mode — supply
dF(forces on the ground-state atoms when the system is in the excited-state charge state).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
frequencies
|
(ndarray, shape(nmodes))
|
Phonon mode frequencies at the Γ point in eV. |
required |
eigenvectors
|
(ndarray, shape(nmodes, natoms, 3))
|
Mass-normalised phonon displacement eigenvectors (real part only). |
required |
masses
|
(ndarray, shape(natoms))
|
Atomic masses in atomic mass units (amu). |
required |
EZPL
|
float
|
Zero-phonon line (ZPL) energy in eV. |
required |
dR
|
(ndarray, shape(natoms, 3))
|
Atomic displacement vector (excited − ground equilibrium) in Å. Used in displacement mode. |
None
|
dF
|
(ndarray, shape(natoms, 3))
|
Atomic force difference (excited charge − ground charge) in eV/Å.
Used in force mode. |
None
|
resolution
|
int
|
Number of energy grid points per eV; sets spectral resolution. Default 1000. |
1000
|
max_energy
|
float
|
Upper bound of the energy axis in eV. Default 5.0. |
5.0
|
sigma
|
float or (float, float)
|
Gaussian broadening width applied to the spectral function S(ω) in eV. Scalar → uniform broadening for all modes. 2-tuple (sigma_low, sigma_high) → linearly interpolated from the lowest to the highest phonon frequency (Jin et al. 2021, Fig. 5). Default 6 meV. |
0.006
|
gamma
|
float
|
Lorentzian (homogeneous) broadening of the ZPL in meV. Default 2.0 meV. |
2.0
|
temperature
|
float
|
Lattice temperature in Kelvin used for the Bose-Einstein phonon
occupation :math: |
0.0
|
Attributes:
| Name | Type | Description |
|---|---|---|
natoms |
int
|
Number of atoms in the supercell. |
delR |
float
|
Root-mean-square atomic displacement ΔR in Å. |
delQ |
float
|
Mass-weighted configuration coordinate displacement ΔQ in
amu\ :sup: |
qks |
(ndarray, shape(nmodes))
|
Mode-projected configurational displacement q\ :sub: |
Sks |
(ndarray, shape(nmodes))
|
Partial (mode-resolved) Huang–Rhys factors S\ :sub: |
HR_factor |
float
|
Total Huang–Rhys factor S = Σ S\ :sub: |
DW_factor |
float
|
Debye–Waller factor exp(−S). |
iprs |
(ndarray, shape(nmodes))
|
Phonon inverse participation ratio (traditional convention): Σp²/(Σp)²; range [1/N, 1] where large = localized. |
iprs_alkauskas |
(ndarray, shape(nmodes))
|
Phonon IPR following Alkauskas et al. (2014) eq. 12: (Σp)²/Σp²;
range [1, N] where small = localized. Reciprocal of |
localization_ratio |
(ndarray, shape(nmodes))
|
Localization ratio β\ :sub: |
nks |
(ndarray, shape(nmodes))
|
Bose-Einstein phonon occupation numbers :math: |
C_omega |
ndarray
|
Thermal electron–phonon spectral density :math: |
Cts |
ndarray
|
Real-valued time-domain thermal correction :math: |
C_total |
float
|
Zero-time thermal correction :math: |
effective_phonon_freq |
float
|
Effective phonon frequency Ω in eV (Jin et al. 2021, Eq. 16),
computed as the displacement-weighted average :math: |
S_omega |
ndarray
|
Continuous Huang–Rhys spectral density S(ω) (eV\ :sup: |
Sts |
ndarray
|
Fourier transform of S(ω) used in the generating function. |
Gts |
ndarray
|
Generating function G(t) = exp[S(t) − S] · exp(−γ|t|). |
A_line |
ndarray
|
Photon energy axis for the lineshape in eV. |
intensity |
ndarray
|
Normalised PL intensity as a function of photon energy. |
Notes
The PL lineshape is obtained via the Fourier transform of the generating function G(t):
.. math::
L(\hbar\omega) = \int_{-\infty}^{\infty} G(t)\,
e^{i(E_{\mathrm{ZPL}} - \hbar\omega)t/\hbar}\, dt
where
.. math::
G(t) = e^{S(t) - S} \cdot e^{-\gamma|t|}
and :math:S(t) = \int_0^{\infty} S(\hbar\omega)\,
e^{-i\omega t}\, d(\hbar\omega).
References
Alkauskas, Buckley, Awschalom & Van de Walle, New J. Phys. 16, 073026 (2014).
Examples:
>>> from defectpl.phonon import read_band_yaml
>>> import numpy as np
>>> freqs, evecs, masses = read_band_yaml("band.yaml")
>>> dR = np.load("dR.npy") # shape (natoms, 3), in Å
>>> pl = Photoluminescence(
... frequencies=freqs,
... eigenvectors=evecs,
... masses=masses,
... EZPL=1.945,
... dR=dR,
... )
>>> print(f"S = {pl.HR_factor:.3f}, DW = {pl.DW_factor:.4f}")
compute_properties
¶
Run the full calculation pipeline and populate all derived attributes.
Source code in defectpl/defectpl.py
as_dict
¶
Serialize to a JSON-compatible dictionary.
Complex-valued arrays (Sts, Gts) and derived spectral arrays
(A_line, intensity) are intentionally omitted; they are
cheaply recomputed by :meth:from_dict.
Source code in defectpl/defectpl.py
from_dict
classmethod
¶
Deserialize from a dictionary produced by :meth:as_dict.
Core inputs and real-valued computed properties are loaded directly;
complex arrays (Sts, Gts) and the intensity spectrum are
recomputed on the fly from the stored S(ω).
Source code in defectpl/defectpl.py
356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 | |
from_dict_expensive
classmethod
¶
Reconstruct by replaying the full pipeline from primary inputs only.
Slower than :meth:from_dict because __post_init__ recomputes
everything from scratch; useful when stored arrays may be stale.
Source code in defectpl/defectpl.py
generate_plots
¶
Generate all standard diagnostic plots and save them to out_dir.
Produces fourteen figures: phonon energy vs mode index, traditional IPR vs energy,
Alkauskas IPR vs energy, localization ratio vs energy, phonon occupation vs energy,
q\ :sub:k vs energy, S\ :sub:k vs energy, S(ω) alone, C(ω,T) alone,
S(ω)+S\ :sub:k, S(ω)+S\ :sub:k coloured by localization ratio,
S(ω)+S\ :sub:k coloured by traditional IPR, S(ω)+S\ :sub:k coloured by
Alkauskas IPR, and the final PL intensity spectrum. Absorption plots require
a :class:Photoabsorption object (which uses excited-state phonons).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
out_dir
|
str or Path
|
Directory where figure files are written (created if absent). |
required |
max_freq
|
float
|
Upper frequency cut-off for S(ω) plots in meV. If |
None
|
iylim
|
tuple of float
|
|
None
|
fig_format
|
('pdf', 'png', 'svg', 'jpg')
|
Output figure format. Default |
'pdf'
|
Source code in defectpl/defectpl.py
457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 | |
Photoabsorption¶
Photoabsorption
dataclass
¶
Photoabsorption(frequencies, eigenvectors, masses, EZPL, dR=None, dF=None, resolution=1000, max_energy=5.0, sigma=0.006, gamma=2.0, temperature=0.0)
Bases: MSONable
Core engine for first-principles photoabsorption lineshape calculations.
Implements the generating-function formalism of Alkauskas et al. (New J. Phys. 16, 073026, 2014) to compute the full multi-phonon photoabsorption spectrum of a point defect from DFT inputs.
This class uses excited-state phonons (a phonopy band.yaml run on
the excited-state geometry) to correctly describe the coupling of the
photon-absorption process to vibrational modes. This is physically
distinct from :class:Photoluminescence, which uses ground-state phonons
for PL emission.
Two input modes are supported:
- Displacement mode — supply
dR(atomic displacements between ground and excited equilibrium geometries). - Force mode — supply
dF(forces on the excited-state atoms when the system is in the ground-state charge state).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
frequencies
|
(ndarray, shape(nmodes))
|
Phonon mode frequencies at the Γ point in eV (from excited-state phonopy calculation). |
required |
eigenvectors
|
(ndarray, shape(nmodes, natoms, 3))
|
Mass-normalised phonon displacement eigenvectors (real part only). |
required |
masses
|
(ndarray, shape(natoms))
|
Atomic masses in atomic mass units (amu). |
required |
EZPL
|
float
|
Zero-phonon line (ZPL) energy in eV. |
required |
dR
|
(ndarray, shape(natoms, 3))
|
Atomic displacement vector (excited − ground equilibrium) in Å. Used in displacement mode. |
None
|
dF
|
(ndarray, shape(natoms, 3))
|
Atomic force difference (ground charge − excited charge) evaluated at
the ES geometry in eV/Å. Used in force mode. |
None
|
resolution
|
int
|
Number of energy grid points per eV; sets spectral resolution. Default 1000. |
1000
|
max_energy
|
float
|
Upper bound of the energy axis in eV. Default 5.0. |
5.0
|
sigma
|
float or (float, float)
|
Gaussian broadening width applied to the spectral function S(ω) in eV. Default 6 meV. |
0.006
|
gamma
|
float
|
Lorentzian (homogeneous) broadening of the ZPL in meV. Default 2.0 meV. |
2.0
|
temperature
|
float
|
Lattice temperature in Kelvin. Pass 0 (default) for the T = 0 K limit. |
0.0
|
Attributes:
| Name | Type | Description |
|---|---|---|
natoms |
int
|
Number of atoms in the supercell. |
delR |
float
|
Root-mean-square atomic displacement ΔR in Å. |
delQ |
float
|
Mass-weighted configuration coordinate displacement ΔQ in
amu\ :sup: |
qks |
(ndarray, shape(nmodes))
|
Mode-projected configurational displacement q\ :sub: |
Sks |
(ndarray, shape(nmodes))
|
Partial (mode-resolved) Huang–Rhys factors S\ :sub: |
HR_factor |
float
|
Total Huang–Rhys factor S = Σ S\ :sub: |
DW_factor |
float
|
Debye–Waller factor exp(−S). |
iprs |
(ndarray, shape(nmodes))
|
Phonon inverse participation ratio (traditional convention). |
iprs_alkauskas |
(ndarray, shape(nmodes))
|
Phonon IPR following Alkauskas et al. (2014) eq. 12. |
localization_ratio |
(ndarray, shape(nmodes))
|
Localization ratio β\ :sub: |
nks |
(ndarray, shape(nmodes))
|
Bose-Einstein phonon occupation numbers :math: |
C_omega |
ndarray
|
Thermal electron–phonon spectral density :math: |
Cts |
ndarray
|
Real-valued time-domain thermal correction :math: |
C_total |
float
|
Zero-time thermal correction :math: |
effective_phonon_freq |
float
|
Effective phonon frequency Ω in eV. |
S_omega |
ndarray
|
Continuous Huang–Rhys spectral density S(ω) (eV\ :sup: |
Sts |
ndarray
|
Fourier transform of S(ω) used in the generating function. |
Gts |
ndarray
|
Generating function G(t) = exp[S(t) − S] · exp(−γ|t|). |
A_abs |
ndarray
|
Absorption spectral function. |
absorption |
ndarray
|
Normalised absorption intensity :math: |
Notes
Physics rationale: In the Franck–Condon picture, the absorption lineshape couples to the vibrational modes of the excited electronic state, because the nuclear wavepacket created by photon absorption evolves on the excited-state potential energy surface. Conversely, PL emission couples to ground-state phonons. Using the correct phonon set (ES for absorption, GS for emission) is essential for quantitatively accurate lineshapes, particularly when the two geometries differ significantly.
References
Alkauskas, Buckley, Awschalom & Van de Walle, New J. Phys. 16, 073026 (2014).
Examples:
>>> from defectpl.phonon import read_band_yaml
>>> import numpy as np
>>> freqs_es, evecs_es, masses = read_band_yaml("band_es.yaml")
>>> dR = np.load("dR.npy")
>>> abs_engine = Photoabsorption(
... frequencies=freqs_es,
... eigenvectors=evecs_es,
... masses=masses,
... EZPL=1.945,
... dR=dR,
... )
>>> print(f"S = {abs_engine.HR_factor:.3f}")
compute_properties
¶
Run the full calculation pipeline and populate all derived attributes.
Source code in defectpl/defectpl.py
as_dict
¶
Serialize to a JSON-compatible dictionary.
Complex-valued arrays (Sts, Gts) and derived spectral arrays
(A_abs, absorption) are stored; Sts/Gts are cheaply recomputed
by :meth:from_dict.
Source code in defectpl/defectpl.py
from_dict
classmethod
¶
Deserialize from a dictionary produced by :meth:as_dict.
Core inputs and real-valued computed properties are loaded directly;
complex arrays (Sts, Gts) and the absorption spectrum are
recomputed on the fly from the stored S(ω).
Source code in defectpl/defectpl.py
925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 | |
from_dict_expensive
classmethod
¶
Reconstruct by replaying the full pipeline from primary inputs only.
Slower than :meth:from_dict because __post_init__ recomputes
everything from scratch; useful when stored arrays may be stale.
Source code in defectpl/defectpl.py
generate_plots
¶
Generate all standard diagnostic plots and save them to out_dir.
Produces fourteen figures: phonon energy vs mode index, traditional IPR vs energy,
Alkauskas IPR vs energy, localization ratio vs energy, phonon occupation vs energy,
q\ :sub:k vs energy, S\ :sub:k vs energy, S(ω) alone, C(ω,T) alone,
S(ω)+S\ :sub:k, S(ω)+S\ :sub:k coloured by localization ratio,
S(ω)+S\ :sub:k coloured by traditional IPR, S(ω)+S\ :sub:k coloured by
Alkauskas IPR, and the absorption spectrum.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
out_dir
|
str or Path
|
Directory where figure files are written (created if absent). |
required |
max_freq
|
float
|
Upper frequency cut-off for S(ω) plots in meV. |
None
|
iylim
|
tuple of float
|
|
None
|
fig_format
|
('pdf', 'png', 'svg', 'jpg')
|
Output figure format. Default |
'pdf'
|
Source code in defectpl/defectpl.py
1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 | |
VibrationalSpectra1D
dataclass
¶
Bases: MSONable
1D harmonic-oscillator model for the vibrational lineshape of a luminescence band.
Computes Franck–Condon overlaps between vibrational levels of two displaced harmonic potentials (ground and excited state) with potentially different effective frequencies, following Alkauskas, Yan & Van de Walle (Phys. Rev. B 90, 075202, 2014).
This model is complementary to :class:Photoluminescence — it replaces
the multi-phonon generating function with an explicit sum over
vibrational quantum numbers, which is exact within the harmonic
approximation and more suitable when ω\ :sub:1 ≠ ω\ :sub:2.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
EZPL
|
float
|
Zero-phonon line energy in eV. |
required |
w1_meV
|
float
|
Ground-state effective phonon frequency in meV. |
required |
w2_meV
|
float
|
Excited-state effective phonon frequency in meV. |
required |
DQ
|
float
|
Configuration coordinate displacement ΔQ in amu\ :sup: |
required |
T
|
float
|
Temperature in K (sets Boltzmann weights for ground-state levels). |
required |
E0
|
float
|
Starting photon energy for the output lineshape grid in eV. |
required |
dE
|
float
|
Energy step of the output lineshape grid in eV. |
required |
M
|
int
|
Number of energy grid points. |
required |
NN1
|
int
|
Maximum vibrational quantum number included for the ground state. Default 22. |
22
|
NN2
|
int
|
Maximum vibrational quantum number included for the excited state. Default 52. |
52
|
Attributes:
| Name | Type | Description |
|---|---|---|
overlap_matrix |
(ndarray, shape(NN1 + 1, NN2 + 1))
|
Franck–Condon overlap integrals ⟨i|j⟩. |
overlap_data |
dict
|
Keys |
spectral_data |
dict
|
Keys |
Notes
The overlap integral between vibrational levels :math:i (ground) and
:math:j (excited) is evaluated recursively using the displaced harmonic
oscillator recurrence relation. The full lineshape is then obtained by
Gaussian broadening with width σ = 0.70·ω\ :sub:2.
The ω³-weighted density dosw3 approximates the spontaneous emission
rate and is normalized to unit area.
Examples:
>>> spec = VibrationalSpectra1D(
... EZPL=1.945, w1_meV=65.0, w2_meV=62.0,
... DQ=1.8, T=300.0, E0=1.3, dE=0.001, M=700
... )
>>> spec.compute_lineshape()
>>> e_peak, _ = spec.get_peak_position()
>>> print(f"Peak at {e_peak:.3f} eV, FWHM = {spec.get_fwhm():.3f} eV")
compute_overlap_matrix
¶
Fill overlap_matrix with Franck–Condon overlaps ⟨i|j⟩ for all (i, j) pairs.
Source code in defectpl/defectpl.py
compute_spectrum
¶
Compute Boltzmann-weighted Franck–Condon transition intensities.
Populates overlap_data with per-transition contributions and
energies, and prints the closure-relation sum (should be ≈ 1).
Source code in defectpl/defectpl.py
compute_lineshape
¶
Gaussian-broaden the FC transitions to produce the PL lineshape.
Calls :meth:compute_spectrum if not already done, then builds the
energy-resolved transition density dos and the ω³-weighted
normalised intensity dosw3 on the grid [E0, E0 + M·dE].
Results are stored in spectral_data.
Source code in defectpl/defectpl.py
save_results
¶
Write results to JSON files.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
overlap_file
|
str
|
Destination for the MSONable object JSON (includes all inputs).
Default |
'overlap.json'
|
lineshape_file
|
str
|
Destination for the |
'lineshape.json'
|
Source code in defectpl/defectpl.py
plot_lineshape
¶
Plot the normalised PL lineshape (ω³-weighted intensity vs energy).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
save_file
|
str
|
If given, save to this path (dpi 600); otherwise |
None
|
figsize
|
tuple of float
|
Matplotlib figure size in inches. Default |
(4.4, 4.4)
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If :meth: |
Source code in defectpl/defectpl.py
get_peak_position
¶
Return the energy and intensity at the lineshape peak.
Returns:
| Type | Description |
|---|---|
(energy, intensity) : tuple of float
|
Peak photon energy in eV and the corresponding normalised intensity. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If :meth: |
Source code in defectpl/defectpl.py
get_fwhm
¶
Compute the Full Width at Half Maximum (FWHM) of the PL lineshape.
Returns:
| Type | Description |
|---|---|
float
|
FWHM in eV. Returns 0.0 if fewer than two points exceed half-maximum. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If :meth: |
Source code in defectpl/defectpl.py
ConfigurationCoordinateDiagram
dataclass
¶
Bases: MSONable
Configuration coordinate diagram for a two-state defect transition.
Manages interpolation of structures between the ground and excited equilibrium geometries, DFT input-file generation, potential energy surface (PES) extraction from completed Vasprun files, and harmonic fitting of the resulting parabolic wells.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ground_struct
|
Structure
|
DFT-relaxed ground-state supercell geometry. |
required |
excited_struct
|
Structure
|
DFT-relaxed excited-state supercell geometry (same species ordering). |
required |
Attributes:
| Name | Type | Description |
|---|---|---|
dQ |
float
|
Mass-weighted configuration coordinate displacement ΔQ in
amu\ :sup: |
Notes
The configuration coordinate is defined as
.. math::
\Delta Q = \sqrt{\sum_i m_i\,|\Delta\mathbf{R}_i|^2}
where the sum runs over all atoms and :math:\Delta\mathbf{R}_i is
the displacement of atom i between the two equilibrium geometries
(minimum-image convention with periodic boundary conditions).
The zero-phonon line energy and Stokes shift can be read from the
fitted parabola minima returned by :meth:analyze_ccd.
Examples:
>>> from pymatgen.core import Structure
>>> gs = Structure.from_file("CONTCAR_gs")
>>> es = Structure.from_file("CONTCAR_es")
>>> ccd = ConfigurationCoordinateDiagram(gs, es)
>>> print(f"ΔQ = {ccd.dQ:.3f} amu^1/2 Å")
>>> ccd.setup_calculations(
... displacements=[-0.5, -0.25, 0.25, 0.5, 0.75],
... output_dir="ccd_calcs",
... ground_input_dir="inputs/ground",
... excited_input_dir="inputs/excited",
... )
generate_structures
¶
Linearly interpolate structures at fractional displacements along ΔQ.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
displacements
|
array-like of float
|
Fractional displacements along the ground→excited path. A value of 0.0 is the ground minimum; 1.0 is the excited minimum. Values outside [0, 1] extrapolate. |
required |
remove_zero
|
bool
|
Drop any entries equal to 0.0 (ground minimum already exists). Default True. |
True
|
Returns:
| Name | Type | Description |
|---|---|---|
ground_structs |
list of Structure
|
Structures displaced from ground toward excited (for ground-state PES). |
excited_structs |
list of Structure
|
Structures displaced from ground + 1.0 (for excited-state PES). |
Source code in defectpl/defectpl.py
setup_calculations
¶
setup_calculations(displacements, output_dir, ground_input_dir, excited_input_dir, input_files=None)
Write interpolated POSCAR files and copy VASP input files.
Creates the directory tree::
output_dir/
ground/0/POSCAR KPOINTS POTCAR INCAR
ground/1/...
excited/0/...
...
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
displacements
|
array-like of float
|
Fractional displacements (see :meth: |
required |
output_dir
|
str or Path
|
Root directory for the calculation tree (created if absent). |
required |
ground_input_dir
|
str or Path
|
Directory containing the VASP input files for ground-state runs. |
required |
excited_input_dir
|
str or Path
|
Directory containing the VASP input files for excited-state runs. |
required |
input_files
|
list of str
|
File names to copy from each input directory.
Default |
None
|
Source code in defectpl/defectpl.py
extract_pes_profile
¶
Extract (Q, E) data points from a list of completed Vasprun files.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
vasprun_paths
|
list of str or Path
|
Paths to |
required |
tol
|
float
|
Fractional-coordinate tolerance for projecting each structure onto the configuration coordinate axis. Default 0.001. |
0.001
|
Returns:
| Name | Type | Description |
|---|---|---|
q_values |
ndarray
|
Configuration coordinate values Q in amu\ :sup: |
energies |
ndarray
|
Total DFT energies shifted so the minimum is zero (eV). |
Source code in defectpl/defectpl.py
analyze_ccd
¶
analyze_ccd(ground_vaspruns, excited_vaspruns, dE=0.0, plot=True, figsize=(3.3, 3.3), xlim=(-3.0, 10.0), ylim=(-0.5, 4.0), save_plot=None)
Fit harmonic wells to the ground- and excited-state PES data.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ground_vaspruns
|
list of str or Path
|
|
required |
excited_vaspruns
|
list of str or Path
|
|
required |
dE
|
float
|
Rigid energy offset applied to the excited-state PES in eV (e.g. to set the excited minimum to the ZPL energy). Default 0.0. |
0.0
|
plot
|
bool
|
If True, show a matplotlib figure. Default True. |
True
|
figsize
|
tuple of float
|
Figure size in inches. Default |
(3.3, 3.3)
|
xlim
|
tuple of float
|
x-axis limits for the CCD plot in amu\ :sup: |
(-3.0, 10.0)
|
ylim
|
tuple of float
|
y-axis limits for the CCD plot in eV. |
(-0.5, 4.0)
|
save_plot
|
str
|
If given, save the figure to this path instead of showing. |
None
|
Returns:
| Type | Description |
|---|---|
(omega_ground, omega_excited) : tuple of float
|
Fitted effective angular frequencies in eV for the ground and excited harmonic potentials. |
Source code in defectpl/defectpl.py
1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 | |
estimate_vertical_transitions
¶
Calculate vertical absorption and emission energy transitions.