Simulation Result¶
A simulation result holds one copy of the simulated layout and one charge_distribution per physically valid charge
configuration, together with the algorithm name, runtime, and physical parameters.
Header: fiction/technology/sidb/simulation/result.hpp
-
struct result¶
The unified return type of every SiDB simulation algorithm: the name of the algorithm, its runtime, the layout it simulated, the physically valid charge distributions it found over that layout, the physical parameters, and optional algorithm-specific named parameters.
The layout is stored once; each charge distribution holds one charge state per SiDB in the layout’s raster order plus its energy.
Public Functions
-
inline model::charge_state charge_state(const std::size_t distribution, const lattice_site &s) const¶
The charge state of an SiDB in one of the charge distributions.
- Parameters:
distribution – Index into
charge_distributions.s – Site of the SiDB.
- Throws:
std::out_of_range – if the distribution index is out of range.
- Returns:
The charge state,
charge_state::NONEifsholds no SiDB.
-
inline std::vector<charge_distribution> groundstates() const¶
The charge distributions of minimal energy. Distributions with identical charge states count once.
Note
If degenerate states exist in the simulation result, this function returns multiple ground states that all possess the same energy.
- Returns:
The charge distributions with the minimal energy.
Public Members
-
std::string algorithm_name = {}¶
Name of the algorithm used to determine the charge distributions. Defaults to an empty string.
-
std::chrono::duration<double> simulation_runtime = {}¶
Total simulation runtime in seconds. Defaults to zero seconds.
-
std::vector<charge_distribution> charge_distributions = {}¶
Charge distributions determined by the algorithm. Empty by default.
-
model::simulation_parameters sim_params = {}¶
Physical parameters used in the simulation. Uses the default physical simulation parameters.
-
std::unordered_map<std::string, std::any> additional_simulation_parameters = {}¶
Additional named simulation parameters. This is used to store algorithm-dependent parameters that are not part of the
sidb::model::simulation_parametersstruct.The key of the map is the name of the parameter, the element is the value of the parameter.
-
inline model::charge_state charge_state(const std::size_t distribution, const lattice_site &s) const¶
- class sidb_simulation_result¶
The unified return type of every SiDB simulation algorithm: the name of the algorithm, its runtime, the layout it simulated, the physically valid charge distributions it found over that layout, the physical parameters, and optional algorithm-specific named parameters.
The layout is stored once; each charge distribution holds one charge state per SiDB in the layout’s raster order plus its energy.
- property additional_simulation_parameters¶
Additional named simulation parameters. This is used to store algorithm-dependent parameters that are not part of the
sidb::model::simulation_parametersstruct.The key of the map is the name of the parameter, the element is the value of the parameter.
- property algorithm_name¶
Name of the algorithm used to determine the charge distributions.
Defaults to an empty string.
- property charge_distributions¶
Charge distributions determined by the algorithm.
Empty by default.
- charge_state(distribution: int, site: lattice_site) sidb_charge_state¶
The charge state of an SiDB in one of the charge distributions.
- Parameters:
distribution – Index into
charge_distributions.site – Site of the SiDB.
- Returns:
The charge state,
charge_state::NONEifsiteholds no SiDB.- Raises:
IndexError – if the distribution index is out of range.
- groundstates() list[charge_distribution]¶
The charge distributions of minimal energy. Distributions with identical charge states count once.
- Returns:
The charge distributions with the minimal energy.
Note
If degenerate states exist in the simulation result, this function returns multiple ground states that all possess the same energy.
- property layout¶
The simulated layout.
Defaults to an empty Si(100)-2x1 layout.
- property simulation_parameters¶
Physical parameters used in the simulation.
Uses the default physical simulation parameters.
- property simulation_runtime¶
Total simulation runtime in seconds.
Defaults to zero seconds.