Skip to content
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

✨ QuickTrace: An Efficient Contour Tracing Algorithm for Defect Robustness Simulation #546

Open
wants to merge 268 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
268 commits
Select commit Hold shift + click to select a range
1d9c6d6
:construction: WIP code.
Drewniok Feb 6, 2024
af88a5d
:construction: reduce the number of used threads.
Drewniok Feb 6, 2024
6ee8124
:construction: increase the number of used threads.
Drewniok Feb 6, 2024
8745b4f
:construction: plot runtime to assess how fast the compute server is.
Drewniok Feb 6, 2024
ee8a861
:construction: set number of threads to 32.
Drewniok Feb 6, 2024
ec87c30
:construction: set number of threads to 16.
Drewniok Feb 6, 2024
67ce364
:construction: set number of threads to 10.
Drewniok Feb 6, 2024
e5e44da
:construction: set number of threads to 1.
Drewniok Feb 6, 2024
7e8d871
:construction: smaller defect region.
Drewniok Feb 6, 2024
cf610bb
:construction: reduce canvas size
Drewniok Feb 6, 2024
cbb1727
:construction: increase the canvas.
Drewniok Feb 6, 2024
d64b67f
:construction: set new file name.
Drewniok Feb 6, 2024
639e144
:construction: without runtime.
Drewniok Feb 6, 2024
e1f63cb
:art: add missing headers.
Drewniok Feb 7, 2024
a0d4b72
:art: add new function to move defect.
Drewniok Feb 7, 2024
acd65a8
:construction: WIP code.
Drewniok Feb 7, 2024
c932bde
:construction: bug fix.
Drewniok Feb 7, 2024
b858c59
:construction: increase thread size.
Drewniok Feb 7, 2024
8e30c94
:construction: increase thread size.
Drewniok Feb 7, 2024
9bca6f8
:construction: WIP code.
Drewniok Feb 9, 2024
a1cc61c
:construction: use maximum number of threads.
Drewniok Feb 9, 2024
b1183b9
Merge branch 'main' into sa_gate_design
Drewniok Feb 27, 2024
267e779
Merge branch 'main' into sa_gate_design
Drewniok Mar 28, 2024
cbd65cb
:construction: WIP code.
Drewniok Apr 26, 2024
dee6127
Merge branch 'main' into sa_gate_design
Drewniok Apr 26, 2024
e2396ff
:art: All unit tests run successfully.
Drewniok Apr 26, 2024
a04a013
Merge branch 'cda-tum:main' into sa_gate_design
Drewniok Apr 26, 2024
9e1ab49
:art: small changes.
Drewniok Apr 26, 2024
3680324
Merge remote-tracking branch 'origin/sa_gate_design' into sa_gate_design
Drewniok Apr 26, 2024
4dbf67f
:art: small changes.
Drewniok Apr 26, 2024
1ab11c2
:art: small changes.
Drewniok Apr 26, 2024
9d30215
:memo: update docu.
Drewniok Apr 26, 2024
7b1e331
:art: small fix.
Drewniok Apr 26, 2024
32eb144
Merge branch 'main' into sa_gate_design
Drewniok Apr 29, 2024
59c1777
:memo: update docu.
Drewniok Apr 29, 2024
cfc687e
:fire: delete experiments.
Drewniok Apr 29, 2024
c592a24
:fire: small fix.
Drewniok Apr 29, 2024
e4b6855
:art: small fix.
Drewniok Apr 29, 2024
89e75c3
:art: small fix.
Drewniok Apr 29, 2024
263480a
:art: small fix.
Drewniok Apr 29, 2024
cb2edd0
:art: small fix.
Drewniok Apr 29, 2024
1c68f2b
Merge branch 'main' into sa_gate_design
Drewniok Apr 29, 2024
1191d51
:art: fix inconsistencies.
Drewniok Apr 29, 2024
3682bc4
🎨 Incorporated pre-commit fixes
pre-commit-ci[bot] Apr 29, 2024
f24b41d
:memo: fix bug in docu.
Drewniok Apr 29, 2024
5512dce
:art: add docu and small fixes.
Drewniok Apr 29, 2024
6daa45e
🎨 Incorporated pre-commit fixes
pre-commit-ci[bot] Apr 29, 2024
a44aa99
:art: renaming.
Drewniok Apr 29, 2024
ab4d01c
:snake: update bindings.
Drewniok Apr 29, 2024
daec1ff
Merge branch 'main' into sa_gate_design
Drewniok Apr 30, 2024
b37fb41
🎨 Incorporated pre-commit fixes
pre-commit-ci[bot] Apr 30, 2024
f245d30
:art: add missing includes.
Drewniok Apr 30, 2024
652c8e9
:art: restructure multithreading due to windows issue.
Drewniok Apr 30, 2024
a3face7
:snake: fix bindings after changes.
Drewniok May 1, 2024
c6f51f1
:snake: fix bindings after changes.
Drewniok May 2, 2024
be14bcd
:snake: implement CodeQL comments.
Drewniok May 2, 2024
1d626be
:snake: small updates.
Drewniok May 2, 2024
5871a79
:memo: update docu.
Drewniok May 2, 2024
87499c4
:art: include missing headers.
Drewniok May 2, 2024
9bced8e
:memo: small fix.
Drewniok May 2, 2024
a54d3b7
:art: small fixes.
Drewniok May 3, 2024
5a48af6
:art: Rename function to better represent functionality.
Drewniok May 3, 2024
47dfa96
:art: small fixes.
Drewniok May 3, 2024
92b45dc
Merge branch 'main' into sa_gate_design
Drewniok May 6, 2024
fa75945
:art: small fixes.
Drewniok May 6, 2024
4a44c27
🎨 Incorporated pre-commit fixes
pre-commit-ci[bot] May 6, 2024
1094491
:bug: small bug fix.
Drewniok May 7, 2024
3c58487
🎨 Incorporated pre-commit fixes
pre-commit-ci[bot] May 7, 2024
1cbbc7d
:art: small renaming due to previous merge.
Drewniok May 7, 2024
ab96344
Merge branch 'main' into sa_gate_design
Drewniok May 31, 2024
1f6420c
:art: increase the sample size.
Drewniok May 31, 2024
1e805ea
🎨 Incorporated pre-commit fixes
pre-commit-ci[bot] May 31, 2024
15c4aa2
:bug: small error in unit test.
Drewniok May 31, 2024
bfc703a
:art: minor changes.
Drewniok Jun 3, 2024
6933664
:construction: testing.
Drewniok Jun 4, 2024
009fe96
:construction: small fixes.
Drewniok Jun 4, 2024
a1ed9eb
:art: small fixes.
Drewniok Jul 1, 2024
9874c05
Merge branch 'main' into sa_gate_design
Drewniok Jul 1, 2024
2f9ff4f
:green_heart: changes to fix code ql error.
Drewniok Jul 1, 2024
9bce493
:green_heart: changes to fix code ql error.
Drewniok Jul 1, 2024
23db22a
:green_heart: changes to fix code ql error.
Drewniok Jul 1, 2024
c5bb04f
:green_heart: disable mugen.
Drewniok Jul 1, 2024
088b0dc
:art: update docstring.
Drewniok Jul 2, 2024
2478303
:green_heart: small changes to test.
Drewniok Jul 2, 2024
55f9ab8
:green_heart: small changes to test.
Drewniok Jul 2, 2024
4ffefe1
:green_heart: small changes to test.
Drewniok Jul 2, 2024
28247ec
Merge branch 'main' into sa_gate_design
Drewniok Jul 3, 2024
63f35f5
:art: rename function.
Drewniok Jul 3, 2024
95cf263
🎨 Incorporated pre-commit fixes
pre-commit-ci[bot] Jul 3, 2024
d97820e
:art: missing renaming in experiment.
Drewniok Jul 3, 2024
8ca2c02
Merge remote-tracking branch 'origin/sa_gate_design' into sa_gate_design
Drewniok Jul 3, 2024
d61690d
:green_heart: fix windows build issue.
Drewniok Jul 3, 2024
2acf8bf
Merge branch 'main' into sa_gate_design
Drewniok Jul 19, 2024
b1aa210
:memo: Update pyfiction docstrings
actions-user Jul 19, 2024
4ea9a69
:memo: fix docu issue.
Drewniok Jul 22, 2024
bc9bec6
🎨 Incorporated pre-commit fixes
pre-commit-ci[bot] Jul 22, 2024
6a11b35
Merge branch 'main' into sa_gate_design
Drewniok Jul 25, 2024
f3745d9
:art: update code after merge.
Drewniok Jul 25, 2024
f24b960
🎨 Incorporated pre-commit fixes
pre-commit-ci[bot] Jul 25, 2024
f16c4dc
:memo: Update pyfiction docstrings
actions-user Jul 25, 2024
beca579
:art: update code after merge.
Drewniok Jul 25, 2024
80b498c
:memo: Update pyfiction docstrings
actions-user Jul 25, 2024
d467583
:memo: fix docu.
Drewniok Jul 25, 2024
cdbb8d0
🎨 Incorporated pre-commit fixes
pre-commit-ci[bot] Jul 25, 2024
351e3db
:art: update the experiment script.
Drewniok Jul 25, 2024
023b807
Merge remote-tracking branch 'origin/sa_gate_design' into sa_gate_design
Drewniok Jul 25, 2024
4cb70ca
🎨 Incorporated pre-commit fixes
pre-commit-ci[bot] Jul 25, 2024
96053d9
:art: small fix.
Drewniok Jul 25, 2024
2d7bb81
:memo: Update pyfiction docstrings
actions-user Jul 25, 2024
5c260d9
:art: small fix.
Drewniok Jul 25, 2024
4043ded
🎨 Incorporated pre-commit fixes
pre-commit-ci[bot] Jul 25, 2024
2bb165c
:memo: Update pyfiction docstrings
actions-user Jul 25, 2024
959ee24
Merge branch 'main' into sa_gate_design
Drewniok Aug 1, 2024
75c7fe4
:twisted_rightwards_arrows: merge.
Drewniok Aug 1, 2024
53325f3
🎨 Incorporated pre-commit fixes
pre-commit-ci[bot] Aug 1, 2024
15dd854
:twisted_rightwards_arrows: merge.
Drewniok Aug 1, 2024
d012748
Merge remote-tracking branch 'origin/sa_gate_design' into sa_gate_design
Drewniok Aug 1, 2024
d36ab6b
Merge remote-tracking branch 'origin/main' into defect_operational_do…
Drewniok Sep 20, 2024
1a1f204
:see_no_evil: update gitignore file.
Drewniok Sep 20, 2024
8f10c7e
:children_crossing: add experiment to compare different methods to de…
Drewniok Sep 20, 2024
37f4219
:art: update code.
Drewniok Sep 20, 2024
0c0a317
Merge branch 'main' into defect_operational_domain_algorithm
Drewniok Sep 20, 2024
ae3727f
:memo: Update pyfiction docstrings
actions-user Sep 20, 2024
abf84cd
:art: add comments.
Drewniok Sep 20, 2024
7739a16
:art: small fix.
Drewniok Sep 20, 2024
728f892
:art: delete superfluous header file
Drewniok Sep 20, 2024
ee6c60f
:art: small changes
Drewniok Oct 2, 2024
08b82cb
:art: small changes.
Drewniok Oct 2, 2024
2bce91c
:art: experiments.
Drewniok Oct 14, 2024
328169c
Merge branch 'main' into defect_operational_domain_algorithm
Drewniok Oct 18, 2024
1ea65b5
:art: several changes.
Drewniok Oct 18, 2024
c6ebcbb
:memo: Update pyfiction docstrings
actions-user Oct 18, 2024
0fa4620
:art: small changes.
Drewniok Oct 18, 2024
add6c52
Merge branch 'main' into defect_operational_domain_algorithm
Drewniok Oct 18, 2024
9b5ee7f
:art: revert changes.
Drewniok Oct 18, 2024
bdde82f
🎨 Incorporated pre-commit fixes
pre-commit-ci[bot] Oct 18, 2024
0369455
:fire: delete files.
Drewniok Oct 18, 2024
b07b9d3
Merge remote-tracking branch 'origin/defect_operational_domain_algori…
Drewniok Oct 18, 2024
814a51d
Merge branch 'main' into defect_operational_domain_algorithm
Drewniok Oct 21, 2024
bc9b113
:art: Make sure the contour does not get stuck if you have only one c…
Drewniok Oct 30, 2024
84d5a1f
Merge branch 'main' into defect_operational_domain_algorithm
Drewniok Oct 30, 2024
c655a24
🎨 Incorporated pre-commit fixes
pre-commit-ci[bot] Oct 30, 2024
dee2194
:memo: Update pyfiction docstrings
actions-user Oct 30, 2024
c0a82e2
:art: small fixes.
Drewniok Oct 30, 2024
afcec19
🎨 Incorporated pre-commit fixes
pre-commit-ci[bot] Oct 30, 2024
652b058
:memo: Update pyfiction docstrings
actions-user Oct 30, 2024
24c6fce
:truck: add Bestagon gate library with logic cell type.
Drewniok Oct 30, 2024
ccb9839
:bug: make sure logic cell type is handled correctly.
Drewniok Oct 30, 2024
de8f9b3
:fire: delete files again and put them to separate PR.
Drewniok Oct 30, 2024
da123b1
🎨 Incorporated pre-commit fixes
pre-commit-ci[bot] Oct 30, 2024
0c6c059
Merge branch 'main' into update_write_read_sqd
Drewniok Oct 31, 2024
712c94c
:art: use switch.
Drewniok Oct 31, 2024
0bcf163
:art: use switch
Drewniok Oct 31, 2024
ccae103
Merge branch 'main' into update_write_read_sqd
Drewniok Oct 31, 2024
80d86c0
Merge branch 'main' into update_write_read_sqd
Drewniok Nov 1, 2024
d761ae0
Merge branch 'main' into defect_operational_domain_algorithm
Drewniok Nov 1, 2024
2800dd4
Merge branch 'main' into update_write_read_sqd
Drewniok Nov 1, 2024
f3fedf1
:snake: fix python bindings.
Drewniok Nov 1, 2024
2c41a63
Merge branch 'main' into defect_operational_domain_algorithm
Drewniok Nov 1, 2024
1e78447
🎨 Incorporated pre-commit fixes
pre-commit-ci[bot] Nov 1, 2024
a038155
:memo: Update pyfiction docstrings
actions-user Nov 1, 2024
14a934e
:art: small fix.
Drewniok Nov 1, 2024
f71a6f8
Merge remote-tracking branch 'origin/defect_operational_domain_algori…
Drewniok Nov 1, 2024
38ff96c
🎨 Incorporated pre-commit fixes
pre-commit-ci[bot] Nov 1, 2024
67a493a
:memo: Update pyfiction docstrings
actions-user Nov 1, 2024
e358e38
:art: small change.
Drewniok Nov 2, 2024
5090abb
:art: small fix.
Drewniok Nov 2, 2024
dc7b0d5
:art: clang-tidy fix.
Drewniok Nov 2, 2024
0e2fba5
🎨 Incorporated pre-commit fixes
pre-commit-ci[bot] Nov 2, 2024
cf4f749
Merge branch 'main' into update_write_read_sqd
Drewniok Nov 2, 2024
2213425
Merge branch 'main' into defect_operational_domain_algorithm
Drewniok Nov 2, 2024
b8fcf6c
:art: small fix.
Drewniok Nov 2, 2024
325c0e3
:art: small fix.
Drewniok Nov 2, 2024
41b630e
:memo: Update pyfiction docstrings
actions-user Nov 2, 2024
f727847
:art: small fix.
Drewniok Nov 2, 2024
00977b6
🎨 Incorporated pre-commit fixes
pre-commit-ci[bot] Nov 2, 2024
f54a4c4
:memo: Update pyfiction docstrings
actions-user Nov 2, 2024
0f05a47
:art: small fix.
Drewniok Nov 3, 2024
f1e38d7
:art: print output to fix CI.
Drewniok Nov 4, 2024
b6b9bc1
:art: print output to fix CI.
Drewniok Nov 4, 2024
3967e2e
:art: integrate Marcel's comment.
Drewniok Nov 4, 2024
e1ab329
Merge branch 'update_write_read_sqd' into defect_operational_domain_a…
Drewniok Nov 4, 2024
ee68a73
:art: small fix in docu.
Drewniok Nov 4, 2024
8e86d53
:art: rename files.
Drewniok Nov 4, 2024
73160ed
:memo: Update pyfiction docstrings
actions-user Nov 4, 2024
2785d9e
:art: small clang-tidy fixes.
Drewniok Nov 4, 2024
e5c5abb
Merge remote-tracking branch 'origin/defect_operational_domain_algori…
Drewniok Nov 4, 2024
5a6409d
🎨 Incorporated pre-commit fixes
pre-commit-ci[bot] Nov 4, 2024
4baa9bc
Merge branch 'main' into defect_operational_domain_algorithm
Drewniok Nov 4, 2024
101d4cf
:art: use one thread to see if that fixes python unit tests in CI.
Drewniok Nov 6, 2024
1cb29bd
Merge branch 'main' into defect_operational_domain_algorithm
Drewniok Nov 6, 2024
0477cf8
:art: try to fix docu.
Drewniok Nov 6, 2024
e125607
:sparkles: add function to save defect operational domain.
Drewniok Nov 6, 2024
24aae60
:thread: replace `future` by `thread` to avoid python 3.13 issues
Drewniok Nov 6, 2024
7702cf0
🎨 Incorporated pre-commit fixes
pre-commit-ci[bot] Nov 6, 2024
830e923
:thread: small fix.
Drewniok Nov 6, 2024
1ef14c6
:thread: small fix.
Drewniok Nov 6, 2024
44ed17b
:thread: use one thread to test CI issues.
Drewniok Nov 6, 2024
708940a
Merge branch 'main' into defect_operational_domain_algorithm
Drewniok Nov 7, 2024
350741f
:thread: use different implementation.
Drewniok Nov 7, 2024
5c8061c
🎨 Incorporated pre-commit fixes
pre-commit-ci[bot] Nov 7, 2024
7d84d90
:memo: small fix.
Drewniok Nov 7, 2024
c5b400b
:memo: small fix.
Drewniok Nov 7, 2024
cf63378
:art: small fix.
Drewniok Nov 7, 2024
4fa4972
:art: small fix.
Drewniok Nov 7, 2024
d8c5e38
:art: revert changes to understand issue.
Drewniok Nov 7, 2024
828e992
:art: small fix.
Drewniok Nov 7, 2024
c92a8bf
🎨 Incorporated pre-commit fixes
pre-commit-ci[bot] Nov 7, 2024
6c1cb6a
:arrow_up: use python 3.13 for readthedocs
Drewniok Nov 7, 2024
0b63725
Merge remote-tracking branch 'origin/defect_operational_domain_algori…
Drewniok Nov 7, 2024
6ff9604
:arrow_up: use python 3.13 for readthedocs
Drewniok Nov 7, 2024
aa101ce
:arrow_up: use python 3.13 for readthedocs
Drewniok Nov 7, 2024
7d03507
:arrow_up: use python 3.8 for readthedocs
Drewniok Nov 7, 2024
ba35b53
:green_heart: use string.
Drewniok Nov 7, 2024
29924b3
Merge branch 'main' into defect_operational_domain_algorithm
Drewniok Nov 13, 2024
cad1164
:art: restructure.
Drewniok Nov 13, 2024
76cfef1
🎨 Incorporated pre-commit fixes
pre-commit-ci[bot] Nov 13, 2024
5d0f4e7
Merge branch 'main' into defect_operational_domain_algorithm
Drewniok Nov 15, 2024
1552711
:arrow_up: use python 3.10 again for readthedocs.
Drewniok Nov 15, 2024
c258a8c
:alembic: small fix.
Drewniok Nov 18, 2024
ebb6885
:alembic: small fix.
Drewniok Nov 18, 2024
bbcad9c
:memo: deactivate `exact` to try to solve documentation issue
Drewniok Nov 18, 2024
eb54fc4
Merge branch 'main' into defect_operational_domain_algorithm
Drewniok Nov 19, 2024
12f373d
:memo: try to fix docu issue.
Drewniok Nov 19, 2024
5a72810
:memo: Update pyfiction docstrings
actions-user Nov 19, 2024
41159b7
:art: include missing header file.
Drewniok Nov 19, 2024
af724e7
Merge remote-tracking branch 'origin/defect_operational_domain_algori…
Drewniok Nov 19, 2024
c3dc185
:memo: small update.
Drewniok Nov 19, 2024
6391274
:memo: Update pyfiction docstrings
actions-user Nov 19, 2024
4369ae8
:white_check_mark: update tests.
Drewniok Nov 19, 2024
46d9988
🎨 Incorporated pre-commit fixes
pre-commit-ci[bot] Nov 19, 2024
b750c6d
:art: use static_cast to use correct type.
Drewniok Nov 19, 2024
615fb0d
:art: static-cast to avoid tpye error.
Drewniok Nov 19, 2024
5f83b49
🎨 Incorporated pre-commit fixes
pre-commit-ci[bot] Nov 19, 2024
aecc06a
:memo: Update pyfiction docstrings
actions-user Nov 19, 2024
fd13dbe
:art: small fix.
Drewniok Nov 21, 2024
e03f175
:memo: small fix.
Drewniok Nov 21, 2024
c4291eb
:white_check_mark: small fix.
Drewniok Nov 22, 2024
ca59bba
🎨 Incorporated pre-commit fixes
pre-commit-ci[bot] Nov 22, 2024
b90070b
:memo: small fix.
Drewniok Nov 22, 2024
53f1371
:memo: revert changes in the workflow.
Drewniok Nov 22, 2024
4e7c38f
:memo: try to fix docu.
Drewniok Nov 22, 2024
941e9ae
🎨 Incorporated pre-commit fixes
pre-commit-ci[bot] Nov 22, 2024
6ed5eec
Merge branch 'main' into defect_operational_domain_algorithm
Drewniok Nov 28, 2024
f7e9ed0
🎨 Incorporated pre-commit fixes
pre-commit-ci[bot] Nov 28, 2024
e429443
:fire: remove python bindings for the moment due to doc issue.
Drewniok Nov 28, 2024
d176140
Merge remote-tracking branch 'origin/defect_operational_domain_algori…
Drewniok Nov 28, 2024
4a2388e
:fire: remove python bindings for the moment due to doc issue.
Drewniok Nov 28, 2024
d8351cf
:art: small fix.
Drewniok Nov 28, 2024
35a6266
🎨 Incorporated pre-commit fixes
pre-commit-ci[bot] Nov 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,6 @@ venv/
*.tar.*
*.7z
*.rar

