Correlation 4.10.0
An Analysis Tool for Liquids and for Amorphous Solids
Loading...
Searching...
No Matches
DistributionFunctions.hpp
Go to the documentation of this file.
1
8
9#pragma once
10
14#include "core/Cell.hpp"
15#include "core/Trajectory.hpp"
16#include "math/Constants.hpp"
17#include "math/Smoothing.hpp"
18
19#include <atomic>
20#include <functional>
21#include <map>
22#include <memory>
23#include <mutex>
24#include <string>
25#include <string_view>
26#include <unordered_map>
27#include <vector>
28
29namespace correlation::analysis {
30
32
42
52
64
68struct alignas(64) ElectronicDiagnostics {
73 std::map<std::string, real_t> fermi_dos_species;
74 std::vector<real_t> per_atom_fermi_dos;
75 bool is_metallic{false};
76 bool has_electronic_dos{false};
77};
78
92
96struct XRDParams {
97 real_t lambda = static_cast<real_t>(1.5406);
98 real_t theta_min = static_cast<real_t>(5.0);
99 real_t theta_max = static_cast<real_t>(90.0);
100 real_t bin_width = static_cast<real_t>(1.0);
101};
102
107 real_t r_max = static_cast<real_t>(20.0);
109 static_cast<real_t>(0.02);
110 real_t q_max = static_cast<real_t>(20.0);
111 real_t q_bin_width = static_cast<real_t>(0.02);
112 real_t r_int_max = static_cast<real_t>(10.0);
113 bool sq_exact_direct = false;
115 static_cast<real_t>(1.0);
117 static_cast<real_t>(1.0);
118 size_t max_ring_size = 12;
124 real_t lef_cutoff = static_cast<real_t>(5.0);
126 static_cast<real_t>(0.2);
128 static_cast<real_t>(0.7);
129 size_t twf_nconn_min = 7;
130 size_t hyperuniformity_samples = 10000;
131 size_t frame_stride = 1;
133 int vacf_max_lag = -1;
136 size_t vdos_zero_pad = 4;
137
140 std::map<std::string, bool> active_calculators;
141
147 [[nodiscard]] bool isActive(std::string_view calc_id) const {
148 if (active_calculators.empty()) {
149 return true; // default: all enabled
150 }
151 const auto iter = active_calculators.find(std::string(calc_id));
152 if (iter != active_calculators.end()) {
153 return iter->second;
154 }
155 static const std::unordered_map<std::string_view, std::string_view> ALIAS_MAP = {
156 {"Radial Distribution Function", "g(r), J(r), G(r)"},
157 {"RDF", "g(r), J(r), G(r)"},
158 {"Plane Angle Distribution", "PAD"},
159 {"Plane-Angle Distribution", "PAD"},
160 {"PAD(θ) Normalized", "PAD"},
161 {"PAD(θ) RAW", "PAD"},
162 {"PAD(Theta) Normalized", "PAD"},
163 {"PAD(Theta) RAW", "PAD"},
164 {"Dihedral Angle Distribution", "DAD"},
165 {"Coordination Number", "CN"},
166 {"Common Neighbor Analysis", "CNA"},
167 {"Ring Size Distribution", "RD"},
168 {"Cluster Size Distribution", "Cluster Analysis"},
169 {"Hydrogen Bond Distribution", "Hydrogen Bond"},
170 {"Static Structure Factor", "S(Q)"},
171 {"X-Ray Diffraction", "XRD"},
172 {"Local Entropy Fingerprint", "Local Entropy"},
173 {"Ten Wolde-Frenkel", "TWF"},
174 {"TWF", "TWF"},
175 {"Hyperuniformity Diagnostics", "σ²_N(R), χ_H(R)"},
176 {"Vibrational Density of States", "vDoS"},
177 {"Total Density of States (TDOS)", "TDOS"},
178 {"eDoS", "TDOS"},
179 {"EDOS", "TDOS"},
180 {"ML Interatomic Potential (ORB-v3)", "MLIP"},
181 {"Eliashberg Spectral Function", "a2F"},
182 {"Eliashberg", "a2F"},
183 {"alpha2F", "a2F"},
184 };
185 if (const auto alias_it = ALIAS_MAP.find(calc_id); alias_it != ALIAS_MAP.end()) {
186 if (const auto ait = active_calculators.find(std::string(alias_it->second));
187 ait != active_calculators.end()) {
188 return ait->second;
189 }
190 }
191 return false;
192 }
193
194 bool smoothing = true;
195 real_t smoothing_sigma = static_cast<real_t>(0.1);
198
199 std::atomic<bool> *cancel_flag = nullptr;
201 std::string mlip_model_path;
202
203 // Electronic LDOS / TDOS post-processing settings
206 real_t ldos_broadening_sigma = static_cast<real_t>(0.0);
208 static_cast<real_t>(300.0);
210 static_cast<real_t>(1e-3);
211 bool ldos_compute_idos = true;
212
213 // Eliashberg α²F(ω) superconductivity estimation settings
215 static_cast<real_t>(0.10);
219 static_cast<real_t>(0.02);
220};
221
222// A structure to hold all data related to a single histogram.
226struct Histogram {
227 std::vector<real_t> bins;
228 std::string title;
229 std::string x_label;
230 std::string y_label;
231 std::string x_unit;
232 std::string y_unit;
233 std::string description;
234 std::string file_suffix;
235
237 std::map<std::string, std::vector<real_t>> partials;
238
240 std::map<std::string, std::vector<real_t>> smoothed_partials;
241
243};
244
260public:
263
272 BondCutoffMatrix bond_cutoffs = {});
273
279
286
291
296
301
303
306
311 [[nodiscard]] const correlation::core::Cell &cell() const { return cell_; }
312
319 [[nodiscard]] const Histogram &getHistogram(const std::string &name) const;
320
327 [[nodiscard]] Histogram &getMutableHistogram(const std::string &name);
328
334 [[nodiscard]] bool hasHistogram(const std::string &name) const;
335
340 [[nodiscard]] const std::map<std::string, Histogram> &getAllHistograms() const {
341 return histograms_;
342 }
343
348 [[nodiscard]] std::map<std::string, Histogram> &getAllHistograms() noexcept {
349 return histograms_;
350 }
351
356 [[nodiscard]] const std::map<std::string, real_t> &getAshcroftWeights() const {
357 return ashcroft_weights_;
358 }
359
365 void addHistogram(const std::string &name, Histogram &&histogram);
366
372 bool removeHistogram(const std::string &name);
373
378 [[nodiscard]] const StructureAnalyzer *neighbors() const;
379
384 [[nodiscard]] std::vector<std::string> getAvailableHistograms() const;
385
390 [[nodiscard]] const DynamicProperties &dynamicProperties() const noexcept {
391 return dynamic_properties_;
392 }
393
398 [[nodiscard]] DynamicProperties &dynamicProperties() noexcept { return dynamic_properties_; }
399
404 void setDynamicProperties(const DynamicProperties &props) noexcept {
405 dynamic_properties_ = props;
406 }
407
412 [[nodiscard]] real_t getDiffusionCoefficientMSD() const noexcept {
413 return dynamic_properties_.diffusion_coefficient_msd;
414 }
415
420 void setDiffusionCoefficientMSD(real_t diff_coeff) noexcept {
421 dynamic_properties_.diffusion_coefficient_msd = diff_coeff;
422 }
423
429 [[nodiscard]] real_t getDiffusionCoefficientVACF() const noexcept {
430 return dynamic_properties_.diffusion_coefficient_vacf;
431 }
432
438 void setDiffusionCoefficientVACF(real_t diff_coeff) noexcept {
439 dynamic_properties_.diffusion_coefficient_vacf = diff_coeff;
440 }
441
446 [[nodiscard]] real_t getRelaxationTime() const noexcept {
447 return dynamic_properties_.relaxation_time;
448 }
449
454 void setRelaxationTime(real_t relax_time) noexcept {
455 dynamic_properties_.relaxation_time = relax_time;
456 }
457
462 [[nodiscard]] real_t getDeborahNumber() const noexcept {
463 return dynamic_properties_.deborah_number;
464 }
465
470 void setDeborahNumber(real_t deborah_num) noexcept {
471 dynamic_properties_.deborah_number = deborah_num;
472 }
473
478 [[nodiscard]] const HyperuniformityDiagnostics &getHyperuniformityDiagnostics() const noexcept {
480 }
481
489
494 [[nodiscard]] real_t getHyperuniformityBeta() const noexcept {
495 return hyperuniformity_diagnostics_.variance_exponent_beta;
496 }
497
502 [[nodiscard]] real_t getHyperuniformityChiH() const noexcept {
503 return hyperuniformity_diagnostics_.asymptotic_chi_h;
504 }
505
510 [[nodiscard]] real_t getHyperuniformityHIndex() const noexcept {
511 return hyperuniformity_diagnostics_.torquato_h_index;
512 }
513
518 [[nodiscard]] real_t getHyperuniformityAlpha() const noexcept {
519 return hyperuniformity_diagnostics_.low_q_exponent_alpha;
520 }
521
526 [[nodiscard]] const ElectronicDiagnostics &getElectronicDiagnostics() const noexcept {
528 }
529
535 electronic_diagnostics_ = std::move(diagnostics);
536 }
537
542 [[nodiscard]] const SuperconductingDiagnostics &getSuperconductingDiagnostics() const noexcept {
544 }
545
551 superconducting_diagnostics_ = diagnostics;
552 }
553
555
558
570 void calculateRDF(RDFParams params = {});
571
576 void calculatePAD(real_t bin_width = 0.25);
577
582 void calculateDAD(real_t bin_width = 0.25);
583
593 MaxFrames max_correlation_frames = {-1}, StartFrame start_frame = {0},
594 EndFrame end_frame = {static_cast<size_t>(-1)});
595
603 void calculateVDOS(VDOSWindowType window_type = VDOSWindowType::Hann, size_t zero_pad_factor = 4,
604 real_t max_freq = static_cast<real_t>(-1.0));
605
610 void calculateXRD(XRDParams params = {});
611
618 void smooth(const std::string &name, real_t sigma,
620
626 void smoothAll(real_t sigma,
628
633 void setStructureAnalyzer(const StructureAnalyzer *analyzer);
634
639 void setStructureAnalyzerOwned(std::unique_ptr<StructureAnalyzer> analyzer);
640
642
645
651 void add(const DistributionFunctions &other);
652
658 void scale(real_t factor);
659
670 [[nodiscard]] static std::unique_ptr<DistributionFunctions>
671 computeMean(correlation::core::Trajectory &trajectory, const TrajectoryAnalyzer &analyzer,
672 size_t start_frame, const AnalysisSettings &settings,
673 std::function<void(float, const std::string &)> progress_callback = nullptr);
674
681 [[nodiscard]] std::string getPartialKey(int type1, int type2) const;
682
689 [[nodiscard]] std::string getInversePartialKey(int type1, int type2) const;
690
695 [[nodiscard]] std::shared_ptr<const PerFrameDistributionStore> getPerFrameStore() const noexcept {
696 return per_frame_store_;
697 }
698
703 [[nodiscard]] std::shared_ptr<PerFrameDistributionStore> mutablePerFrameStore() noexcept {
704 return per_frame_store_;
705 }
706
716 const correlation::core::Cell &cell, const AnalysisSettings &settings,
717 const BondCutoffMatrix &bond_cutoffs,
718 std::array<bool, PerFrameDistributionStore::METRIC_COUNT> wanted_metrics);
719
724 void setPerFrameStore(std::shared_ptr<PerFrameDistributionStore> store) noexcept {
725 per_frame_store_ = std::move(store);
726 }
727
729
730private:
731 static std::unique_ptr<DistributionFunctions>
733 size_t frame_idx, const AnalysisSettings &settings,
734 const BondCutoffMatrix &bond_cutoffs);
735
736 static void normalizeHistograms(DistributionFunctions &dist_funcs);
737
743
748
751 std::unique_ptr<StructureAnalyzer> neighbors_owned_;
754
755 std::map<std::string, Histogram> histograms_;
756 std::map<std::string, real_t> ashcroft_weights_;
757 mutable std::mutex histogram_mutex_;
758
765 std::shared_ptr<PerFrameDistributionStore>
767};
768
769} // namespace correlation::analysis
Simulation cell structure with periodic boundary conditions.
Mathematical and physical constants for the Correlation tool.
Kernel-based smoothing algorithms for analysis data.
Structural analysis utilities for neighbor detection and bond topology.
Trajectory data structure for time-series atomistic simulations.
Contiguous 2D matrix of element-pair bond cutoff ranges.
Definition AnalysisTypes.hpp:48
Manages the calculation and storage of various distribution functions.
Definition DistributionFunctions.hpp:259
void calculateVACF(const correlation::core::Trajectory &traj, MaxFrames max_correlation_frames={-1}, StartFrame start_frame={0}, EndFrame end_frame={static_cast< size_t >(-1)})
Calculates the Velocity Autocorrelation Function (VACF).
Definition DistributionFunctions.cpp:359
void setDeborahNumber(real_t deborah_num) noexcept
Sets the Deborah number.
Definition DistributionFunctions.hpp:470
const correlation::core::Cell & cell() const
Access the underlying simulation cell.
Definition DistributionFunctions.hpp:311
const std::map< std::string, real_t > & getAshcroftWeights() const
Gets the Ashcroft-Langreth weights used for S(Q) partials.
Definition DistributionFunctions.hpp:356
real_t getHyperuniformityBeta() const noexcept
Gets the real-space number variance scaling exponent β (σ²_N(R) ∝ R^β).
Definition DistributionFunctions.hpp:494
DistributionFunctions & operator=(const DistributionFunctions &)=delete
Deleted copy assignment operator (contains non-copyable std::mutex).
void setHyperuniformityDiagnostics(const HyperuniformityDiagnostics &diag) noexcept
Sets the scalar hyperuniformity diagnostics struct.
Definition DistributionFunctions.hpp:486
void scale(real_t factor)
Scales all histograms in this object by a factor. Used for normalizing averaged distributions.
Definition DistributionFunctions.cpp:458
BondCutoffMatrix bond_cutoffs_
Cached squared bond cutoff ranges.
Definition DistributionFunctions.hpp:753
std::mutex histogram_mutex_
Protects concurrent access to histograms_.
Definition DistributionFunctions.hpp:757
void calculateXRD(XRDParams params={})
Calculates the XRD pattern.
Definition DistributionFunctions.cpp:391
real_t getHyperuniformityAlpha() const noexcept
Gets the low-q structure factor scaling exponent α (S(q) ∝ q^α).
Definition DistributionFunctions.hpp:518
void setSuperconductingDiagnostics(const SuperconductingDiagnostics &diagnostics) noexcept
Sets the superconducting screening diagnostics derived from Eliashberg α²F(ω).
Definition DistributionFunctions.hpp:550
void smooth(const std::string &name, real_t sigma, correlation::math::KernelType kernel=correlation::math::KernelType::Gaussian)
Smooths a specific histogram.
Definition DistributionFunctions.cpp:295
void addHistogram(const std::string &name, Histogram &&histogram)
Manually add a histogram to the collection.
Definition DistributionFunctions.cpp:203
bool removeHistogram(const std::string &name)
Removes a histogram from the collection if present.
Definition DistributionFunctions.cpp:208
void setDiffusionCoefficientVACF(real_t diff_coeff) noexcept
Sets the self-diffusion coefficient computed from Velocity Autocorrelation Function (VACF).
Definition DistributionFunctions.hpp:438
std::unique_ptr< StructureAnalyzer > neighbors_owned_
Owned neighbor info.
Definition DistributionFunctions.hpp:751
std::map< std::string, real_t > ashcroft_weights_
Scalar weights for S(Q) calculations.
Definition DistributionFunctions.hpp:756
~DistributionFunctions()=default
Default destructor.
std::shared_ptr< PerFrameDistributionStore > mutablePerFrameStore() noexcept
Accesses mutable shared pointer to the per-frame distribution store.
Definition DistributionFunctions.hpp:703
std::string getInversePartialKey(int type1, int type2) const
Generates the inverse string key for a pair of element types.
Definition DistributionFunctions.cpp:237
static PerFrameDistributionStore::FrameCurveArray computeLightweightFrameCurves(const correlation::core::Cell &cell, const AnalysisSettings &settings, const BondCutoffMatrix &bond_cutoffs, std::array< bool, PerFrameDistributionStore::METRIC_COUNT > wanted_metrics)
Computes lightweight 1D [RDF, PAD, SQ, XRD] curves for a single cell frame.
Definition DistributionFunctions.cpp:714
DistributionFunctions(const DistributionFunctions &)=delete
Deleted copy constructor (contains non-copyable std::mutex).
void setDiffusionCoefficientMSD(real_t diff_coeff) noexcept
Sets the self-diffusion coefficient computed from Mean Squared Displacement (MSD).
Definition DistributionFunctions.hpp:420
HyperuniformityDiagnostics hyperuniformity_diagnostics_
Scalar hyperuniformity diagnostics.
Definition DistributionFunctions.hpp:761
correlation::core::Cell cell_
Reference to the cell being analyzed.
Definition DistributionFunctions.hpp:749
const std::map< std::string, Histogram > & getAllHistograms() const
Access all calculated histograms.
Definition DistributionFunctions.hpp:340
bool hasHistogram(const std::string &name) const
Checks if a calculated histogram exists by name or alias.
Definition DistributionFunctions.cpp:152
std::shared_ptr< PerFrameDistributionStore > per_frame_store_
Per-frame 1D distribution curves.
Definition DistributionFunctions.hpp:766
void calculateAshcroftWeights()
Calculates weights for partial distributions based on concentrations.
Definition DistributionFunctions.cpp:250
void ensureNeighborsComputed(real_t r_max)
Ensures neighbors are computed for the given cutoff.
Definition DistributionFunctions.cpp:191
real_t getHyperuniformityChiH() const noexcept
Gets the large-R asymptotic real-space hyperuniformity index χ_H(R_max).
Definition DistributionFunctions.hpp:502
void setDynamicProperties(const DynamicProperties &props) noexcept
Sets the trajectory-wide dynamic properties.
Definition DistributionFunctions.hpp:404
real_t getDiffusionCoefficientMSD() const noexcept
Gets the self-diffusion coefficient computed from Mean Squared Displacement (MSD).
Definition DistributionFunctions.hpp:412
real_t current_cutoff_
Last cutoff used for neighbor searching.
Definition DistributionFunctions.hpp:752
const StructureAnalyzer * neighbors_ref_
Pointer to external neighbor info.
Definition DistributionFunctions.hpp:750
void setStructureAnalyzerOwned(std::unique_ptr< StructureAnalyzer > analyzer)
Takes ownership of a StructureAnalyzer for neighborhood/bond info.
Definition DistributionFunctions.cpp:94
void add(const DistributionFunctions &other)
Adds the histograms from another DistributionFunctions object to this one. Used for averaging over mu...
Definition DistributionFunctions.cpp:419
DynamicProperties & dynamicProperties() noexcept
Gets mutable trajectory-wide dynamic properties.
Definition DistributionFunctions.hpp:398
std::vector< std::string > getAvailableHistograms() const
Gets a list of names for all currently available histograms.
Definition DistributionFunctions.cpp:213
SuperconductingDiagnostics superconducting_diagnostics_
Eliashberg α²F(ω) superconducting diagnostics.
Definition DistributionFunctions.hpp:764
static std::unique_ptr< DistributionFunctions > processSingleFrame(correlation::core::Trajectory &trajectory, const TrajectoryAnalyzer &analyzer, size_t frame_idx, const AnalysisSettings &settings, const BondCutoffMatrix &bond_cutoffs)
Definition DistributionFunctions.cpp:475
DistributionFunctions & operator=(DistributionFunctions &&other) noexcept
Move assignment operator.
Definition DistributionFunctions.cpp:63
void calculatePAD(real_t bin_width=0.25)
Calculates the Plane Angle Distribution (PAD).
Definition DistributionFunctions.cpp:339
std::map< std::string, Histogram > histograms_
Storage for all analysis results.
Definition DistributionFunctions.hpp:755
void setRelaxationTime(real_t relax_time) noexcept
Sets the relaxation time computed from normalized VACF.
Definition DistributionFunctions.hpp:454
static void normalizeHistograms(DistributionFunctions &dist_funcs)
Definition DistributionFunctions.cpp:526
const StructureAnalyzer * neighbors() const
Returns the structure analyzer providing neighbor information.
Definition DistributionFunctions.cpp:99
void smoothAll(real_t sigma, correlation::math::KernelType kernel=correlation::math::KernelType::Gaussian)
Smooths all available histograms.
Definition DistributionFunctions.cpp:300
real_t getRelaxationTime() const noexcept
Gets the relaxation time computed from normalized VACF.
Definition DistributionFunctions.hpp:446
void setPerFrameStore(std::shared_ptr< PerFrameDistributionStore > store) noexcept
Sets or updates the per-frame distribution store.
Definition DistributionFunctions.hpp:724
const HyperuniformityDiagnostics & getHyperuniformityDiagnostics() const noexcept
Gets the scalar hyperuniformity diagnostics struct.
Definition DistributionFunctions.hpp:478
std::shared_ptr< const PerFrameDistributionStore > getPerFrameStore() const noexcept
Accesses the per-frame distribution store (if computed).
Definition DistributionFunctions.hpp:695
std::string getPartialKey(int type1, int type2) const
Generates a unique string key for a pair of element types.
Definition DistributionFunctions.cpp:224
const Histogram & getHistogram(const std::string &name) const
Access a specific calculated histogram by name.
Definition DistributionFunctions.cpp:161
const DynamicProperties & dynamicProperties() const noexcept
Gets the trajectory-wide dynamic properties.
Definition DistributionFunctions.hpp:390
void calculateVDOS(VDOSWindowType window_type=VDOSWindowType::Hann, size_t zero_pad_factor=4, real_t max_freq=static_cast< real_t >(-1.0))
Calculates the Vibrational Density of States (VDOS) from the VACF. Requires calculateVACF to be calle...
Definition DistributionFunctions.cpp:369
const SuperconductingDiagnostics & getSuperconductingDiagnostics() const noexcept
Gets the superconducting screening diagnostics derived from Eliashberg α²F(ω).
Definition DistributionFunctions.hpp:542
ElectronicDiagnostics electronic_diagnostics_
Electronic LDOS/TDOS diagnostics.
Definition DistributionFunctions.hpp:762
void calculateRDF(RDFParams params={})
Calculates the radial distribution function g(r).
Definition DistributionFunctions.cpp:308
void calculateDAD(real_t bin_width=0.25)
Calculates the Dihedral Angle Distribution (DAD).
Definition DistributionFunctions.cpp:349
void calculateCoordinationNumber()
Calculates the Coordination Number (CN) distribution. Requires that neighbors have been computed.
Definition DistributionFunctions.cpp:304
std::map< std::string, Histogram > & getAllHistograms() noexcept
Access mutable collection of all calculated histograms.
Definition DistributionFunctions.hpp:348
void setStructureAnalyzer(const StructureAnalyzer *analyzer)
Uses an external StructureAnalyzer for neighborhood/bond info.
Definition DistributionFunctions.cpp:87
const ElectronicDiagnostics & getElectronicDiagnostics() const noexcept
Gets the electronic structure diagnostics extracted from LDOS/TDOS.
Definition DistributionFunctions.hpp:526
Histogram & getMutableHistogram(const std::string &name)
Access a mutable calculated histogram by name.
Definition DistributionFunctions.cpp:176
real_t getHyperuniformityHIndex() const noexcept
Gets the reciprocal-space Torquato-Stillinger index H = S(0⁺) / S(q_peak).
Definition DistributionFunctions.hpp:510
void setElectronicDiagnostics(ElectronicDiagnostics diagnostics) noexcept
Sets the electronic structure diagnostics extracted from LDOS/TDOS.
Definition DistributionFunctions.hpp:534
static std::unique_ptr< DistributionFunctions > computeMean(correlation::core::Trajectory &trajectory, const TrajectoryAnalyzer &analyzer, size_t start_frame, const AnalysisSettings &settings, std::function< void(float, const std::string &)> progress_callback=nullptr)
Computes the mean distribution functions over a trajectory. Uses parallel execution to speed up calcu...
Definition DistributionFunctions.cpp:615
DynamicProperties dynamic_properties_
Trajectory-wide dynamic properties.
Definition DistributionFunctions.hpp:759
DistributionFunctions(correlation::core::Cell cell, real_t cutoff=0.0, BondCutoffMatrix bond_cutoffs={})
Constructs a DistributionFunctions object.
Definition DistributionFunctions.cpp:30
real_t getDeborahNumber() const noexcept
Gets the Deborah number.
Definition DistributionFunctions.hpp:462
real_t getDiffusionCoefficientVACF() const noexcept
Gets the self-diffusion coefficient computed from Velocity Autocorrelation Function (VACF).
Definition DistributionFunctions.hpp:429
std::array< std::vector< real_t >, METRIC_COUNT > FrameCurveArray
Definition PerFrameDistributionStore.hpp:53
Computes and stores pairwise distances and bond angles in tensors indexed by element type.
Definition StructureAnalyzer.hpp:33
Orchestrates structural analysis across multiple frames of a trajectory.
Definition TrajectoryAnalyzer.hpp:31
Represents the simulation cell (periodic box).
Definition Cell.hpp:30
This class stores a series of snapshots of a system.
Definition Trajectory.hpp:32
Definition AnalysisTypes.hpp:11
LDOSBroadeningKernel
Spectral convolution kernel for post-processing electronic LDOS/TDOS spectra.
Definition AnalysisTypes.hpp:459
@ None
No additional broadening beyond the model's native grid.
Definition AnalysisTypes.hpp:460
VDOSWindowType
Time-domain tapering half-window applied to the VACF prior to Fourier cosine transform.
Definition AnalysisTypes.hpp:448
@ Hann
Half-Hann: 0.5 * (1 + cos(pi * t / t_max)) — exact zero at t_max (default).
Definition AnalysisTypes.hpp:449
CouplingEstimationMode
Strategy for estimating MLIP electron-phonon deformation sensitivity.
Definition AnalysisTypes.hpp:469
@ TrajectoryFluctuation
Fast regression of per-atom δN_i(E_F, t) vs MD displacements.
Definition AnalysisTypes.hpp:470
RingProjectionMode
Projection or filtering strategy for network ring tracing.
Definition AnalysisTypes.hpp:436
@ Direct
Direct search on raw atomic neighbor graph.
Definition AnalysisTypes.hpp:437
RingType
Ring definition used for cycle topology search.
Definition AnalysisTypes.hpp:426
@ King
King ring: geodesic distance in G equals perimeter distance along C.
Definition AnalysisTypes.hpp:427
KernelType
Selection of kernel types for smoothing.
Definition Smoothing.hpp:26
@ Gaussian
Definition Smoothing.hpp:26
constexpr real_t MAX_CUTOFF_RADIUS
Maximum allowable cutoff radius in Angstroms.
Definition Constants.hpp:46
double real_t
Definition Precision.hpp:18
Configuration settings for distribution function analysis.
Definition DistributionFunctions.hpp:106
real_t smoothing_sigma
Gaussian smoothing standard deviation.
Definition DistributionFunctions.hpp:195
real_t lef_sigma
Standard deviation for Gaussian smoothing in local entropy.
Definition DistributionFunctions.hpp:125
real_t r_int_max
Cutoff for integration-based properties.
Definition DistributionFunctions.hpp:112
real_t ldos_electronic_temp_k
Electronic temperature for Fermi-Dirac N(E_F) smearing (K).
Definition DistributionFunctions.hpp:207
size_t hyperuniformity_samples
Number of random sample points for hyperuniformity.
Definition DistributionFunctions.hpp:130
bool populate_per_frame_store
Populate per-frame 1D curves for 3D viewer scrubbing.
Definition DistributionFunctions.hpp:132
RingType ring_type
Ring topology criterion (King or Franzblau).
Definition DistributionFunctions.hpp:119
size_t twf_nconn_min
Minimum coherent bonds for solid-like classification.
Definition DistributionFunctions.hpp:129
VDOSWindowType vdos_window
Time-domain window for VDOS cosine transform.
Definition DistributionFunctions.hpp:134
real_t eliashberg_mu_star
Coulomb pseudopotential μ* for Allen-Dynes T_c.
Definition DistributionFunctions.hpp:214
real_t r_max
Maximum radius for RDF calculations (Angstroms).
Definition DistributionFunctions.hpp:107
real_t r_bin_width
Bin width for radial distributions (Angstroms).
Definition DistributionFunctions.hpp:108
std::atomic< bool > * cancel_flag
Pointer to a cancellation flag.
Definition DistributionFunctions.hpp:199
XRDParams xrd_params
Parameters for XRD calculation.
Definition DistributionFunctions.hpp:200
real_t lef_cutoff
Cutoff radius for local entropy integration.
Definition DistributionFunctions.hpp:124
size_t frame_stride
Sampling stride between frames (>= 1).
Definition DistributionFunctions.hpp:131
real_t eliashberg_disp_step
Finite-displacement perturbation amplitude (Å).
Definition DistributionFunctions.hpp:218
size_t vdos_zero_pad
Zero-padding multiplier for VDOS FFT (>= 1).
Definition DistributionFunctions.hpp:136
int vacf_max_lag
Maximum VACF lag frames (-1 = half trajectory).
Definition DistributionFunctions.hpp:133
std::string mlip_model_path
Optional path to MLIP/LDOS binary weight file.
Definition DistributionFunctions.hpp:201
real_t angle_bin_width
Bin width for bond angle distributions (degrees).
Definition DistributionFunctions.hpp:114
real_t dihedral_bin_width
Bin width for dihedral distributions (degrees).
Definition DistributionFunctions.hpp:116
std::string ring_network_former
Network-former element symbol (e.g., "Si").
Definition DistributionFunctions.hpp:122
correlation::math::KernelType smoothing_kernel
The kernel to use for smoothing.
Definition DistributionFunctions.hpp:196
LDOSBroadeningKernel ldos_broadening_kernel
Additional LDOS spectral broadening kernel.
Definition DistributionFunctions.hpp:204
real_t ldos_gap_threshold
DOS threshold (states/eV/atom) for band-gap edge detection.
Definition DistributionFunctions.hpp:209
CouplingEstimationMode eliashberg_coupling_mode
Deformation-sensitivity estimator mode.
Definition DistributionFunctions.hpp:216
RingProjectionMode ring_projection_mode
Network glass ring projection strategy.
Definition DistributionFunctions.hpp:120
real_t ldos_broadening_sigma
Broadening width sigma/gamma (eV).
Definition DistributionFunctions.hpp:206
bool sq_exact_direct
Force full direct reciprocal-space S(Q) for large cells (>= 1000 atoms).
Definition DistributionFunctions.hpp:113
std::string ring_bridging_element
Bridging element symbol (e.g., "O").
Definition DistributionFunctions.hpp:123
bool isActive(std::string_view calc_id) const
Helper to check if a specific calculator is enabled.
Definition DistributionFunctions.hpp:147
bool ldos_compute_idos
Whether to compute companion Integrated DOS (IDOS) histogram.
Definition DistributionFunctions.hpp:211
size_t max_ring_size
Maximum size of rings to search for.
Definition DistributionFunctions.hpp:118
real_t q_max
Maximum momentum transfer for S(Q) (Angstroms^-1).
Definition DistributionFunctions.hpp:110
bool smoothing
Whether to apply post-processing smoothing.
Definition DistributionFunctions.hpp:194
real_t q_bin_width
Bin width for S(Q) (Angstroms^-1).
Definition DistributionFunctions.hpp:111
real_t twf_chi_cut
Coherence threshold for Ten Wolde-Frenkel bonds.
Definition DistributionFunctions.hpp:127
std::map< std::string, bool > active_calculators
Definition DistributionFunctions.hpp:140
Trajectory-wide dynamic properties computed from time-series correlation functions.
Definition DistributionFunctions.hpp:46
real_t relaxation_time
Relaxation time from normalized VACF (fs).
Definition DistributionFunctions.hpp:49
real_t deborah_number
Deborah number.
Definition DistributionFunctions.hpp:50
real_t diffusion_coefficient_vacf
Self-diffusion coefficient from VACF (Ų/fs).
Definition DistributionFunctions.hpp:48
real_t diffusion_coefficient_msd
Self-diffusion coefficient from MSD (Ų/fs).
Definition DistributionFunctions.hpp:47
Electronic structure diagnostics extracted from MLIP LDOS/TDOS spectra.
Definition DistributionFunctions.hpp:68
bool has_electronic_dos
True when electronic DOS diagnostics were populated.
Definition DistributionFunctions.hpp:76
real_t band_gap
Electronic band gap E_g (eV; 0 for metallic systems).
Definition DistributionFunctions.hpp:70
real_t vbm_energy
Valence band maximum relative to E_F (eV).
Definition DistributionFunctions.hpp:71
bool is_metallic
True when N(E_F) exceeds metallic threshold (E_g == 0).
Definition DistributionFunctions.hpp:75
std::map< std::string, real_t > fermi_dos_species
Species-projected N_α(E_F).
Definition DistributionFunctions.hpp:73
real_t cbm_energy
Conduction band minimum relative to E_F (eV).
Definition DistributionFunctions.hpp:72
std::vector< real_t > per_atom_fermi_dos
Per-atom N_i(E_F) for 3D visualization.
Definition DistributionFunctions.hpp:74
real_t fermi_dos_total
Total DOS at the Fermi level N(E_F) (states/eV/atom).
Definition DistributionFunctions.hpp:69
Container for a single calculated distribution function.
Definition DistributionFunctions.hpp:226
std::string x_label
Label for the x-axis.
Definition DistributionFunctions.hpp:229
std::string x_unit
Physical unit for the x-axis (e.g. "A").
Definition DistributionFunctions.hpp:231
std::string y_unit
Physical unit for the y-axis (e.g. "A^-3").
Definition DistributionFunctions.hpp:232
std::string title
Descriptive title for the plot.
Definition DistributionFunctions.hpp:228
std::map< std::string, std::vector< real_t > > smoothed_partials
Maps a partial key to its smoothed histogram values.
Definition DistributionFunctions.hpp:240
std::string description
Internal description of what this data represents.
Definition DistributionFunctions.hpp:233
int compute_count
Number of frames/contributions accumulated in this histogram.
Definition DistributionFunctions.hpp:242
std::string file_suffix
Default suffix for saving this histogram to disk.
Definition DistributionFunctions.hpp:234
std::string y_label
Label for the y-axis.
Definition DistributionFunctions.hpp:230
std::vector< real_t > bins
The x-axis values (radii, angles, etc.).
Definition DistributionFunctions.hpp:227
std::map< std::string, std::vector< real_t > > partials
Maps a partial key (e.g., "Si-O" or "Total") to its histogram values.
Definition DistributionFunctions.hpp:237
Scalar hyperuniformity diagnostics derived from σ²_N(R), χ_H(R), and S(Q).
Definition DistributionFunctions.hpp:56
real_t variance_exponent_beta
Power-law slope β from σ²_N(R) ∝ R^β (≈2 HU, ≈3 Poisson).
Definition DistributionFunctions.hpp:57
real_t asymptotic_chi_h
Large-R tail mean of χ_H(R) = σ²_N(R) / ⟨N(R)⟩.
Definition DistributionFunctions.hpp:58
bool has_reciprocal_space
True when S(Q) H-index / α metrics were computed.
Definition DistributionFunctions.hpp:62
real_t torquato_h_index
Reciprocal-space index H = S(0⁺) / S(q_peak).
Definition DistributionFunctions.hpp:59
bool has_real_space
True when σ²_N(R) / χ_H(R) metrics were computed.
Definition DistributionFunctions.hpp:61
real_t low_q_exponent_alpha
Low-q scaling exponent α from S(q) ∝ q^α.
Definition DistributionFunctions.hpp:60
Parameters for radial distribution function g(r) calculation.
Definition DistributionFunctions.hpp:36
real_t r_max
Maximum radius to calculate up to (Angstroms).
Definition DistributionFunctions.hpp:37
real_t max_radius
Maximum allowable cutoff radius ceiling.
Definition DistributionFunctions.hpp:39
real_t r_bin_width
Width of each bin in Angstroms.
Definition DistributionFunctions.hpp:38
Superconducting screening diagnostics derived from MLIP-VDOS Eliashberg α²F(ω).
Definition DistributionFunctions.hpp:82
real_t lambda
Electron-phonon coupling constant λ (dimensionless).
Definition DistributionFunctions.hpp:83
real_t mu_star
Coulomb pseudopotential μ* used for T_c.
Definition DistributionFunctions.hpp:89
real_t tc_mcmillan_k
McMillan critical temperature T_c estimate (K).
Definition DistributionFunctions.hpp:87
real_t omega_2_mev
Root-mean-square frequency ω_2 (meV).
Definition DistributionFunctions.hpp:86
real_t tc_allen_dynes_k
Allen-Dynes critical temperature T_c estimate (K).
Definition DistributionFunctions.hpp:88
real_t omega_log_k
Logarithmic average frequency ħω_log/k_B (K).
Definition DistributionFunctions.hpp:85
real_t omega_log_mev
Logarithmic average phonon frequency ω_log (meV).
Definition DistributionFunctions.hpp:84
bool has_eliashberg
True when Eliashberg α²F(ω) diagnostics were computed.
Definition DistributionFunctions.hpp:90
Parameters for X-Ray Diffraction (XRD) pattern calculation.
Definition DistributionFunctions.hpp:96
real_t lambda
X-ray wavelength in Angstroms.
Definition DistributionFunctions.hpp:97
real_t bin_width
Bin width for 2-theta in degrees.
Definition DistributionFunctions.hpp:100
real_t theta_max
Maximum 2-theta angle in degrees.
Definition DistributionFunctions.hpp:99
real_t theta_min
Minimum 2-theta angle in degrees.
Definition DistributionFunctions.hpp:98