config.py — Shared Workflow Configuration¶
Central configuration file imported by all workflow scripts. Edit this file to point to your own structures, force-constant files, and diffusivity data before running any 1-series or 2-series script.
Parameter groups¶
- Paths
Output directories for BNE and DL results (
BNE_WORK_DIR,DL_WORK_DIR), the reference crystal POSCAR and FC2 (CRYSTAL_POSCAR,CRYSTAL_FC2), the disordered system structure (DISORDERED_POSCAR), and pre-computed vibrational frequencies and diffusivity for the disordered system (DISORDERED_FREQUENCIES,DISORDERED_DIFFUSIVITY).- Phonon mesh
Supercell expansion matrix (
SUPERCELL_MATRIX), BZ mesh dimensions (MESH = [128, 128, 32]), Γ-centering flag, and Lorentzian half-width η for VDOS broadening (GAMMA_BROADENING = 0.6 cm⁻¹).- Band structure
High-symmetry q-point path (
BAND_PATH) and labels (BAND_LABELS) for the phonon dispersion plot produced by2a_DL_workflow_precompute.py.- Fitting
Initial grain-boundary mean free path
L0[nm], defect scattering amplitudeR0[1e-6 THz cm nm³], L-BFGS learning rateLR, maximum iterationsMAX_ITER, line-search strategyLINE_SEARCH_FN = "strong_wolfe", and fallback phonon lifetime for frequencies above the computed range (EXTRAPOLATION_VALUE).- BNE
Bond distance cutoff (
CUTOFF = 1.8 Å), number of pre-computed nearest-neighbour distances per atom (N_SMALLEST = 300), structure label index (STRUCTURE_IDX), LAE sizes (LOCAL_ENVIRONMENT_NAT), and growth-rate normalisation window (N_START,N_STOP).
1import numpy as np
2from smooth_disorder.structural import THzToCm
3
4# ── Paths ──────────────────────────────────────────────────────────────────────
5
6# Root output directory for BNE results
7BNE_WORK_DIR = "./bne_workflow"
8# Subdirectory name for BNE output files
9BNE_FOLDER = "bond_network_entropy"
10# Root output directory for disorder-linewidth results
11DL_WORK_DIR = "./dl_workflow"
12
13# Reference crystal structure (POSCAR format)
14CRYSTAL_POSCAR = "./ref_crystal/POSCAR"
15# Second-order force constants for the reference crystal
16CRYSTAL_FC2 = "./ref_crystal/fc2.hdf5"
17# Disordered system structure (POSCAR format)
18DISORDERED_POSCAR = "./disordered_system/irg_t9_14009.vasp"
19# Pre-computed vibrational frequencies for the disordered system
20DISORDERED_FREQUENCIES = "./disordered_system/irg_t9_frequencies.hdf5"
21# Pre-computed diffusivity data for the disordered system
22DISORDERED_DIFFUSIVITY = "./disordered_system/irg_t9_diffusivity.hdf5"
23
24# ── Phonon mesh ────────────────────────────────────────────────────────────────
25
26# Supercell expansion matrix used to build the second order force constants
27SUPERCELL_MATRIX = np.diag([8, 8, 2])
28# q-point mesh dimensions for phonon sampling
29MESH = [128, 128, 32]
30# Whether the q-point mesh is Gamma-centered
31GAMMA_CENTER = True
32# Lorentzian half-width η for VDOS broadening [cm⁻¹]
33GAMMA_BROADENING = 0.6
34
35# ── Band structure ─────────────────────────────────────────────────────────────
36
37# High-symmetry q-point path through the Brillouin zone (fractional coordinates)
38BAND_PATH = [[[0, 0, 0], [0., 0., 0.5], [0.5, 0., 0.5],
39 [0.5, 0., 0.], [0., 0., 0.],
40 [0.33333333, 0.33333333, 0.], [0.33333333, 0.33333333, 0.5]]]
41# Labels for the high-symmetry points along the band path
42BAND_LABELS = [r"$\Gamma$", "A", "L", "M", r"$\Gamma$", "K", "H"]
43
44# ── Fitting ────────────────────────────────────────────────────────────────────
45
46# Initial grain boundary mean free path [nm]
47L0 = 3.3
48# Initial defect scattering amplitude [1e-6 THz cm nm³]
49R0 = 5.54
50# Learning rate for the L-BFGS optimizer
51LR = 1.0
52# Maximum number of L-BFGS iterations
53MAX_ITER = 50
54# Line search strategy for L-BFGS
55LINE_SEARCH_FN = "strong_wolfe"
56# Fallback phonon lifetime for frequencies above the maximum computed value [s]
57EXTRAPOLATION_VALUE = 1 / 24 * THzToCm * 1e-12
58
59# ── BNE ───────────────────────────────────────────────────────────────────────
60
61# Bond distance cutoff for building the adjacency matrix [Å]
62CUTOFF = 1.8
63# Number of nearest-neighbor distances pre-computed per atom (must exceed max LAE size)
64N_SMALLEST = 300
65# Label index for this structure (used in output subdirectory names)
66STRUCTURE_IDX = 0
67# LAE sizes over which BNE is computed
68LOCAL_ENVIRONMENT_NAT = list(range(10, 31))
69# Start of LAE window used for growth-rate normalization in plots
70N_START = 14
71# End of LAE window used for growth-rate normalization in plots
72N_STOP = 30