-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
✨ Sorting designed SiDB gates #552
base: main
Are you sure you want to change the base?
Conversation
…irst operational gate is designed
… that certified the status `OPERATIONAL`
# Conflicts: # include/fiction/algorithms/physical_design/design_sidb_gates.hpp
Signed-off-by: GitHub Actions <[email protected]>
Signed-off-by: GitHub Actions <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
include/fiction/algorithms/physical_design/design_sidb_gates.hpp
Outdated
Show resolved
Hide resolved
include/fiction/algorithms/physical_design/design_sidb_gates.hpp
Outdated
Show resolved
Hide resolved
include/fiction/algorithms/physical_design/design_sidb_gates.hpp
Outdated
Show resolved
Hide resolved
include/fiction/algorithms/physical_design/design_sidb_gates.hpp
Outdated
Show resolved
Hide resolved
include/fiction/algorithms/physical_design/design_sidb_gates.hpp
Outdated
Show resolved
Hide resolved
include/fiction/algorithms/physical_design/design_sidb_gates.hpp
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
include/fiction/algorithms/physical_design/design_sidb_gates.hpp
Outdated
Show resolved
Hide resolved
include/fiction/algorithms/physical_design/design_sidb_gates.hpp
Outdated
Show resolved
Hide resolved
include/fiction/algorithms/physical_design/design_sidb_gates.hpp
Outdated
Show resolved
Hide resolved
include/fiction/algorithms/physical_design/design_sidb_gates.hpp
Outdated
Show resolved
Hide resolved
include/fiction/algorithms/physical_design/design_sidb_gates.hpp
Outdated
Show resolved
Hide resolved
include/fiction/algorithms/physical_design/design_sidb_gates.hpp
Outdated
Show resolved
Hide resolved
include/fiction/algorithms/physical_design/design_sidb_gates.hpp
Outdated
Show resolved
Hide resolved
…ned_gates_sorting # Conflicts: # include/fiction/algorithms/physical_design/design_sidb_gates.hpp
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
include/fiction/algorithms/physical_design/design_sidb_gates.hpp
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
include/fiction/algorithms/physical_design/design_sidb_gates.hpp
Outdated
Show resolved
Hide resolved
@wlambooy is this PR still under active development, or can it be closed? |
I actually started merging it with main yesterday (big task in this case). It is a good starting point for the advanced circuit design I'm getting into. I'll let you know if this PR will stay or if it will be part of a different one. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
Hi @wlambooy, Many thanks for your hard work! Before I give you detailed feedback, could you, as we have discussed, extend the benchmark with gate design and operational domain? It will be super helpful in the future, especially for changes like this one. Many thanks! |
I see now that I misread your comment; I added a specific benchmark for For Let me know if you think this is good :). |
That's great! Thank you! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Many thanks, @wlambooy! As discussed, I will try to find more time as soon as possible to look at it in more detail. Here are just a few comments that came up when I skimmed through it.
include/fiction/algorithms/physical_design/design_sidb_gates.hpp
Outdated
Show resolved
Hide resolved
{ | ||
const std::size_t start_index = i * chunk_size; | ||
const std::size_t end_index = std::min(start_index + chunk_size, all_canvas_layouts.size()); | ||
|
||
for (std::size_t j = start_index; j < end_index; ++j) | ||
{ | ||
conduct_pruning_steps(all_canvas_layouts[j]); | ||
conduct_pruning_steps(all_canvas_layouts.at(j)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the reason for this change? I guess you know that[]
is faster but does not check bounds.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was under the impression that .at(.)
does not really introduce any runtime overhead, and thus it is the preferred choice of array indexing in fiction. I could be wrong on that though, and that we prefer []
in performance-critical code. @marcelwa , could you enlighten us here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here, it says vector at() is slightly slower, due to the additional bounds checking. However, it is often negligible.
. However, a small experiment shows the slightly opposite 😅
@@ -719,12 +664,12 @@ class design_sidb_gates_impl | |||
// SiDBs cannot be placed on positions which are already occupied by atomic defects. | |||
if constexpr (is_sidb_defect_surface_v<Lyt>) | |||
{ | |||
if (skeleton_layout.get_sidb_defect(all_sidbs_in_canvas[i]).type != sidb_defect_type::NONE) | |||
if (skeleton_layout.get_sidb_defect(all_sidbs_in_canvas.at(i)).type != sidb_defect_type::NONE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
{ | ||
continue; | ||
} | ||
} | ||
lyt.assign_cell_type(all_sidbs_in_canvas[i], sidb_technology::cell_type::LOGIC); | ||
lyt.assign_cell_type(all_sidbs_in_canvas.at(i), sidb_technology::cell_type::LOGIC); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
namespace detail | ||
{ | ||
|
||
template <typename Lyt> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add a docstring.
|
||
#endif // COMPARE_BY_ENERGETIC_GAP_HPP | ||
|
||
// |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this code still needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will use it to write docstrings later. It will be removed in the future
…ned_gates_sorting
Signed-off-by: GitHub Actions <[email protected]>
Description
This PR introduces an extension to
is_operational
anddesign_sidb_gates
. The former is now able to return the simulation results that certify the statusOPERATIONAL
, which may then be used by the extension to the latter, which uses the simulation results to return the designed layouts in a specific ordering. This PR implements a simple heuristic for this ordering, namely it prefers the layouts for the the ground state isolation is large, ie., the energetic gap between the ground state and the first excited state. Specifically, it sorts by the minimum ground state isolation for each input.To use this new feature when designing SiDB gates, make sure that all combinations are enumerated, and set the
post_design_process
parameter toPREFER_ENERGETICALLY_ISOLATED_GROUND_STATES
.Checklist: