52inline std::unique_ptr<Flavor>
create_flavor(
const std::string& calculation_type,
54 if (calculation_type ==
"self_consistent_field") {
55 return std::make_unique<SelfConsistentFieldFlavor>(std::move(iterator_factory));
57 if (calculation_type ==
"non_self_consistent_field") {
58 return std::make_unique<NonSelfConsistentFieldFlavor>(std::move(iterator_factory));
60 if (calculation_type ==
"verification") {
66 if (iterator_factory) {
67 throw std::runtime_error(
68 "create_flavor: 'verification' runs on the serial q3 binary only; run this "
71 return std::make_unique<VerificationFlavor>();
73 if (calculation_type ==
"band_structure") {
74 throw std::runtime_error(
75 "create_flavor: 'band_structure' is a multi-step workflow (SCF, then NSCF along "
76 "the requested k-point path), orchestrated by the Python layer, not a single "
77 "engine flavor -- the q3 binary never runs it directly. Run this file through "
78 "q3.workflows.run_band_structure_workflow(scf_input_path=<this file>) instead, "
79 "or set calculation: self_consistent_field for a single-point SCF run.");
81 if (calculation_type ==
"interpolation") {
82 throw std::runtime_error(
83 "create_flavor: 'interpolation' evaluates a model a previous NSCF run saved "
84 "(control.interpolation on calculation: nscf), which is post-processing rather "
85 "than an engine flavor -- the q3 binary never runs it directly. Run this file "
86 "with `q3_utility interpolate <file>` instead.");
88 if (calculation_type ==
"density_of_states") {
89 throw std::runtime_error(
90 "create_flavor: 'density_of_states' is a multi-step workflow (SCF, then a dense "
91 "NSCF k-mesh, then Gaussian-broadened binning), orchestrated by the Python layer, "
92 "not a single engine flavor -- the q3 binary never runs it directly. Run this "
93 "file through q3.workflows.run_dos_workflow(scf_input_path=...) instead, or set "
94 "calculation: self_consistent_field for a single-point SCF run.");
96 throw std::runtime_error(
"create_flavor: unsupported calculation type '" + calculation_type +
97 "'. Supported: self_consistent_field, non_self_consistent_field, "