Skip to content

Commit f2867d1

Browse files
wlambooyactions-userpre-commit-ci[bot]Drewniok
authored
💥 Introducing ClusterComplete: Exact SiDB Logic Simulation with well over 50 DBs (cda-tum#390)
* 🐛 Python bindings for `SIDB_CHARGE_STATES_BASE_b` are now consistent with `b` * ✨ Added a global function for string to SiDB simulation engine * 📝 Added docstrings for the bindings for `ground_state_space_reporting` * 🎨 Used the new global name to simulation engine function where possible * 🔥 Removed resolved TODO * 📝 add docstrings for bound direction enum class members `LOWER` and `UPPER` * 🩹 Forgotten import * 🩹 Make sure tests pass also with the `DEBUG_SIDB_CLUSTER_HIERARCHY` flag set * 🐛 ClusterComplete did not call `charge_distribution_to_index` for returned charge distributions (test added) * ⚡ improve runtimes on tiny layouts by skipping the multithreading setup when not needed * 🐛 Revert validity checking logic to the original version that is consistent with SimAnneal * 🐛 `std::numeric_limits::epsilon` is too strict for double equality error when equating system energies * 📝 Added docstrings everywhere to Ground State Space * 📝 tiny change * 📝 forgotten `@return` * 📝 Added docstrings for the lower/upper bound identifiers * 📝 Added docstrings everywhere in the ClusterComplete code * 🎨 Moved the `ccsim` shortcut to `shortcuts.fs` * ✅ Change the tests that marked a difference between QE and CC to be consistent with ExGS results * ⚗️ Included ClusterComplete in the equivalence checking, and added parallelisation. * 🔀 Merged with main * 🎨 Reformat * 📝 Update pyfiction docstrings Signed-off-by: GitHub Actions <[email protected]> * 🎨 Incorporated pre-commit fixes * :bindings: double declaration of `exact_sidb_simulation_engine` * 🍎 Make mac CI happy * 🎨 Trying locally generated ClangTidy suggested * 📝 Trying to fix the link to ClusterComplete * 💚 Undo make copy constructor explicit (Clang-Tidy suggestion) * 🎨 Revert more insecure Clang-Tidy suggestions * 💚 Trying without ClusterComplete in `is_operational.cpp` * 🎨 Incorporated pre-commit fixes * 💚 Testing hanging Windows CI by commenting ClusterComplete calls from `time_to_solution.cpp` * 🎨 Incorporated pre-commit fixes * 📦 Use ALGLIB as submodule * 📦 add `.git` to the URL * 📦 add submodule folder to `libs` * Delete libs/alglib directory * 📦 Manage concurrent cmake builds: one downloads while the others wait * 📦 update submodule * 🚨 Write less type-safe code to make Clang-Tidy happy * 🚨 Write type-safe, but ugly code to make Clang-Tidy happy * 🚨 Fix unnecessary cast warning * 📦 Rolled back to ALGLIB 3.14 because the Windows compiler does not accept 4.03 * 📦 Rolled back to ALGLIB 3.14 because the Windows compiler does not accept 4.03 * 📦 Rolled back to ALGLIB 3.14 because the Windows compiler does not accept 4.03 * 📦 Make ALGLIB an optional dependency again and enable it on all CI builds * 🎨 Incorporated pre-commit fixes * 🩹 Fixing a small mess-up * 🎨 Some Clang-Tidy suggestions * 🎨 Incorporated pre-commit fixes * 🎨 Some Clang-Tidy suggestions * 📦 cmake rebuild now works when ALGLIB is already unpacked * 💚 Trying a `pywin32` update * 💚 Trying a `pywin32` update * 💚 Trying ALGLIB disabled for Windows pybindings * 💚 Trying to specify a directory for ALGLIB for windows pybindings * 🎨 Clang-Tidy suggestion: remove redundant `inline`s * 🎨 Clang-Tidy suggestion: remove initialiser * 🎨 Clang-Tidy suggestion: remove initialiser * 💚 Turn ALGLIB back on for the Windows pybindings * Revert "🎨 Clang-Tidy suggestion: remove initialiser" This reverts commit 2acb9c7. * 📦 Adding installation * 🎨 More Clang-Tidy suggestions * 📦 Set "/Ox" on Windows only for Release * 🎨 Missing import * :pencil1: typo * ⚡ Small Ground State Space optimisation that omits useless charge space checking passes * ⚗️ add clustercomplete to runtime experiment. * ⚗️ SAVE * ⚗️ attempt 1 * ⚗️ attempt 2 * ⚗️ attempt 2 * ⚗️ attempt 3 (beginning) * ⚗️ attempt 3 (beginning) * ⚗️ attempt 3 (mid) * ⚗️ attempt 3 (mid) * ⚗️ attempt 3 (weakened) [works!] * 🎨 improve clustering state usability * 🎨 alter potential bounds store interface to avoid confusion * ✅ contain test in the correct compilation guard branch * ⚗️ full multithreading setup: single core works (with debug prints) * ⚗️ full multithreading setup: single core works (without debug prints) * ⚗️ full multithreading: dual core works (with debug prints) * ⚗️ full multithreading: multi core almost works (without debug prints) * ⚡ full multithreading: multi core works (towards finalising) * 📝 Update pyfiction docstrings Signed-off-by: GitHub Actions <[email protected]> * ⚡ full multithreading: multi core works (towards finalising) * 📝 Update pyfiction docstrings Signed-off-by: GitHub Actions <[email protected]> * ⚡ full multithreading: multi core works (towards finalising) * ⚡ full multithreading: multi core works (towards finalising) * 📝 Update pyfiction docstrings Signed-off-by: GitHub Actions <[email protected]> * 🎨 Docstrings + code simplifications & stabilizations * 📝 Update pyfiction docstrings Signed-off-by: GitHub Actions <[email protected]> * 🔀 merged full-multithreading * 📝 missing docstring * 📝 Update pyfiction docstrings Signed-off-by: GitHub Actions <[email protected]> * 🔀 Merged with main * 🔀 Merged with main * 🎨 Incorporated pre-commit fixes * 📝 Update pyfiction docstrings Signed-off-by: GitHub Actions <[email protected]> * 🩹 accidental include * 🩹 unused import * 🎨 Clang Tidy suggestion (unused import) * 🎨 Use include guards * 🐍 made imports explicit * 🎨 Incorporated pre-commit fixes * 🐍 conform to new bindings code * 🎨 Incorporated pre-commit fixes * 🎨 Removed print statement to stdout * 🎨 Incorporated pre-commit fixes * 🎨 Missing import * 🩹 missing commas * 🎨 missing import * 🎨 merging artifact * 🎨 unused imports (Clang-Tidy suggestions) * 🎨 unused import (Clang-Tidy suggestions) * 🎨 unused import (Clang-Tidy suggestions) * 🎨 unused import (Clang-Tidy suggestions) * 🎨 reduce enum type width to `uint8_t` * 🎨 unused import (Clang-Tidy suggestions) * 🎨 Clang-Tidy suggestions * 🎨 Incorporated pre-commit fixes * :pencil1: typo * 🔀 merging artifact * 🎨 added `static_cast` * ✅ same UIDs for separate `sidb_cluster` instances are allowed for the single SiDB simulation special case * 🎨 Clang-Tidy suggestions * 📝 Update pyfiction docstrings Signed-off-by: GitHub Actions <[email protected]> * 💚 use tinyxml shared libs * 🎨 Clang-Tidy suggestions * ✅ `std::all_of` seems to be unstable * Revert "💚 use tinyxml shared libs" This reverts commit bab265d. * 💚 try linking tinyxml before ALGLIB * 🚨 trying to reduce compiler warnings * 💚 trying dashed arguments for ALGLIB * 🎨 Clang-Tidy suggestion * 🎨 Incorporated pre-commit fixes * 🎨 Incorporated pre-commit fixes * 🔀 merging artifact * 🎨 Incorporated pre-commit fixes * 🔀 merging artifact * 🔀 merging artifact * 💚 triggering docstring-generator * 💚 triggering docstring-generator * 📝 Update pyfiction docstrings Signed-off-by: GitHub Actions <[email protected]> * 🎨 missing import (Clang-Tidy suggestion) * 🎨 artifact from aliased command (removed long ago) * 🎨 added `assert` for when CC is selected as simulator but ALGLIB is not enabled * Revert "💚 trying dashed arguments for ALGLIB" This reverts commit 229585a. * 💚 reverting ALGLIB fix attempt * 💚 added wrong import earlier * ⬆️ adjusted minimum required CMake version * 🎨 `phmap::flat_hash_set` may fail when used with `std::set_union` * 🩹 Fixed small inconsistency with STL vs phmap containers * 💚 Only run determinism check in Release * 💚 Trying to reduce memory consumption on the CI * 💚 Trying to reduce memory consumption on the CI * ✅ Instead of disabling, in Debug builds the determinism check now runs 100 times * 🎨 Incorporated pre-commit fixes * 💚 Trying to reduce memory consumption on the CI * 🎨 Clang-Tidy suggestion * 🩹 Removed dangling `#endif` * 🎨 Incorporated pre-commit fixes * 🎨 removed ` // NDEBUG` * 💚 Undo adding global debug flags * 👷 Changed Ubuntu version for the C++20 runner to `ubuntu-latest` * 👷 Turned off experiment building for Ubuntu Debug builds * 👷 trying to reduce memory consumption * 👷 add experiments building back for ubuntu debug builds * 👷 Made the memory optimization accessible under -DFICTION_ENABLE_LIGHTWEIGHT_DEBUG_BUILDS` (default=`OFF`) * 👷 Implemented Marcel's feedback * 👷 Match for `*.Clang` instead of `Clang` * ⚡ Removed unnecessary mutex lock * 📝 Updated benchmarks * 📝 Updated benchmarks (with jemalloc) * 📝 outdated mention of removed `ccsim` alias * 📝 outdated identifier * 🎨 removed duplicate `using` statement * 🎨 Moved `ground_state_space_reporting` inside the params struct for consistency with *QuickExact* * 🦺 Switch `assert`s in `is_operational.hpp` to validate technical limitations only * 📝 Added the word `QuickSim` to "a heuristic simulation" * 🦺 Switch `assert`s in `critical_temperature.hpp` to validate technical limitations only * 🎨 make `physical_simulation_of_bdl_iterator` in `critical_temperature.hpp` consistent with `physical_simulation_of_layout` in `is_operational.hpp` * :pencil1: changed `base 3` to `base-3` where grammatically required * :pencil1: `simulation search space` to `the ...` * 📝 Fixed the stray `.. _abc-cmake:` * 📝 `linked to` -> `linked against` * 🎨 added `[[nodiscard]]` wherever possible in `ground_state_space.hpp` * 🎨 added `[[nodiscard]]` wherever possible in `clustercomplete.hpp` * 🎨 added `[[nodiscard]]` wherever possible in `sidb_cluster_hierarchy.hpp` and implemented some code inspections comments * 🔥 Removed `setup.py` * 🎨 Switched default template argument to `offset::ucoord_t` and removed unnecessary calls to `convert_layout_to_siqad_coordinates` * 🎨 Removed `[[nodiscard]]` in places where it should not be * 📝 Added missing `@return` docs * 🎨 Added brace initialisers to ALGLIB object instantiations * ✅ Added testing with the 111 lattice configuration * 📝 Added docstrings to type aliases * 🎨 removed `explicit` keyword where not needed * 📝 missing final `s` from `ground_state_space_results` * :pencil1: "debug" -> "Debug" * 🎨 Marcel's suggestions to the CC CLI * 🎨 Adapted other simulation CLI tools to have the same style * 📝 Added small docstrings where there was a space to fill * 🎨 Moved comment to the right place * 🔥 Removed duplicate type alias definition * 🔥 Removed template arguments that can be defaulted * 🏗️ Moved ALGLIB to the right place in `CMakeLists.txt`---no guarantees that the CI works! * 🎨 return a `std::string_view` for `sidb_simulation_engine_name` and cosmetic changes * ✅ Removed commented test case * 📝 Added a sentence about why shuffling is performed * :pencil1: Corrected a sentence * 📝 Split a multi-declaration into separate parts and added docstrings * 🎨 Incorporated pre-commit fixes * 📝 Update pyfiction docstrings Signed-off-by: GitHub Actions <[email protected]> * 🐍 Adjusted the type of `sidb_simulation_engine_name` in the bindings * 🎨 Unnecessary imports * Revert "🏗️ Moved ALGLIB to the right place in `CMakeLists.txt`---no guarantees that the CI works!" This reverts commit b2d93ce. * ♻️ Reorganised `libs/CMakeLists.txt` * 🔀 Fixed merging artifact * 📝 Update pyfiction docstrings Signed-off-by: GitHub Actions <[email protected]> * 🎨 Consistency fix w.r.t. single quote encapsulation of layout names --------- Signed-off-by: GitHub Actions <[email protected]> Signed-off-by: Willem Lambooy <[email protected]> Co-authored-by: GitHub Actions <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Drewniok <[email protected]>
1 parent ddbc2fa commit f2867d1

File tree

77 files changed

+10536
-716
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+10536
-716
lines changed

.github/workflows/clang-tidy-review.yml

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ jobs:
3535
-DFICTION_TEST=ON
3636
-DFICTION_BENCHMARK=OFF
3737
-DFICTION_EXPERIMENTS=ON
38+
-DFICTION_ALGLIB=ON
3839
-DMOCKTURTLE_EXAMPLES=OFF
3940
build_dir: build
4041
apt_packages: "libreadline-dev,libtbb-dev"

.github/workflows/codeql-analysis.yml

+1
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ jobs:
128128
-DFICTION_BENCHMARK=OFF
129129
-DFICTION_EXPERIMENTS=ON
130130
-DFICTION_Z3=ON
131+
-DFICTION_ALGLIB=ON
131132
-DFICTION_ENABLE_MUGEN=ON
132133
-DFICTION_PROGRESS_BARS=OFF
133134
-DFICTION_WARNINGS_AS_ERRORS=OFF

.github/workflows/coverage.yml

+1
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ jobs:
101101
-DFICTION_TEST=ON
102102
-DFICTION_BENCHMARK=OFF
103103
-DFICTION_Z3=ON
104+
-DFICTION_ALGLIB=ON
104105
-DFICTION_ENABLE_MUGEN=ON
105106
-DFICTION_PROGRESS_BARS=OFF
106107
-DFICTION_WARNINGS_AS_ERRORS=OFF

.github/workflows/macos.yml

+2
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ jobs:
113113
-DFICTION_BENCHMARK=OFF
114114
-DFICTION_EXPERIMENTS=ON
115115
-DFICTION_Z3=ON
116+
-DFICTION_ALGLIB=ON
116117
-DFICTION_PROGRESS_BARS=OFF
117118
-DFICTION_WARNINGS_AS_ERRORS=OFF
118119
-DMOCKTURTLE_EXAMPLES=OFF
@@ -142,6 +143,7 @@ jobs:
142143
-DFICTION_BENCHMARK=OFF
143144
-DFICTION_EXPERIMENTS=ON
144145
-DFICTION_Z3=ON
146+
-DFICTION_ALGLIB=ON
145147
-DFICTION_PROGRESS_BARS=OFF
146148
-DFICTION_WARNINGS_AS_ERRORS=OFF
147149
-DMOCKTURTLE_EXAMPLES=OFF

.github/workflows/pyfiction-docstring-generator.yml

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ jobs:
3939
-m pybind11_mkdoc
4040
-o ${{ github.workspace }}/bindings/mnt/pyfiction/include/pyfiction/pybind11_mkdoc_docstrings.hpp
4141
-D FICTION_Z3_SOLVER
42+
-D FICTION_ALGLIB_ENABLED
4243
`find ${{ github.workspace }}/include/fiction -name "*.hpp" -print`
4344
4445
- name: Upload docstrings as an artifact

.github/workflows/ubuntu.yml

+3
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,12 @@ jobs:
134134
-DFICTION_BENCHMARK=OFF
135135
-DFICTION_EXPERIMENTS=ON
136136
${{ matrix.os != 'ubuntu-24.04-arm' && '-DFICTION_Z3=ON' || '' }}
137+
-DFICTION_ALGLIB=ON
137138
-DFICTION_ENABLE_MUGEN=ON
138139
-DFICTION_PROGRESS_BARS=OFF
139140
-DFICTION_WARNINGS_AS_ERRORS=OFF
140141
-DMOCKTURTLE_EXAMPLES=OFF
142+
-DFICTION_LIGHTWEIGHT_DEBUG_BUILDS=ON
141143
142144
- name: Build (Debug)
143145
working-directory: ${{github.workspace}}/build_debug
@@ -165,6 +167,7 @@ jobs:
165167
-DFICTION_BENCHMARK=OFF
166168
-DFICTION_EXPERIMENTS=ON
167169
${{ matrix.os != 'ubuntu-24.04-arm' && '-DFICTION_Z3=ON' || '' }}
170+
-DFICTION_ALGLIB=ON
168171
-DFICTION_ENABLE_MUGEN=ON
169172
-DFICTION_PROGRESS_BARS=OFF
170173
-DFICTION_WARNINGS_AS_ERRORS=OFF

.github/workflows/windows.yml

+2
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ jobs:
100100
-DFICTION_BENCHMARK=OFF
101101
-DFICTION_EXPERIMENTS=ON
102102
-DFICTION_Z3=ON
103+
-DFICTION_ALGLIB=ON
103104
-DFICTION_WARNINGS_AS_ERRORS=OFF
104105
-DMOCKTURTLE_EXAMPLES=OFF
105106
@@ -128,6 +129,7 @@ jobs:
128129
-DFICTION_BENCHMARK=OFF
129130
-DFICTION_EXPERIMENTS=ON
130131
-DFICTION_Z3=ON
132+
-DFICTION_ALGLIB=ON
131133
-DFICTION_WARNINGS_AS_ERRORS=OFF
132134
-DMOCKTURTLE_EXAMPLES=OFF
133135

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,6 @@
2020
path = libs/mockturtle
2121
url = https://github.com/marcelwa/mockturtle.git
2222
branch = mnt
23+
[submodule "libs/alglib-cmake"]
24+
path = libs/alglib-cmake
25+
url = https://github.com/wlambooy/alglib-cmake.git

.readthedocs.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ build:
1212
- cmake
1313
jobs:
1414
pre_build:
15-
- echo "Reinstall pyfiction with Z3 enabled"
16-
- z3="ON" python -m pip install --upgrade --upgrade-strategy eager --no-cache-dir .[docs]
15+
- echo "Reinstall pyfiction with Z3 and ALGLIB enabled"
16+
- z3="ON" alglib="ON" python -m pip install --upgrade --upgrade-strategy eager --no-cache-dir .[docs]
1717

1818
sphinx:
1919
configuration: docs/conf.py

Dockerfile

+1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ RUN . venv/bin/activate \
5353
-DFICTION_TEST=OFF \
5454
-DFICTION_EXPERIMENTS=OFF \
5555
-DFICTION_Z3=ON \
56+
-DFICTION_ALGLIB=ON \
5657
-DFICTION_ENABLE_MUGEN=OFF \
5758
-DFICTION_PROGRESS_BARS=ON \
5859
-DFICTION_WARNINGS_AS_ERRORS=OFF \

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ simulated using a physical model. Currently, the following simulation algorithms
227227

228228
- Silicon Dangling Bonds (SiDBs)
229229
- Electrostatic Ground State Simulation
230+
- [_ClusterComplete_](https://fiction.readthedocs.io/en/latest/algorithms/sidb_simulation.html#_CPPv4I0EN7fiction15clustercompleteE22sidb_simulation_resultI3LytERK3LytRK22clustercomplete_paramsI4cellI3LytEE)
230231
- [_QuickExact_](https://arxiv.org/abs/2308.04487)
231232
- [_QuickSim_](https://ieeexplore.ieee.org/document/10231266)
232233
- [Exhaustive _(ExGS)_](https://open.library.ubc.ca/soa/cIRcle/collections/ubctheses/24/items/1.0392909)

bindings/mnt/__init__.py

+10-7
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@
22
import sys
33
from pathlib import Path
44

5-
if sys.platform == "win32" and "Z3_ROOT" in os.environ:
6-
lib_path = Path(os.environ["Z3_ROOT"]) / "lib"
7-
if lib_path.exists():
8-
os.add_dll_directory(str(lib_path))
9-
bin_path = Path(os.environ["Z3_ROOT"]) / "bin"
10-
if bin_path.exists():
11-
os.add_dll_directory(str(bin_path))
5+
if sys.platform == "win32":
6+
if "Z3_ROOT" in os.environ:
7+
lib_path = Path(os.environ["Z3_ROOT"]) / "lib"
8+
if lib_path.exists():
9+
os.add_dll_directory(str(lib_path))
10+
bin_path = Path(os.environ["Z3_ROOT"]) / "bin"
11+
if bin_path.exists():
12+
os.add_dll_directory(str(bin_path))
13+
if "ALGLIB_DIR" in os.environ:
14+
os.add_dll_directory(str(os.environ["ALGLIB_DIR"]))

bindings/mnt/pyfiction/__init__.py

+20-7
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,16 @@
88
import sys
99
from pathlib import Path
1010

11-
if sys.platform == "win32" and "Z3_ROOT" in os.environ:
12-
lib_path = Path(os.environ["Z3_ROOT"]) / "lib"
13-
if lib_path.exists():
14-
os.add_dll_directory(str(lib_path))
15-
bin_path = Path(os.environ["Z3_ROOT"]) / "bin"
16-
if bin_path.exists():
17-
os.add_dll_directory(str(bin_path))
11+
if sys.platform == "win32":
12+
if "Z3_ROOT" in os.environ:
13+
lib_path = Path(os.environ["Z3_ROOT"]) / "lib"
14+
if lib_path.exists():
15+
os.add_dll_directory(str(lib_path))
16+
bin_path = Path(os.environ["Z3_ROOT"]) / "bin"
17+
if bin_path.exists():
18+
os.add_dll_directory(str(bin_path))
19+
if "ALGLIB_DIR" in os.environ:
20+
os.add_dll_directory(str(os.environ["ALGLIB_DIR"]))
1821

1922
from .pyfiction import ( # type: ignore[import-not-found]
2023
__compiled_date__,
@@ -64,6 +67,8 @@
6467
clocked_cartesian_layout,
6568
clocked_hexagonal_layout,
6669
clocked_shifted_cartesian_layout,
70+
clustercomplete,
71+
clustercomplete_params,
6772
color_mode,
6873
color_routing,
6974
color_routing_params,
@@ -155,8 +160,10 @@
155160
graph_oriented_layout_design,
156161
graph_oriented_layout_design_params,
157162
graph_oriented_layout_design_stats,
163+
ground_state_space_reporting,
158164
groundstate_from_simulation_result,
159165
has_high_degree_fanin_nodes,
166+
heuristic_sidb_simulation_engine,
160167
hexagonal_gate_layout,
161168
hexagonal_layout,
162169
hexagonal_obstruction_layout,
@@ -258,6 +265,7 @@
258265
sidb_nm_distance_111,
259266
sidb_nm_position,
260267
sidb_simulation_engine,
268+
sidb_simulation_engine_name,
261269
sidb_simulation_parameters,
262270
sidb_simulation_result_100,
263271
sidb_simulation_result_111,
@@ -366,6 +374,8 @@
366374
"clocked_cartesian_layout",
367375
"clocked_hexagonal_layout",
368376
"clocked_shifted_cartesian_layout",
377+
"clustercomplete",
378+
"clustercomplete_params",
369379
"color_mode",
370380
"color_routing",
371381
"color_routing_params",
@@ -457,8 +467,10 @@
457467
"graph_oriented_layout_design",
458468
"graph_oriented_layout_design_params",
459469
"graph_oriented_layout_design_stats",
470+
"ground_state_space_reporting",
460471
"groundstate_from_simulation_result",
461472
"has_high_degree_fanin_nodes",
473+
"heuristic_sidb_simulation_engine",
462474
"hexagonal_gate_layout",
463475
"hexagonal_layout",
464476
"hexagonal_obstruction_layout",
@@ -560,6 +572,7 @@
560572
"sidb_nm_distance_111",
561573
"sidb_nm_position",
562574
"sidb_simulation_engine",
575+
"sidb_simulation_engine_name",
563576
"sidb_simulation_parameters",
564577
"sidb_simulation_result_100",
565578
"sidb_simulation_result_111",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
//
2+
// Created by marcel on 21.11.23.
3+
//
4+
5+
#ifndef PYFICTION_CLUSTERCOMPLETE_HPP
6+
#define PYFICTION_CLUSTERCOMPLETE_HPP
7+
8+
#if (FICTION_ALGLIB_ENABLED)
9+
10+
#include "pyfiction/documentation.hpp"
11+
#include "pyfiction/types.hpp"
12+
13+
#include <fiction/algorithms/simulation/sidb/clustercomplete.hpp>
14+
#include <fiction/layouts/coordinates.hpp>
15+
16+
#include <pybind11/pybind11.h>
17+
#include <pybind11/stl.h>
18+
19+
namespace pyfiction
20+
{
21+
22+
namespace detail
23+
{
24+
25+
template <typename Lyt>
26+
void clustercomplete(pybind11::module& m)
27+
{
28+
namespace py = pybind11;
29+
30+
m.def("clustercomplete", &fiction::clustercomplete<Lyt>, py::arg("lyt"),
31+
py::arg("params") = fiction::clustercomplete_params<>{}, DOC(fiction_clustercomplete));
32+
}
33+
34+
} // namespace detail
35+
36+
inline void clustercomplete(pybind11::module& m)
37+
{
38+
namespace py = pybind11;
39+
40+
/**
41+
* Report *Ground State Space* stats.
42+
*/
43+
py::enum_<fiction::clustercomplete_params<>::ground_state_space_reporting>(
44+
m, "ground_state_space_reporting", DOC(fiction_clustercomplete_params_ground_state_space_reporting))
45+
.value("ON", fiction::clustercomplete_params<>::ground_state_space_reporting::ON,
46+
DOC(fiction_clustercomplete_params_ground_state_space_reporting_ON))
47+
.value("OFF", fiction::clustercomplete_params<>::ground_state_space_reporting::OFF,
48+
DOC(fiction_clustercomplete_params_ground_state_space_reporting_OFF));
49+
50+
/**
51+
* ClusterComplete parameters.
52+
*/
53+
py::class_<fiction::clustercomplete_params<>>(m, "clustercomplete_params", DOC(fiction_clustercomplete_params))
54+
.def(py::init<>())
55+
.def_readwrite("simulation_parameters", &fiction::clustercomplete_params<>::simulation_parameters,
56+
DOC(fiction_clustercomplete_params_simulation_parameters))
57+
.def_readwrite("local_external_potential", &fiction::clustercomplete_params<>::local_external_potential,
58+
DOC(fiction_clustercomplete_params_local_external_potential))
59+
.def_readwrite("global_potential", &fiction::clustercomplete_params<>::global_potential,
60+
DOC(fiction_clustercomplete_params_global_potential))
61+
.def_readwrite("validity_witness_partitioning_max_cluster_size_gss",
62+
&fiction::clustercomplete_params<>::validity_witness_partitioning_max_cluster_size_gss,
63+
DOC(fiction_clustercomplete_params_validity_witness_partitioning_max_cluster_size_gss))
64+
.def_readwrite("num_overlapping_witnesses_limit_gss",
65+
&fiction::clustercomplete_params<>::num_overlapping_witnesses_limit_gss,
66+
DOC(fiction_clustercomplete_params_num_overlapping_witnesses_limit_gss))
67+
.def_readwrite("available_threads", &fiction::clustercomplete_params<>::available_threads,
68+
DOC(fiction_clustercomplete_params_available_threads))
69+
.def_readwrite("report_gss_stats", &fiction::clustercomplete_params<>::report_gss_stats,
70+
DOC(fiction_clustercomplete_params_report_gss_stats));
71+
72+
// NOTE be careful with the order of the following calls! Python will resolve the first matching overload!
73+
74+
detail::clustercomplete<py_sidb_100_lattice>(m);
75+
detail::clustercomplete<py_sidb_111_lattice>(m);
76+
}
77+
78+
} // namespace pyfiction
79+
80+
#else // FICTION_ALGLIB_ENABLED
81+
82+
#include <pybind11/pybind11.h>
83+
84+
namespace pyfiction
85+
{
86+
87+
/**
88+
* Disable ClusterComplete.
89+
*/
90+
inline void clustercomplete([[maybe_unused]] pybind11::module& m) {}
91+
92+
} // namespace pyfiction
93+
94+
#endif // FICTION_ALGLIB_ENABLED
95+
96+
#endif // PYFICTION_CLUSTERCOMPLETE_HPP

bindings/mnt/pyfiction/include/pyfiction/algorithms/simulation/sidb/operational_domain.hpp

-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ void operational_domain(pybind11::module& m)
5050
inline void operational_domain(pybind11::module& m)
5151
{
5252
namespace py = pybind11;
53-
namespace py = pybind11;
5453

5554
py::class_<fiction::parameter_point>(m, "parameter_point", DOC(fiction_parameter_point))
5655
.def(py::init<>(), DOC(fiction_parameter_point_parameter_point))

bindings/mnt/pyfiction/include/pyfiction/algorithms/simulation/sidb/quickexact.hpp

+13-17
Original file line numberDiff line numberDiff line change
@@ -25,43 +25,39 @@ void quickexact(pybind11::module& m)
2525
{
2626
namespace py = pybind11;
2727

28-
m.def("quickexact", &fiction::quickexact<Lyt>, py::arg("lyt"),
29-
py::arg("params") = fiction::quickexact_params<fiction::offset::ucoord_t>{}, DOC(fiction_quickexact));
28+
m.def("quickexact", &fiction::quickexact<Lyt>, py::arg("lyt"), py::arg("params") = fiction::quickexact_params<>{},
29+
DOC(fiction_quickexact));
3030
}
3131

3232
} // namespace detail
3333

3434
inline void quickexact(pybind11::module& m)
3535
{
36-
// NOTE be careful with the order of the following calls! Python will resolve the first matching overload!
37-
namespace py = pybind11;
3836
namespace py = pybind11;
3937

40-
py::enum_<typename fiction::quickexact_params<fiction::offset::ucoord_t>::automatic_base_number_detection>(
38+
py::enum_<fiction::quickexact_params<>::automatic_base_number_detection>(
4139
m, "automatic_base_number_detection", DOC(fiction_quickexact_params_automatic_base_number_detection))
42-
.value("ON", fiction::quickexact_params<fiction::offset::ucoord_t>::automatic_base_number_detection::ON,
40+
.value("ON", fiction::quickexact_params<>::automatic_base_number_detection::ON,
4341
DOC(fiction_quickexact_params_automatic_base_number_detection_ON))
44-
.value("OFF", fiction::quickexact_params<fiction::offset::ucoord_t>::automatic_base_number_detection::OFF,
42+
.value("OFF", fiction::quickexact_params<>::automatic_base_number_detection::OFF,
4543
DOC(fiction_quickexact_params_automatic_base_number_detection_OFF));
4644

4745
/**
4846
* QuickExact parameters.
4947
*/
50-
py::class_<fiction::quickexact_params<fiction::offset::ucoord_t>>(m, "quickexact_params",
51-
DOC(fiction_quickexact_params))
48+
py::class_<fiction::quickexact_params<>>(m, "quickexact_params", DOC(fiction_quickexact_params))
5249
.def(py::init<>())
53-
.def_readwrite("simulation_parameters",
54-
&fiction::quickexact_params<fiction::offset::ucoord_t>::simulation_parameters,
55-
DOC(fiction_quickexact_params))
56-
.def_readwrite("base_number_detection",
57-
&fiction::quickexact_params<fiction::offset::ucoord_t>::base_number_detection,
50+
.def_readwrite("simulation_parameters", &fiction::quickexact_params<>::simulation_parameters,
51+
DOC(fiction_quickexact_params_simulation_parameters))
52+
.def_readwrite("base_number_detection", &fiction::quickexact_params<>::base_number_detection,
5853
DOC(fiction_quickexact_params_base_number_detection))
59-
.def_readwrite("local_external_potential",
60-
&fiction::quickexact_params<fiction::offset::ucoord_t>::local_external_potential,
54+
.def_readwrite("local_external_potential", &fiction::quickexact_params<>::local_external_potential,
6155
DOC(fiction_quickexact_params_local_external_potential))
62-
.def_readwrite("global_potential", &fiction::quickexact_params<fiction::offset::ucoord_t>::global_potential,
56+
.def_readwrite("global_potential", &fiction::quickexact_params<>::global_potential,
6357
DOC(fiction_quickexact_params_global_potential));
6458

59+
// NOTE be careful with the order of the following calls! Python will resolve the first matching overload!
60+
6561
detail::quickexact<py_sidb_100_lattice>(m);
6662
detail::quickexact<py_sidb_111_lattice>(m);
6763
}

0 commit comments

Comments
 (0)