# Jupyter notebook
*.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,7 @@ inline void design_sidb_gates(pybind11::module& m)
.def_readwrite("operational_params",
&fiction::design_sidb_gates_params<fiction::offset::ucoord_t>::operational_params,
DOC(fiction_design_sidb_gates_params_operational_params))
.def_readwrite("design_mode", &fiction::design_sidb_gates_params<fiction::offset::ucoord_t>::design_mode,
DOC(fiction_design_sidb_gates_params_design_mode))
.def_readwrite("design_mode", &fiction::design_sidb_gates_params<fiction::offset::ucoord_t>::design_mode)
.def_readwrite("canvas", &fiction::design_sidb_gates_params<fiction::offset::ucoord_t>::canvas,
DOC(fiction_design_sidb_gates_params_canvas))
.def_readwrite("number_of_sidbs",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,36 @@
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>

#include <string>

namespace pyfiction
{

namespace detail
{

template <typename Lyt>
void assess_physical_population_stability(pybind11::module& m)
void assess_physical_population_stability(pybind11::module& m, const std::string& lattice = "")
{
namespace py = pybind11;
namespace py = pybind11;

m.def("assess_physical_population_stability", &fiction::assess_physical_population_stability<Lyt>, py::arg("lyt"),
py::class_<fiction::population_stability_information<Lyt>>(
m, fmt::format("population_stability_information{}", lattice).c_str(),
DOC(fiction_population_stability_information))
.def(py::init<>())
.def_readwrite("critical_cell", &fiction::population_stability_information<Lyt>::critical_cell,
DOC(fiction_population_stability_information_critical_cell))
.def_readwrite("transition_from_to_with_cell_and_required_pot",
&fiction::population_stability_information<Lyt>::transition_from_to_with_cell_and_required_pot,
DOC(fiction_population_stability_information_transition_from_to_with_cell_and_required_pot))
.def_readwrite("distance_corresponding_to_potential",
&fiction::population_stability_information<Lyt>::distance_corresponding_to_potential,
DOC(fiction_population_stability_information_distance_corresponding_to_potential))
.def_readwrite("system_energy", &fiction::population_stability_information<Lyt>::system_energy,
DOC(fiction_population_stability_information_system_energy));

m.def(fmt::format("assess_physical_population_stability{}", lattice).c_str(),
&fiction::assess_physical_population_stability<Lyt>, py::arg("lyt"),
py::arg("params") = fiction::assess_physical_population_stability_params{},
DOC(fiction_assess_physical_population_stability));
}
Expand All @@ -46,27 +63,6 @@ inline void assess_physical_population_stability(pybind11::module& m)
.value("POSITIVE_TO_NEUTRAL", fiction::transition_type::POSITIVE_TO_NEUTRAL,
DOC(fiction_transition_type_POSITIVE_TO_NEUTRAL));

py::class_<fiction::population_stability_information<fiction::offset::ucoord_t>>(
m, "population_stability_information", DOC(fiction_population_stability_information))
.def(py::init<>())
.def_readwrite("critical_cell",
&fiction::population_stability_information<fiction::offset::ucoord_t>::critical_cell,
DOC(fiction_population_stability_information_critical_cell))
.def_readwrite("transition_from_to",
&fiction::population_stability_information<fiction::offset::ucoord_t>::transition_from_to,
DOC(fiction_population_stability_information_transition_from_to))
.def_readwrite("minimum_potential_difference_to_transition",
&fiction::population_stability_information<
fiction::offset::ucoord_t>::minimum_potential_difference_to_transition,
DOC(fiction_population_stability_information_minimum_potential_difference_to_transition))
.def_readwrite(
"distance_corresponding_to_potential",
&fiction::population_stability_information<fiction::offset::ucoord_t>::distance_corresponding_to_potential,
DOC(fiction_population_stability_information_distance_corresponding_to_potential))
.def_readwrite("system_energy",
&fiction::population_stability_information<fiction::offset::ucoord_t>::system_energy,
DOC(fiction_population_stability_information_system_energy));

/**
* Parameters.
*/
Expand All @@ -83,8 +79,8 @@ inline void assess_physical_population_stability(pybind11::module& m)

// NOTE be careful with the order of the following calls! Python will resolve the first matching overload!

detail::assess_physical_population_stability<py_sidb_100_lattice>(m);
detail::assess_physical_population_stability<py_sidb_111_lattice>(m);
detail::assess_physical_population_stability<py_sidb_100_lattice>(m, "_100");
detail::assess_physical_population_stability<py_sidb_111_lattice>(m, "_111");
}

} // namespace pyfiction
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>

#include <cstdint>

namespace pyfiction
{

Expand All @@ -26,19 +28,17 @@ void determine_physically_valid_parameters(pybind11::module& m)
namespace py = pybind11;

m.def("determine_physically_valid_parameters", &fiction::determine_physically_valid_parameters<Lyt>, py::arg("cds"),
py::arg("params") = fiction::operational_domain_params{});
py::arg("params") = fiction::operational_domain_params{}, DOC(fiction_determine_physically_valid_parameters));
}

} // namespace detail

