Quantum 3xplorer (Q3)
An AI-native quantum simulation engine
Loading...
Searching...
No Matches
q3::InputData Struct Reference

Parsed input data — holds raw values read from input files. More...

#include <data.hpp>

Public Member Functions

void set_free_lattice_vectors (const Matrix3x3 &vectors_bohr, Real preset_lattice_parameter=0.0)
 

Public Attributes

std::vector< Real > atomic_starting_magnetization
 
std::vector< Atom > atoms
 
std::vector< std::pair< std::string, Vector3D > > band_path
 
int band_path_points_per_segment = 20
 
int bravais_lattice_index = 0
 
std::string calculation = "self_consistent_field"
 
Real cell_dimension_1 = 0.0
 
Real cell_dimension_2 = 0.0
 
Real cell_dimension_3 = 0.0
 
Real cell_dimension_4 = 0.0
 
Real cell_dimension_5 = 0.0
 
Real cell_dimension_6 = 0.0
 
Real charge_density_energy_cutoff = 0.0
 
bool compute_projections = false
 
Real convergence_threshold = 1e-6
 
int davidson_basis_expansion_factor = 2
 
bool davidson_basis_expansion_factor_set_by_deck = false
 
std::string diagonalization_method = "davidson"
 
bool disable_symmetry = false
 
std::string dispersion_correction = "none"
 
Real dos_broadening = 0.02
 
Real dos_energy_max = 100.0
 
Real dos_energy_min = -100.0
 
int dos_energy_steps = 2000
 
std::string exchange_correlation_functional
 
bool has_explicit_lattice_vectors = false
 
std::vector< HubbardSpecification > hubbard
 
int hubbard_fixed_occupation_iterations = 0
 
std::string hubbard_projector_type = "atomic"
 
std::vector< HubbardStartingEigenvalue > hubbard_starting_eigenvalues
 
std::string ibz_reduction_method = "internal"
 
InterpolationSpecification interpolation
 
bool is_relaxation_step = false
 
std::string isolated_system_correction = "none"
 
int kpoint_grid_dimension_1 = 1
 
int kpoint_grid_dimension_2 = 1
 
int kpoint_grid_dimension_3 = 1
 
int kpoint_grid_shift_1 = 0
 
int kpoint_grid_shift_2 = 0
 
int kpoint_grid_shift_3 = 0
 
std::vector< std::pair< Vector3D, Real > > kpoints_list
 
Matrix3x3 lattice_vectors {}
 
int maximum_iterations = 100
 
std::string mean_field_export = "none"
 
bool mean_field_export_kleinman_bylander_projectors = false
 
int methfessel_paxton_order = 1
 
Real mixing_beta = 0.7
 
int mixing_history_size = 8
 
std::string mixing_mode = "broyden"
 
std::string mixing_preconditioning = "default"
 
Real mixing_q0 = 1.0
 
std::string nonlocal_stress_derivative_method = "analytical"
 
int number_of_atoms = 0
 
int number_of_bands = 0
 
int number_of_kpoint_pools = 0
 
int number_of_species = 0
 
int number_of_spin_components = 1
 
std::string output_directory = "./"
 
std::string prefix = "q3"
 
std::string pseudopotential_directory = "./"
 
Real relax_energy_threshold = 1.0e-4
 
Real relax_force_threshold = 1.0e-3
 
int relax_maximum_steps = 100
 
std::string smearing = "none"
 
Real smearing_width = 0.0
 
std::string source_format
 
std::vector< AtomSpecies > species
 
bool start_from_saved_charge_density = false
 
std::vector< Real > starting_magnetization
 
std::string theory = "kohn_sham"
 
Real total_charge = 0.0
 
bool use_deterministic_fft_planning = false
 
bool use_exact_wavefunction_grid = false
 
std::string verbosity = "default"
 
Real wavefunction_energy_cutoff = 30.0
 

Detailed Description

Parsed input data — holds raw values read from input files.

Definition at line 27 of file data.hpp.

Member Function Documentation

