2#include "DiracOperator/TensorOperator.hpp"
3#include "IO/InputBlock.hpp"
4#include "Wavefunction/Wavefunction.hpp"
49 std::string description;
69 void add(std::string name, std::string description,
FactoryFn fn) {
70 m_entries.push_back({std::move(name), std::move(description), fn});
74 const std::vector<OperatorEntry> &
entries()
const {
return m_entries; }
78 std::vector<OperatorEntry> m_entries;
96 Register(
const char *name,
const char *description) {
119std::unique_ptr<DiracOperator::TensorOperator>
Singleton registry of all compiled-in operators.
Definition GenerateOperator.hpp:60
void add(std::string name, std::string description, FactoryFn fn)
Append a new entry. Normally called only by Register<T>.
Definition GenerateOperator.hpp:69
const std::vector< OperatorEntry > & entries() const
All registered operators, in registration order.
Definition GenerateOperator.hpp:74
static Registry & get()
Access the singleton instance.
Definition GenerateOperator.hpp:63
Stores Wavefunction (set of valence orbitals, grid, HF etc.)
Definition Wavefunction.hpp:37
Dirac operators: TensorOperator base class and derived implementations for single-particle (one-body)...
Definition GenerateOperator.cpp:6
std::unique_ptr< DiracOperator::TensorOperator > generate(std::string_view operator_name, const IO::InputBlock &input, const Wavefunction &wf)
Constructs and returns a TensorOperator by name.
Definition GenerateOperator.cpp:10
void list_operators()
Print the list of compiled-in operators (name + description).
Definition GenerateOperator.cpp:39
std::unique_ptr< TensorOperator >(*)(const IO::InputBlock &, const Wavefunction &) FactoryFn
Operators are self-registering: each operator class exposes a static generate() factory and registers...
Definition GenerateOperator.hpp:42
One entry in the operator registry.
Definition GenerateOperator.hpp:47
Constructing a Register<T> adds T::generate to the Registry.
Definition GenerateOperator.hpp:95