Skip to content

Commit

Permalink
Merge branch 'main' into pyml
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelwa committed Nov 21, 2023
2 parents 1ff86a4 + d00dabd commit 1c41e43
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,8 @@ class critical_temperature_impl

{
stats.critical_temperature = params.max_temperature;
stats.algorithm_name =
(params.engine == critical_temperature_params::simulation_engine::EXACT) ? "QuickExact" : "QuickSim";
}

/**
Expand All @@ -186,7 +188,6 @@ class critical_temperature_impl
stats.critical_temperature = 0.0;
return true;
}

else if (layout.num_cells() > 1)
{
const auto output_bdl_pairs =
Expand Down
4 changes: 4 additions & 0 deletions test/algorithms/simulation/sidb/critical_temperature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,8 @@ TEMPLATE_TEST_CASE(
critical_temperature_params::simulation_engine::EXACT, 0.99, 350};
critical_temperature_gate_based(lyt, std::vector<tt>{create_id_tt()}, params, &criticalstats);

CHECK(criticalstats.algorithm_name == "QuickExact");

CHECK_THAT(std::abs(criticalstats.energy_between_ground_state_and_first_erroneous),
Catch::Matchers::WithinAbs(305.95, 0.01));
CHECK_THAT(std::abs(criticalstats.critical_temperature), Catch::Matchers::WithinAbs(0.00, 0.01));
Expand All @@ -371,6 +373,8 @@ TEMPLATE_TEST_CASE(
750};
critical_temperature_non_gate_based(lyt, params, &criticalstats);

CHECK(criticalstats.algorithm_name == "QuickSim");

CHECK_THAT(std::abs(criticalstats.critical_temperature), Catch::Matchers::WithinAbs(11.55, 0.01));
}
}

0 comments on commit 1c41e43

Please sign in to comment.