Skip to content

Commit

Permalink
🎨 small fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
Drewniok committed Nov 2, 2024
1 parent 2213425 commit 325c0e3
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -270,9 +270,16 @@ class defect_operational_domain_impl
assert(layout.num_defects() == 0 && "An atomic defect is added");

// find an operational point on the contour starting from the randomly determined starting point
const auto contour_starting_point =
const auto contour_starting_p =
find_last_operational_defect_position_moving_right(*operational_starting_point);

if (!contour_starting_p.has_value())
{
continue;
}

const auto contour_starting_point = *contour_starting_p;

// the layout hs to be defect-free.
assert(layout.num_defects() == 0 && "An atomic defect is added");

Expand All @@ -286,13 +293,8 @@ class defect_operational_domain_impl
current_neighborhood.front() :
next_clockwise_point(current_neighborhood, backtrack_point);

std::size_t counter = 0;
while (next_point != contour_starting_point && counter < 100)
while (next_point != contour_starting_point)
{
counter++; // avoid infinite loops

std::cout << counter << std::endl;

const auto operational_status = is_defect_position_operational(next_point);

assert(layout.num_defects() == 0 && "more than one defect");
Expand Down Expand Up @@ -442,9 +444,9 @@ class defect_operational_domain_impl
*
* @param starting_defect_position The starting position of the defect, from which the traversal towards the right
* is conducted while maintaining gate operability.
* @return The last operational defect position.
* @return The last operational defect position. If no non-operational defect is found, std::nullopt is returned.
*/
[[nodiscard]] typename Lyt::cell
[[nodiscard]] std::optional<typename Lyt::cell>
find_last_operational_defect_position_moving_right(const typename Lyt::cell& starting_defect_position) noexcept
{
auto latest_operational_defect_position = starting_defect_position;
Expand Down Expand Up @@ -473,6 +475,11 @@ class defect_operational_domain_impl
}
}

if (current_defect_position == latest_operational_defect_position)
{
return std::nullopt;
}

return latest_operational_defect_position;
}
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ TEST_CASE("novel designed AND Gate influence distance function which fails again
defect_operational_domain_stats stats{};
const auto defect_influence_domain =
defect_operational_domain_grid_search(cube_lyt, std::vector<tt>{create_and_tt()}, 3, params, &stats);
CHECK_THAT(defect_avoidance_distance(cube_lyt, defect_influence_domain).minimum_defect_clearance,
Catch::Matchers::WithinAbs(8.42177748459314479, physical_constants::POP_STABILITY_ERR));
CHECK(defect_avoidance_distance(cube_lyt, defect_influence_domain).minimum_defect_clearance <=
6.2126117696183147);
}

SECTION("Random Sampling")
Expand All @@ -56,11 +56,12 @@ TEST_CASE("novel designed AND Gate influence distance function which fails again

SECTION("QuickTrace")
{
// 6.21261176961831474 nm is the exact value.
params.defect_influence_params.additional_scanning_area = {20, 20};
defect_operational_domain_stats stats{};
const auto defect_influence_domain =
defect_operational_domain_quicktrace(cube_lyt, std::vector<tt>{create_and_tt()}, 5, params, &stats);
CHECK_THAT(defect_avoidance_distance(cube_lyt, defect_influence_domain).minimum_defect_clearance,
Catch::Matchers::WithinAbs(9.62301241815680086, physical_constants::POP_STABILITY_ERR));
Catch::Matchers::WithinAbs(6.21261176961831474, physical_constants::POP_STABILITY_ERR));
}
}

0 comments on commit 325c0e3

Please sign in to comment.