◆ set_free_lattice_vectors()

void q3::InputData::set_free_lattice_vectors ( const Matrix3x3 &  vectors_bohr,
Real  preset_lattice_parameter = 0.0 
)
inline

Store a "free" lattice (bravais_lattice_index 0) from explicit lattice vectors given in bohr. Single source for both input formats that build an explicit cell: the YAML general-lattice path and the QE CELL_PARAMETERS bohr/angstrom card.

Parameters
vectors_bohrRows a1,a2,a3 in bohr.
preset_lattice_parameterIf > 0, used as alat directly (QE's celldm(1)-takes-precedence rule when CELL_PARAMETERS coexists with an explicit celldm). If <= 0 (the YAML case: there is no prior alat), alat is derived as |a1| instead.

Definition at line 317 of file data.hpp.

References bravais_lattice_index, cell_dimension_1, has_explicit_lattice_vectors, and lattice_vectors.

Referenced by q3::YAMLInputParser::parse_material(), and q3::substitute_material().

Member Data Documentation

◆ atomic_starting_magnetization

std::vector<Real> q3::InputData::atomic_starting_magnetization

Initial magnetization per ATOM, parallel to atoms (same [-1, 1] convention). Empty = unset. When set it overrides starting_magnetization atom by atom, so atoms of one species can start with different moments (a same-species antiferromagnet); such atoms are also kept symmetry-inequivalent (see site_symmetry_classes_from_input).

Definition at line 57 of file data.hpp.

Referenced by q3::create_kohn_sham_iterator(), q3::site_symmetry_classes_from_input(), and q3::bindings::SCFSolver::solve().

◆ atoms

◆ band_path

std::vector<std::pair<std::string, Vector3D> > q3::InputData::band_path

Definition at line 117 of file data.hpp.

Referenced by q3::create_kohn_sham_iterator(), and q3::bindings::SCFSolver::solve().

◆ band_path_points_per_segment

int q3::InputData::band_path_points_per_segment = 20

Definition at line 118 of file data.hpp.

Referenced by q3::create_kohn_sham_iterator(), and q3::bindings::SCFSolver::solve().

◆ bravais_lattice_index

int q3::InputData::bravais_lattice_index = 0

◆ calculation

◆ cell_dimension_1

◆ cell_dimension_2

Real q3::InputData::cell_dimension_2 = 0.0

The remaining cell dimensions, in the same convention as get_lattice_vectors_from_bravais_index: b/a, c/a, and three cosines whose meaning depends on the Bravais index. Zero for every lattice that does not need them (all cubic ones), which is why the default is 0 rather than 1.

Definition at line 137 of file data.hpp.

Referenced by q3::build_crystal_from_input(), and q3::QEInputParser::parse().

◆ cell_dimension_3

Real q3::InputData::cell_dimension_3 = 0.0

Definition at line 138 of file data.hpp.

Referenced by q3::build_crystal_from_input(), and q3::QEInputParser::parse().

◆ cell_dimension_4

Real q3::InputData::cell_dimension_4 = 0.0

Definition at line 139 of file data.hpp.

Referenced by q3::build_crystal_from_input(), and q3::QEInputParser::parse().

◆ cell_dimension_5

Real q3::InputData::cell_dimension_5 = 0.0

Definition at line 140 of file data.hpp.

Referenced by q3::build_crystal_from_input(), and q3::QEInputParser::parse().

◆ cell_dimension_6

Real q3::InputData::cell_dimension_6 = 0.0

Definition at line 141 of file data.hpp.

Referenced by q3::build_crystal_from_input(), and q3::QEInputParser::parse().

◆ charge_density_energy_cutoff

◆ compute_projections

bool q3::InputData::compute_projections = false

Atomic-orbital (ortho-atomic/Löwdin) projections, used when calculation == "non_self_consistent_field". Opt-in: adds a Löwdin orthogonalization + projection pass per k-point on top of plain NSCF.

Definition at line 242 of file data.hpp.

Referenced by q3::NonSelfConsistentFieldFlavor::run_calculation().

◆ convergence_threshold

◆ davidson_basis_expansion_factor

int q3::InputData::davidson_basis_expansion_factor = 2

Davidson working basis size as a multiple of the band count. Two arrays of this many vectors dominate the solver's memory, so this is the one deck key that trades restart frequency against footprint.

Definition at line 66 of file data.hpp.

Referenced by q3::create_kohn_sham_iterator(), and q3::NonSelfConsistentFieldFlavor::run_calculation().

◆ davidson_basis_expansion_factor_set_by_deck

bool q3::InputData::davidson_basis_expansion_factor_set_by_deck = false

Whether the deck named method.scf.davidson.basis_expansion_factor itself. A non-self-consistent pass raises the default to its own floor, but keeps a factor the deck asked for.

Definition at line 72 of file data.hpp.

Referenced by q3::NonSelfConsistentFieldFlavor::run_calculation().

◆ diagonalization_method

std::string q3::InputData::diagonalization_method = "davidson"

◆ disable_symmetry

bool q3::InputData::disable_symmetry = false

true = use no symmetry at all: the k-point mesh is not reduced, and the density, forces and stress are not symmetrized (Quantum ESPRESSO's nosym + noinv). A shifted mesh then gives the raw-mesh energy rather than the symmetrized-mesh one.

Definition at line 192 of file data.hpp.

Referenced by q3::build_global_kpoint_grid_from_input(), q3::create_kohn_sham_iterator(), q3::QEInputParser::parse(), report_resolved_input(), q3::SelfConsistentFieldFlavor::run_calculation(), and q3::bindings::SCFSolver::solve().

◆ dispersion_correction

std::string q3::InputData::dispersion_correction = "none"

◆ dos_broadening

Real q3::InputData::dos_broadening = 0.02

Definition at line 232 of file data.hpp.

◆ dos_energy_max

Real q3::InputData::dos_energy_max = 100.0

Definition at line 234 of file data.hpp.

◆ dos_energy_min

Real q3::InputData::dos_energy_min = -100.0

Definition at line 233 of file data.hpp.

◆ dos_energy_steps

int q3::InputData::dos_energy_steps = 2000

Definition at line 235 of file data.hpp.

◆ exchange_correlation_functional

std::string q3::InputData::exchange_correlation_functional

Empty when the input names no functional. parse_input() then fills in the one the pseudopotentials state, as pw.x does without input_dft; the former default, "PZ", ran PBE datasets as LDA without a word.

Definition at line 41 of file data.hpp.

Referenced by q3::create_kohn_sham_iterator(), q3::QEInputParser::parse(), q3::parse_input(), report_resolved_input(), and q3::bindings::SCFSolver::solve().

◆ has_explicit_lattice_vectors

bool q3::InputData::has_explicit_lattice_vectors = false

◆ hubbard

std::vector<HubbardSpecification> q3::InputData::hubbard

◆ hubbard_fixed_occupation_iterations

int q3::InputData::hubbard_fixed_occupation_iterations = 0

SCF iterations for which the seeded occupation matrix is held in place (drop-in mixing_fixed_ns). 0 = seed the first iteration and let self-consistency take over immediately.

Definition at line 107 of file data.hpp.

Referenced by q3::create_kohn_sham_iterator(), and q3::QEInputParser::parse().

◆ hubbard_projector_type

std::string q3::InputData::hubbard_projector_type = "atomic"

Projector convention for the Hubbard manifold: "atomic" (raw pseudo-atomic UPF orbitals, QE's HUBBARD {atomic} card) or "ortho-atomic" (Lowdin-orthogonalized over the FULL system-wide atomic-orbital set, then the Hubbard manifold's columns selected out – QE's HUBBARD {ortho-atomic} card). A single joint diagonalization over the whole system, so this is a per-run choice, not settable per manifold.

Definition at line 93 of file data.hpp.

Referenced by q3::create_kohn_sham_iterator(), q3::QEInputParser::parse(), and report_resolved_input().

◆ hubbard_starting_eigenvalues

std::vector<HubbardStartingEigenvalue> q3::InputData::hubbard_starting_eigenvalues

First-iteration occupation-eigenvalue overrides (drop-in starting_ns_eigenvalue, YAML hubbard_starting_eigenvalues). Empty = no seeding. Indices are 0-based here; parsers convert.

Definition at line 100 of file data.hpp.

Referenced by q3::create_kohn_sham_iterator(), and q3::QEInputParser::parse().

◆ ibz_reduction_method

std::string q3::InputData::ibz_reduction_method = "internal"

Definition at line 193 of file data.hpp.

Referenced by q3::build_global_kpoint_grid_from_input().

◆ interpolation

InterpolationSpecification q3::InputData::interpolation

control.interpolation: a build request on an NSCF run, an evaluation request on calculation == "interpolation" (see the struct's header).

Definition at line 248 of file data.hpp.

Referenced by q3::NonSelfConsistentFieldFlavor::run_calculation(), and q3::write_and_export_interpolation_record().

◆ is_relaxation_step

bool q3::InputData::is_relaxation_step = false

True when the input asked for a relaxation ('relax'/'vc-relax'), which runs here as one SCF at the input's geometry – a step of the relaxation q3.workflows drives. The relaxation parameters below are then reported in the results' provenance, for that driver to read.

Definition at line 268 of file data.hpp.

Referenced by q3::parse_input(), and q3::QuantumSystemProvenanceRecord::to_json().

◆ isolated_system_correction

std::string q3::InputData::isolated_system_correction = "none"

Isolated (charged) system correction: "none" (default) or "makov-payne" (QE's assume_isolated='makov-payne' analog). Cubic lattices only (see MakovPayneCorrectionCalculator); opt-in since it's meaningless for genuinely periodic bulk systems and only appropriate for a net-charged cell modeling an isolated defect/molecule.

Definition at line 209 of file data.hpp.

Referenced by q3::QEInputParser::parse(), report_resolved_input(), and q3::SelfConsistentFieldFlavor::run_calculation().

◆ kpoint_grid_dimension_1

int q3::InputData::kpoint_grid_dimension_1 = 1

◆ kpoint_grid_dimension_2

int q3::InputData::kpoint_grid_dimension_2 = 1

◆ kpoint_grid_dimension_3

int q3::InputData::kpoint_grid_dimension_3 = 1

◆ kpoint_grid_shift_1

int q3::InputData::kpoint_grid_shift_1 = 0

◆ kpoint_grid_shift_2

int q3::InputData::kpoint_grid_shift_2 = 0

◆ kpoint_grid_shift_3

int q3::InputData::kpoint_grid_shift_3 = 0

◆ kpoints_list

std::vector<std::pair<Vector3D, Real> > q3::InputData::kpoints_list

Explicit k-point list for NSCF calculations (calculation == "non_self_consistent_field"). Each entry is (crystal-coordinate k-vector, weight). Takes precedence over kpoint_grid when non-empty.

Definition at line 125 of file data.hpp.

Referenced by q3::build_global_kpoint_grid_from_input(), report_resolved_input(), and q3::NonSelfConsistentFieldFlavor::run_calculation().

◆ lattice_vectors

Matrix3x3 q3::InputData::lattice_vectors {}

Explicit lattice vectors (rows a1,a2,a3 in units of cell_dimension_1). Set for "free" lattices (bravais_lattice_index == 0): YAML general cells (hexagonal, slab, triclinic, explicit vectors) and QE CELL_PARAMETERS.

Definition at line 147 of file data.hpp.

Referenced by q3::build_crystal_from_input(), set_free_lattice_vectors(), and q3::substitute_material().

◆ maximum_iterations

◆ mean_field_export

std::string q3::InputData::mean_field_export = "none"

Mean-field export for an external many-body-perturbation-theory code: "none" (default) or "berkeleygw" (writes WFN/RHO/vxc.dat – see create_mean_field_exporter()). BerkeleyGW normally consumes an NSCF run with many empty (conduction) bands rather than the SCF run itself, but the export is wired into both flavors unconditionally (Null object for "none"), writing into output_directory.

Definition at line 219 of file data.hpp.

Referenced by q3::export_and_record_mean_field(), and q3::export_and_record_mean_field_under_topology().

◆ mean_field_export_kleinman_bylander_projectors

bool q3::InputData::mean_field_export_kleinman_bylander_projectors = false

With mean_field_export "berkeleygw", also write the nonlocal pseudopotential at every k-point as BerkeleyGW's VKB file – the projectors ParaBands needs, with VSC, to add bands to WFN. Off by default: VKB holds one plane-wave vector per projector channel per k-point, usually more than WFN's own bands. Norm-conserving runs only (see add_kleinman_bylander_projectors_to_mean_field_record()).

Definition at line 229 of file data.hpp.

◆ methfessel_paxton_order

int q3::InputData::methfessel_paxton_order = 1

Definition at line 77 of file data.hpp.

Referenced by q3::create_kohn_sham_iterator(), and q3::bindings::SCFSolver::solve().

◆ mixing_beta

Real q3::InputData::mixing_beta = 0.7

◆ mixing_history_size

int q3::InputData::mixing_history_size = 8

◆ mixing_mode

std::string q3::InputData::mixing_mode = "broyden"

◆ mixing_preconditioning

std::string q3::InputData::mixing_preconditioning = "default"

◆ mixing_q0

Real q3::InputData::mixing_q0 = 1.0

Definition at line 74 of file data.hpp.

Referenced by q3::create_kohn_sham_iterator(), and q3::bindings::SCFSolver::solve().

◆ nonlocal_stress_derivative_method

std::string q3::InputData::nonlocal_stress_derivative_method = "analytical"

Stress tensor options "analytical" (default) = differentiate Lagrange interpolation polynomial (matches QE) "numerical" = finite-difference derivatives of beta projectors and Ylm

Definition at line 200 of file data.hpp.

Referenced by q3::create_kohn_sham_iterator(), q3::SelfConsistentFieldFlavor::run_calculation(), and q3::bindings::SCFSolver::solve().

◆ number_of_atoms

int q3::InputData::number_of_atoms = 0

Definition at line 149 of file data.hpp.

Referenced by q3::QEInputParser::parse(), and q3::YAMLInputParser::parse_material().

◆ number_of_bands

int q3::InputData::number_of_bands = 0

◆ number_of_kpoint_pools

int q3::InputData::number_of_kpoint_pools = 0

Parallelization Number of k-point pool groups. Each pool handles a subset of k-points. 0 = choose automatically from the irreducible k-point count.

Definition at line 280 of file data.hpp.

Referenced by q3::create_scf_iterator_mpi(), and q3::QEInputParser::parse().

◆ number_of_species

int q3::InputData::number_of_species = 0

Definition at line 150 of file data.hpp.

Referenced by q3::QEInputParser::parse(), and q3::YAMLInputParser::parse_material().

◆ number_of_spin_components

◆ output_directory

◆ prefix

◆ pseudopotential_directory

std::string q3::InputData::pseudopotential_directory = "./"

◆ relax_energy_threshold

Real q3::InputData::relax_energy_threshold = 1.0e-4

◆ relax_force_threshold

Real q3::InputData::relax_force_threshold = 1.0e-3

◆ relax_maximum_steps

int q3::InputData::relax_maximum_steps = 100

◆ smearing

std::string q3::InputData::smearing = "none"

◆ smearing_width

Real q3::InputData::smearing_width = 0.0

◆ source_format

std::string q3::InputData::source_format

Canonical name of the registered input format this run was read from ("yaml", "qe", or a name a build-time add-on registers), recorded by parse_input(). Empty for an InputData assembled in code.

The finished run is handed back to that format for the companion outputs its own conventions expect (io/output/companion_outputs.hpp), so those files are written only beside a run that was read from it.

Definition at line 174 of file data.hpp.

Referenced by q3::parse_input(), and q3::write_companion_outputs().

◆ species

◆ start_from_saved_charge_density

bool q3::InputData::start_from_saved_charge_density = false

Start the SCF from the charge density a previous run saved in output_directory/prefix.save (pw.x startingpot = 'file'), rather than from overlapping atoms. A relaxation driven step by step sets it, so each geometry starts from the last one's density. A density that does not fit this run's grid, or a missing one, falls back to the atoms. The saved bands are offered the same way, as the starting wavefunctions; a k-point whose file does not fit this basis starts from the atomic + random guess.

Definition at line 260 of file data.hpp.

Referenced by q3::QEInputParser::parse(), q3::parse_input(), and q3::SelfConsistentFieldFlavor::run_calculation().

◆ starting_magnetization

std::vector<Real> q3::InputData::starting_magnetization

Initial magnetization per species, parallel to species (QE starting_magnetization(i) convention: values in [-1, 1], negative = opposite sublattice for AFM). May be shorter than species; missing entries mean 0. Empty = unset (spin-polarized runs then use a default).

Definition at line 49 of file data.hpp.

Referenced by q3::create_kohn_sham_iterator(), q3::QEInputParser::parse(), and q3::bindings::SCFSolver::solve().

◆ theory

std::string q3::InputData::theory = "kohn_sham"

Definition at line 29 of file data.hpp.

Referenced by q3::create_iterator().

◆ total_charge

Real q3::InputData::total_charge = 0.0

Net cell charge in electrons removed (QE tot_charge convention): positive = cationic (electrons removed), negative = anionic (electrons added).

Definition at line 83 of file data.hpp.

Referenced by q3::create_kohn_sham_iterator(), and q3::QEInputParser::parse().

◆ use_deterministic_fft_planning

bool q3::InputData::use_deterministic_fft_planning = false

FFT planning determinism. false (default) = FFTW_MEASURE: each process times several transform algorithms at startup and keeps the fastest, which is the better-performing choice but makes runs whose SCF trajectory is sensitive to Allreduce/summation-order noise (e.g. a metallic system with a soft, nearly-degenerate magnetic moment under hot smearing) vary slightly from run to run. true = FFTW_ESTIMATE: a fixed heuristic plan with no runtime timing, giving bit-reproducible repeated runs at some performance cost. See TODOs.md §2.3.

Definition at line 292 of file data.hpp.

Referenced by q3::create_kohn_sham_iterator().

◆ use_exact_wavefunction_grid

bool q3::InputData::use_exact_wavefunction_grid = false

Wavefunction FFT grid size. false (default) = the 2 x ecutwfc grid: faster, but approximate – V(r)ψ(r) and |ψ(r)|² alias, which is harmless where the wavefunctions have little weight near the cutoff and up to mRy off pw.x on hard pseudopotentials at low cutoffs. true = the exact grid, sized for 4 x ecutwfc as pw.x sizes it, at 1.4x to 2.3x the solver time on the silicon and copper examples. YAML control.use_exact_wavefunction_grid; the QE-format reader always sets it, so a pw.x deck runs on pw.x's grid.

Definition at line 303 of file data.hpp.

Referenced by q3::create_kohn_sham_iterator(), and q3::QEInputParser::parse().

◆ verbosity

std::string q3::InputData::verbosity = "default"

How much the run says about itself on stdout: "default" (the physics and the SCF trajectory) or "high" (that, plus the per-iteration and per-phase diagnostics – Davidson micro-iterations, timing breakdowns, mixer internals – which are logged at debug level). Quantum ESPRESSO's verbosity maps onto this; an explicit –log-level overrides it.

Definition at line 186 of file data.hpp.

Referenced by q3::bindings::SCFSolver::SCFSolver(), q3::QEInputParser::parse(), q3::cli::read_input(), q3::bindings::run_nscf(), and q3::bindings::run_scf().

◆ wavefunction_energy_cutoff


The documentation for this struct was generated from the following file: