FileToml
A file handler for TOML files. Most funtionality is only provided for the C++ version as Julia already provides good tools handling TOML files.
Sources file_toml.hpp, file_toml.cpp
Constructors
Name | Description | Default |
---|---|---|
filename | filename of the TOML file |
Methods
defined
Returns whether or not the TOML file has a certain key defined.
getindex / operator[] (C++ only)
Returns a handler to a value to be read from the TOML file.
Usage Example
auto fl = FileToml(XDIAG_DIRECTORY "/misc/data/toml/input.toml");
XDIAG_SHOW(defined(fl, "N"));
int N = fl["N"].as<int>();
int nup = fl["nup"].as<int>();
double J1 = fl["J1"].as<double>();
double J2 = fl["J2"].as<double>();
auto block = Spinhalf(N, nup);
auto H = OpSum();
for (int i=0; i<N; ++i){
H += J1 * Op("SdotS", {i, (i+1)%N});
H += J2 * Op("SdotS", {i, (i+2)%N});
}
double e0 = eigval0(H, block);
XDIAG_SHOW(e0);