Quantum 3xplorer (Q3)
An AI-native quantum simulation engine
Loading...
Searching...
No Matches
pseudopotential_format_registry.hpp
Go to the documentation of this file.
1#pragma once
2
3/**
4 * The pseudopotential file formats this build can read.
5 *
6 * Core seeds the registry with UPF on first use. A build-time add-on registers
7 * its formats from its registration function, which every entry point runs
8 * before it reads input (io/addon_registration.hpp). Formats are consulted in
9 * registration order, so core's UPF is always asked first.
10 */
11
12#include <memory>
13
16#include "utils/registry.hpp"
17
18namespace q3 {
19
20/// The registry PseudopotentialFactory::read() chooses a format from.
22 static Registry<PseudopotentialFormat> registry = [] {
24 seeded.add(std::make_unique<UPFPseudopotentialFormat>());
25 return seeded;
26 }();
27 return registry;
28}
29
30} // namespace q3
An ordered set of interchangeable implementations of Entry, found by name.
Definition registry.hpp:33
void add(std::unique_ptr< Entry > entry)
Add entry; throws std::logic_error when one of its names is already registered.
Definition registry.hpp:36
Registry< PseudopotentialFormat > & pseudopotential_format_registry()
The registry PseudopotentialFactory::read() chooses a format from.