-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgenerate_figures.sh
More file actions
88 lines (71 loc) · 2.66 KB
/
Copy pathgenerate_figures.sh
File metadata and controls
88 lines (71 loc) · 2.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#!/usr/bin/env bash
# generate_figures.sh — Reproduce all data and figures from the paper.
#
# Usage:
# bash generate_figures.sh # run everything
# bash generate_figures.sh data # Stage 1+2 only (DFT + QP)
# bash generate_figures.sh plot # plotting only (needs data)
# bash generate_figures.sh data plot # same as no args
# bash generate_figures.sh --dry-run # show what would run
# bash generate_figures.sh --dry-run plot
#
# Environment:
# JULIA_CMD override julia binary (default: julia)
# JULIA_PROJECT override --project path (default: .)
set -euo pipefail
cd "$(dirname "$0")"
DRY_RUN=""
STEPS=()
for arg in "$@"; do
case "$arg" in
--dry-run) DRY_RUN="--dry-run" ;;
data) STEPS+=(data) ;;
plot) STEPS+=(plot) ;;
*) echo "Usage: $0 [--dry-run] [data] [plot]"; exit 1 ;;
esac
done
# Default: run all steps
[[ ${#STEPS[@]} -eq 0 ]] && STEPS=(data plot)
[[ -n "$DRY_RUN" ]] && echo "=== DRY RUN ===" && echo ""
JULIA="${JULIA_CMD:-julia} --project=${JULIA_PROJECT:-.}"
mkdir -p fig
step_data() {
echo "=== Step 1: Generating data (KS-DFT + QP correction) ==="
for elem in lithium sodium potassium calcium aluminum silicon magnesium; do
echo " [$elem] Stage 1: KS-DFT (LDA)..."
$JULIA "$elem/run_ks.jl" $DRY_RUN
if [[ "$elem" == "lithium" ]]; then
echo " [$elem] Stage 1: EFT nonlocal PSP..."
$JULIA "$elem/run_ks_eft.jl" $DRY_RUN
echo " [$elem] Stage 1: PBE..."
$JULIA "$elem/run_ks_pbe.jl" $DRY_RUN
echo " [$elem] Stage 2: QP correction (all 3 PSPs)..."
$JULIA "$elem/freq_correction_new.jl" $DRY_RUN
else
echo " [$elem] Stage 2: QP correction..."
$JULIA "$elem/freq_correction.jl" $DRY_RUN
if [[ -f "$elem/run_ks_pbe.jl" ]]; then
echo " [$elem] Stage 1: KS-DFT (PBE)..."
$JULIA "$elem/run_ks_pbe.jl" $DRY_RUN
echo " [$elem] Stage 2: QP correction (PBE)..."
$JULIA "$elem/freq_correction_pbe.jl" $DRY_RUN
fi
fi
done
echo " [lih] Stage 1 + Stage 2..."
$JULIA lih/run_ks.jl $DRY_RUN
$JULIA lih/freq_correction.jl $DRY_RUN
echo " Data generation complete."
}
step_plot() {
echo "=== Step 2: Generating plots ==="
echo " [1/2] Na+K+Mg+Al bands vs ARPES + Δ(K)..."
$JULIA plotting/plot_expt_comparison.jl $DRY_RUN
echo " [2/2] PBE band comparison..."
$JULIA plotting/plot_pbe_bands.jl $DRY_RUN
echo " Plot generation complete."
}
for step in "${STEPS[@]}"; do
"step_$step"
done
echo "=== Done ==="