inline void determine_physically_valid_parameters(pybind11::module& m)
{
namespace py = pybind11;
namespace py = pybind11;

py::class_<fiction::operational_domain<fiction::parameter_point, uint64_t>>(m, "physically_valid_parameters_domain",
DOC(fiction_operational_domain))
// todo add docu
.def(py::init<>())
.def_readwrite("dimensions", &fiction::operational_domain<fiction::parameter_point, uint64_t>::dimensions)

Expand All @@ -47,14 +47,16 @@ inline void determine_physically_valid_parameters(pybind11::module& m)
[](const fiction::operational_domain<fiction::parameter_point, uint64_t>& domain,
const fiction::parameter_point& pp)
{
try
{
return domain.get_value(pp);
}
catch (const std::out_of_range& e)
auto result = domain.get_value(pp);

// Check if the result has a value
if (result.has_value())
{
throw py::value_error(e.what());
return result.value();
}
// If no value is present, raise a Python ValueError
throw py::value_error(
"Invalid parameter point: no excited state number available for the provided parameter.");
},
py::arg("pp"));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>

#include <string>

namespace pyfiction
{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ template <typename LytBase, typename ClockedLyt>
void clocked_layout(pybind11::module& m, const std::string& topology)
{
namespace py = pybind11;
namespace py = pybind11;

/**
* Clocked Cartesian layout.
Expand Down
Loading
Loading