diff --git a/bindings/mnt/pyfiction/__init__.py b/bindings/mnt/pyfiction/__init__.py index a88250508..bbb094a4a 100644 --- a/bindings/mnt/pyfiction/__init__.py +++ b/bindings/mnt/pyfiction/__init__.py @@ -23,7 +23,6 @@ __version__, a_star, a_star_distance, - ## path_finding a_star_params, all_standard_2_input_functions, all_standard_3_input_functions, @@ -31,10 +30,8 @@ and_or_not, and_or_not_maj, apply_bestagon_library, - ## physical_design apply_qca_one_library, apply_topolinano_library, - # Technology area, assess_physical_population_stability, assess_physical_population_stability_params, @@ -50,7 +47,6 @@ calculate_energy_and_state_type_with_kinks_rejected, can_positive_charges_occur, cartesian_gate_layout, - # Layouts cartesian_layout, cartesian_obstruction_layout, charge_configuration_to_string, @@ -71,7 +67,6 @@ color_routing_params, compute_operational_ratio, compute_operational_ratio_params, - convert_layout_to_siqad_coordinates, convert_potential_to_distance, create_and3_tt, create_and_tt, @@ -99,15 +94,12 @@ create_xor3_tt, create_xor_and_tt, create_xor_tt, - ## properties critical_path_length_and_throughput, critical_temperature_gate_based, critical_temperature_non_gate_based, critical_temperature_params, critical_temperature_stats, - cube_area, cube_coordinate, - cube_volume, defect_extent, dependent_cell_mode, design_sidb_gates, @@ -147,14 +139,9 @@ extract_routing_objectives, fanout_substitution, fanout_substitution_params, - # Inout fgl_parsing_error, - ## verfication gate_level_drv_params, gate_level_drvs, - generate_multiple_random_sidb_layouts, - generate_random_sidb_layout, - generate_random_sidb_layout_params, get_name, gold_cost_objective, gold_effort_mode, @@ -167,11 +154,10 @@ hexagonal_layout, hexagonal_obstruction_layout, hexagonalization, + hexagonalization_stats, high_degree_fanin_exception, inml_layout, inml_technology, - # Algorithms - ## iter input_bdl_configuration, is_balanced, is_charged_defect_type, @@ -193,13 +179,10 @@ network_balancing, network_balancing_params, normalize_layout_coordinates, - # Utils num_adjacent_coordinates, occupation_probability_gate_based, occupation_probability_non_gate_based, - offset_area, offset_coordinate, - offset_volume, operational_condition, operational_domain, operational_domain_contour_tracing, @@ -219,7 +202,6 @@ physically_valid_parameters_domain, place, population_stability_information, - positive_charges, post_layout_optimization, post_layout_optimization_params, post_layout_optimization_stats, @@ -252,8 +234,7 @@ sidb_defect_type, sidb_lattice_mode, sidb_layout, - sidb_nm_distance_100, - sidb_nm_distance_111, + sidb_nm_distance, sidb_nm_position, sidb_simulation_engine, sidb_simulation_parameters, @@ -261,21 +242,16 @@ sidb_simulation_result_111, sidb_technology, sign_to_charge_state, - ### logic simulate, - siqad_area, siqad_coordinate, - siqad_volume, sqd_parsing_error, squared_euclidean_distance, - ## network_transformation substitution_strategy, sweep_parameter, technology_constraints, technology_mapping, technology_mapping_params, technology_mapping_stats, - # Networks technology_network, time_to_solution, time_to_solution_for_given_simulation_results, @@ -284,13 +260,12 @@ to_cube_coord, to_offset_coord, to_siqad_coord, - ## simulation - ### sidb transition_type, twoddwave_distance, undefined_cell_label_exception, unrecognized_cell_definition_exception, unsupported_character_exception, + volume, wiring_reduction, wiring_reduction_params, wiring_reduction_stats, @@ -323,7 +298,6 @@ "__version__", "a_star", "a_star_distance", - ## path_finding "a_star_params", "all_standard_2_input_functions", "all_standard_3_input_functions", @@ -331,10 +305,9 @@ "and_or_not", "and_or_not_maj", "apply_bestagon_library", - ## physical_design "apply_qca_one_library", "apply_topolinano_library", - # Technology + "area", "area", "assess_physical_population_stability", "assess_physical_population_stability_params", @@ -350,7 +323,6 @@ "calculate_energy_and_state_type_with_kinks_rejected", "can_positive_charges_occur", "cartesian_gate_layout", - # Layouts "cartesian_layout", "cartesian_obstruction_layout", "charge_configuration_to_string", @@ -371,7 +343,6 @@ "color_routing_params", "compute_operational_ratio", "compute_operational_ratio_params", - "convert_layout_to_siqad_coordinates", "convert_potential_to_distance", "create_and3_tt", "create_and_tt", @@ -399,15 +370,12 @@ "create_xor3_tt", "create_xor_and_tt", "create_xor_tt", - ## properties "critical_path_length_and_throughput", "critical_temperature_gate_based", "critical_temperature_non_gate_based", "critical_temperature_params", "critical_temperature_stats", - "cube_area", "cube_coordinate", - "cube_volume", "defect_extent", "dependent_cell_mode", "design_sidb_gates", @@ -447,14 +415,9 @@ "extract_routing_objectives", "fanout_substitution", "fanout_substitution_params", - # Inout "fgl_parsing_error", - ## verfication "gate_level_drv_params", "gate_level_drvs", - "generate_multiple_random_sidb_layouts", - "generate_random_sidb_layout", - "generate_random_sidb_layout_params", "get_name", "gold_cost_objective", "gold_effort_mode", @@ -467,11 +430,10 @@ "hexagonal_layout", "hexagonal_obstruction_layout", "hexagonalization", + "hexagonalization_stats", "high_degree_fanin_exception", "inml_layout", "inml_technology", - # Algorithms - ## iter "input_bdl_configuration", "is_balanced", "is_charged_defect_type", @@ -493,13 +455,10 @@ "network_balancing", "network_balancing_params", "normalize_layout_coordinates", - # Utils "num_adjacent_coordinates", "occupation_probability_gate_based", "occupation_probability_non_gate_based", - "offset_area", "offset_coordinate", - "offset_volume", "operational_condition", "operational_domain", "operational_domain_contour_tracing", @@ -519,7 +478,6 @@ "physically_valid_parameters_domain", "place", "population_stability_information", - "positive_charges", "post_layout_optimization", "post_layout_optimization_params", "post_layout_optimization_stats", @@ -552,8 +510,7 @@ "sidb_defect_type", "sidb_lattice_mode", "sidb_layout", - "sidb_nm_distance_100", - "sidb_nm_distance_111", + "sidb_nm_distance", "sidb_nm_position", "sidb_simulation_engine", "sidb_simulation_parameters", @@ -561,21 +518,16 @@ "sidb_simulation_result_111", "sidb_technology", "sign_to_charge_state", - ### logic "simulate", - "siqad_area", "siqad_coordinate", - "siqad_volume", "sqd_parsing_error", "squared_euclidean_distance", - ## network_transformation "substitution_strategy", "sweep_parameter", "technology_constraints", "technology_mapping", "technology_mapping_params", "technology_mapping_stats", - # Networks "technology_network", "time_to_solution", "time_to_solution_for_given_simulation_results", @@ -584,13 +536,12 @@ "to_cube_coord", "to_offset_coord", "to_siqad_coord", - ## simulation - ### sidb "transition_type", "twoddwave_distance", "undefined_cell_label_exception", "unrecognized_cell_definition_exception", "unsupported_character_exception", + "volume", "wiring_reduction", "wiring_reduction_params", "wiring_reduction_stats", diff --git a/bindings/mnt/pyfiction/include/pyfiction/algorithms/iter/bdl_input_iterator.hpp b/bindings/mnt/pyfiction/include/pyfiction/algorithms/iter/bdl_input_iterator.hpp index f6793eb22..2f5888d69 100644 --- a/bindings/mnt/pyfiction/include/pyfiction/algorithms/iter/bdl_input_iterator.hpp +++ b/bindings/mnt/pyfiction/include/pyfiction/algorithms/iter/bdl_input_iterator.hpp @@ -48,10 +48,29 @@ void bdl_input_iterator(pybind11::module& m, const std::string& lattice) }, DOC(fiction_bdl_input_iterator_operator_mul)) .def( - "__eq__", [](const fiction::bdl_input_iterator& self, const uint64_t n) -> bool { return self == n; }, + "__eq__", + [](const fiction::bdl_input_iterator& self, const py::object& other) -> bool + { + if (!py::isinstance(other)) + { + return false; + } + + return self == other.cast(); + }, + py::arg("m"), DOC(fiction_bdl_input_iterator_operator_eq)) .def( - "__ne__", [](const fiction::bdl_input_iterator& self, const uint64_t n) -> bool { return self != n; }, + "__ne__", + [](const fiction::bdl_input_iterator& self, const py::object& other) -> bool + { + if (!py::isinstance(other)) + { + return false; + } + + return self != other.cast(); + }, py::arg("m"), DOC(fiction_bdl_input_iterator_operator_ne)) .def( "__lt__", [](const fiction::bdl_input_iterator& self, const uint64_t n) -> bool { return self < n; }, diff --git a/bindings/mnt/pyfiction/include/pyfiction/algorithms/network_transformation/technology_mapping.hpp b/bindings/mnt/pyfiction/include/pyfiction/algorithms/network_transformation/technology_mapping.hpp index f5a78d634..143264d16 100644 --- a/bindings/mnt/pyfiction/include/pyfiction/algorithms/network_transformation/technology_mapping.hpp +++ b/bindings/mnt/pyfiction/include/pyfiction/algorithms/network_transformation/technology_mapping.hpp @@ -73,9 +73,7 @@ inline void technology_mapping(pybind11::module& m) py::class_(m, "technology_mapping_stats", DOC(fiction_technology_mapping_stats)) .def(py::init<>()) .def("__repr__", [](const fiction::technology_mapping_stats& stats) { return stats.report(); }) - .def("report", &fiction::technology_mapping_stats::report, DOC(fiction_technology_mapping_stats_report)) - .def_readonly("mapper_stats", &fiction::technology_mapping_stats::mapper_stats, - DOC(fiction_technology_mapping_stats_mapper_stats)); + .def("report", &fiction::technology_mapping_stats::report, DOC(fiction_technology_mapping_stats_report)); m.def("and_or_not", &fiction::and_or_not, DOC(fiction_and_or_not)); diff --git a/bindings/mnt/pyfiction/include/pyfiction/algorithms/path_finding/k_shortest_paths.hpp b/bindings/mnt/pyfiction/include/pyfiction/algorithms/path_finding/k_shortest_paths.hpp index 1e574bbfa..0052a4b04 100644 --- a/bindings/mnt/pyfiction/include/pyfiction/algorithms/path_finding/k_shortest_paths.hpp +++ b/bindings/mnt/pyfiction/include/pyfiction/algorithms/path_finding/k_shortest_paths.hpp @@ -60,7 +60,7 @@ inline void yen_k_shortest_paths(pybind11::module& m) py::class_(m, "yen_k_shortest_paths_params", DOC(fiction_yen_k_shortest_paths_params)) .def(py::init<>()) - .def_readwrite("a_star_params", &fiction::yen_k_shortest_paths_params::astar_params, + .def_readwrite("astar_params", &fiction::yen_k_shortest_paths_params::astar_params, DOC(fiction_yen_k_shortest_paths_params_astar_params)) ; diff --git a/bindings/mnt/pyfiction/include/pyfiction/algorithms/physical_design/exact.hpp b/bindings/mnt/pyfiction/include/pyfiction/algorithms/physical_design/exact.hpp index 28ff8f24d..1c38ce76d 100644 --- a/bindings/mnt/pyfiction/include/pyfiction/algorithms/physical_design/exact.hpp +++ b/bindings/mnt/pyfiction/include/pyfiction/algorithms/physical_design/exact.hpp @@ -13,7 +13,6 @@ #include #include -#include #include @@ -26,7 +25,6 @@ namespace pyfiction inline void exact(pybind11::module& m) { namespace py = pybind11; - namespace py = pybind11; py::enum_(m, "technology_constraints", DOC(fiction_technology_constraints)) .value("NONE", fiction::technology_constraints::NONE, DOC(fiction_technology_constraints_NONE)) @@ -39,6 +37,8 @@ inline void exact(pybind11::module& m) .def(py::init<>()) .def_readwrite("scheme", &fiction::exact_physical_design_params::scheme, DOC(fiction_exact_physical_design_params_scheme)) + .def_readwrite("upper_bound_area", &fiction::exact_physical_design_params::upper_bound_area, + DOC(fiction_exact_physical_design_params_upper_bound_area)) .def_readwrite("upper_bound_x", &fiction::exact_physical_design_params::upper_bound_x, DOC(fiction_exact_physical_design_params_upper_bound_x)) .def_readwrite("upper_bound_y", &fiction::exact_physical_design_params::upper_bound_y, diff --git a/bindings/mnt/pyfiction/include/pyfiction/algorithms/physical_design/graph_oriented_layout_design.hpp b/bindings/mnt/pyfiction/include/pyfiction/algorithms/physical_design/graph_oriented_layout_design.hpp index ceca6f703..3a7e4a50d 100644 --- a/bindings/mnt/pyfiction/include/pyfiction/algorithms/physical_design/graph_oriented_layout_design.hpp +++ b/bindings/mnt/pyfiction/include/pyfiction/algorithms/physical_design/graph_oriented_layout_design.hpp @@ -25,7 +25,6 @@ namespace pyfiction inline void graph_oriented_layout_design(pybind11::module& m) { namespace py = pybind11; - namespace py = pybind11; py::enum_( m, "gold_effort_mode", DOC(fiction_graph_oriented_layout_design_params_effort_mode)) diff --git a/bindings/mnt/pyfiction/include/pyfiction/algorithms/physical_design/hexagonalization.hpp b/bindings/mnt/pyfiction/include/pyfiction/algorithms/physical_design/hexagonalization.hpp index 5d7080648..277cee9d9 100644 --- a/bindings/mnt/pyfiction/include/pyfiction/algorithms/physical_design/hexagonalization.hpp +++ b/bindings/mnt/pyfiction/include/pyfiction/algorithms/physical_design/hexagonalization.hpp @@ -12,28 +12,29 @@ #include -namespace pyfiction -{ +#include -namespace detail +namespace pyfiction { -template -void hexagonalization(pybind11::module& m) +inline void hexagonalization(pybind11::module& m) { namespace py = pybind11; - m.def( - "hexagonalization", [](const Lyt& lyt) -> py_hexagonal_gate_layout - { return fiction::hexagonalization(lyt); }, py::arg("layout"), - DOC(fiction_hexagonalization)); -} - -} // namespace detail - -inline void hexagonalization(pybind11::module& m) -{ - detail::hexagonalization(m); + py::class_(m, "hexagonalization_stats", DOC(fiction_hexagonalization_stats)) + .def(py::init<>()) + .def("__repr__", + [](const fiction::hexagonalization_stats& stats) + { + std::stringstream stream{}; + stats.report(stream); + return stream.str(); + }) + .def_readonly("time_total", &fiction::hexagonalization_stats::time_total, + DOC(fiction_hexagonalization_stats_duration)); + + m.def("hexagonalization", &fiction::hexagonalization, + py::arg("layout"), py::arg("statistics") = nullptr, DOC(fiction_hexagonalization)); } } // namespace pyfiction diff --git a/bindings/mnt/pyfiction/include/pyfiction/algorithms/physical_design/orthogonal.hpp b/bindings/mnt/pyfiction/include/pyfiction/algorithms/physical_design/orthogonal.hpp index 4fac19f3c..3892cd461 100644 --- a/bindings/mnt/pyfiction/include/pyfiction/algorithms/physical_design/orthogonal.hpp +++ b/bindings/mnt/pyfiction/include/pyfiction/algorithms/physical_design/orthogonal.hpp @@ -11,7 +11,6 @@ #include #include -#include #include @@ -24,7 +23,6 @@ namespace pyfiction inline void orthogonal(pybind11::module& m) { namespace py = pybind11; - namespace py = pybind11; py::class_(m, "orthogonal_params", DOC(fiction_orthogonal_physical_design_params)) diff --git a/bindings/mnt/pyfiction/include/pyfiction/algorithms/physical_design/post_layout_optimization.hpp b/bindings/mnt/pyfiction/include/pyfiction/algorithms/physical_design/post_layout_optimization.hpp index fb892f852..fe52c30c0 100644 --- a/bindings/mnt/pyfiction/include/pyfiction/algorithms/physical_design/post_layout_optimization.hpp +++ b/bindings/mnt/pyfiction/include/pyfiction/algorithms/physical_design/post_layout_optimization.hpp @@ -21,7 +21,6 @@ namespace pyfiction inline void post_layout_optimization(pybind11::module& m) { namespace py = pybind11; - namespace py = pybind11; py::class_(m, "post_layout_optimization_params", DOC(fiction_post_layout_optimization_params)) diff --git a/bindings/mnt/pyfiction/include/pyfiction/algorithms/physical_design/wiring_reduction.hpp b/bindings/mnt/pyfiction/include/pyfiction/algorithms/physical_design/wiring_reduction.hpp index 3496a9184..fb2ab374e 100644 --- a/bindings/mnt/pyfiction/include/pyfiction/algorithms/physical_design/wiring_reduction.hpp +++ b/bindings/mnt/pyfiction/include/pyfiction/algorithms/physical_design/wiring_reduction.hpp @@ -21,7 +21,6 @@ namespace pyfiction inline void wiring_reduction(pybind11::module& m) { namespace py = pybind11; - namespace py = pybind11; py::class_(m, "wiring_reduction_params", DOC(fiction_wiring_reduction_params)) .def(py::init<>()) diff --git a/bindings/mnt/pyfiction/include/pyfiction/algorithms/simulation/logic_simulation.hpp b/bindings/mnt/pyfiction/include/pyfiction/algorithms/simulation/logic_simulation.hpp index a87f06735..08adfe0e6 100644 --- a/bindings/mnt/pyfiction/include/pyfiction/algorithms/simulation/logic_simulation.hpp +++ b/bindings/mnt/pyfiction/include/pyfiction/algorithms/simulation/logic_simulation.hpp @@ -5,7 +5,6 @@ #ifndef PYFICTION_LOGIC_SIMULATION_HPP #define PYFICTION_LOGIC_SIMULATION_HPP -#include "pyfiction/documentation.hpp" #include "pyfiction/types.hpp" #include @@ -16,6 +15,7 @@ #include #include +#include #include #include #include diff --git a/bindings/mnt/pyfiction/include/pyfiction/algorithms/simulation/sidb/assess_physical_population_stability.hpp b/bindings/mnt/pyfiction/include/pyfiction/algorithms/simulation/sidb/assess_physical_population_stability.hpp index 811a80010..3fd4e5376 100644 --- a/bindings/mnt/pyfiction/include/pyfiction/algorithms/simulation/sidb/assess_physical_population_stability.hpp +++ b/bindings/mnt/pyfiction/include/pyfiction/algorithms/simulation/sidb/assess_physical_population_stability.hpp @@ -23,7 +23,6 @@ template void assess_physical_population_stability(pybind11::module& m) { namespace py = pybind11; - namespace py = pybind11; m.def("assess_physical_population_stability", &fiction::assess_physical_population_stability, py::arg("lyt"), py::arg("params") = fiction::assess_physical_population_stability_params{}, diff --git a/bindings/mnt/pyfiction/include/pyfiction/algorithms/simulation/sidb/compute_operational_ratio.hpp b/bindings/mnt/pyfiction/include/pyfiction/algorithms/simulation/sidb/compute_operational_ratio.hpp index 7c32019e5..f5346149a 100644 --- a/bindings/mnt/pyfiction/include/pyfiction/algorithms/simulation/sidb/compute_operational_ratio.hpp +++ b/bindings/mnt/pyfiction/include/pyfiction/algorithms/simulation/sidb/compute_operational_ratio.hpp @@ -24,7 +24,6 @@ template void compute_operational_ratio(pybind11::module& m) { namespace py = pybind11; - namespace py = pybind11; m.def("compute_operational_ratio", &fiction::compute_operational_ratio, py::arg("lyt"), py::arg("spec"), py::arg("pp"), py::arg("params") = fiction::operational_domain_params{}, @@ -36,7 +35,6 @@ void compute_operational_ratio(pybind11::module& m) inline void compute_operational_ratio(pybind11::module& m) { namespace py = pybind11; - namespace py = pybind11; py::class_(m, "compute_operational_ratio_params", DOC(fiction_compute_operational_ratio_params)) diff --git a/bindings/mnt/pyfiction/include/pyfiction/algorithms/simulation/sidb/detect_bdl_pairs.hpp b/bindings/mnt/pyfiction/include/pyfiction/algorithms/simulation/sidb/detect_bdl_pairs.hpp index 960cb0cda..7880fc725 100644 --- a/bindings/mnt/pyfiction/include/pyfiction/algorithms/simulation/sidb/detect_bdl_pairs.hpp +++ b/bindings/mnt/pyfiction/include/pyfiction/algorithms/simulation/sidb/detect_bdl_pairs.hpp @@ -12,11 +12,10 @@ #include #include -#include #include #include -#include +#include namespace pyfiction { @@ -29,7 +28,7 @@ void detect_bdl_pairs(pybind11::module& m) { namespace py = pybind11; - m.def("detect_bdl_pairs", &fiction::detect_bdl_pairs, py::arg("lyt"), py::arg("type") = std::nullopt, + m.def("detect_bdl_pairs", &fiction::detect_bdl_pairs, py::arg("lyt"), py::arg("cell_type") = std::nullopt, py::arg("params") = fiction::detect_bdl_pairs_params{}, DOC(fiction_detect_bdl_pairs)); } @@ -38,7 +37,6 @@ void detect_bdl_pairs(pybind11::module& m) inline void detect_bdl_pairs(pybind11::module& m) { namespace py = pybind11; - namespace py = pybind11; py::class_>(m, "bdl_pair", DOC(fiction_bdl_pair)) .def(py::init<>(), DOC(fiction_bdl_pair_bdl_pair)) diff --git a/bindings/mnt/pyfiction/include/pyfiction/algorithms/simulation/sidb/detect_bdl_wires.hpp b/bindings/mnt/pyfiction/include/pyfiction/algorithms/simulation/sidb/detect_bdl_wires.hpp index 89848091f..9ae561533 100644 --- a/bindings/mnt/pyfiction/include/pyfiction/algorithms/simulation/sidb/detect_bdl_wires.hpp +++ b/bindings/mnt/pyfiction/include/pyfiction/algorithms/simulation/sidb/detect_bdl_wires.hpp @@ -24,7 +24,6 @@ template void detect_bdl_wires(pybind11::module& m, const std::string& lattice) { namespace py = pybind11; - namespace py = pybind11; using bdl_wire_t = fiction::bdl_wire; @@ -52,7 +51,6 @@ void detect_bdl_wires(pybind11::module& m, const std::string& lattice) inline void detect_bdl_wires(pybind11::module& m) { namespace py = pybind11; - namespace py = pybind11; // Enum for wire selection options py::enum_(m, "bdl_wire_selection", DOC(fiction_bdl_wire_selection)) diff --git a/bindings/mnt/pyfiction/include/pyfiction/algorithms/simulation/sidb/determine_physically_valid_parameters.hpp b/bindings/mnt/pyfiction/include/pyfiction/algorithms/simulation/sidb/determine_physically_valid_parameters.hpp index e06ac9a00..4615fba5b 100644 --- a/bindings/mnt/pyfiction/include/pyfiction/algorithms/simulation/sidb/determine_physically_valid_parameters.hpp +++ b/bindings/mnt/pyfiction/include/pyfiction/algorithms/simulation/sidb/determine_physically_valid_parameters.hpp @@ -14,12 +14,17 @@ #include #include +#include +#include + namespace pyfiction { namespace detail { +// TODO update docu + template void determine_physically_valid_parameters(pybind11::module& m) { @@ -34,14 +39,11 @@ void determine_physically_valid_parameters(pybind11::module& m) inline void determine_physically_valid_parameters(pybind11::module& m) { namespace py = pybind11; - namespace py = pybind11; - py::class_>(m, "physically_valid_parameters_domain", - DOC(fiction_operational_domain)) - // todo add docu + py::class_>( + m, "physically_valid_parameters_domain", DOC(fiction_determine_physically_valid_parameters)) .def(py::init<>()) .def_readwrite("dimensions", &fiction::operational_domain::dimensions) - .def( "get_excited_state_number_for_parameter", [](const fiction::operational_domain& domain, diff --git a/bindings/mnt/pyfiction/include/pyfiction/algorithms/simulation/sidb/displacement_robustness_domain.hpp b/bindings/mnt/pyfiction/include/pyfiction/algorithms/simulation/sidb/displacement_robustness_domain.hpp index 5f220ca78..34c05f7b0 100644 --- a/bindings/mnt/pyfiction/include/pyfiction/algorithms/simulation/sidb/displacement_robustness_domain.hpp +++ b/bindings/mnt/pyfiction/include/pyfiction/algorithms/simulation/sidb/displacement_robustness_domain.hpp @@ -25,16 +25,19 @@ void determine_displacement_robustness_domain(pybind11::module& m, const std::st { namespace py = pybind11; - namespace py = pybind11; py::class_>( - m, fmt::format("displacement_robustness_domain{}", lattice).c_str()) + m, fmt::format("displacement_robustness_domain_{}", lattice).c_str(), + DOC(fiction_displacement_robustness_domain)) .def(py::init<>()) - .def_readwrite("operational_values", &fiction::displacement_robustness_domain::operational_values); + .def_readwrite("operational_values", &fiction::displacement_robustness_domain::operational_values, + DOC(fiction_displacement_robustness_domain_operational_values)) + + ; - m.def(fmt::format("determine_displacement_robustness_domain{}", lattice).c_str(), + m.def(fmt::format("determine_displacement_robustness_domain_{}", lattice).c_str(), &fiction::determine_displacement_robustness_domain, py::arg("layout"), py::arg("spec"), - py::arg("params"), py::arg("stats") = nullptr); + py::arg("params"), py::arg("stats") = nullptr, DOC(fiction_determine_displacement_robustness_domain)); } } // namespace detail @@ -42,52 +45,76 @@ void determine_displacement_robustness_domain(pybind11::module& m, const std::st inline void determine_displacement_robustness_domain(pybind11::module& m) { namespace py = pybind11; - namespace py = pybind11; py::enum_::dimer_displacement_policy>( - m, "dimer_displacement_policy") + m, "dimer_displacement_policy", DOC(fiction_displacement_robustness_domain_params_dimer_displacement_policy)) .value("STAY_ON_ORIGINAL_DIMER", fiction::displacement_robustness_domain_params< - fiction::offset::ucoord_t>::dimer_displacement_policy::STAY_ON_ORIGINAL_DIMER) - .value("ALLOW_OTHER_DIMER", fiction::displacement_robustness_domain_params< - fiction::offset::ucoord_t>::dimer_displacement_policy::ALLOW_OTHER_DIMER); + fiction::offset::ucoord_t>::dimer_displacement_policy::STAY_ON_ORIGINAL_DIMER, + DOC(fiction_displacement_robustness_domain_params_dimer_displacement_policy_STAY_ON_ORIGINAL_DIMER)) + .value("ALLOW_OTHER_DIMER", + fiction::displacement_robustness_domain_params< + fiction::offset::ucoord_t>::dimer_displacement_policy::ALLOW_OTHER_DIMER, + DOC(fiction_displacement_robustness_domain_params_dimer_displacement_policy_ALLOW_OTHER_DIMER)) + + ; py::enum_::displacement_analysis_mode>( - m, "displacement_analysis_mode") - .value("EXHAUSTIVE", fiction::displacement_robustness_domain_params< - fiction::offset::ucoord_t>::displacement_analysis_mode::EXHAUSTIVE) - .value("RANDOM", fiction::displacement_robustness_domain_params< - fiction::offset::ucoord_t>::displacement_analysis_mode::RANDOM); + m, "displacement_analysis_mode", DOC(fiction_displacement_robustness_domain_params_analysis_mode)) + .value("EXHAUSTIVE", + fiction::displacement_robustness_domain_params< + fiction::offset::ucoord_t>::displacement_analysis_mode::EXHAUSTIVE, + DOC(fiction_displacement_robustness_domain_params_displacement_analysis_mode_EXHAUSTIVE)) + .value("RANDOM", + fiction::displacement_robustness_domain_params< + fiction::offset::ucoord_t>::displacement_analysis_mode::RANDOM, + DOC(fiction_displacement_robustness_domain_params_displacement_analysis_mode_RANDOM)) + + ; py::class_>( - m, "displacement_robustness_domain_params") + m, "displacement_robustness_domain_params", DOC(fiction_displacement_robustness_domain_params)) .def(py::init<>()) .def_readwrite("analysis_mode", - &fiction::displacement_robustness_domain_params::analysis_mode) + &fiction::displacement_robustness_domain_params::analysis_mode, + DOC(fiction_displacement_robustness_domain_params_analysis_mode)) .def_readwrite("percentage_of_analyzed_displaced_layouts", &fiction::displacement_robustness_domain_params< - fiction::offset::ucoord_t>::percentage_of_analyzed_displaced_layouts) + fiction::offset::ucoord_t>::percentage_of_analyzed_displaced_layouts, + DOC(fiction_displacement_robustness_domain_params_percentage_of_analyzed_displaced_layouts)) .def_readwrite( "displacement_variations", - &fiction::displacement_robustness_domain_params::displacement_variations) + &fiction::displacement_robustness_domain_params::displacement_variations, + DOC(fiction_displacement_robustness_domain_params_displacement_variations)) .def_readwrite("operational_params", - &fiction::displacement_robustness_domain_params::operational_params) + &fiction::displacement_robustness_domain_params::operational_params, + DOC(fiction_displacement_robustness_domain_params_operational_params)) .def_readwrite("fixed_sidbs", - &fiction::displacement_robustness_domain_params::fixed_sidbs) + &fiction::displacement_robustness_domain_params::fixed_sidbs, + DOC(fiction_displacement_robustness_domain_params_fixed_sidbs)) .def_readwrite("dimer_policy", - &fiction::displacement_robustness_domain_params::dimer_policy); + &fiction::displacement_robustness_domain_params::dimer_policy, + DOC(fiction_displacement_robustness_domain_params_dimer_policy)) - py::class_(m, "displacement_robustness_domain_stats") + ; + + py::class_(m, "displacement_robustness_domain_stats", + DOC(fiction_displacement_robustness_domain_stats)) .def(py::init<>()) - .def_readwrite("time_total", &fiction::displacement_robustness_domain_stats::time_total) + .def_readwrite("time_total", &fiction::displacement_robustness_domain_stats::time_total, + DOC(fiction_displacement_robustness_domain_stats_duration)) .def_readwrite("num_operational_sidb_displacements", - &fiction::displacement_robustness_domain_stats::num_operational_sidb_displacements) + &fiction::displacement_robustness_domain_stats::num_operational_sidb_displacements, + DOC(fiction_displacement_robustness_domain_stats_num_operational_sidb_displacements)) .def_readwrite("num_non_operational_sidb_displacements", - &fiction::displacement_robustness_domain_stats::num_non_operational_sidb_displacements); + &fiction::displacement_robustness_domain_stats::num_non_operational_sidb_displacements, + DOC(fiction_displacement_robustness_domain_stats_num_non_operational_sidb_displacements)) + + ; // NOTE: be careful with the order of the following calls! Python will resolve the first matching overload! - detail::determine_displacement_robustness_domain(m, "_100"); - detail::determine_displacement_robustness_domain(m, "_111"); + detail::determine_displacement_robustness_domain(m, "100"); + detail::determine_displacement_robustness_domain(m, "111"); } } // namespace pyfiction diff --git a/bindings/mnt/pyfiction/include/pyfiction/algorithms/simulation/sidb/occupation_probability_of_excited_states.hpp b/bindings/mnt/pyfiction/include/pyfiction/algorithms/simulation/sidb/occupation_probability_of_excited_states.hpp index 26c61bbc9..93e657625 100644 --- a/bindings/mnt/pyfiction/include/pyfiction/algorithms/simulation/sidb/occupation_probability_of_excited_states.hpp +++ b/bindings/mnt/pyfiction/include/pyfiction/algorithms/simulation/sidb/occupation_probability_of_excited_states.hpp @@ -6,7 +6,6 @@ #define PYFICTION_OCCUPATION_PROBABILITY_OF_EXCITED_STATES_HPP #include "pyfiction/documentation.hpp" -#include "pyfiction/types.hpp" #include @@ -19,7 +18,7 @@ namespace pyfiction namespace detail { -void occupation_probability_of_excited_states(pybind11::module& m) +inline void occupation_probability_of_excited_states(pybind11::module& m) { namespace py = pybind11; diff --git a/bindings/mnt/pyfiction/include/pyfiction/algorithms/simulation/sidb/operational_domain.hpp b/bindings/mnt/pyfiction/include/pyfiction/algorithms/simulation/sidb/operational_domain.hpp index bcb416d19..93bcf9d54 100644 --- a/bindings/mnt/pyfiction/include/pyfiction/algorithms/simulation/sidb/operational_domain.hpp +++ b/bindings/mnt/pyfiction/include/pyfiction/algorithms/simulation/sidb/operational_domain.hpp @@ -50,7 +50,6 @@ void operational_domain(pybind11::module& m) inline void operational_domain(pybind11::module& m) { namespace py = pybind11; - namespace py = pybind11; py::class_(m, "parameter_point", DOC(fiction_parameter_point)) .def(py::init<>(), DOC(fiction_parameter_point_parameter_point)) @@ -92,8 +91,8 @@ inline void operational_domain(pybind11::module& m) py::class_(m, "operational_domain_value_range", DOC(fiction_operational_domain_value_range)) .def(py::init(), py::arg("dimension")) - .def(py::init(), py::arg("dimension"), py::arg("min"), - py::arg("max"), py::arg("step")) + .def(py::init(), py::arg("dimension"), py::arg("minimum"), + py::arg("maximum"), py::arg("step")) .def_readwrite("dimension", &fiction::operational_domain_value_range::dimension, DOC(fiction_operational_domain_value_range_dimension)) .def_readwrite("min", &fiction::operational_domain_value_range::min, diff --git a/bindings/mnt/pyfiction/include/pyfiction/algorithms/simulation/sidb/quickexact.hpp b/bindings/mnt/pyfiction/include/pyfiction/algorithms/simulation/sidb/quickexact.hpp index 25833c05c..f1a1b16cb 100644 --- a/bindings/mnt/pyfiction/include/pyfiction/algorithms/simulation/sidb/quickexact.hpp +++ b/bindings/mnt/pyfiction/include/pyfiction/algorithms/simulation/sidb/quickexact.hpp @@ -35,7 +35,6 @@ inline void quickexact(pybind11::module& m) { // NOTE be careful with the order of the following calls! Python will resolve the first matching overload! namespace py = pybind11; - namespace py = pybind11; py::enum_::automatic_base_number_detection>( m, "automatic_base_number_detection", DOC(fiction_quickexact_params_automatic_base_number_detection)) diff --git a/bindings/mnt/pyfiction/include/pyfiction/algorithms/simulation/sidb/random_sidb_layout_generator.hpp b/bindings/mnt/pyfiction/include/pyfiction/algorithms/simulation/sidb/random_sidb_layout_generator.hpp index 1a330627a..154f58f7a 100644 --- a/bindings/mnt/pyfiction/include/pyfiction/algorithms/simulation/sidb/random_sidb_layout_generator.hpp +++ b/bindings/mnt/pyfiction/include/pyfiction/algorithms/simulation/sidb/random_sidb_layout_generator.hpp @@ -41,7 +41,6 @@ void random_layout_generator(pybind11::module& m) inline void random_sidb_layout_generator(pybind11::module& m) { namespace py = pybind11; - namespace py = pybind11; py::enum_::positive_charges>( m, "positive_charges", DOC(fiction_generate_random_sidb_layout_params_positive_charges)) diff --git a/bindings/mnt/pyfiction/include/pyfiction/algorithms/simulation/sidb/sidb_simulation_parameters.hpp b/bindings/mnt/pyfiction/include/pyfiction/algorithms/simulation/sidb/sidb_simulation_parameters.hpp index 815b579e1..3e309b4d4 100644 --- a/bindings/mnt/pyfiction/include/pyfiction/algorithms/simulation/sidb/sidb_simulation_parameters.hpp +++ b/bindings/mnt/pyfiction/include/pyfiction/algorithms/simulation/sidb/sidb_simulation_parameters.hpp @@ -22,7 +22,6 @@ namespace pyfiction inline void sidb_simulation_parameters(pybind11::module& m) { namespace py = pybind11; - namespace py = pybind11; py::class_(m, "sidb_simulation_parameters", DOC(fiction_sidb_simulation_parameters)) diff --git a/bindings/mnt/pyfiction/include/pyfiction/algorithms/simulation/sidb/sidb_simulation_result.hpp b/bindings/mnt/pyfiction/include/pyfiction/algorithms/simulation/sidb/sidb_simulation_result.hpp index b5ed86ec3..bc6244afb 100644 --- a/bindings/mnt/pyfiction/include/pyfiction/algorithms/simulation/sidb/sidb_simulation_result.hpp +++ b/bindings/mnt/pyfiction/include/pyfiction/algorithms/simulation/sidb/sidb_simulation_result.hpp @@ -26,7 +26,6 @@ template void sidb_simulation_result(pybind11::module& m, const std::string& lattice = "") { namespace py = pybind11; - namespace py = pybind11; py::class_>(m, fmt::format("sidb_simulation_result{}", lattice).c_str(), DOC(fiction_sidb_simulation_result)) diff --git a/bindings/mnt/pyfiction/include/pyfiction/algorithms/simulation/sidb/time_to_solution.hpp b/bindings/mnt/pyfiction/include/pyfiction/algorithms/simulation/sidb/time_to_solution.hpp index e868dbaa6..e2bbb22f8 100644 --- a/bindings/mnt/pyfiction/include/pyfiction/algorithms/simulation/sidb/time_to_solution.hpp +++ b/bindings/mnt/pyfiction/include/pyfiction/algorithms/simulation/sidb/time_to_solution.hpp @@ -11,7 +11,8 @@ #include #include -#include + +#include namespace pyfiction { diff --git a/bindings/mnt/pyfiction/include/pyfiction/algorithms/verification/equivalence_checking.hpp b/bindings/mnt/pyfiction/include/pyfiction/algorithms/verification/equivalence_checking.hpp index ff47b47f1..044d71488 100644 --- a/bindings/mnt/pyfiction/include/pyfiction/algorithms/verification/equivalence_checking.hpp +++ b/bindings/mnt/pyfiction/include/pyfiction/algorithms/verification/equivalence_checking.hpp @@ -72,10 +72,6 @@ inline void equivalence_checking(pybind11::module& m) DOC(fiction_equivalence_checking_stats_counter_example)) .def_readonly("runtime", &fiction::equivalence_checking_stats::runtime, DOC(fiction_equivalence_checking_stats_duration)) - .def_readonly("spec_drv_stats", &fiction::equivalence_checking_stats::spec_drv_stats, - DOC(fiction_equivalence_checking_stats_spec_drv_stats)) - .def_readonly("impl_drv_stats", &fiction::equivalence_checking_stats::impl_drv_stats, - DOC(fiction_equivalence_checking_stats_impl_drv_stats)) ; diff --git a/bindings/mnt/pyfiction/include/pyfiction/inout/read_fgl_layout.hpp b/bindings/mnt/pyfiction/include/pyfiction/inout/read_fgl_layout.hpp index 65d445cca..1bb7dfb66 100644 --- a/bindings/mnt/pyfiction/include/pyfiction/inout/read_fgl_layout.hpp +++ b/bindings/mnt/pyfiction/include/pyfiction/inout/read_fgl_layout.hpp @@ -9,7 +9,6 @@ #include "pyfiction/types.hpp" #include -#include #include diff --git a/bindings/mnt/pyfiction/include/pyfiction/inout/write_fgl_layout.hpp b/bindings/mnt/pyfiction/include/pyfiction/inout/write_fgl_layout.hpp index 4ef815b69..dc681dfd9 100644 --- a/bindings/mnt/pyfiction/include/pyfiction/inout/write_fgl_layout.hpp +++ b/bindings/mnt/pyfiction/include/pyfiction/inout/write_fgl_layout.hpp @@ -9,7 +9,6 @@ #include "pyfiction/types.hpp" #include -#include #include diff --git a/bindings/mnt/pyfiction/include/pyfiction/inout/write_qca_layout.hpp b/bindings/mnt/pyfiction/include/pyfiction/inout/write_qca_layout.hpp index 296a7c84c..38403ea97 100644 --- a/bindings/mnt/pyfiction/include/pyfiction/inout/write_qca_layout.hpp +++ b/bindings/mnt/pyfiction/include/pyfiction/inout/write_qca_layout.hpp @@ -20,7 +20,6 @@ namespace pyfiction inline void write_qca_layout(pybind11::module& m) { namespace py = pybind11; - namespace py = pybind11; py::class_(m, "write_qca_layout_params", DOC(fiction_write_qca_layout_params)) .def(py::init<>()) diff --git a/bindings/mnt/pyfiction/include/pyfiction/inout/write_svg_layout.hpp b/bindings/mnt/pyfiction/include/pyfiction/inout/write_svg_layout.hpp index 6ba7888cc..f54f60b86 100644 --- a/bindings/mnt/pyfiction/include/pyfiction/inout/write_svg_layout.hpp +++ b/bindings/mnt/pyfiction/include/pyfiction/inout/write_svg_layout.hpp @@ -61,10 +61,9 @@ inline void write_qca_layout_svg_impl(pybind11::module& m) } // namespace detail -void write_svg_layout(pybind11::module& m) +inline void write_svg_layout(pybind11::module& m) { namespace py = pybind11; - namespace py = pybind11; py::enum_(m, "color_mode", DOC(fiction_write_sidb_layout_svg_params_color_mode)) diff --git a/bindings/mnt/pyfiction/include/pyfiction/layouts/cartesian_layout.hpp b/bindings/mnt/pyfiction/include/pyfiction/layouts/cartesian_layout.hpp index 0e9b9c1a4..61cd0573a 100644 --- a/bindings/mnt/pyfiction/include/pyfiction/layouts/cartesian_layout.hpp +++ b/bindings/mnt/pyfiction/include/pyfiction/layouts/cartesian_layout.hpp @@ -23,7 +23,6 @@ namespace pyfiction inline void cartesian_layout(pybind11::module& m) { namespace py = pybind11; - namespace py = pybind11; /** * Cartesian layout. diff --git a/bindings/mnt/pyfiction/include/pyfiction/layouts/cell_level_layout.hpp b/bindings/mnt/pyfiction/include/pyfiction/layouts/cell_level_layout.hpp index 7a3312459..39d136a82 100644 --- a/bindings/mnt/pyfiction/include/pyfiction/layouts/cell_level_layout.hpp +++ b/bindings/mnt/pyfiction/include/pyfiction/layouts/cell_level_layout.hpp @@ -32,7 +32,6 @@ template void fcn_technology_cell_level_layout(pybind11::module& m) { namespace py = pybind11; - namespace py = pybind11; // fetch technology name auto tech_name = std::string{fiction::tech_impl_name}; diff --git a/bindings/mnt/pyfiction/include/pyfiction/layouts/clocked_layout.hpp b/bindings/mnt/pyfiction/include/pyfiction/layouts/clocked_layout.hpp index 2486cf9cf..f1ef83dae 100644 --- a/bindings/mnt/pyfiction/include/pyfiction/layouts/clocked_layout.hpp +++ b/bindings/mnt/pyfiction/include/pyfiction/layouts/clocked_layout.hpp @@ -28,7 +28,6 @@ template void clocked_layout(pybind11::module& m, const std::string& topology) { namespace py = pybind11; - namespace py = pybind11; /** * Clocked Cartesian layout. diff --git a/bindings/mnt/pyfiction/include/pyfiction/layouts/coordinates.hpp b/bindings/mnt/pyfiction/include/pyfiction/layouts/coordinates.hpp index 360e9896b..b5c0ed70f 100644 --- a/bindings/mnt/pyfiction/include/pyfiction/layouts/coordinates.hpp +++ b/bindings/mnt/pyfiction/include/pyfiction/layouts/coordinates.hpp @@ -32,7 +32,6 @@ namespace pyfiction inline void offset_coordinate(pybind11::module& m) { namespace py = pybind11; - namespace py = pybind11; py::class_(m, "offset_coordinate", DOC(fiction_offset_ucoord_t)) .def(py::init<>(), DOC(fiction_offset_ucoord_t_ucoord_t)) @@ -93,7 +92,6 @@ inline void offset_coordinate(pybind11::module& m) inline void cube_coordinate(pybind11::module& m) { namespace py = pybind11; - namespace py = pybind11; py::class_(m, "cube_coordinate", DOC(fiction_cube_coord_t)) .def(py::init<>(), DOC(fiction_cube_coord_t_coord_t)) @@ -150,7 +148,6 @@ inline void cube_coordinate(pybind11::module& m) inline void siqad_coordinate(pybind11::module& m) { namespace py = pybind11; - namespace py = pybind11; py::class_(m, "siqad_coordinate", DOC(fiction_siqad_coord_t)) .def(py::init<>(), DOC(fiction_siqad_coord_t_coord_t)) @@ -208,13 +205,13 @@ inline void coordinate_utility(pybind11::module& m) { namespace py = pybind11; - m.def("offset_area", &fiction::area, py::arg("coord"), DOC(fiction_area)); - m.def("cube_area", &fiction::area, py::arg("coord"), DOC(fiction_area)); - m.def("siqad_area", &fiction::area, py::arg("coord"), DOC(fiction_area)); + m.def("area", &fiction::area, py::arg("coord"), DOC(fiction_area)); + m.def("area", &fiction::area, py::arg("coord"), DOC(fiction_area)); + m.def("area", &fiction::area, py::arg("coord"), DOC(fiction_area)); - m.def("offset_volume", &fiction::volume, py::arg("coord"), DOC(fiction_volume)); - m.def("cube_volume", &fiction::volume, py::arg("coord"), DOC(fiction_volume)); - m.def("siqad_volume", &fiction::volume, py::arg("coord"), DOC(fiction_volume)); + m.def("volume", &fiction::volume, py::arg("coord"), DOC(fiction_volume)); + m.def("volume", &fiction::volume, py::arg("coord"), DOC(fiction_volume)); + m.def("volume", &fiction::volume, py::arg("coord"), DOC(fiction_volume)); m.def("to_offset_coord", &fiction::siqad::to_fiction_coord, py::arg("coord"), DOC(fiction_siqad_to_fiction_coord)); diff --git a/bindings/mnt/pyfiction/include/pyfiction/layouts/gate_level_layout.hpp b/bindings/mnt/pyfiction/include/pyfiction/layouts/gate_level_layout.hpp index 2ee16d208..dda497234 100644 --- a/bindings/mnt/pyfiction/include/pyfiction/layouts/gate_level_layout.hpp +++ b/bindings/mnt/pyfiction/include/pyfiction/layouts/gate_level_layout.hpp @@ -29,7 +29,6 @@ template void gate_level_layout(pybind11::module& m, const std::string& topology) { namespace py = pybind11; - namespace py = pybind11; py::class_(m, fmt::format("{}_gate_layout", topology).c_str(), DOC(fiction_gate_level_layout)) .def(py::init<>()) diff --git a/bindings/mnt/pyfiction/include/pyfiction/layouts/hexagonal_layout.hpp b/bindings/mnt/pyfiction/include/pyfiction/layouts/hexagonal_layout.hpp index 2ca20d37b..d36e872f4 100644 --- a/bindings/mnt/pyfiction/include/pyfiction/layouts/hexagonal_layout.hpp +++ b/bindings/mnt/pyfiction/include/pyfiction/layouts/hexagonal_layout.hpp @@ -22,7 +22,6 @@ namespace pyfiction inline void hexagonal_layout(pybind11::module& m) { namespace py = pybind11; - namespace py = pybind11; /** * Hexagonal layout. diff --git a/bindings/mnt/pyfiction/include/pyfiction/layouts/obstruction_layout.hpp b/bindings/mnt/pyfiction/include/pyfiction/layouts/obstruction_layout.hpp index b846f1be6..c0e20b6f5 100644 --- a/bindings/mnt/pyfiction/include/pyfiction/layouts/obstruction_layout.hpp +++ b/bindings/mnt/pyfiction/include/pyfiction/layouts/obstruction_layout.hpp @@ -12,6 +12,8 @@ #include +#include + namespace pyfiction { @@ -22,7 +24,6 @@ template void obstruction_layout(pybind11::module& m, const std::string& topology) { namespace py = pybind11; - namespace py = pybind11; py::class_(m, fmt::format("{}_obstruction_layout", topology).c_str(), DOC(fiction_obstruction_layout)) diff --git a/bindings/mnt/pyfiction/include/pyfiction/layouts/shifted_cartesian_layout.hpp b/bindings/mnt/pyfiction/include/pyfiction/layouts/shifted_cartesian_layout.hpp index e8a19f237..f7d81beff 100644 --- a/bindings/mnt/pyfiction/include/pyfiction/layouts/shifted_cartesian_layout.hpp +++ b/bindings/mnt/pyfiction/include/pyfiction/layouts/shifted_cartesian_layout.hpp @@ -23,7 +23,6 @@ namespace pyfiction inline void shifted_cartesian_layout(pybind11::module& m) { namespace py = pybind11; - namespace py = pybind11; /** * Shifted Cartesian layout. diff --git a/bindings/mnt/pyfiction/include/pyfiction/networks/logic_networks.hpp b/bindings/mnt/pyfiction/include/pyfiction/networks/logic_networks.hpp index 65a100012..167a9314c 100644 --- a/bindings/mnt/pyfiction/include/pyfiction/networks/logic_networks.hpp +++ b/bindings/mnt/pyfiction/include/pyfiction/networks/logic_networks.hpp @@ -34,7 +34,6 @@ template void network(pybind11::module& m, const std::string& network_name) { namespace py = pybind11; - namespace py = pybind11; /** * Network node. @@ -149,7 +148,10 @@ void network(pybind11::module& m, const std::string& network_name) py::arg("index")) .def( "po_index", [](const Ntk& ntk, const mockturtle::node& n) { return ntk.po_index(n); }, py::arg("n")) - .def("po_at", [](const Ntk& ntk, const uint32_t index) { return ntk.po_at(index); }, py::arg("index")); + .def( + "po_at", [](const Ntk& ntk, const uint32_t index) { return ntk.po_at(index); }, py::arg("index")) + + ; /** * Network parsing function. diff --git a/bindings/mnt/pyfiction/include/pyfiction/networks/truth_tables.hpp b/bindings/mnt/pyfiction/include/pyfiction/networks/truth_tables.hpp index c11318d09..f808e7aa3 100644 --- a/bindings/mnt/pyfiction/include/pyfiction/networks/truth_tables.hpp +++ b/bindings/mnt/pyfiction/include/pyfiction/networks/truth_tables.hpp @@ -8,7 +8,8 @@ #include "pyfiction/types.hpp" #include -#include + +#include namespace pyfiction { @@ -19,7 +20,7 @@ inline void truth_tables(pybind11::module& m) py::class_(m, "dynamic_truth_table") .def(py::init<>()) - .def(py::init()) + .def(py::init(), py::arg("num_vars")) .def("num_vars", &py_tt::num_vars) .def("num_blocks", &py_tt::num_blocks) diff --git a/bindings/mnt/pyfiction/include/pyfiction/pybind11_mkdoc_docstrings.hpp b/bindings/mnt/pyfiction/include/pyfiction/pybind11_mkdoc_docstrings.hpp index 2f8cdd768..2540f3e3c 100644 --- a/bindings/mnt/pyfiction/include/pyfiction/pybind11_mkdoc_docstrings.hpp +++ b/bindings/mnt/pyfiction/include/pyfiction/pybind11_mkdoc_docstrings.hpp @@ -1122,6 +1122,56 @@ static const char *__doc_fiction_bounding_box_2d_x_size = R"doc(The horizontal s static const char *__doc_fiction_bounding_box_2d_y_size = R"doc(The vertical size of the bounding box in layout coordinates.)doc"; +static const char *__doc_fiction_branching_signal_container = +R"doc(A container class to help identify layout locations of branching nodes +like fanouts. When a node from a network is to placed in a layout, +fetching the node's fanins and looking for their locations in the +layout does not work properly when branching nodes like fanouts are +involved that got extended by wire nodes. This container solves that +issue. + +Template parameter ``Lyt``: + Gate-level layout type. + +Template parameter ``Ntk``: + Logic network type. + +Template parameter ``fanout_size``: + Maximum fanout size possible in the layout and/or the network.)doc"; + +static const char *__doc_fiction_branching_signal_container_branches = R"doc(Storage for all branches.)doc"; + +static const char *__doc_fiction_branching_signal_container_branching_signal = R"doc(Branch type.)doc"; + +static const char *__doc_fiction_branching_signal_container_branching_signal_branching_signal = R"doc()doc"; + +static const char *__doc_fiction_branching_signal_container_branching_signal_lyt_signal = R"doc()doc"; + +static const char *__doc_fiction_branching_signal_container_branching_signal_ntk_node = R"doc()doc"; + +static const char *__doc_fiction_branching_signal_container_operator_array = +R"doc(Accesses the branching container to find the location of a given node +`n`. Returns the signal to that location if it was already stored or +the default signal, otherwise. + +Parameter ``n``: + Node whose branching position is desired. + +Returns: + Signal to `n`'s layout location or the default signal if it wasn't + found.)doc"; + +static const char *__doc_fiction_branching_signal_container_update_branch = +R"doc(Updates the given node's branch by another layout signal, thereby, +creating a new branch or updating the position of an existing one, +e.g., if further wire segments were moving the head of the branch. + +Parameter ``ntk_node``: + Node whose branch is to be updated. + +Parameter ``lyt_signal``: + New signal pointing to the end of the branch.)doc"; + static const char *__doc_fiction_calculate_energy_and_state_type_with_kinks_accepted = R"doc(This function takes in an SiDB energy distribution. For each charge distribution, the state type is determined (i.e. erroneous, @@ -5906,8 +5956,8 @@ static const char *__doc_fiction_detail_exact_impl_smt_handler_tile_ite_counters R"doc(Constructs a series of expressions to evaluate how many tiles were occupied by a given edge. Therefore, all te variables are translated to expressions of the form ite(te, 1, 0) which allows for applying -z3::sum to them. This is a work around because no such api function -for pseudo boolean exists. +z3::sum to them. This is a workaround because no such api function for +pseudo boolean exists. Parameter ``e``: Edge to consider. @@ -10152,6 +10202,20 @@ Parameter ``lyt``: Returns: List of all routing objectives in the given layout.)doc"; +static const char *__doc_fiction_fanin_container = +R"doc(Container that stores fanins of a node in a network, including whether +one of them is a constant. + +Note that this container assumes that each node has a maximum of one +constant fanin. + +Template parameter ``Ntk``: + `mockturtle` network type.)doc"; + +static const char *__doc_fiction_fanin_container_constant_fanin = +R"doc(Has a value if a fanin node is constant. In that case, it represents +the constant value.)doc"; + static const char *__doc_fiction_fanin_edge_container = R"doc(Container that stores fanin edges of a node in a network, including whether one of them is a constant. @@ -15125,6 +15189,158 @@ static const char *__doc_fiction_path_set_add = R"doc()doc"; static const char *__doc_fiction_path_set_contains = R"doc()doc"; static const char *__doc_fiction_place = +R"doc(Place 0-input gates. + +Template parameter ``Lyt``: + Gate-level layout type. + +Template parameter ``Ntk``: + Logic network type. + +Parameter ``lyt``: + Gate-level layout in which to place a 0-input gate. + +Parameter ``t``: + Tile in `lyt` to place the gate onto. + +Parameter ``ntk``: + Network whose node is to be placed. + +Parameter ``n``: + Node in `ntk` to place onto `t` in `lyt`. + +Returns: + Signal pointing to the placed gate in `lyt`.)doc"; + +static const char *__doc_fiction_place_2 = +R"doc(Place 1-input gates. + +Template parameter ``Lyt``: + Gate-level layout type. + +Template parameter ``Ntk``: + Logic network type. + +Parameter ``lyt``: + Gate-level layout in which to place a 1-input gate. + +Parameter ``t``: + Tile in `lyt` to place the gate onto. + +Parameter ``ntk``: + Network whose node is to be placed. + +Parameter ``n``: + Node in `ntk` to place onto `t` in `lyt`. + +Parameter ``a``: + Incoming signal to the newly placed gate in `lyt`. + +Returns: + Signal pointing to the placed gate in `lyt`.)doc"; + +static const char *__doc_fiction_place_3 = +R"doc(Place 2-input gates. + +Template parameter ``Lyt``: + Gate-level layout type. + +Template parameter ``Ntk``: + Logic network type. + +Parameter ``lyt``: + Gate-level layout in which to place a 2-input gate. + +Parameter ``t``: + Tile in `lyt` to place the gate onto. + +Parameter ``ntk``: + Network whose node is to be placed. + +Parameter ``n``: + Node in `ntk` to place onto `t` in `lyt`. + +Parameter ``a``: + First incoming signal to the newly placed gate in `lyt`. + +Parameter ``b``: + Second incoming signal to the newly placed gate in `lyt`. + +Parameter ``c``: + Third optional incoming constant value signal to the newly placed + gate in `lyt`. Might change the gate function when set, e.g., from + a MAJ to an AND if `c == false`. + +Returns: + Signal pointing to the placed gate in `lyt`.)doc"; + +static const char *__doc_fiction_place_4 = +R"doc(Place 3-input gates. + +Template parameter ``Lyt``: + Gate-level layout type. + +Template parameter ``Ntk``: + Logic network type. + +Parameter ``lyt``: + Gate-level layout in which to place a 3-input gate. + +Parameter ``t``: + Tile in `lyt` to place the gate onto. + +Parameter ``ntk``: + Network whose node is to be placed. + +Parameter ``n``: + Node in `ntk` to place onto `t` in `lyt`. + +Parameter ``a``: + First incoming signal to the newly placed gate in `lyt`. + +Parameter ``b``: + Second incoming signal to the newly placed gate in `lyt`. + +Parameter ``c``: + Third incoming signal to the newly placed gate in `lyt`. + +Returns: + Signal pointing to the placed gate in `lyt`.)doc"; + +static const char *__doc_fiction_place_5 = +R"doc(Place any gate from a network. This function automatically identifies +the arity of the passed node and fetches its incoming signals from the +given network and a provided `mockturtle::node_map`. This function +does not update the `mockturtle::node_map`. + +Template parameter ``Lyt``: + Gate-level layout type. + +Template parameter ``Ntk``: + Logic network type. + +Parameter ``lyt``: + Gate-level layout in which to place any gate. + +Parameter ``t``: + Tile in `lyt` to place the gate onto. + +Parameter ``ntk``: + Network whose node is to be placed. + +Parameter ``n``: + Node in `ntk` to place onto `t` in `lyt`. + +Parameter ``node2pos``: + Mapping from network nodes to layout signals, i.e., a pointer to + their position in the layout. The map is used to fetch location of + the fanins. The `mockturtle::node_map` is not updated by this + function. + +Returns: + Signal to the newly placed gate in `lyt`.)doc"; + +static const char *__doc_fiction_place_6 = R"doc(Place any gate from a network. This function automatically identifies the arity of the passed node and fetches its incoming signals from the given network and a provided branching_signal_container @@ -19107,6 +19323,12 @@ static const char *__doc_fmt_formatter_parse = R"doc()doc"; static const char *__doc_fmt_formatter_parse_2 = R"doc()doc"; +static const char *__doc_fmt_unnamed_struct_at_home_runner_work_fiction_fiction_include_fiction_layouts_coordinates_hpp_1090_8 = R"doc()doc"; + +static const char *__doc_fmt_unnamed_struct_at_home_runner_work_fiction_fiction_include_fiction_layouts_coordinates_hpp_1106_8 = R"doc()doc"; + +static const char *__doc_fmt_unnamed_struct_at_home_runner_work_fiction_fiction_include_fiction_technology_cell_ports_hpp_291_8 = R"doc()doc"; + static const char *__doc_mockturtle_detail_foreach_element_if_transform = R"doc()doc"; static const char *__doc_mockturtle_edge = diff --git a/bindings/mnt/pyfiction/include/pyfiction/technology/charge_distribution_surface.hpp b/bindings/mnt/pyfiction/include/pyfiction/technology/charge_distribution_surface.hpp index 088efdbfd..21c9f2cfb 100644 --- a/bindings/mnt/pyfiction/include/pyfiction/technology/charge_distribution_surface.hpp +++ b/bindings/mnt/pyfiction/include/pyfiction/technology/charge_distribution_surface.hpp @@ -32,7 +32,6 @@ template void charge_distribution_surface_layout(pybind11::module& m, const std::string& lattice = "") { namespace py = pybind11; - namespace py = pybind11; using py_cds = py_charge_distribution_surface_layout; @@ -213,31 +212,6 @@ void charge_distribution_surface_layout(pybind11::module& m, const std::string& .def("get_sidb_order", &py_cds::get_sidb_order) .def("add_sidb", &py_cds::add_sidb, py::arg("cell"), py::arg("charge")) - .def("cells", - [](const py_cds& lyt) - { - std::vector> cells{}; - cells.reserve(lyt.num_cells()); - lyt.foreach_cell([&cells](const auto& c) { cells.push_back(c); }); - return cells; - }) - .def("pis", - [](const py_cds& lyt) - { - std::vector> pis{}; - pis.reserve(lyt.num_pis()); - lyt.foreach_pi([&pis](const auto& c) { pis.push_back(c); }); - return pis; - }) - .def("pos", - [](const py_cds& lyt) - { - std::vector> pos{}; - pos.reserve(lyt.num_pos()); - lyt.foreach_po([&pos](const auto& c) { pos.push_back(c); }); - return pos; - }) - .def( "is_within_bounds", [](const py_cds& lyt, const fiction::coordinate& c) { return lyt.is_within_bounds(c); }, py::arg("c"), DOC(fiction_cartesian_layout_is_within_bounds)) diff --git a/bindings/mnt/pyfiction/include/pyfiction/technology/sidb_charge_state.hpp b/bindings/mnt/pyfiction/include/pyfiction/technology/sidb_charge_state.hpp index a5e7c0886..5ae5e328d 100644 --- a/bindings/mnt/pyfiction/include/pyfiction/technology/sidb_charge_state.hpp +++ b/bindings/mnt/pyfiction/include/pyfiction/technology/sidb_charge_state.hpp @@ -17,7 +17,6 @@ namespace pyfiction inline void sidb_charge_state(pybind11::module& m) { namespace py = pybind11; - namespace py = pybind11; py::enum_(m, "sidb_charge_state", DOC(fiction_sidb_charge_state)) .value("NEGATIVE", fiction::sidb_charge_state::NEGATIVE, DOC(fiction_sidb_charge_state_NEGATIVE)) diff --git a/bindings/mnt/pyfiction/include/pyfiction/technology/sidb_lattice.hpp b/bindings/mnt/pyfiction/include/pyfiction/technology/sidb_lattice.hpp index 4fc8c310d..044b211e0 100644 --- a/bindings/mnt/pyfiction/include/pyfiction/technology/sidb_lattice.hpp +++ b/bindings/mnt/pyfiction/include/pyfiction/technology/sidb_lattice.hpp @@ -8,7 +8,6 @@ #include "pyfiction/documentation.hpp" #include "pyfiction/types.hpp" -#include #include #include #include @@ -18,9 +17,7 @@ #include #include -#include #include -#include namespace pyfiction { @@ -32,7 +29,6 @@ template void sidb_lattice_cell_level_layout(pybind11::module& m) { namespace py = pybind11; - namespace py = pybind11; // fetch technology name auto orientation = std::string{fiction::sidb_lattice_name}; @@ -46,8 +42,9 @@ void sidb_lattice_cell_level_layout(pybind11::module& m) py::class_(m, fmt::format("sidb_{}_lattice", orientation).c_str(), DOC(fiction_cell_level_layout), py::module_local()) .def(py::init<>()) - .def(py::init&, const std::string&>(), py::arg("dimension"), - py::arg("name") = "", DOC(fiction_sidb_lattice)) + .def(py::init&, const std::string&>(), + py::arg("dimension") = fiction::aspect_ratio{}, py::arg("name") = "", + DOC(fiction_sidb_lattice)) ; } diff --git a/bindings/mnt/pyfiction/include/pyfiction/technology/sidb_nm_distance.hpp b/bindings/mnt/pyfiction/include/pyfiction/technology/sidb_nm_distance.hpp index 0d7607832..28925a99f 100644 --- a/bindings/mnt/pyfiction/include/pyfiction/technology/sidb_nm_distance.hpp +++ b/bindings/mnt/pyfiction/include/pyfiction/technology/sidb_nm_distance.hpp @@ -21,20 +21,20 @@ namespace detail { template -void nanometer_distance(pybind11::module& m, const std::string& lattice = "") +void nanometer_distance(pybind11::module& m) { namespace py = pybind11; - m.def(fmt::format("sidb_nm_distance{}", lattice).c_str(), &fiction::sidb_nm_distance, py::arg("lyt"), - py::arg("source"), py::arg("target"), DOC(fiction_sidb_nm_distance)); + m.def(fmt::format("sidb_nm_distance").c_str(), &fiction::sidb_nm_distance, py::arg("lyt"), py::arg("source"), + py::arg("target"), DOC(fiction_sidb_nm_distance)); } } // namespace detail inline void sidb_nm_distance(pybind11::module& m) { - detail::nanometer_distance(m, "_100"); - detail::nanometer_distance(m, "_111"); + detail::nanometer_distance(m); + detail::nanometer_distance(m); } } // namespace pyfiction diff --git a/bindings/mnt/pyfiction/include/pyfiction/utils/layout_utils.hpp b/bindings/mnt/pyfiction/include/pyfiction/utils/layout_utils.hpp index bf3777f58..6612fe2c3 100644 --- a/bindings/mnt/pyfiction/include/pyfiction/utils/layout_utils.hpp +++ b/bindings/mnt/pyfiction/include/pyfiction/utils/layout_utils.hpp @@ -8,12 +8,10 @@ #include "pyfiction/documentation.hpp" #include "pyfiction/types.hpp" +#include #include #include -#include - -#include namespace pyfiction { diff --git a/bindings/mnt/pyfiction/pyfiction.pyi b/bindings/mnt/pyfiction/pyfiction.pyi new file mode 100644 index 000000000..af48bb1bd --- /dev/null +++ b/bindings/mnt/pyfiction/pyfiction.pyi @@ -0,0 +1,2890 @@ +from enum import Enum +from typing import Any, Callable, Iterable, overload + +from typing_extensions import Self + +# Layouts + +class offset_coordinate: + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, int_repr: int) -> None: ... + @overload + def __init__(self, x: int, y: int, z: int = 0) -> None: ... + @overload + def __init__(self, c: offset_coordinate) -> None: ... + @overload + def __init__(self, c: tuple[int, int, int]) -> None: ... + + x: int + y: int + z: int + + def __eq__(self, other: object) -> bool: ... + def __ne__(self, other: object) -> bool: ... + def __lt__(self, other: offset_coordinate) -> bool: ... + def __gt__(self, other: offset_coordinate) -> bool: ... + def __le__(self, other: offset_coordinate) -> bool: ... + def __ge__(self, other: offset_coordinate) -> bool: ... + def __hash__(self) -> int: ... + +class cube_coordinate: + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, x: int, y: int, z: int = 0) -> None: ... + @overload + def __init__(self, c: cube_coordinate) -> None: ... + @overload + def __init__(self, c: tuple[int, int, int]) -> None: ... + + x: int + y: int + z: int + + def __eq__(self, other: object) -> bool: ... + def __ne__(self, other: object) -> bool: ... + def __lt__(self, other: cube_coordinate) -> bool: ... + def __gt__(self, other: cube_coordinate) -> bool: ... + def __le__(self, other: cube_coordinate) -> bool: ... + def __ge__(self, other: cube_coordinate) -> bool: ... + def __hash__(self) -> int: ... + +class siqad_coordinate: + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, x: int, y: int, z: int = 0) -> None: ... + @overload + def __init__(self, c: siqad_coordinate) -> None: ... + @overload + def __init__(self, c: tuple[int, int, int]) -> None: ... + + x: int + y: int + z: int + + def __eq__(self, other: object) -> bool: ... + def __ne__(self, other: object) -> bool: ... + def __lt__(self, other: siqad_coordinate) -> bool: ... + def __gt__(self, other: siqad_coordinate) -> bool: ... + def __le__(self, other: siqad_coordinate) -> bool: ... + def __ge__(self, other: siqad_coordinate) -> bool: ... + def __hash__(self) -> int: ... + +# For consistent behavior: +@overload +def area(coord: offset_coordinate | cube_coordinate | siqad_coordinate) -> float: ... +def volume(coord: offset_coordinate | cube_coordinate | siqad_coordinate) -> float: ... + +# For conversions with potentially nuanced behavior: +def to_offset_coord(coord: siqad_coordinate) -> offset_coordinate: ... +def to_cube_coord(coord: siqad_coordinate) -> cube_coordinate: ... +@overload +def to_siqad_coord(coord: offset_coordinate) -> siqad_coordinate: ... +@overload +def to_siqad_coord(coord: cube_coordinate) -> siqad_coordinate: ... + +class cartesian_layout: + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, dimension: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> None: ... + def coord(self, x: int, y: int, z: int = 0) -> offset_coordinate: ... + def x(self) -> int: ... + def y(self) -> int: ... + def z(self) -> int: ... + def area(self) -> int: ... + def resize(self, dimension: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> None: ... + def north(self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> offset_coordinate | None: ... + def north_east(self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> offset_coordinate | None: ... + def east(self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> offset_coordinate | None: ... + def south_east(self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> offset_coordinate | None: ... + def south(self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> offset_coordinate | None: ... + def south_west(self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> offset_coordinate | None: ... + def west(self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> offset_coordinate | None: ... + def north_west(self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> offset_coordinate | None: ... + def above(self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> offset_coordinate | None: ... + def below(self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> offset_coordinate | None: ... + def is_north_of( + self, + c1: offset_coordinate | tuple[int, int] | tuple[int, int, int], + c2: offset_coordinate | tuple[int, int] | tuple[int, int, int], + ) -> bool: ... + def is_east_of( + self, + c1: offset_coordinate | tuple[int, int] | tuple[int, int, int], + c2: offset_coordinate | tuple[int, int] | tuple[int, int, int], + ) -> bool: ... + def is_south_of( + self, + c1: offset_coordinate | tuple[int, int] | tuple[int, int, int], + c2: offset_coordinate | tuple[int, int] | tuple[int, int, int], + ) -> bool: ... + def is_west_of( + self, + c1: offset_coordinate | tuple[int, int] | tuple[int, int, int], + c2: offset_coordinate | tuple[int, int] | tuple[int, int, int], + ) -> bool: ... + def is_adjacent_of( + self, + c1: offset_coordinate | tuple[int, int] | tuple[int, int, int], + c2: offset_coordinate | tuple[int, int] | tuple[int, int, int], + ) -> bool: ... + def is_adjacent_elevation_of( + self, + c1: offset_coordinate | tuple[int, int] | tuple[int, int, int], + c2: offset_coordinate | tuple[int, int] | tuple[int, int, int], + ) -> bool: ... + def is_above( + self, + c1: offset_coordinate | tuple[int, int] | tuple[int, int, int], + c2: offset_coordinate | tuple[int, int] | tuple[int, int, int], + ) -> bool: ... + def is_below( + self, + c1: offset_coordinate | tuple[int, int] | tuple[int, int, int], + c2: offset_coordinate | tuple[int, int] | tuple[int, int, int], + ) -> bool: ... + def is_northwards_of( + self, + c1: offset_coordinate | tuple[int, int] | tuple[int, int, int], + c2: offset_coordinate | tuple[int, int] | tuple[int, int, int], + ) -> bool: ... + def is_eastwards_of( + self, + c1: offset_coordinate | tuple[int, int] | tuple[int, int, int], + c2: offset_coordinate | tuple[int, int] | tuple[int, int, int], + ) -> bool: ... + def is_southwards_of( + self, + c1: offset_coordinate | tuple[int, int] | tuple[int, int, int], + c2: offset_coordinate | tuple[int, int] | tuple[int, int, int], + ) -> bool: ... + def is_westwards_of( + self, + c1: offset_coordinate | tuple[int, int] | tuple[int, int, int], + c2: offset_coordinate | tuple[int, int] | tuple[int, int, int], + ) -> bool: ... + def is_at_northern_border(self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> bool: ... + def is_at_eastern_border(self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> bool: ... + def is_at_southern_border(self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> bool: ... + def is_at_western_border(self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> bool: ... + def is_at_any_border(self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> bool: ... + def northern_border_of( + self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int] + ) -> offset_coordinate | None: ... + def eastern_border_of( + self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int] + ) -> offset_coordinate | None: ... + def southern_border_of( + self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int] + ) -> offset_coordinate | None: ... + def western_border_of( + self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int] + ) -> offset_coordinate | None: ... + def is_ground_layer(self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> bool: ... + def is_crossing_layer(self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> bool: ... + def is_within_bounds(self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> bool: ... + def offset_coordinates(self) -> list[offset_coordinate]: ... + def ground_coordinates(self) -> list[offset_coordinate]: ... + def adjacent_coordinates( + self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int] + ) -> list[offset_coordinate]: ... + def adjacent_opposite_coordinates( + self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int] + ) -> list[offset_coordinate]: ... + +class shifted_cartesian_layout: + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, dimension: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> None: ... + def coord(self, x: int, y: int, z: int = 0) -> offset_coordinate: ... + def x(self) -> int: ... + def y(self) -> int: ... + def z(self) -> int: ... + def area(self) -> int: ... + def resize(self, dimension: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> None: ... + def north(self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> offset_coordinate | None: ... + def north_east(self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> offset_coordinate | None: ... + def east(self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> offset_coordinate | None: ... + def south_east(self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> offset_coordinate | None: ... + def south(self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> offset_coordinate | None: ... + def south_west(self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> offset_coordinate | None: ... + def west(self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> offset_coordinate | None: ... + def north_west(self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> offset_coordinate | None: ... + def above(self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> offset_coordinate | None: ... + def below(self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> offset_coordinate | None: ... + def is_north_of( + self, + c1: offset_coordinate | tuple[int, int] | tuple[int, int, int], + c2: offset_coordinate | tuple[int, int] | tuple[int, int, int], + ) -> bool: ... + def is_east_of( + self, + c1: offset_coordinate | tuple[int, int] | tuple[int, int, int], + c2: offset_coordinate | tuple[int, int] | tuple[int, int, int], + ) -> bool: ... + def is_south_of( + self, + c1: offset_coordinate | tuple[int, int] | tuple[int, int, int], + c2: offset_coordinate | tuple[int, int] | tuple[int, int, int], + ) -> bool: ... + def is_west_of( + self, + c1: offset_coordinate | tuple[int, int] | tuple[int, int, int], + c2: offset_coordinate | tuple[int, int] | tuple[int, int, int], + ) -> bool: ... + def is_adjacent_of( + self, + c1: offset_coordinate | tuple[int, int] | tuple[int, int, int], + c2: offset_coordinate | tuple[int, int] | tuple[int, int, int], + ) -> bool: ... + def is_adjacent_elevation_of( + self, + c1: offset_coordinate | tuple[int, int] | tuple[int, int, int], + c2: offset_coordinate | tuple[int, int] | tuple[int, int, int], + ) -> bool: ... + def is_above( + self, + c1: offset_coordinate | tuple[int, int] | tuple[int, int, int], + c2: offset_coordinate | tuple[int, int] | tuple[int, int, int], + ) -> bool: ... + def is_below( + self, + c1: offset_coordinate | tuple[int, int] | tuple[int, int, int], + c2: offset_coordinate | tuple[int, int] | tuple[int, int, int], + ) -> bool: ... + def is_northwards_of( + self, + c1: offset_coordinate | tuple[int, int] | tuple[int, int, int], + c2: offset_coordinate | tuple[int, int] | tuple[int, int, int], + ) -> bool: ... + def is_eastwards_of( + self, + c1: offset_coordinate | tuple[int, int] | tuple[int, int, int], + c2: offset_coordinate | tuple[int, int] | tuple[int, int, int], + ) -> bool: ... + def is_southwards_of( + self, + c1: offset_coordinate | tuple[int, int] | tuple[int, int, int], + c2: offset_coordinate | tuple[int, int] | tuple[int, int, int], + ) -> bool: ... + def is_westwards_of( + self, + c1: offset_coordinate | tuple[int, int] | tuple[int, int, int], + c2: offset_coordinate | tuple[int, int] | tuple[int, int, int], + ) -> bool: ... + def is_at_northern_border(self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> bool: ... + def is_at_eastern_border(self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> bool: ... + def is_at_southern_border(self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> bool: ... + def is_at_western_border(self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> bool: ... + def is_at_any_border(self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> bool: ... + def northern_border_of( + self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int] + ) -> offset_coordinate | None: ... + def eastern_border_of( + self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int] + ) -> offset_coordinate | None: ... + def southern_border_of( + self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int] + ) -> offset_coordinate | None: ... + def western_border_of( + self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int] + ) -> offset_coordinate | None: ... + def is_ground_layer(self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> bool: ... + def is_crossing_layer(self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> bool: ... + def is_within_bounds(self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> bool: ... + def coordinates(self) -> list[offset_coordinate]: ... + def ground_coordinates(self) -> list[offset_coordinate]: ... + def adjacent_coordinates( + self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int] + ) -> list[offset_coordinate]: ... + def adjacent_opposite_coordinates( + self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int] + ) -> list[offset_coordinate]: ... + +class hexagonal_layout: + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, dimension: cube_coordinate | tuple[int, int] | tuple[int, int, int]) -> None: ... + def coord(self, x: int, y: int, z: int = 0) -> cube_coordinate: ... + def x(self) -> int: ... + def y(self) -> int: ... + def z(self) -> int: ... + def area(self) -> int: ... + def resize(self, dimension: cube_coordinate | tuple[int, int] | tuple[int, int, int]) -> None: ... + def north(self, c: cube_coordinate | tuple[int, int] | tuple[int, int, int]) -> cube_coordinate | None: ... + def north_east(self, c: cube_coordinate | tuple[int, int] | tuple[int, int, int]) -> cube_coordinate | None: ... + def east(self, c: cube_coordinate | tuple[int, int] | tuple[int, int, int]) -> cube_coordinate | None: ... + def south_east(self, c: cube_coordinate | tuple[int, int] | tuple[int, int, int]) -> cube_coordinate | None: ... + def south(self, c: cube_coordinate | tuple[int, int] | tuple[int, int, int]) -> cube_coordinate | None: ... + def south_west(self, c: cube_coordinate | tuple[int, int] | tuple[int, int, int]) -> cube_coordinate | None: ... + def west(self, c: cube_coordinate | tuple[int, int] | tuple[int, int, int]) -> cube_coordinate | None: ... + def north_west(self, c: cube_coordinate | tuple[int, int] | tuple[int, int, int]) -> cube_coordinate | None: ... + def above(self, c: cube_coordinate | tuple[int, int] | tuple[int, int, int]) -> cube_coordinate | None: ... + def below(self, c: cube_coordinate | tuple[int, int] | tuple[int, int, int]) -> cube_coordinate | None: ... + def is_north_of( + self, + c1: cube_coordinate | tuple[int, int] | tuple[int, int, int], + c2: cube_coordinate | tuple[int, int] | tuple[int, int, int], + ) -> bool: ... + def is_east_of( + self, + c1: cube_coordinate | tuple[int, int] | tuple[int, int, int], + c2: cube_coordinate | tuple[int, int] | tuple[int, int, int], + ) -> bool: ... + def is_south_of( + self, + c1: cube_coordinate | tuple[int, int] | tuple[int, int, int], + c2: cube_coordinate | tuple[int, int] | tuple[int, int, int], + ) -> bool: ... + def is_west_of( + self, + c1: cube_coordinate | tuple[int, int] | tuple[int, int, int], + c2: cube_coordinate | tuple[int, int] | tuple[int, int, int], + ) -> bool: ... + def is_adjacent_of( + self, + c1: cube_coordinate | tuple[int, int] | tuple[int, int, int], + c2: cube_coordinate | tuple[int, int] | tuple[int, int, int], + ) -> bool: ... + def is_adjacent_elevation_of( + self, + c1: cube_coordinate | tuple[int, int] | tuple[int, int, int], + c2: cube_coordinate | tuple[int, int] | tuple[int, int, int], + ) -> bool: ... + def is_above( + self, + c1: cube_coordinate | tuple[int, int] | tuple[int, int, int], + c2: cube_coordinate | tuple[int, int] | tuple[int, int, int], + ) -> bool: ... + def is_below( + self, + c1: cube_coordinate | tuple[int, int] | tuple[int, int, int], + c2: cube_coordinate | tuple[int, int] | tuple[int, int, int], + ) -> bool: ... + def is_northwards_of( + self, + c1: cube_coordinate | tuple[int, int] | tuple[int, int, int], + c2: cube_coordinate | tuple[int, int] | tuple[int, int, int], + ) -> bool: ... + def is_eastwards_of( + self, + c1: cube_coordinate | tuple[int, int] | tuple[int, int, int], + c2: cube_coordinate | tuple[int, int] | tuple[int, int, int], + ) -> bool: ... + def is_southwards_of( + self, + c1: cube_coordinate | tuple[int, int] | tuple[int, int, int], + c2: cube_coordinate | tuple[int, int] | tuple[int, int, int], + ) -> bool: ... + def is_westwards_of( + self, + c1: cube_coordinate | tuple[int, int] | tuple[int, int, int], + c2: cube_coordinate | tuple[int, int] | tuple[int, int, int], + ) -> bool: ... + def is_at_northern_border(self, c: cube_coordinate | tuple[int, int] | tuple[int, int, int]) -> bool: ... + def is_at_eastern_border(self, c: cube_coordinate | tuple[int, int] | tuple[int, int, int]) -> bool: ... + def is_at_southern_border(self, c: cube_coordinate | tuple[int, int] | tuple[int, int, int]) -> bool: ... + def is_at_western_border(self, c: cube_coordinate | tuple[int, int] | tuple[int, int, int]) -> bool: ... + def is_at_any_border(self, c: cube_coordinate | tuple[int, int] | tuple[int, int, int]) -> bool: ... + def northern_border_of( + self, c: cube_coordinate | tuple[int, int] | tuple[int, int, int] + ) -> cube_coordinate | None: ... + def eastern_border_of( + self, c: cube_coordinate | tuple[int, int] | tuple[int, int, int] + ) -> cube_coordinate | None: ... + def southern_border_of( + self, c: cube_coordinate | tuple[int, int] | tuple[int, int, int] + ) -> cube_coordinate | None: ... + def western_border_of( + self, c: cube_coordinate | tuple[int, int] | tuple[int, int, int] + ) -> cube_coordinate | None: ... + def is_ground_layer(self, c: cube_coordinate | tuple[int, int] | tuple[int, int, int]) -> bool: ... + def is_crossing_layer(self, c: cube_coordinate | tuple[int, int] | tuple[int, int, int]) -> bool: ... + def is_within_bounds(self, c: cube_coordinate | tuple[int, int] | tuple[int, int, int]) -> bool: ... + def coordinates(self) -> list[cube_coordinate]: ... + def ground_coordinates(self) -> list[cube_coordinate]: ... + def adjacent_coordinates( + self, c: cube_coordinate | tuple[int, int] | tuple[int, int, int] + ) -> list[cube_coordinate]: ... + def adjacent_opposite_coordinates( + self, c: cube_coordinate | tuple[int, int] | tuple[int, int, int] + ) -> list[cube_coordinate]: ... + +class clocked_cartesian_layout(cartesian_layout): + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, dimension: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> None: ... + @overload + def __init__( + self, dimension: offset_coordinate | tuple[int, int] | tuple[int, int, int], clocking_scheme: str = "2DDWave" + ) -> None: ... + def assign_clock_number(self, cz: offset_coordinate | tuple[int, int] | tuple[int, int, int], cn: int) -> None: ... + def get_clock_number(self, cz: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> int: ... + def num_clocks(self) -> int: ... + def is_regularly_clocked(self) -> bool: ... + def is_clocking_scheme(self, name: str) -> bool: ... + def is_incoming_clocked( + self, + cz1: offset_coordinate | tuple[int, int] | tuple[int, int, int], + cz2: offset_coordinate | tuple[int, int] | tuple[int, int, int], + ) -> bool: ... + def is_outgoing_clocked( + self, + cz1: offset_coordinate | tuple[int, int] | tuple[int, int, int], + cz2: offset_coordinate | tuple[int, int] | tuple[int, int, int], + ) -> bool: ... + def incoming_clocked_zones( + self, cz: offset_coordinate | tuple[int, int] | tuple[int, int, int] + ) -> list[offset_coordinate]: ... + def outgoing_clocked_zones( + self, cz: offset_coordinate | tuple[int, int] | tuple[int, int, int] + ) -> list[offset_coordinate]: ... + def in_degree(self, cz: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> int: ... + def out_degree(self, cz: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> int: ... + def degree(self, cz: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> int: ... + +class clocked_shifted_cartesian_layout(shifted_cartesian_layout): + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, dimension: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> None: ... + @overload + def __init__( + self, dimension: offset_coordinate | tuple[int, int] | tuple[int, int, int], clocking_scheme: str = "2DDWave" + ) -> None: ... + def assign_clock_number(self, cz: offset_coordinate | tuple[int, int] | tuple[int, int, int], cn: int) -> None: ... + def get_clock_number(self, cz: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> int: ... + def num_clocks(self) -> int: ... + def is_regularly_clocked(self) -> bool: ... + def is_clocking_scheme(self, name: str) -> bool: ... + def is_incoming_clocked( + self, + cz1: offset_coordinate | tuple[int, int] | tuple[int, int, int], + cz2: offset_coordinate | tuple[int, int] | tuple[int, int, int], + ) -> bool: ... + def is_outgoing_clocked( + self, + cz1: offset_coordinate | tuple[int, int] | tuple[int, int, int], + cz2: offset_coordinate | tuple[int, int] | tuple[int, int, int], + ) -> bool: ... + def incoming_clocked_zones( + self, cz: offset_coordinate | tuple[int, int] | tuple[int, int, int] + ) -> list[offset_coordinate]: ... + def outgoing_clocked_zones( + self, cz: offset_coordinate | tuple[int, int] | tuple[int, int, int] + ) -> list[offset_coordinate]: ... + def in_degree(self, cz: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> int: ... + def out_degree(self, cz: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> int: ... + def degree(self, cz: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> int: ... + +class clocked_hexagonal_layout(hexagonal_layout): + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, dimension: cube_coordinate | tuple[int, int] | tuple[int, int, int]) -> None: ... + @overload + def __init__( + self, dimension: cube_coordinate | tuple[int, int] | tuple[int, int, int], clocking_scheme: str = "2DDWave" + ) -> None: ... + def assign_clock_number(self, cz: cube_coordinate | tuple[int, int] | tuple[int, int, int], cn: int) -> None: ... + def get_clock_number(self, cz: cube_coordinate | tuple[int, int] | tuple[int, int, int]) -> int: ... + def num_clocks(self) -> int: ... + def is_regularly_clocked(self) -> bool: ... + def is_clocking_scheme(self, name: str) -> bool: ... + def is_incoming_clocked( + self, + cz1: cube_coordinate | tuple[int, int] | tuple[int, int, int], + cz2: cube_coordinate | tuple[int, int] | tuple[int, int, int], + ) -> bool: ... + def is_outgoing_clocked( + self, + cz1: cube_coordinate | tuple[int, int] | tuple[int, int, int], + cz2: cube_coordinate | tuple[int, int] | tuple[int, int, int], + ) -> bool: ... + def incoming_clocked_zones( + self, cz: cube_coordinate | tuple[int, int] | tuple[int, int, int] + ) -> list[cube_coordinate]: ... + def outgoing_clocked_zones( + self, cz: cube_coordinate | tuple[int, int] | tuple[int, int, int] + ) -> list[cube_coordinate]: ... + def in_degree(self, cz: cube_coordinate | tuple[int, int] | tuple[int, int, int]) -> int: ... + def out_degree(self, cz: cube_coordinate | tuple[int, int] | tuple[int, int, int]) -> int: ... + def degree(self, cz: cube_coordinate | tuple[int, int] | tuple[int, int, int]) -> int: ... + +class cartesian_gate_layout(clocked_cartesian_layout): + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, dimension: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> None: ... + @overload + def __init__( + self, + dimension: offset_coordinate | tuple[int, int] | tuple[int, int, int], + clocking_scheme: str = "2DDWave", + layout_name: str = "", + ) -> None: ... + def create_pi( + self, name: str = "", t: offset_coordinate | tuple[int, int] | tuple[int, int, int] | None = ... + ) -> int: ... + def create_po( + self, s: int, name: str = "", t: offset_coordinate | tuple[int, int] | tuple[int, int, int] | None = ... + ) -> int: ... + def is_pi(self, n: int) -> bool: ... + def is_po(self, n: int) -> bool: ... + def is_pi_coordinate(self, t: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> bool: ... + def is_po_coordinate(self, t: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> bool: ... + def is_inv(self) -> bool: ... + def is_and(self) -> bool: ... + def is_nand(self) -> bool: ... + def is_or(self) -> bool: ... + def is_nor(self) -> bool: ... + def is_xor(self) -> bool: ... + def is_xnor(self) -> bool: ... + def is_maj(self) -> bool: ... + def is_fanout(self) -> bool: ... + def is_wire(self) -> bool: ... + def set_layout_name(self, name: str) -> None: ... + def set_name(self, name: str) -> None: ... + def get_layout_name(self) -> str: ... + def set_input_name(self, index: int, name: str) -> None: ... + def get_input_name(self, index: int) -> str: ... + def set_output_name(self, index: int, name: str) -> None: ... + def get_output_name(self, index: int) -> str: ... + def get_name(self, s: int) -> str: ... + def create_buf( + self, a: int, t: offset_coordinate | tuple[int, int] | tuple[int, int, int] | None = None + ) -> int: ... + def create_not( + self, a: int, t: offset_coordinate | tuple[int, int] | tuple[int, int, int] | None = None + ) -> int: ... + def create_and( + self, a: int, b: int, t: offset_coordinate | tuple[int, int] | tuple[int, int, int] | None = None + ) -> int: ... + def create_nand( + self, a: int, b: int, t: offset_coordinate | tuple[int, int] | tuple[int, int, int] | None = None + ) -> int: ... + def create_or( + self, a: int, b: int, t: offset_coordinate | tuple[int, int] | tuple[int, int, int] | None = None + ) -> int: ... + def create_nor( + self, a: int, b: int, t: offset_coordinate | tuple[int, int] | tuple[int, int, int] | None = None + ) -> int: ... + def create_xor( + self, a: int, b: int, t: offset_coordinate | tuple[int, int] | tuple[int, int, int] | None = None + ) -> int: ... + def create_xnor( + self, a: int, b: int, t: offset_coordinate | tuple[int, int] | tuple[int, int, int] | None = None + ) -> int: ... + def create_maj( + self, a: int, b: int, c: int, t: offset_coordinate | tuple[int, int] | tuple[int, int, int] | None = None + ) -> int: ... + def num_pis(self) -> int: ... + def num_pos(self) -> int: ... + def num_gates(self) -> int: ... + def num_wires(self) -> int: ... + def num_crossings(self) -> int: ... + def is_empty(self) -> bool: ... + def fanin_size(self, n: int) -> int: ... + def fanout_size(self, n: int) -> int: ... + def get_node(self, t: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> int: ... + def get_tile(self, n: int) -> int: ... + def make_signal(self, n: int) -> int: ... + def move_node( + self, + n: int, + t: offset_coordinate | tuple[int, int] | tuple[int, int, int], + new_children: list[offset_coordinate] = [], + ) -> None: ... + def clear_coordinate(self, t: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> None: ... + def is_gate_coordinate(self, t: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> bool: ... + def is_wire_coordinate(self, t: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> bool: ... + def is_empty_coordinate(self, t: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> bool: ... + def pis(self) -> list[offset_coordinate]: ... + def pos(self) -> list[offset_coordinate]: ... + def gates(self) -> list[offset_coordinate]: ... + def wires(self) -> list[offset_coordinate]: ... + def fanins(self, t: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> list[int]: ... + def fanouts(self, t: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> list[int]: ... + def is_incoming_signal(self, t: offset_coordinate | tuple[int, int] | tuple[int, int, int], s: int) -> bool: ... + def has_no_incoming_signal(self, t: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> bool: ... + def has_northern_incoming_signal(self, t: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> bool: ... + def has_north_eastern_incoming_signal( + self, t: offset_coordinate | tuple[int, int] | tuple[int, int, int] + ) -> bool: ... + def has_eastern_incoming_signal(self, t: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> bool: ... + def has_south_eastern_incoming_signal( + self, t: offset_coordinate | tuple[int, int] | tuple[int, int, int] + ) -> bool: ... + def has_southern_incoming_signal(self, t: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> bool: ... + def has_south_western_incoming_signal( + self, t: offset_coordinate | tuple[int, int] | tuple[int, int, int] + ) -> bool: ... + def has_western_incoming_signal(self, t: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> bool: ... + def has_north_western_incoming_signal( + self, t: offset_coordinate | tuple[int, int] | tuple[int, int, int] + ) -> bool: ... + def is_outgoing_signal(self, t: offset_coordinate | tuple[int, int] | tuple[int, int, int], s: int) -> bool: ... + def has_no_outgoing_signal(self, t: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> bool: ... + def has_northern_outgoing_signal(self, t: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> bool: ... + def has_north_eastern_outgoing_signal( + self, t: offset_coordinate | tuple[int, int] | tuple[int, int, int] + ) -> bool: ... + def has_eastern_outgoing_signal(self, t: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> bool: ... + def has_south_eastern_outgoing_signal( + self, t: offset_coordinate | tuple[int, int] | tuple[int, int, int] + ) -> bool: ... + def has_southern_outgoing_signal(self, t: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> bool: ... + def has_south_western_outgoing_signal( + self, t: offset_coordinate | tuple[int, int] | tuple[int, int, int] + ) -> bool: ... + def has_western_outgoing_signal(self, t: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> bool: ... + def has_north_western_outgoing_signal( + self, t: offset_coordinate | tuple[int, int] | tuple[int, int, int] + ) -> bool: ... + def bounding_box_2d(self) -> tuple[offset_coordinate, offset_coordinate]: ... + def is_dead(self, n: int) -> bool: ... + +class shifted_cartesian_gate_layout(clocked_shifted_cartesian_layout): + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, dimension: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> None: ... + @overload + def __init__( + self, + dimension: offset_coordinate | tuple[int, int] | tuple[int, int, int], + clocking_scheme: str = "2DDWave", + layout_name: str = "", + ) -> None: ... + def create_pi( + self, name: str = "", t: offset_coordinate | tuple[int, int] | tuple[int, int, int] | None = ... + ) -> int: ... + def create_po( + self, s: int, name: str = "", t: offset_coordinate | tuple[int, int] | tuple[int, int, int] | None = ... + ) -> int: ... + def is_pi(self, n: int) -> bool: ... + def is_po(self, n: int) -> bool: ... + def is_pi_coordinate(self, t: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> bool: ... + def is_po_coordinate(self, t: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> bool: ... + def is_inv(self) -> bool: ... + def is_and(self) -> bool: ... + def is_nand(self) -> bool: ... + def is_or(self) -> bool: ... + def is_nor(self) -> bool: ... + def is_xor(self) -> bool: ... + def is_xnor(self) -> bool: ... + def is_maj(self) -> bool: ... + def is_fanout(self) -> bool: ... + def is_wire(self) -> bool: ... + def set_layout_name(self, name: str) -> None: ... + def get_layout_name(self) -> str: ... + def set_input_name(self, index: int, name: str) -> None: ... + def get_input_name(self, index: int) -> str: ... + def set_output_name(self, index: int, name: str) -> None: ... + def get_output_name(self, index: int) -> str: ... + def get_name(self, s: int) -> str: ... + def create_buf( + self, a: int, t: offset_coordinate | tuple[int, int] | tuple[int, int, int] | None = None + ) -> int: ... + def create_not( + self, a: int, t: offset_coordinate | tuple[int, int] | tuple[int, int, int] | None = None + ) -> int: ... + def create_and( + self, a: int, b: int, t: offset_coordinate | tuple[int, int] | tuple[int, int, int] | None = None + ) -> int: ... + def create_nand( + self, a: int, b: int, t: offset_coordinate | tuple[int, int] | tuple[int, int, int] | None = None + ) -> int: ... + def create_or( + self, a: int, b: int, t: offset_coordinate | tuple[int, int] | tuple[int, int, int] | None = None + ) -> int: ... + def create_nor( + self, a: int, b: int, t: offset_coordinate | tuple[int, int] | tuple[int, int, int] | None = None + ) -> int: ... + def create_xor( + self, a: int, b: int, t: offset_coordinate | tuple[int, int] | tuple[int, int, int] | None = None + ) -> int: ... + def create_xnor( + self, a: int, b: int, t: offset_coordinate | tuple[int, int] | tuple[int, int, int] | None = None + ) -> int: ... + def create_maj( + self, a: int, b: int, c: int, t: offset_coordinate | tuple[int, int] | tuple[int, int, int] | None = None + ) -> int: ... + def num_pis(self) -> int: ... + def num_pos(self) -> int: ... + def num_gates(self) -> int: ... + def num_wires(self) -> int: ... + def num_crossings(self) -> int: ... + def is_empty(self) -> bool: ... + def fanin_size(self, n: int) -> int: ... + def fanout_size(self, n: int) -> int: ... + def get_tile(self, n: int) -> int: ... + def get_coordinate(self, n: int) -> offset_coordinate: ... + def make_signal(self, n: int) -> int: ... + def move_node( + self, + n: int, + t: offset_coordinate | tuple[int, int] | tuple[int, int, int], + new_children: list[offset_coordinate] = [], + ) -> None: ... + def clear_coordinate(self, t: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> None: ... + def is_gate_coordinate(self, t: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> bool: ... + def is_wire_coordinate(self, t: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> bool: ... + def is_empty_coordinate(self, t: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> bool: ... + def pis(self) -> list[offset_coordinate]: ... + def pos(self) -> list[offset_coordinate]: ... + def gates(self) -> list[offset_coordinate]: ... + def wires(self) -> list[offset_coordinate]: ... + def fanins(self, t: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> list[int]: ... + def fanouts(self, t: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> list[int]: ... + def is_incoming_signal(self, t: offset_coordinate | tuple[int, int] | tuple[int, int, int], s: int) -> bool: ... + def has_no_incoming_signal(self, t: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> bool: ... + def has_northern_incoming_signal(self, t: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> bool: ... + def has_north_eastern_incoming_signal( + self, t: offset_coordinate | tuple[int, int] | tuple[int, int, int] + ) -> bool: ... + def has_eastern_incoming_signal(self, t: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> bool: ... + def has_south_eastern_incoming_signal( + self, t: offset_coordinate | tuple[int, int] | tuple[int, int, int] + ) -> bool: ... + def has_southern_incoming_signal(self, t: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> bool: ... + def has_south_western_incoming_signal( + self, t: offset_coordinate | tuple[int, int] | tuple[int, int, int] + ) -> bool: ... + def has_western_incoming_signal(self, t: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> bool: ... + def has_north_western_incoming_signal( + self, t: offset_coordinate | tuple[int, int] | tuple[int, int, int] + ) -> bool: ... + def is_outgoing_signal(self, t: offset_coordinate | tuple[int, int] | tuple[int, int, int], s: int) -> bool: ... + def has_no_outgoing_signal(self, t: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> bool: ... + def has_northern_outgoing_signal(self, t: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> bool: ... + def has_north_eastern_outgoing_signal( + self, t: offset_coordinate | tuple[int, int] | tuple[int, int, int] + ) -> bool: ... + def has_eastern_outgoing_signal(self, t: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> bool: ... + def has_south_eastern_outgoing_signal( + self, t: offset_coordinate | tuple[int, int] | tuple[int, int, int] + ) -> bool: ... + def has_southern_outgoing_signal(self, t: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> bool: ... + def has_south_western_outgoing_signal( + self, t: offset_coordinate | tuple[int, int] | tuple[int, int, int] + ) -> bool: ... + def has_western_outgoing_signal(self, t: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> bool: ... + def has_north_western_outgoing_signal( + self, t: offset_coordinate | tuple[int, int] | tuple[int, int, int] + ) -> bool: ... + def bounding_box_2d(self) -> tuple[offset_coordinate, offset_coordinate]: ... + def is_dead(self, n: int) -> bool: ... + +class hexagonal_gate_layout(clocked_hexagonal_layout): + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, dimension: cube_coordinate | tuple[int, int] | tuple[int, int, int]) -> None: ... + @overload + def __init__( + self, + dimension: cube_coordinate | tuple[int, int] | tuple[int, int, int], + clocking_scheme: str = "2DDWave", + layout_name: str = "", + ) -> None: ... + def create_pi( + self, name: str = "", t: cube_coordinate | tuple[int, int] | tuple[int, int, int] | None = ... + ) -> int: ... + def create_po( + self, s: int, name: str = "", t: cube_coordinate | tuple[int, int] | tuple[int, int, int] | None = ... + ) -> int: ... + def is_pi(self, n: int) -> bool: ... + def is_po(self, n: int) -> bool: ... + def is_pi_coordinate(self, t: cube_coordinate | tuple[int, int] | tuple[int, int, int]) -> bool: ... + def is_po_coordinate(self, t: cube_coordinate | tuple[int, int] | tuple[int, int, int]) -> bool: ... + def is_inv(self) -> bool: ... + def is_and(self) -> bool: ... + def is_nand(self) -> bool: ... + def is_or(self) -> bool: ... + def is_nor(self) -> bool: ... + def is_xor(self) -> bool: ... + def is_xnor(self) -> bool: ... + def is_maj(self) -> bool: ... + def is_fanout(self) -> bool: ... + def is_wire(self) -> bool: ... + def set_layout_name(self, name: str) -> None: ... + def get_layout_name(self) -> str: ... + def set_input_name(self, index: int, name: str) -> None: ... + def get_input_name(self, index: int) -> str: ... + def set_output_name(self, index: int, name: str) -> None: ... + def get_output_name(self, index: int) -> str: ... + def get_name(self, s: int) -> str: ... + def create_buf(self, a: int, t: cube_coordinate | tuple[int, int] | tuple[int, int, int] | None = None) -> int: ... + def create_not(self, a: int, t: cube_coordinate | tuple[int, int] | tuple[int, int, int] | None = None) -> int: ... + def create_and( + self, a: int, b: int, t: cube_coordinate | tuple[int, int] | tuple[int, int, int] | None = None + ) -> int: ... + def create_nand( + self, a: int, b: int, t: cube_coordinate | tuple[int, int] | tuple[int, int, int] | None = None + ) -> int: ... + def create_or( + self, a: int, b: int, t: cube_coordinate | tuple[int, int] | tuple[int, int, int] | None = None + ) -> int: ... + def create_nor( + self, a: int, b: int, t: cube_coordinate | tuple[int, int] | tuple[int, int, int] | None = None + ) -> int: ... + def create_xor( + self, a: int, b: int, t: cube_coordinate | tuple[int, int] | tuple[int, int, int] | None = None + ) -> int: ... + def create_xnor( + self, a: int, b: int, t: cube_coordinate | tuple[int, int] | tuple[int, int, int] | None = None + ) -> int: ... + def create_maj( + self, a: int, b: int, c: int, t: cube_coordinate | tuple[int, int] | tuple[int, int, int] | None = None + ) -> int: ... + def num_pis(self) -> int: ... + def num_pos(self) -> int: ... + def num_gates(self) -> int: ... + def num_wires(self) -> int: ... + def num_crossings(self) -> int: ... + def is_empty(self) -> bool: ... + def fanin_size(self, n: int) -> int: ... + def fanout_size(self, n: int) -> int: ... + def get_tile(self, n: int) -> int: ... + def get_coordinate(self, n: int) -> cube_coordinate: ... + def make_signal(self, n: int) -> int: ... + def move_node( + self, + n: int, + t: cube_coordinate | tuple[int, int] | tuple[int, int, int], + new_children: list[cube_coordinate] = [], + ) -> None: ... + def clear_coordinate(self, t: cube_coordinate | tuple[int, int] | tuple[int, int, int]) -> None: ... + def is_gate_coordinate(self, t: cube_coordinate | tuple[int, int] | tuple[int, int, int]) -> bool: ... + def is_wire_coordinate(self, t: cube_coordinate | tuple[int, int] | tuple[int, int, int]) -> bool: ... + def is_empty_coordinate(self, t: cube_coordinate | tuple[int, int] | tuple[int, int, int]) -> bool: ... + def pis(self) -> list[cube_coordinate]: ... + def pos(self) -> list[cube_coordinate]: ... + def gates(self) -> list[cube_coordinate]: ... + def wires(self) -> list[cube_coordinate]: ... + def fanins(self, t: cube_coordinate | tuple[int, int] | tuple[int, int, int]) -> list[int]: ... + def fanouts(self, t: cube_coordinate | tuple[int, int] | tuple[int, int, int]) -> list[int]: ... + def is_incoming_signal(self, t: cube_coordinate | tuple[int, int] | tuple[int, int, int], s: int) -> bool: ... + def has_no_incoming_signal(self, t: cube_coordinate | tuple[int, int] | tuple[int, int, int]) -> bool: ... + def has_northern_incoming_signal(self, t: cube_coordinate | tuple[int, int] | tuple[int, int, int]) -> bool: ... + def has_north_eastern_incoming_signal( + self, t: cube_coordinate | tuple[int, int] | tuple[int, int, int] + ) -> bool: ... + def has_eastern_incoming_signal(self, t: cube_coordinate | tuple[int, int] | tuple[int, int, int]) -> bool: ... + def has_south_eastern_incoming_signal( + self, t: cube_coordinate | tuple[int, int] | tuple[int, int, int] + ) -> bool: ... + def has_southern_incoming_signal(self, t: cube_coordinate | tuple[int, int] | tuple[int, int, int]) -> bool: ... + def has_south_western_incoming_signal( + self, t: cube_coordinate | tuple[int, int] | tuple[int, int, int] + ) -> bool: ... + def has_western_incoming_signal(self, t: cube_coordinate | tuple[int, int] | tuple[int, int, int]) -> bool: ... + def has_north_western_incoming_signal( + self, t: cube_coordinate | tuple[int, int] | tuple[int, int, int] + ) -> bool: ... + def is_outgoing_signal(self, t: cube_coordinate | tuple[int, int] | tuple[int, int, int], s: int) -> bool: ... + def has_no_outgoing_signal(self, t: cube_coordinate | tuple[int, int] | tuple[int, int, int]) -> bool: ... + def has_northern_outgoing_signal(self, t: cube_coordinate | tuple[int, int] | tuple[int, int, int]) -> bool: ... + def has_north_eastern_outgoing_signal( + self, t: cube_coordinate | tuple[int, int] | tuple[int, int, int] + ) -> bool: ... + def has_eastern_outgoing_signal(self, t: cube_coordinate | tuple[int, int] | tuple[int, int, int]) -> bool: ... + def has_south_eastern_outgoing_signal( + self, t: cube_coordinate | tuple[int, int] | tuple[int, int, int] + ) -> bool: ... + def has_southern_outgoing_signal(self, t: cube_coordinate | tuple[int, int] | tuple[int, int, int]) -> bool: ... + def has_south_western_outgoing_signal( + self, t: cube_coordinate | tuple[int, int] | tuple[int, int, int] + ) -> bool: ... + def has_western_outgoing_signal(self, t: cube_coordinate | tuple[int, int] | tuple[int, int, int]) -> bool: ... + def has_north_western_outgoing_signal( + self, t: cube_coordinate | tuple[int, int] | tuple[int, int, int] + ) -> bool: ... + def bounding_box_2d(self) -> tuple[cube_coordinate, cube_coordinate]: ... + def is_dead(self, n: int) -> bool: ... + +class cartesian_obstruction_layout(cartesian_gate_layout): + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, layout: cartesian_gate_layout) -> None: ... + def obstruct_coordinate(self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> None: ... + def obstruct_connection( + self, + src: offset_coordinate | tuple[int, int] | tuple[int, int, int], + tgt: offset_coordinate | tuple[int, int] | tuple[int, int, int], + ) -> None: ... + def is_obstructed_coordinate(self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> bool: ... + def is_obstructed_connection( + self, + src: offset_coordinate | tuple[int, int] | tuple[int, int, int], + tgt: offset_coordinate | tuple[int, int] | tuple[int, int, int], + ) -> bool: ... + def clear_obstructed_coordinate(self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> None: ... + def clear_obstructed_connection( + self, + src: offset_coordinate | tuple[int, int] | tuple[int, int, int], + tgt: offset_coordinate | tuple[int, int] | tuple[int, int, int], + ) -> None: ... + def clear_obstructed_coordinates(self) -> None: ... + def clear_obstructed_connections(self) -> None: ... + +class shifted_cartesian_obstruction_layout(shifted_cartesian_gate_layout): + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, layout: shifted_cartesian_gate_layout) -> None: ... + def obstruct_coordinate(self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> None: ... + def obstruct_connection( + self, + src: offset_coordinate | tuple[int, int] | tuple[int, int, int], + tgt: offset_coordinate | tuple[int, int] | tuple[int, int, int], + ) -> None: ... + def is_obstructed_coordinate(self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> bool: ... + def is_obstructed_connection( + self, + src: offset_coordinate | tuple[int, int] | tuple[int, int, int], + tgt: offset_coordinate | tuple[int, int] | tuple[int, int, int], + ) -> bool: ... + def clear_obstructed_coordinate(self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> None: ... + def clear_obstructed_connection( + self, + src: offset_coordinate | tuple[int, int] | tuple[int, int, int], + tgt: offset_coordinate | tuple[int, int] | tuple[int, int, int], + ) -> None: ... + def clear_obstructed_coordinates(self) -> None: ... + def clear_obstructed_connections(self) -> None: ... + +class hexagonal_obstruction_layout(hexagonal_gate_layout): + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, layout: hexagonal_gate_layout) -> None: ... + def obstruct_coordinate(self, c: cube_coordinate | tuple[int, int] | tuple[int, int, int]) -> None: ... + def obstruct_connection( + self, + src: cube_coordinate | tuple[int, int] | tuple[int, int, int], + tgt: cube_coordinate | tuple[int, int] | tuple[int, int, int], + ) -> None: ... + def is_obstructed_coordinate(self, c: cube_coordinate | tuple[int, int] | tuple[int, int, int]) -> bool: ... + def is_obstructed_connection( + self, + src: cube_coordinate | tuple[int, int] | tuple[int, int, int], + tgt: cube_coordinate | tuple[int, int] | tuple[int, int, int], + ) -> bool: ... + def clear_obstructed_coordinate(self, c: cube_coordinate | tuple[int, int] | tuple[int, int, int]) -> None: ... + def clear_obstructed_connection( + self, + src: cube_coordinate | tuple[int, int] | tuple[int, int, int], + tgt: cube_coordinate | tuple[int, int] | tuple[int, int, int], + ) -> None: ... + def clear_obstructed_coordinates(self) -> None: ... + def clear_obstructed_connections(self) -> None: ... + +class qca_technology: + class cell_type(Enum): + EMPTY = ... + NORMAL = ... + INPUT = ... + OUTPUT = ... + CONST_0 = ... + CONST_1 = ... + +class inml_technology: + class cell_type(Enum): + EMPTY = ... + NORMAL = ... + INPUT = ... + OUTPUT = ... + SLANTED_EDGE_UP_MAGNET = ... + SLANTED_EDGE_DOWN_MAGNET = ... + INVERTER_MAGNET = ... + CROSSWIRE_MAGNET = ... + FANOUT_COUPLER_MAGNET = ... + +class sidb_technology: + class cell_type(Enum): + EMPTY = ... + NORMAL = ... + INPUT = ... + OUTPUT = ... + LOGIC = ... + +class qca_layout(clocked_cartesian_layout): + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, dimension: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> None: ... + @overload + def __init__( + self, + dimension: offset_coordinate | tuple[int, int] | tuple[int, int, int], + clocking_scheme: str = "2DDWave", + layout_name: str = "", + ) -> None: ... + def assign_cell_type( + self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int], ct: qca_technology.cell_type + ) -> None: ... + def get_cell_type( + self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int] + ) -> qca_technology.cell_type: ... + def is_empty_cell(self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> bool: ... + def assign_cell_name(self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int], n: str) -> None: ... + def get_cell_name(self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> str | None: ... + def set_layout_name(self, name: str) -> None: ... + def get_layout_name(self) -> str: ... + def num_cells(self) -> int: ... + def is_empty(self) -> bool: ... + def num_pis(self) -> int: ... + def num_pos(self) -> int: ... + def is_pi(self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> bool: ... + def is_po(self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> bool: ... + def cells(self) -> list[offset_coordinate]: ... + def pis(self) -> list[offset_coordinate]: ... + def pos(self) -> list[offset_coordinate]: ... + def bounding_box_2d(self) -> tuple[offset_coordinate, offset_coordinate]: ... + +class inml_layout(clocked_cartesian_layout): + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, dimension: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> None: ... + @overload + def __init__( + self, + dimension: offset_coordinate | tuple[int, int] | tuple[int, int, int], + clocking_scheme: str = "2DDWave", + layout_name: str = "", + ) -> None: ... + def assign_cell_type( + self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int], ct: inml_technology.cell_type + ) -> None: ... + def get_cell_type( + self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int] + ) -> inml_technology.cell_type: ... + def is_empty_cell(self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> bool: ... + def assign_cell_name(self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int], n: str) -> None: ... + def get_cell_name(self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> str | None: ... + def set_layout_name(self, name: str) -> None: ... + def get_layout_name(self) -> str: ... + def num_cells(self) -> int: ... + def is_empty(self) -> bool: ... + def num_pis(self) -> int: ... + def num_pos(self) -> int: ... + def is_pi(self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> bool: ... + def is_po(self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> bool: ... + def cells(self) -> list[offset_coordinate]: ... + def pis(self) -> list[offset_coordinate]: ... + def pos(self) -> list[offset_coordinate]: ... + def bounding_box_2d(self) -> tuple[offset_coordinate, offset_coordinate]: ... + +class sidb_layout(clocked_cartesian_layout): + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, dimension: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> None: ... + @overload + def __init__( + self, + dimension: offset_coordinate | tuple[int, int] | tuple[int, int, int], + clocking_scheme: str = "2DDWave", + layout_name: str = "", + ) -> None: ... + def assign_cell_type( + self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int], ct: sidb_technology.cell_type + ) -> None: ... + def get_cell_type( + self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int] + ) -> sidb_technology.cell_type: ... + def is_empty_cell(self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> bool: ... + def assign_cell_name(self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int], n: str) -> None: ... + def get_cell_name(self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> str | None: ... + def set_layout_name(self, name: str) -> None: ... + def get_layout_name(self) -> str: ... + def num_cells(self) -> int: ... + def is_empty(self) -> bool: ... + def num_pis(self) -> int: ... + def num_pos(self) -> int: ... + def is_pi(self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> bool: ... + def is_po(self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> bool: ... + def cells(self) -> list[offset_coordinate]: ... + def pis(self) -> list[offset_coordinate]: ... + def pos(self) -> list[offset_coordinate]: ... + def bounding_box_2d(self) -> tuple[offset_coordinate, offset_coordinate]: ... + +class sidb_100_lattice(sidb_layout): + def __init__( + self, dimension: offset_coordinate | tuple[int, int] | tuple[int, int, int] = ..., name: str = "" + ) -> None: ... + +class sidb_111_lattice(sidb_layout): + def __init__( + self, dimension: offset_coordinate | tuple[int, int] | tuple[int, int, int] = ..., name: str = "" + ) -> None: ... + +# Networks + +class technology_network_node: + def __hash__(self) -> int: ... + +class technology_network: + def __init__(self) -> None: ... + def size(self) -> int: ... + def num_gates(self) -> int: ... + def num_pis(self) -> int: ... + def num_pos(self) -> int: ... + def nodes(self) -> list[technology_network_node]: ... + def gates(self) -> list[technology_network_node]: ... + def pis(self) -> list[technology_network_node]: ... + def pos(self) -> list[technology_network_node]: ... + def fanins(self, n: technology_network_node | int) -> list[technology_network_node]: ... + def is_constant(self, n: technology_network_node | int) -> bool: ... + def is_pi(self, n: technology_network_node | int) -> bool: ... + def is_po(self, n: technology_network_node | int) -> bool: ... + def is_buf(self, n: technology_network_node | int) -> bool: ... + def is_fanout(self, n: technology_network_node | int) -> bool: ... + def is_inv(self, n: technology_network_node | int) -> bool: ... + def is_and(self, n: technology_network_node | int) -> bool: ... + def is_or(self, n: technology_network_node | int) -> bool: ... + def is_xor(self, n: technology_network_node | int) -> bool: ... + def is_maj(self, n: technology_network_node | int) -> bool: ... + def is_nand(self, n: technology_network_node | int) -> bool: ... + def is_nor(self, n: technology_network_node | int) -> bool: ... + def is_xnor(self, n: technology_network_node | int) -> bool: ... + def has_name(self, n: technology_network_node | int) -> bool: ... + def get_name(self, n: technology_network_node | int) -> str | None: ... + def has_output_name(self, index: int) -> bool: ... + def get_output_name(self, index: int) -> str | None: ... + def po_index(self, n: technology_network_node | int) -> int: ... + def po_at(self, index: int) -> technology_network_node: ... + +def read_technology_network(filename: str) -> technology_network: ... + +class dynamic_truth_table: + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, num_vars: int) -> None: ... + def num_vars(self) -> int: ... + def num_blocks(self) -> int: ... + def num_bits(self) -> int: ... + +# Algorithms + +## network transformation + +class substitution_strategy: + BREADTH: ... + DEPTH: ... + +class fanout_substitution_params: + def __init__(self) -> None: ... + + strategy: substitution_strategy + degree: int | None + threshold: int | None + +def fanout_substitution( + network: technology_network, params: fanout_substitution_params | None = ... +) -> technology_network: ... +def is_fanout_substituted(network: technology_network, params: fanout_substitution_params | None = ...) -> bool: ... + +class network_balancing_params: + def __init__(self) -> None: ... + + unify_outputs: bool + +def network_balancing( + network: technology_network, params: network_balancing_params | None = ... +) -> technology_network: ... +def is_balanced(network: technology_network, params: network_balancing_params | None = ...) -> bool: ... + +class technology_mapping_params: + def __init__(self) -> None: ... + + decay: float | None + inv: bool | None + and2: bool | None + nand2: bool | None + or2: bool | None + nor2: bool | None + xor2: bool | None + xnor2: bool | None + and3: bool | None + xor_and: bool | None + or_and: bool | None + onehot: bool | None + maj3: bool | None + gamble: bool | None + dot: bool | None + mux: bool | None + and_xor: bool | None + +class technology_mapping_stats: + def __init__(self) -> None: ... + def report(self) -> None: ... + +def and_or_not() -> technology_mapping_params: ... +def and_or_not_maj() -> technology_mapping_params: ... +def all_standard_2_input_functions() -> technology_mapping_params: ... +def all_standard_3_input_functions() -> technology_mapping_params: ... +def all_supported_standard_functions() -> technology_mapping_params: ... +def technology_mapping( + network: technology_network, + params: technology_mapping_params | None = ..., + stats: technology_mapping_stats | None = None, +) -> technology_network: ... + +## path finding + +@overload +def manhattan_distance( + layout: cartesian_layout | shifted_cartesian_layout, + source: offset_coordinate | tuple[int, int] | tuple[int, int, int], + target: offset_coordinate | tuple[int, int] | tuple[int, int, int], +) -> int: ... +@overload +def manhattan_distance( + layout: hexagonal_layout, + source: cube_coordinate | tuple[int, int] | tuple[int, int, int], + target: cube_coordinate | tuple[int, int] | tuple[int, int, int], +) -> int: ... +@overload +def euclidean_distance( + layout: cartesian_layout | shifted_cartesian_layout, + source: offset_coordinate | tuple[int, int] | tuple[int, int, int], + target: offset_coordinate | tuple[int, int] | tuple[int, int, int], +) -> float: ... +@overload +def euclidean_distance( + layout: hexagonal_layout, + source: cube_coordinate | tuple[int, int] | tuple[int, int, int], + target: cube_coordinate | tuple[int, int] | tuple[int, int, int], +) -> float: ... +@overload +def squared_euclidean_distance( + layout: cartesian_layout | shifted_cartesian_layout, + source: offset_coordinate | tuple[int, int] | tuple[int, int, int], + target: offset_coordinate | tuple[int, int] | tuple[int, int, int], +) -> float: ... +@overload +def squared_euclidean_distance( + layout: hexagonal_layout, + source: cube_coordinate | tuple[int, int] | tuple[int, int, int], + target: cube_coordinate | tuple[int, int] | tuple[int, int, int], +) -> float: ... +@overload +def twoddwave_distance( + layout: cartesian_layout | shifted_cartesian_layout, + source: offset_coordinate | tuple[int, int] | tuple[int, int, int], + target: offset_coordinate | tuple[int, int] | tuple[int, int, int], +) -> int: ... +@overload +def twoddwave_distance( + layout: hexagonal_layout, + source: cube_coordinate | tuple[int, int] | tuple[int, int, int], + target: cube_coordinate | tuple[int, int] | tuple[int, int, int], +) -> int: ... +@overload +def chebyshev_distance( + layout: cartesian_layout | shifted_cartesian_layout, + source: offset_coordinate | tuple[int, int] | tuple[int, int, int], + target: offset_coordinate | tuple[int, int] | tuple[int, int, int], +) -> int: ... +@overload +def chebyshev_distance( + layout: hexagonal_layout, + source: cube_coordinate | tuple[int, int] | tuple[int, int, int], + target: cube_coordinate | tuple[int, int] | tuple[int, int, int], +) -> int: ... + +class a_star_params: + def __init__(self) -> None: ... + + crossings: bool + +@overload +def a_star( + layout: cartesian_obstruction_layout + | cartesian_gate_layout + | cartesian_layout + | shifted_cartesian_obstruction_layout + | shifted_cartesian_gate_layout + | shifted_cartesian_layout, + source: offset_coordinate | tuple[int, int] | tuple[int, int, int], + target: offset_coordinate | tuple[int, int] | tuple[int, int, int], + params: a_star_params | None = ..., +) -> list[offset_coordinate]: ... +@overload +def a_star( + layout: hexagonal_obstruction_layout | hexagonal_gate_layout | hexagonal_layout, + source: cube_coordinate | tuple[int, int] | tuple[int, int, int], + target: cube_coordinate | tuple[int, int] | tuple[int, int, int], + params: a_star_params | None = ..., +) -> list[cube_coordinate]: ... + +class enumerate_all_paths_params: + def __init__(self) -> None: ... + + crossings: bool + +@overload +def enumerate_all_paths( + layout: cartesian_obstruction_layout + | cartesian_gate_layout + | cartesian_layout + | shifted_cartesian_obstruction_layout + | shifted_cartesian_gate_layout + | shifted_cartesian_layout, + source: offset_coordinate | tuple[int, int] | tuple[int, int, int], + target: offset_coordinate | tuple[int, int] | tuple[int, int, int], + params: enumerate_all_paths_params | None = ..., +) -> list[list[offset_coordinate]]: ... +@overload +def enumerate_all_paths( + layout: hexagonal_obstruction_layout | hexagonal_gate_layout | hexagonal_layout, + source: cube_coordinate | tuple[int, int] | tuple[int, int, int], + target: cube_coordinate | tuple[int, int] | tuple[int, int, int], + params: enumerate_all_paths_params | None = ..., +) -> list[list[cube_coordinate]]: ... + +class yen_k_shortest_paths_params: + def __init__(self) -> None: ... + + astar_params: a_star_params + +@overload +def yen_k_shortest_paths( + layout: cartesian_obstruction_layout + | cartesian_gate_layout + | cartesian_layout + | shifted_cartesian_obstruction_layout + | shifted_cartesian_gate_layout + | shifted_cartesian_layout, + source: offset_coordinate | tuple[int, int] | tuple[int, int, int], + target: offset_coordinate | tuple[int, int] | tuple[int, int, int], + k: int, + params: yen_k_shortest_paths_params | None = ..., +) -> list[list[offset_coordinate]]: ... +@overload +def yen_k_shortest_paths( + layout: hexagonal_obstruction_layout | hexagonal_gate_layout | hexagonal_layout, + source: cube_coordinate | tuple[int, int] | tuple[int, int, int], + target: cube_coordinate | tuple[int, int] | tuple[int, int, int], + k: int, + params: yen_k_shortest_paths_params | None = ..., +) -> list[list[cube_coordinate]]: ... + +# physical design + +def apply_qca_one_library(layout: cartesian_gate_layout) -> qca_layout: ... +def apply_topolinano_library(layout: shifted_cartesian_gate_layout) -> inml_layout: ... +def apply_bestagon_library(layout: hexagonal_gate_layout) -> sidb_layout: ... + +class graph_coloring_engine(Enum): + MCS = ... + DSATUR = ... + LMXRLF = ... + TABUCOL = ... + SAT = ... + +class color_routing_params: + def __init__(self) -> None: ... + + conduct_partial_routing: bool + crossings: bool + path_limit: int | None + engine: graph_coloring_engine + partial_sat: bool + +@overload +def color_routing( + layout: cartesian_obstruction_layout + | cartesian_gate_layout + | shifted_cartesian_obstruction_layout + | shifted_cartesian_gate_layout, + objectives: list[tuple[offset_coordinate, offset_coordinate]], + params: color_routing_params | None = ..., +) -> bool: ... +@overload +def color_routing( + layout: hexagonal_obstruction_layout | hexagonal_gate_layout, + objectives: list[tuple[cube_coordinate, cube_coordinate]], + params: color_routing_params | None = ..., +) -> bool: ... + +class technology_constraints(Enum): + NONE: ... + TOPOLINANO: ... + +class exact_params: + def __init__(self) -> None: ... + + scheme: str + upper_bound_area: int + upper_bound_x: int + upper_bound_y: int + fixed_size: bool + num_threads: int + crossings: bool + border_io: bool + straight_inverters: bool + desynchronize: bool + minimize_wires: bool + minimize_crossings: bool + timeout: int + technology_specifics: technology_constraints + +class exact_stats: + time_total: float + x_size: int + y_size: int + num_gates: int + num_wires: int + num_crossings: int + num_aspect_ratios: int + + def __init__(self) -> None: ... + def report(self) -> str: ... + +def exact_cartesian( + network: technology_network, parameters: exact_params | None = None, statistics: exact_stats | None = None +) -> cartesian_gate_layout: ... +def exact_shifted_cartesian( + network: technology_network, parameters: exact_params | None = None, statistics: exact_stats | None = None +) -> shifted_cartesian_gate_layout: ... +def exact_hexagonal( + network: technology_network, parameters: exact_params | None = None, statistics: exact_stats | None = None +) -> hexagonal_gate_layout: ... + +class gold_effort_mode(Enum): + HIGH_EFFICIENCY = ... + HIGH_EFFORT = ... + HIGHEST_EFFORT = ... + +class gold_cost_objective(Enum): + AREA = ... + WIRES = ... + CROSSINGS = ... + ACP = ... + CUSTOM = ... + +class graph_oriented_layout_design_params: + def __init__(self) -> None: ... + + timeout: int + num_vertex_expansions: int + verbose: bool + mode: gold_effort_mode + cost: gold_cost_objective + return_first: bool + planar: bool + enable_multithreading: bool + +class graph_oriented_layout_design_stats: + time_total: float + x_size: int + y_size: int + num_gates: int + num_wires: int + num_crossings: int + + def __init__(self) -> None: ... + def report(self) -> str: ... + +def graph_oriented_layout_design( + network: technology_network, + parameters: graph_oriented_layout_design_params | None = ..., + statistics: graph_oriented_layout_design_stats | None = None, +) -> cartesian_gate_layout: ... + +class hexagonalization_stats: + time_total: float + + def __init__(self) -> None: ... + def report(self) -> str: ... + +def hexagonalization( + layout: cartesian_gate_layout, statistics: hexagonalization_stats | None = None +) -> hexagonal_gate_layout: ... + +class orthogonal_params: + def __init__(self) -> None: ... + +class orthogonal_stats: + time_total: float + x_size: int + y_size: int + num_gates: int + num_wires: int + num_crossings: int + + def __init__(self) -> None: ... + def report(self) -> None: ... + +def orthogonal( + network: technology_network, parameters: orthogonal_params | None = ..., statistics: orthogonal_stats | None = None +) -> cartesian_gate_layout: ... + +class post_layout_optimization_params: + def __init__(self) -> None: ... + + timeout: int + max_gate_relocations: int + optimize_pos_only: bool + planar_optimization: bool + +class post_layout_optimization_stats: + time_total: float + x_size_before: int + y_size_before: int + x_size_after: int + y_size_after: int + area_improvement: float + num_wires_before: int + num_wires_after: int + num_crossings_before: int + num_crossings_after: int + + def __init__(self) -> None: ... + def report(self) -> str: ... + +def post_layout_optimization( + layout: cartesian_gate_layout, + parameters: post_layout_optimization_params | None = ..., + statistics: post_layout_optimization_stats | None = None, +) -> cartesian_gate_layout: ... + +class wiring_reduction_params: + def __init__(self) -> None: ... + + timeout: int + +class wiring_reduction_stats: + time_total: float + x_size_before: int + y_size_before: int + x_size_after: int + y_size_after: int + num_wires_before: int + num_wires_after: int + area_improvement: float + wiring_improvement: float + + def __init__(self) -> None: ... + def report(self) -> str: ... + +def wiring_reduction( + layout: cartesian_gate_layout, + parameters: wiring_reduction_params | None = ..., + statistics: wiring_reduction_stats | None = None, +) -> cartesian_gate_layout: ... +def clear_routing( + lyt: cartesian_obstruction_layout + | cartesian_gate_layout + | shifted_cartesian_layout + | shifted_cartesian_gate_layout + | hexagonal_obstruction_layout + | hexagonal_gate_layout, +) -> None: ... +def critical_path_length_and_throughput( + layout: cartesian_gate_layout | shifted_cartesian_gate_layout | hexagonal_gate_layout, +) -> tuple[int, int]: ... + +# SidB Logic Design + +class design_sidb_gates_stats: + def __init__(self) -> None: ... + +class design_sidb_gates_mode(Enum): + QUICKCELL: ... + AUTOMATIC_EXHAUSTIVE_GATE_DESIGNER: ... + RANDOM: ... + +class design_sidb_gates_params: + def __init__(self) -> None: ... + + operational_params: is_operational_params + design_mode: design_sidb_gates_mode + canvas: tuple[offset_coordinate, offset_coordinate] + number_of_sidbs: int + +def design_sidb_gates( + skeleton: sidb_100_lattice | sidb_111_lattice, + spec: list[dynamic_truth_table], + params: design_sidb_gates_params = ..., + stats: design_sidb_gates_stats | None = None, +) -> list[sidb_100_lattice | sidb_111_lattice]: ... + +## simulation + +### logic + +@overload +def simulate(network: technology_network) -> dict[str, list[bool]]: ... +@overload +def simulate( + layout: cartesian_gate_layout | shifted_cartesian_gate_layout | hexagonal_gate_layout, +) -> dict[str, list[bool]]: ... + +## verification + +class gate_level_drv_params: + def __init__(self) -> None: ... + + unplaced_nodes: bool + placed_dead_nodes: bool + non_adjacent_connections: bool + missing_connections: bool + crossing_gates: bool + clocked_data_flow: bool + has_io: bool + empty_io: bool + io_pins: bool + border_io: bool + +def gate_level_drvs( + layout: cartesian_gate_layout | shifted_cartesian_gate_layout | hexagonal_gate_layout, + params: gate_level_drv_params | None = ..., + print_report: bool | None = False, +) -> tuple[int, int]: ... + +class eq_type(Enum): + NO = ... + WEAK = ... + STRONG = ... + +class equivalence_checking_stats: + def __init__(self) -> None: ... + + eq: eq_type + tp_spec: int + tp_impl: int + tp_diff: int + counter_example: list[bool] + runtime: float + +def equivalence_checking( + specification: technology_network | cartesian_gate_layout | shifted_cartesian_gate_layout | hexagonal_gate_layout, + implementation: technology_network | cartesian_gate_layout | shifted_cartesian_gate_layout | hexagonal_gate_layout, + statistics: equivalence_checking_stats | None = None, +) -> eq_type: ... + +# In/Out + +class fgl_parsing_error(RuntimeError): ... + +def read_cartesian_fgl_layout(filename: str, layout_name: str = "") -> cartesian_gate_layout: ... +def read_shifted_cartesian_fgl_layout(filename: str, layout_name: str = "") -> shifted_cartesian_gate_layout: ... +def read_hexagonal_fgl_layout(filename: str, layout_name: str = "") -> hexagonal_gate_layout: ... + +class unsupported_character_exception(Exception): ... +class undefined_cell_label_exception(Exception): ... +class unrecognized_cell_definition_exception(Exception): ... + +def read_fqca_layout(filename: str, layout_name: str = "") -> qca_layout: ... + +class sqd_parsing_error(RuntimeError): ... + +def read_sqd_layout_100(filename: str, layout_name: str = "") -> sidb_100_lattice: ... +def read_sqd_layout_111(filename: str, layout_name: str = "") -> sidb_111_lattice: ... +def write_dot_network(network: technology_network, filename: str) -> None: ... +def write_dot_layout( + layout: cartesian_gate_layout | shifted_cartesian_gate_layout | hexagonal_gate_layout, filename: str +) -> None: ... +def write_fgl_layout( + layout: cartesian_gate_layout | shifted_cartesian_gate_layout | hexagonal_gate_layout, filename: str +) -> None: ... + +class out_of_cell_names_exception(IndexError): ... + +class write_fqca_layout_params: + def __init__(self) -> None: ... + + create_inter_layer_via_cells: bool + +def write_fqca_layout( + layout: cartesian_gate_layout | shifted_cartesian_gate_layout | hexagonal_gate_layout, + filename: str, + params: write_fqca_layout_params | None = ..., +) -> None: ... + +class sample_writing_mode(Enum): + ALL_SAMPLES: ... + OPERATIONAL_ONLY: ... + +class write_operational_domain_params: + def __init__(self) -> None: ... + operational_tag: str + non_operational_tag: str + writing_mode: sample_writing_mode + +def write_operational_domain( + opdom: operational_domain, filename: str, params: write_operational_domain_params | None = None +) -> None: ... + +class color_mode(Enum): + """Enumeration for color modes in the SVG layout.""" + + LIGHT: int # Light mode for the layout colors + DARK: int # Dark mode for the layout colors + +class sidb_lattice_mode(Enum): + SHOW_LATTICE: ... + HIDE_LATTICE: ... + +class write_sidb_layout_svg_params: + def __init__(self) -> None: ... + lattice_point_size: float + sidb_size: float + sidb_border_width: float + color_background: str + color_mode: color_mode + lattice_mode: sidb_lattice_mode + +class write_qca_layout_svg_params: + def __init__(self) -> None: ... + +def write_sidb_layout_svg( + layout: sidb_100_lattice | sidb_111_lattice | sidb_layout, filename: str, params: write_sidb_layout_svg_params = ... +) -> None: ... +def write_sidb_layout_svg_to_string( + layout: sidb_100_lattice | sidb_111_lattice | sidb_layout, params: write_sidb_layout_svg_params = ... +) -> str: ... +def write_qca_layout_svg(layout: sidb_layout, filename: str, params: write_sidb_layout_svg_params = ...) -> None: ... + +class write_qca_layout_params: + def __init__(self) -> None: ... + + create_inter_layer_via_cells: bool + +def write_qca_layout(layout: qca_layout, filename: str, params: write_qca_layout_params = ...) -> None: ... +def write_qcc_layout(layout: inml_layout, filename: str) -> None: ... +def write_qll_layout(layout: qca_layout | inml_layout, filename: str) -> None: ... +def write_sqd_layout( + layout: sidb_111_lattice | sidb_100_lattice | sidb_layout, + filename: str, +) -> None: ... +def write_sqd_sim_result(layout: sidb_layout, filename: str) -> None: ... + +# Technology + +@overload +def area(layout: qca_layout, width: int = 18, height: int = 18, hspace: int = 2, vspace: int = 2) -> float: ... +@overload +def area(layout: inml_layout, width: int = 50, height: int = 100, hspace: int = 10, vspace: int = 25) -> float: ... +@overload +def area( + layout: sidb_layout, width: float = 0.0, height: float = 0.0, hspace: float = 0.384, vspace: float = 0.384 +) -> float: ... + +# SiDB Technology + +class input_bdl_configuration(Enum): + PERTURBER_ABSENCE_ENCODED: ... + PERTURBER_DISTANCE_ENCODED: ... + +# Class for BDL input iterator parameters +class bdl_input_iterator_params: + def __init__(self) -> None: ... + + bdl_wire_params: detect_bdl_wires_params + input_bdl_config: input_bdl_configuration + +# Class for BDL input iterator +class bdl_input_iterator_100(Iterable): + def __init__(self, lyt: sidb_100_lattice, params: bdl_input_iterator_params = ...) -> None: ... + def __next__(self) -> object: ... + def __eq__(self, m: object) -> bool: ... + def __ne__(self, m: object) -> bool: ... + def __lt__(self, m: int) -> bool: ... + def __le__(self, m: int) -> bool: ... + def __gt__(self, m: int) -> bool: ... + def __ge__(self, m: int) -> bool: ... + def __add__(self, m: int) -> bdl_input_iterator_100: ... + def __iadd__(self, m: int) -> Self: ... + def __sub__(self, m: int) -> bdl_input_iterator_100: ... + def __isub__(self, m: int) -> Self: ... + def __getitem__(self, m: int) -> bdl_input_iterator_100: ... + def num_input_pairs(self) -> int: ... + def get_layout(self) -> sidb_layout: ... + +class bdl_input_iterator_111(Iterable): + def __init__(self, lyt: sidb_111_lattice, params: bdl_input_iterator_params) -> None: ... + def __next__(self) -> object: ... + def __eq__(self, m: object) -> bool: ... + def __ne__(self, m: object) -> bool: ... + def __lt__(self, m: int) -> bool: ... + def __le__(self, m: int) -> bool: ... + def __gt__(self, m: int) -> bool: ... + def __ge__(self, m: int) -> bool: ... + def __add__(self, m: int) -> bdl_input_iterator_111: ... + def __iadd__(self, m: int) -> Self: ... + def __sub__(self, m: int) -> bdl_input_iterator_111: ... + def __isub__(self, m: int) -> Self: ... + def __getitem__(self, m: int) -> bdl_input_iterator_111: ... + def num_input_pairs(self) -> int: ... + def get_layout(self) -> sidb_layout: ... + +class bdl_pair: + def __init__( + self, + t: sidb_technology.cell_type, + u: offset_coordinate | tuple[int, int] | tuple[int, int, int], + l: offset_coordinate | tuple[int, int] | tuple[int, int, int], + ) -> None: ... + type: sidb_technology.cell_type + upper: offset_coordinate | tuple[int, int] | tuple[int, int, int] + lower: offset_coordinate | tuple[int, int] | tuple[int, int, int] + +class detect_bdl_pairs_params: + def __init__(self) -> None: ... + minimum_distance: float + maximum_distance: float + +def detect_bdl_pairs( + lyt: sidb_100_lattice | sidb_111_lattice, + cell_type: sidb_technology.cell_type | None = None, + params: detect_bdl_pairs_params = ..., +) -> list[bdl_pair]: ... + +class sidb_defect_type(Enum): + NONE: ... + DB: ... + SI_VACANCY: ... + SINGLE_DIHYDRIDE: ... + DIHYDRIDE_PAIR: ... + ONE_BY_ONE: ... + THREE_BY_ONE: ... + SILOXANE: ... + RAISED_SI: ... + MISSING_DIMER: ... + ETCH_PIT: ... + STEP_EDGE: ... + GUNK: ... + UNKNOWN: ... + +class sidb_defect: + def __init__( + self, + defect_type: sidb_defect_type = ..., + electric_charge: int = 0, + relative_permittivity: float = 0.0, + screening_distance: float = 0.0, + ) -> None: ... + def __eq__(self, rhs: object) -> bool: ... + def __ne__(self, rhs: object) -> bool: ... + + type: sidb_defect_type + charge: int + epsilon_r: float + lambda_tf: float + +def is_charged_defect_type(defect: sidb_defect_type) -> bool: ... +def is_neutral_defect_type(defect: sidb_defect_type) -> bool: ... +def is_positively_charged_defect(defect: sidb_defect_type) -> bool: ... +def is_negatively_charged_defect(defect: sidb_defect_type) -> bool: ... +def is_neutrally_charged_defect(defect: sidb_defect_type) -> bool: ... +def defect_extent( + defect: sidb_defect_type, + charged_defect_spacing_overwrite: float | None = None, + neutral_defect_spacing_overwrite: float | None = None, +) -> float: ... + +class sidb_charge_state(Enum): + NEGATIVE: int = -1 + NEUTRAL: int = 0 + POSITIVE: int = 1 + NONE: int = 127 + +def charge_state_to_sign(cs: sidb_charge_state) -> int: ... +def sign_to_charge_state(sg: int) -> sidb_charge_state: ... +def charge_configuration_to_string(charge_distribution: list[sidb_charge_state]) -> str: ... + +class dependent_cell_mode(Enum): + FIXED: ... + VARIABLE: ... + +class energy_calculation(Enum): + KEEP_OLD_ENERGY_VALUE: ... + UPDATE_ENERGY: ... + +class charge_distribution_mode(Enum): + UPDATE_CHARGE_DISTRIBUTION: ... + KEEP_CHARGE_DISTRIBUTION: ... + +class charge_index_mode(Enum): + UPDATE_CHARGE_INDEX: ... + KEEP_CHARGE_INDEX: ... + +class charge_distribution_history(Enum): + CONSIDER: ... + NEGLECT: ... + +class sidb_100_lattice_orientation(Enum): + LAT_A: float + LAT_B: float + LAT_C: tuple[float, float] + +class sidb_111_lattice_orientation(Enum): + LAT_A: float + LAT_B: float + LAT_C: tuple[float, float] + +class sidb_simulation_parameters: + def __init__( + self, + base_number: int = 3, + mu_minus: float = -0.32, + relative_permittivity: float = 5.6, + screening_distance: float = 5.0, + ) -> None: ... + def k(self) -> float: ... + def mu_plus(self) -> float: ... + + epsilon_r: float + lambda_tf: float + mu_minus: float + base: int + +class charge_distribution_surface_100(sidb_100_lattice): + @overload + def __init__(self, params: sidb_simulation_parameters = ..., cs: sidb_charge_state = ...) -> None: ... + @overload + def __init__( + self, + lyt: charge_distribution_surface_100, + params: sidb_simulation_parameters = ..., + cs: sidb_charge_state = ..., + ) -> None: ... + @overload + def __init__(self, lyt: charge_distribution_surface_100) -> None: ... + def get_all_sidb_locations_in_nm(self) -> list[tuple[float, float, float]]: ... + def assign_cell_type( + self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int], ct: sidb_technology.cell_type + ) -> None: ... + def assign_physical_parameters(self, params: sidb_simulation_parameters) -> None: ... + def get_phys_params(self) -> sidb_simulation_parameters: ... + def charge_exists(self, cs: sidb_charge_state) -> bool: ... + def cell_to_index(self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> int: ... + def assign_charge_state( + self, + c: offset_coordinate | tuple[int, int] | tuple[int, int, int], + cs: sidb_charge_state, + index_mode: charge_index_mode = ..., + ) -> None: ... + def assign_charge_by_cell_index(self, i: int, cs: sidb_charge_state) -> None: ... + def assign_all_charge_states(self, cs: sidb_charge_state) -> None: ... + def assign_dependent_cell( + self, dependent_cell: offset_coordinate | tuple[int, int] | tuple[int, int, int] + ) -> None: ... + def assign_base_number(self, base: int) -> None: ... + def add_sidb_defect_to_potential_landscape(self, c: sidb_charge_state, defect: sidb_defect) -> None: ... + def erase_defect(self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> None: ... + def assign_charge_state_by_cell_index( + self, index: int, cs: sidb_charge_state, index_mode: charge_index_mode = ... + ) -> None: ... + def get_charge_state(self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> sidb_charge_state: ... + def get_charge_state_by_index(self, index: int) -> sidb_charge_state: ... + def get_all_sidb_charges(self) -> list[sidb_charge_state]: ... + def negative_sidb_detection(self) -> list[int]: ... + def get_nm_distance_between_sidbs( + self, + c1: offset_coordinate | tuple[int, int] | tuple[int, int, int], + c2: offset_coordinate | tuple[int, int] | tuple[int, int, int], + ) -> float: ... + def get_nm_distance_by_indices(self, index1: int, index2: int) -> float: ... + def calculate_chargeless_potential_between_sidbs_by_index(self, index1: int, index2: int) -> float: ... + def calculate_chargeless_potential_between_sidbs( + self, + c1: offset_coordinate | tuple[int, int] | tuple[int, int, int], + c2: offset_coordinate | tuple[int, int] | tuple[int, int, int], + ) -> float: ... + def get_chargeless_potential_between_sidbs( + self, + c1: offset_coordinate | tuple[int, int] | tuple[int, int, int], + c2: offset_coordinate | tuple[int, int] | tuple[int, int, int], + ) -> float: ... + def get_chargeless_potential_by_indices(self, index1: int, index2: int) -> float: ... + def get_potential_between_sidbs( + self, + c1: offset_coordinate | tuple[int, int] | tuple[int, int, int], + c2: offset_coordinate | tuple[int, int] | tuple[int, int, int], + ) -> float: ... + def update_local_potential(self, consider_history: charge_distribution_history) -> None: ... + def get_local_potential(self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> float: ... + def get_local_potential_by_index(self, index: int) -> float: ... + def assign_system_energy_to_zero(self) -> None: ... + def recompute_system_energy(self) -> None: ... + def get_system_energy(self) -> float: ... + def update_after_charge_change( + self, + dep_cell: dependent_cell_mode = ..., + energy_calculation_mode: energy_calculation = ..., + history_mode: charge_distribution_history = ..., + ) -> None: ... + def validity_check(self) -> bool: ... + def is_physically_valid(self) -> bool: ... + def charge_distribution_to_index_general(self) -> int: ... + def charge_distribution_to_index(self) -> int: ... + def get_charge_index_and_base(self) -> tuple[int, int]: ... + def increase_charge_index_by_one( + self, + dependent_cell_fixed: dependent_cell_mode = ..., + recompute_system_energy: energy_calculation = ..., + consider_history: charge_distribution_history = ..., + engine: exact_sidb_simulation_engine = ..., + ) -> None: ... + def get_max_charge_index(self) -> int: ... + def assign_charge_index( + self, charge_index: int, cdc: offset_coordinate | tuple[int, int] | tuple[int, int, int] + ) -> None: ... + def adjacent_search(self, alpha: float, negative_indices: list[int]) -> None: ... + def assign_global_external_potential( + self, potential_value: float, dependent_cell: dependent_cell_mode = ... + ) -> None: ... + def is_three_state_simulation_required(self) -> bool: ... + def get_positive_candidates(self) -> list[int]: ... + def three_state_cell_to_index(self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> int: ... + def two_state_cell_to_index(self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> int: ... + def index_to_cell(self, index: int) -> offset_coordinate: ... + def index_to_three_state_cell(self, index: int) -> offset_coordinate: ... + def index_to_two_state_cell(self, index: int) -> offset_coordinate: ... + def chargeless_potential_at_given_distance(self, distance: float) -> float: ... + def chargeless_potential_generated_by_defect_at_given_distance( + self, distance: float, defect: sidb_defect + ) -> float: ... + def assign_local_external_potential(self, external_potential: float) -> None: ... + def get_local_external_potentials(self) -> list[float]: ... + def get_local_defect_potentials(self) -> list[float]: ... + def get_defects(self) -> list[sidb_defect]: ... + def update_charge_state_of_dependent_cell(self) -> None: ... + def get_charge_index_of_sub_layout(self) -> int: ... + def charge_index_gray_code_to_charge_distribution(self, new_gray_code: int, old_gray_code: int) -> None: ... + def increase_charge_index_of_sub_layout_by_one( + self, + dependent_cell_fixed: dependent_cell_mode = ..., + recompute_system_energy: energy_calculation = ..., + consider_history: charge_distribution_history = ..., + engine: exact_sidb_simulation_engine = ..., + ) -> None: ... + def assign_charge_index_by_gray_code( + self, + current_gray_code: int, + previous_gray_code: int, + dependent_cell: dependent_cell_mode = ..., + energy_calc_mode: energy_calculation = ..., + history_mode: charge_distribution_history = ..., + ) -> None: ... + def reset_charge_index_sub_layout(self) -> None: ... + def get_max_charge_index_sub_layout(self) -> int: ... + def assign_charge_index_by_two_gray_codes(self, gray_code: int, gray_code_old: int) -> None: ... + def get_sidb_order(self) -> list[int]: ... + def add_sidb(self, cell: offset_coordinate | tuple[int, int] | tuple[int, int, int], charge: int) -> None: ... + +class charge_distribution_surface_111(sidb_111_lattice): + @overload + def __init__(self, params: sidb_simulation_parameters = ..., cs: sidb_charge_state = ...) -> None: ... + @overload + def __init__( + self, + lyt: sidb_111_lattice, + params: sidb_simulation_parameters = ..., + cs: sidb_charge_state = ..., + ) -> None: ... + @overload + def __init__(self, lyt: charge_distribution_surface_111) -> None: ... + def get_all_sidb_locations_in_nm(self) -> list[tuple[float, float, float]]: ... + def assign_cell_type( + self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int], ct: sidb_technology.cell_type + ) -> None: ... + def assign_physical_parameters(self, params: sidb_simulation_parameters) -> None: ... + def get_phys_params(self) -> sidb_simulation_parameters: ... + def charge_exists(self, cs: sidb_charge_state) -> bool: ... + def cell_to_index(self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> int: ... + def assign_charge_state( + self, + c: offset_coordinate | tuple[int, int] | tuple[int, int, int], + cs: sidb_charge_state, + index_mode: charge_index_mode = ..., + ) -> None: ... + def assign_charge_by_cell_index(self, i: int, cs: sidb_charge_state) -> None: ... + def assign_all_charge_states(self, cs: sidb_charge_state) -> None: ... + def assign_dependent_cell( + self, dependent_cell: offset_coordinate | tuple[int, int] | tuple[int, int, int] + ) -> None: ... + def assign_base_number(self, base: int) -> None: ... + def add_sidb_defect_to_potential_landscape(self, c: sidb_charge_state, defect: sidb_defect) -> None: ... + def erase_defect(self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> None: ... + def assign_charge_state_by_cell_index( + self, index: int, cs: sidb_charge_state, index_mode: charge_index_mode = ... + ) -> None: ... + def get_charge_state(self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> sidb_charge_state: ... + def get_charge_state_by_index(self, index: int) -> sidb_charge_state: ... + def get_all_sidb_charges(self) -> list[sidb_charge_state]: ... + def negative_sidb_detection(self) -> list[int]: ... + def get_nm_distance_between_sidbs( + self, + c1: offset_coordinate | tuple[int, int] | tuple[int, int, int], + c2: offset_coordinate | tuple[int, int] | tuple[int, int, int], + ) -> float: ... + def get_nm_distance_by_indices(self, index1: int, index2: int) -> float: ... + def calculate_chargeless_potential_between_sidbs_by_index(self, index1: int, index2: int) -> float: ... + def calculate_chargeless_potential_between_sidbs( + self, + c1: offset_coordinate | tuple[int, int] | tuple[int, int, int], + c2: offset_coordinate | tuple[int, int] | tuple[int, int, int], + ) -> float: ... + def get_chargeless_potential_between_sidbs( + self, + c1: offset_coordinate | tuple[int, int] | tuple[int, int, int], + c2: offset_coordinate | tuple[int, int] | tuple[int, int, int], + ) -> float: ... + def get_chargeless_potential_by_indices(self, index1: int, index2: int) -> float: ... + def get_potential_between_sidbs( + self, + c1: offset_coordinate | tuple[int, int] | tuple[int, int, int], + c2: offset_coordinate | tuple[int, int] | tuple[int, int, int], + ) -> float: ... + def update_local_potential(self, consider_history: charge_distribution_history) -> None: ... + def get_local_potential(self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> float: ... + def get_local_potential_by_index(self, index: int) -> float: ... + def assign_system_energy_to_zero(self) -> None: ... + def recompute_system_energy(self) -> None: ... + def get_system_energy(self) -> float: ... + def update_after_charge_change( + self, + dep_cell: dependent_cell_mode = ..., + energy_calculation_mode: energy_calculation = ..., + history_mode: charge_distribution_history = ..., + ) -> None: ... + def validity_check(self) -> bool: ... + def is_physically_valid(self) -> bool: ... + def charge_distribution_to_index_general(self) -> int: ... + def charge_distribution_to_index(self) -> int: ... + def get_charge_index_and_base(self) -> tuple[int, int]: ... + def increase_charge_index_by_one( + self, + dependent_cell_fixed: dependent_cell_mode = ..., + recompute_system_energy: energy_calculation = ..., + consider_history: charge_distribution_history = ..., + engine: exact_sidb_simulation_engine = ..., + ) -> None: ... + def get_max_charge_index(self) -> int: ... + def assign_charge_index( + self, charge_index: int, cdc: offset_coordinate | tuple[int, int] | tuple[int, int, int] + ) -> None: ... + def adjacent_search(self, alpha: float, negative_indices: list[int]) -> None: ... + def assign_global_external_potential( + self, potential_value: float, dependent_cell: dependent_cell_mode = ... + ) -> None: ... + def is_three_state_simulation_required(self) -> bool: ... + def get_positive_candidates(self) -> list[int]: ... + def three_state_cell_to_index(self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> int: ... + def two_state_cell_to_index(self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> int: ... + def index_to_cell(self, index: int) -> offset_coordinate: ... + def index_to_three_state_cell(self, index: int) -> offset_coordinate: ... + def index_to_two_state_cell(self, index: int) -> offset_coordinate: ... + def chargeless_potential_at_given_distance(self, distance: float) -> float: ... + def chargeless_potential_generated_by_defect_at_given_distance( + self, distance: float, defect: sidb_defect + ) -> float: ... + def assign_local_external_potential(self, external_potential: float) -> None: ... + def get_local_external_potentials(self) -> list[float]: ... + def get_local_defect_potentials(self) -> list[float]: ... + def get_defects(self) -> list[sidb_defect]: ... + def update_charge_state_of_dependent_cell(self) -> None: ... + def get_charge_index_of_sub_layout(self) -> int: ... + def charge_index_gray_code_to_charge_distribution(self, new_gray_code: int, old_gray_code: int) -> None: ... + def increase_charge_index_of_sub_layout_by_one( + self, + dependent_cell_fixed: dependent_cell_mode = ..., + recompute_system_energy: energy_calculation = ..., + consider_history: charge_distribution_history = ..., + engine: exact_sidb_simulation_engine = ..., + ) -> None: ... + def assign_charge_index_by_gray_code( + self, + current_gray_code: int, + previous_gray_code: int, + dependent_cell: dependent_cell_mode = ..., + energy_calc_mode: energy_calculation = ..., + history_mode: charge_distribution_history = ..., + ) -> None: ... + def reset_charge_index_sub_layout(self) -> None: ... + def get_max_charge_index_sub_layout(self) -> int: ... + def assign_charge_index_by_two_gray_codes(self, gray_code: int, gray_code_old: int) -> None: ... + def get_sidb_order(self) -> list[int]: ... + def add_sidb(self, cell: offset_coordinate | tuple[int, int] | tuple[int, int, int], charge: int) -> None: ... + +class charge_distribution_surface(sidb_layout): + @overload + def __init__(self, params: sidb_simulation_parameters = ..., cs: sidb_charge_state = ...) -> None: ... + @overload + def __init__( + self, + lyt: sidb_layout, + params: sidb_simulation_parameters = ..., + cs: sidb_charge_state = ..., + ) -> None: ... + @overload + def __init__(self, lyt: charge_distribution_surface) -> None: ... + def get_all_sidb_locations_in_nm(self) -> list[tuple[float, float, float]]: ... + def assign_cell_type( + self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int], ct: sidb_technology.cell_type + ) -> None: ... + def assign_physical_parameters(self, params: sidb_simulation_parameters) -> None: ... + def get_phys_params(self) -> sidb_simulation_parameters: ... + def charge_exists(self, cs: sidb_charge_state) -> bool: ... + def cell_to_index(self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> int: ... + def assign_charge_state( + self, + c: offset_coordinate | tuple[int, int] | tuple[int, int, int], + cs: sidb_charge_state, + index_mode: charge_index_mode = ..., + ) -> None: ... + def assign_charge_by_cell_index(self, i: int, cs: sidb_charge_state) -> None: ... + def assign_all_charge_states(self, cs: sidb_charge_state) -> None: ... + def assign_dependent_cell( + self, dependent_cell: offset_coordinate | tuple[int, int] | tuple[int, int, int] + ) -> None: ... + def assign_base_number(self, base: int) -> None: ... + def add_sidb_defect_to_potential_landscape(self, c: sidb_charge_state, defect: sidb_defect) -> None: ... + def erase_defect(self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> None: ... + def assign_charge_state_by_cell_index( + self, index: int, cs: sidb_charge_state, index_mode: charge_index_mode = ... + ) -> None: ... + def get_charge_state(self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> sidb_charge_state: ... + def get_charge_state_by_index(self, index: int) -> sidb_charge_state: ... + def get_all_sidb_charges(self) -> list[sidb_charge_state]: ... + def negative_sidb_detection(self) -> list[int]: ... + def get_nm_distance_between_sidbs( + self, + c1: offset_coordinate | tuple[int, int] | tuple[int, int, int], + c2: offset_coordinate | tuple[int, int] | tuple[int, int, int], + ) -> float: ... + def get_nm_distance_by_indices(self, index1: int, index2: int) -> float: ... + def calculate_chargeless_potential_between_sidbs_by_index(self, index1: int, index2: int) -> float: ... + def calculate_chargeless_potential_between_sidbs( + self, + c1: offset_coordinate | tuple[int, int] | tuple[int, int, int], + c2: offset_coordinate | tuple[int, int] | tuple[int, int, int], + ) -> float: ... + def get_chargeless_potential_between_sidbs( + self, + c1: offset_coordinate | tuple[int, int] | tuple[int, int, int], + c2: offset_coordinate | tuple[int, int] | tuple[int, int, int], + ) -> float: ... + def get_chargeless_potential_by_indices(self, index1: int, index2: int) -> float: ... + def get_potential_between_sidbs( + self, + c1: offset_coordinate | tuple[int, int] | tuple[int, int, int], + c2: offset_coordinate | tuple[int, int] | tuple[int, int, int], + ) -> float: ... + def update_local_potential(self, consider_history: charge_distribution_history) -> None: ... + def get_local_potential(self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> float: ... + def get_local_potential_by_index(self, index: int) -> float: ... + def assign_system_energy_to_zero(self) -> None: ... + def recompute_system_energy(self) -> None: ... + def get_system_energy(self) -> float: ... + def update_after_charge_change( + self, + dep_cell: dependent_cell_mode = ..., + energy_calculation_mode: energy_calculation = ..., + history_mode: charge_distribution_history = ..., + ) -> None: ... + def validity_check(self) -> bool: ... + def is_physically_valid(self) -> bool: ... + def charge_distribution_to_index_general(self) -> int: ... + def charge_distribution_to_index(self) -> int: ... + def get_charge_index_and_base(self) -> tuple[int, int]: ... + def increase_charge_index_by_one( + self, + dependent_cell_fixed: dependent_cell_mode = ..., + recompute_system_energy: energy_calculation = ..., + consider_history: charge_distribution_history = ..., + engine: exact_sidb_simulation_engine = ..., + ) -> None: ... + def get_max_charge_index(self) -> int: ... + def assign_charge_index( + self, charge_index: int, cdc: offset_coordinate | tuple[int, int] | tuple[int, int, int] + ) -> None: ... + def adjacent_search(self, alpha: float, negative_indices: list[int]) -> None: ... + def assign_global_external_potential( + self, potential_value: float, dependent_cell: dependent_cell_mode = ... + ) -> None: ... + def is_three_state_simulation_required(self) -> bool: ... + def get_positive_candidates(self) -> list[int]: ... + def three_state_cell_to_index(self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> int: ... + def two_state_cell_to_index(self, c: offset_coordinate | tuple[int, int] | tuple[int, int, int]) -> int: ... + def index_to_cell(self, index: int) -> offset_coordinate: ... + def index_to_three_state_cell(self, index: int) -> offset_coordinate: ... + def index_to_two_state_cell(self, index: int) -> offset_coordinate: ... + def chargeless_potential_at_given_distance(self, distance: float) -> float: ... + def chargeless_potential_generated_by_defect_at_given_distance( + self, distance: float, defect: sidb_defect + ) -> float: ... + def assign_local_external_potential(self, external_potential: float) -> None: ... + def get_local_external_potentials(self) -> list[float]: ... + def get_local_defect_potentials(self) -> list[float]: ... + def get_defects(self) -> list[sidb_defect]: ... + def update_charge_state_of_dependent_cell(self) -> None: ... + def get_charge_index_of_sub_layout(self) -> int: ... + def charge_index_gray_code_to_charge_distribution(self, new_gray_code: int, old_gray_code: int) -> None: ... + def increase_charge_index_of_sub_layout_by_one( + self, + dependent_cell_fixed: dependent_cell_mode = ..., + recompute_system_energy: energy_calculation = ..., + consider_history: charge_distribution_history = ..., + engine: exact_sidb_simulation_engine = ..., + ) -> None: ... + def assign_charge_index_by_gray_code( + self, + current_gray_code: int, + previous_gray_code: int, + dependent_cell: dependent_cell_mode = ..., + energy_calc_mode: energy_calculation = ..., + history_mode: charge_distribution_history = ..., + ) -> None: ... + def reset_charge_index_sub_layout(self) -> None: ... + def get_max_charge_index_sub_layout(self) -> int: ... + def assign_charge_index_by_two_gray_codes(self, gray_code: int, gray_code_old: int) -> None: ... + def get_sidb_order(self) -> list[int]: ... + def add_sidb(self, cell: offset_coordinate | tuple[int, int] | tuple[int, int, int], charge: int) -> None: ... + +@overload +def exhaustive_ground_state_simulation( + lyt: sidb_100_lattice, params: sidb_simulation_parameters = ... +) -> sidb_simulation_result_100: ... +@overload +def exhaustive_ground_state_simulation( + lyt: sidb_111_lattice, params: sidb_simulation_parameters = ... +) -> sidb_simulation_result_111: ... + +class sidb_simulation_engine(Enum): + EXGS: ... + QUICKSIM: ... + QUICKEXACT: ... + +class exact_sidb_simulation_engine(Enum): + EXGS: ... + QUICKEXACT: ... + +@overload +def sidb_nm_position( + lyt: charge_distribution_surface | sidb_layout | sidb_100_lattice | sidb_111_lattice, + c: offset_coordinate | tuple[int, int] | tuple[int, int, int], +) -> tuple[float, float]: ... +def sidb_nm_distance( + lyt: sidb_100_lattice | sidb_111_lattice, + source: offset_coordinate | tuple[int, int] | tuple[int, int, int], + target: offset_coordinate | tuple[int, int] | tuple[int, int, int], +) -> tuple[float, float]: ... + +class transition_type(Enum): + NEUTRAL_TO_NEGATIVE: ... + NEGATIVE_TO_NEUTRAL: ... + NEUTRAL_TO_POSITIVE: ... + POSITIVE_TO_NEUTRAL: ... + +class population_stability_information: + def __init__(self) -> None: ... + + critical_cell: tuple[int, int] + transition_from_to: transition_type + minimum_potential_difference_to_transition: float + distance_corresponding_to_potential: float + system_energy: float + +class assess_physical_population_stability_params: + def __init__(self) -> None: ... + + simulation_parameters: sidb_simulation_parameters + precision_for_distance_corresponding_to_potential: float + +def assess_physical_population_stability_100( + lyt: sidb_100_lattice, params: assess_physical_population_stability_params = ... +) -> list[population_stability_information]: ... +def assess_physical_population_stability_111( + lyt: sidb_100_lattice, params: assess_physical_population_stability_params = ... +) -> list[population_stability_information]: ... +def energy_distribution(input_vec: list[charge_distribution_surface]) -> dict[float, int]: ... + +class bdl_wire_selection(Enum): + ALL: ... + INPUT: ... + OUTPUT: ... + +class bdl_wire_100: + def __init__(self, p: list[bdl_pair]) -> None: ... + + pairs: list[bdl_pair] + direction: int + first_bdl_pair: bdl_pair + last_bdl_pair: bdl_pair + +class bdl_wire_111: + def __init__(self, p: list[bdl_pair]) -> None: ... + + pairs: list[bdl_pair] + direction: int + first_bdl_pair: bdl_pair + last_bdl_pair: bdl_pair + +class detect_bdl_wires_params: + def __init__(self) -> None: ... + + threshold_bdl_interdistance: float + bdl_pairs_params: detect_bdl_wires_params + +def detect_bdl_wires_100( + lyt: sidb_100_lattice, params: detect_bdl_wires_params = ..., wire_selection: bdl_wire_selection = ... +) -> list[bdl_wire_100]: ... +def detect_bdl_wires_111( + lyt: sidb_111_lattice, params: detect_bdl_wires_params = ..., wire_selection: bdl_wire_selection = ... +) -> list[bdl_wire_111]: ... + +# Enums +class operational_status: + OPERATIONAL: ... + NON_OPERATIONAL: ... + +class operational_condition: + TOLERATE_KINKS: ... + REJECT_KINKS: ... + +# Class Definitions +class is_operational_params: + def __init__(self) -> None: ... + + simulation_parameters: sidb_simulation_parameters + sim_engine: sidb_simulation_engine + input_bdl_iterator_params: bdl_input_iterator_params + op_condition: operational_condition + +# Functions + +@overload +def is_operational( + lyt: sidb_100_lattice, + spec: list[dynamic_truth_table], + params: is_operational_params = ..., + input_bdl_wire: bdl_wire_100 | None = None, + output_bdl_wire: bdl_wire_100 | None = None, +) -> operational_status: ... +@overload +def is_operational( + lyt: sidb_100_lattice, + spec: list[dynamic_truth_table], + params: is_operational_params = ..., + input_bdl_wire: bdl_wire_111 | None = None, + output_bdl_wire: bdl_wire_111 | None = None, +) -> operational_status: ... +@overload +def operational_input_patterns( + lyt: sidb_100_lattice, + spec: list[dynamic_truth_table], + params: is_operational_params = ..., +) -> list[int]: ... +@overload +def operational_input_patterns( + lyt: sidb_111_lattice, + spec: list[dynamic_truth_table], + params: is_operational_params = ..., +) -> set[int]: ... +@overload +def is_kink_induced_non_operational( + lyt: sidb_100_lattice, + spec: list[dynamic_truth_table], + params: is_operational_params = ..., + input_bdl_wire: list[bdl_wire_100] | None = None, + output_bdl_wire: list[bdl_wire_100] | None = None, +) -> operational_status: ... +@overload +def is_kink_induced_non_operational( + lyt: sidb_111_lattice, + spec: list[dynamic_truth_table], + params: is_operational_params = ..., + input_bdl_wire: list[bdl_wire_111] | None = None, + output_bdl_wire: list[bdl_wire_111] | None = None, +) -> operational_status: ... +def kink_induced_non_operational_input_patterns( + lyt: sidb_100_lattice | sidb_111_lattice, + spec: list[dynamic_truth_table], + params: is_operational_params = ..., +) -> set[int]: ... + +# QuickExact +class quickexact_params: + def __init__(self) -> None: ... + simulation_parameters: sidb_simulation_parameters + base_number_detection: automatic_base_number_detection + local_external_potential: float + global_potential: float + +class automatic_base_number_detection(Enum): + ON = ... + OFF = ... + +def quickexact(lyt: sidb_100_lattice | sidb_111_lattice, params: quickexact_params) -> None: ... + +# QuickSim +class quicksim_params: + def __init__(self) -> None: ... + simulation_parameters: sidb_simulation_parameters + iteration_steps: int + alpha: float + number_threads: int + +def quicksim(lyt: sidb_100_lattice, params: quicksim_params) -> None: ... + +class critical_temperature_stats: + def __init__(self) -> None: ... + def report(self) -> None: ... + + algorithm_name: str + num_valid_lyt: int + is_ground_state_transparent: float + +class critical_temperature_params: + def __init__(self) -> None: ... + + operational_params: dict + confidence_level: float + max_temperature: float + +def critical_temperature_gate_based( + lyt: sidb_100_lattice | sidb_111_lattice, + spec: dict, + params: critical_temperature_params | None = ..., + stats: critical_temperature_stats | None = ..., +) -> float | None: ... +def critical_temperature_non_gate_based( + lyt: sidb_100_lattice | sidb_111_lattice, + params: critical_temperature_params | None = ..., + stats: critical_temperature_stats | None = ..., +) -> float | None: ... + +class parameter_point: + def __init__(self, values: list[float] | None = None) -> None: ... + def __hash__(self) -> int: ... + def __eq__(self, other: object) -> bool: ... + def __ne__(self, other: object) -> bool: ... + + parameters: list[float] + +class sweep_parameter(Enum): + EPSILON_R: ... + LAMBDA_TF: ... + MU_MINUS: ... + +class operational_domain_value_range: + def __init__( + self, + dimension: sweep_parameter, + minimum: float | None = None, + maximum: float | None = None, + step: float | None = None, + ) -> None: ... + + dimension: sweep_parameter + min: float + max: float + step: float + +class operational_domain_params: + def __init__(self) -> None: ... + + operational_params: is_operational_params + sweep_dimensions: list[operational_domain_value_range] + +class operational_domain_stats: + def __init__(self) -> None: ... + + time_total: float + num_simulator_invocations: int + num_evaluated_parameter_combinations: int + num_operational_parameter_combinations: int + num_non_operational_parameter_combinations: int + num_total_parameter_points: int + +class operational_domain: + def __init__(self) -> None: ... + dimensions: list[operational_domain_value_range] + operational_values: dict[parameter_point, str] + def get_value(self, point: parameter_point) -> str: ... + +def operational_domain_grid_search( + lyt: sidb_100_lattice | sidb_111_lattice, + spec: dict, + params: operational_domain_params | None = None, + stats: operational_domain_stats | None = None, +) -> operational_domain | None: ... +def operational_domain_random_sampling( + lyt: sidb_100_lattice | sidb_111_lattice, + spec: dict, + samples: int, + params: operational_domain_params | None = None, + stats: operational_domain_stats | None = None, +) -> operational_domain | None: ... +def operational_domain_flood_fill( + lyt: sidb_100_lattice | sidb_111_lattice, + spec: dict, + samples: int, + params: operational_domain_params | None = None, + stats: operational_domain_stats | None = None, +) -> operational_domain | None: ... +def operational_domain_contour_tracing( + lyt: sidb_100_lattice | sidb_111_lattice, + spec: dict, + samples: int, + params: operational_domain_params | None = None, + stats: operational_domain_stats | None = None, +) -> operational_domain | None: ... +@overload +def calculate_energy_and_state_type_with_kinks_accepted( + energy_distribution: dict[float, int], + valid_charge_distributions: list[sidb_100_lattice], + output_bdl_pairs: list[bdl_wire_100], + spec: list[dynamic_truth_table], + input_index: int, +) -> None: ... +@overload +def calculate_energy_and_state_type_with_kinks_accepted( + energy_distribution: dict[float, int], + valid_charge_distributions: list[sidb_111_lattice], + output_bdl_pairs: list[bdl_wire_111], + spec: list[dynamic_truth_table], + input_index: int, +) -> None: ... +@overload +def calculate_energy_and_state_type_with_kinks_rejected( + energy_distribution: dict[float, int], + valid_charge_distributions: list[sidb_100_lattice], + spec: list[dynamic_truth_table], + input_index: int, + input_bdl_wires: list[bdl_wire_100], + output_bdl_wires: list[bdl_wire_100], +) -> None: ... +@overload +def calculate_energy_and_state_type_with_kinks_rejected( + energy_distribution: dict[float, int], + valid_charge_distributions: list[sidb_111_lattice], + spec: list[dynamic_truth_table], + input_index: int, + input_bdl_wires: list[bdl_wire_111], + output_bdl_wires: list[bdl_wire_111], +) -> None: ... +def can_positive_charges_occur( + lyt: sidb_100_lattice | sidb_111_lattice, + sim_params: sidb_simulation_parameters, +) -> bool: ... +@overload +def check_simulation_results_for_equivalence( + result1: sidb_simulation_result_100, + result2: sidb_simulation_result_100, +) -> bool: ... +@overload +def check_simulation_results_for_equivalence( + result1: sidb_simulation_result_111, + result2: sidb_simulation_result_111, +) -> bool: ... + +class sidb_simulation_result_100: + def __init__(self) -> None: ... + algorithm_name: str + simulation_runtime: float + charge_distributions: list[charge_distribution_surface_100] + simulation_parameters: sidb_simulation_parameters + additional_simulation_parameters: dict[str, Any] + +class sidb_simulation_result_111: + def __init__(self) -> None: ... + algorithm_name: str + simulation_runtime: float + charge_distributions: list[charge_distribution_surface_111] + simulation_parameters: sidb_simulation_parameters + additional_simulation_parameters: dict[str, Any] + +class time_to_solution_params: + def __init__(self) -> None: ... + engine: str + repetitions: int + confidence_level: float + +class time_to_solution_stats: + def __init__(self) -> None: ... + time_to_solution: float + acc: float + mean_single_runtime: float + single_runtime_exact: float + algorithm: str + + def report(self, stream: str | None = None) -> None: ... + +def time_to_solution( + lyt: sidb_100_lattice | sidb_111_lattice, + quickim_params: quicksim_params, + tts_params: time_to_solution_params = ..., + ps: time_to_solution_stats | None = None, +) -> None: ... +@overload +def time_to_solution_for_given_simulation_results( + results_exact: sidb_simulation_result_100, + results_heuristic: list[sidb_simulation_result_100], + confidence_level: float = 0.997, + ps: time_to_solution_stats | None = None, +) -> None: ... +@overload +def time_to_solution_for_given_simulation_results( + results_exact: sidb_simulation_result_111, + results_heuristic: list[sidb_simulation_result_111], + confidence_level: float = 0.997, + ps: time_to_solution_stats | None = None, +) -> None: ... +@overload +def is_ground_state( + heuristic_results: sidb_simulation_result_100, + exhaustive_results: sidb_simulation_result_100, +) -> bool: ... +@overload +def is_ground_state( + heuristic_results: sidb_simulation_result_111, + exhaustive_results: sidb_simulation_result_111, +) -> bool: ... + +class displacement_analysis_mode(Enum): + EXHAUSTIVE = 0 + RANDOM = 1 + +class dimer_displacement_policy(Enum): + STAY_ON_ORIGINAL_DIMER = 0 + ALLOW_OTHER_DIMER = 1 + +class displacement_robustness_domain_params: + def __init__(self) -> None: ... + analysis_mode: displacement_analysis_mode + percentage_of_analyzed_displaced_layouts: float + displacement_variations: int + operational_params: is_operational_params + fixed_sidbs: list[siqad_coordinate | offset_coordinate] + dimer_policy: dimer_displacement_policy + +class displacement_robustness_domain_stats: + def __init__(self) -> None: ... + time_total: float + num_operational_sidb_displacements: int + num_non_operational_sidb_displacements: int + +class displacement_robustness_domain_100: + def __init__(self) -> None: ... + +class displacement_robustness_domain_111: + def __init__(self) -> None: ... + +def determine_displacement_robustness_domain_100( + layout: sidb_100_lattice, + spec: list[dynamic_truth_table], + params: displacement_robustness_domain_params, + stats: displacement_robustness_domain_stats | None = None, +) -> None: ... +def determine_displacement_robustness_domain_111( + layout: sidb_111_lattice, + spec: list[dynamic_truth_table], + params: displacement_robustness_domain_params, + stats: displacement_robustness_domain_stats | None = None, +) -> None: ... +def occupation_probability_gate_based(energy_and_state_type: list[tuple[float, str]], temperature: float) -> float: ... +def occupation_probability_non_gate_based(energy_distribution: list[float], temperature: float) -> float: ... + +class compute_operational_ratio_params: + def __init__(self) -> None: ... + op_domain_params: operational_domain_params + +def compute_operational_ratio( + lyt: sidb_100_lattice | sidb_111_lattice, + spec: list[dynamic_truth_table], + pp: parameter_point, + params: compute_operational_ratio_params = ..., +) -> float: ... +@overload +def determine_groundstate_from_simulation_results( + simulation_results: sidb_simulation_result_100, +) -> list[charge_distribution_surface_100]: ... +@overload +def determine_groundstate_from_simulation_results( + simulation_results: sidb_simulation_result_111, +) -> list[charge_distribution_surface_111]: ... +@overload +def minimum_energy(layouts: list[charge_distribution_surface_100]) -> float: ... +@overload +def minimum_energy(layouts: list[charge_distribution_surface_111]) -> float: ... + +class physically_valid_parameters_domain: + def __init__(self) -> None: ... + def get_excited_state_number_for_parameter(self, pp: parameter_point) -> int: ... + +@overload +def determine_physically_valid_parameters( + cds: charge_distribution_surface_100, params: operational_domain_params = ... +) -> physically_valid_parameters_domain: ... +@overload +def determine_physically_valid_parameters( + cds: charge_distribution_surface_111, params: operational_domain_params = ... +) -> physically_valid_parameters_domain: ... + +# Utils + +# Functions to create various types of truth tables +def create_id_tt() -> Callable[[int], int]: ... +def create_not_tt() -> Callable[[int], int]: ... +def create_and_tt() -> Callable[[int, int], int]: ... +def create_or_tt() -> Callable[[int, int], int]: ... +def create_nand_tt() -> Callable[[int, int], int]: ... +def create_nor_tt() -> Callable[[int, int], int]: ... +def create_xor_tt() -> Callable[[int, int], int]: ... +def create_xnor_tt() -> Callable[[int, int], int]: ... +def create_lt_tt() -> Callable[[int, int], int]: ... +def create_gt_tt() -> Callable[[int, int], int]: ... +def create_le_tt() -> Callable[[int, int], int]: ... +def create_ge_tt() -> Callable[[int, int], int]: ... +def create_and3_tt() -> Callable[[int, int, int], int]: ... +def create_xor_and_tt() -> Callable[[int, int, int], int]: ... +def create_or_and_tt() -> Callable[[int, int, int], int]: ... +def create_onehot_tt() -> Callable[[int], int]: ... +def create_maj_tt() -> Callable[[int, int, int], int]: ... +def create_gamble_tt() -> Callable[[int, int], int]: ... +def create_dot_tt() -> Callable[[int, int], int]: ... +def create_ite_tt() -> Callable[[int, int, int], int]: ... +def create_and_xor_tt() -> Callable[[int, int, int], int]: ... +def create_xor3_tt() -> Callable[[int, int, int], int]: ... +def create_double_wire_tt() -> Callable[[int, int], int]: ... +def create_crossing_wire_tt() -> Callable[[int, int], int]: ... +def create_fan_out_tt() -> Callable[[int], int]: ... +def create_half_adder_tt() -> Callable[[int, int], int]: ... +@overload +def random_coordinate( + coordinate1: offset_coordinate | tuple[int, int] | tuple[int, int, int], + coordinate2: offset_coordinate | tuple[int, int] | tuple[int, int, int], +) -> offset_coordinate: ... +@overload +def random_coordinate( + coordinate1: cube_coordinate | tuple[int, int] | tuple[int, int, int], + coordinate2: cube_coordinate | tuple[int, int] | tuple[int, int, int], +) -> cube_coordinate: ... +@overload +def random_coordinate(coordinate1: siqad_coordinate, coordinate2: siqad_coordinate) -> siqad_coordinate: ... +def normalize_layout_coordinates( + lyt: sidb_100_lattice | sidb_111_lattice | sidb_layout | qca_layout | inml_layout, +) -> None: ... +def convert_potential_to_distance( + potential: float, params: sidb_simulation_parameters = ..., precision: float = 2 +) -> float: ... diff --git a/bindings/mnt/pyfiction/test/algorithms/physical_design/test_hexagonalization.py b/bindings/mnt/pyfiction/test/algorithms/physical_design/test_hexagonalization.py index 3c6c14e11..a3b139a6b 100644 --- a/bindings/mnt/pyfiction/test/algorithms/physical_design/test_hexagonalization.py +++ b/bindings/mnt/pyfiction/test/algorithms/physical_design/test_hexagonalization.py @@ -1,7 +1,14 @@ import os import unittest -from mnt.pyfiction import eq_type, equivalence_checking, hexagonalization, orthogonal, read_technology_network +from mnt.pyfiction import ( + eq_type, + equivalence_checking, + hexagonalization, + hexagonalization_stats, + orthogonal, + read_technology_network, +) dir_path = os.path.dirname(os.path.realpath(__file__)) @@ -15,6 +22,15 @@ def test_hexagonalization_default(self): self.assertEqual(equivalence_checking(network, hex_layout), eq_type.STRONG) self.assertEqual(equivalence_checking(cart_layout, hex_layout), eq_type.STRONG) + def test_hexagonalization_with_stats(self): + network = read_technology_network(dir_path + "/../../resources/mux21.v") + cart_layout = orthogonal(network) + self.assertEqual(equivalence_checking(network, cart_layout), eq_type.STRONG) + stats = hexagonalization_stats() + hex_layout = hexagonalization(cart_layout, statistics=stats) + self.assertEqual(equivalence_checking(network, hex_layout), eq_type.STRONG) + self.assertEqual(equivalence_checking(cart_layout, hex_layout), eq_type.STRONG) + if __name__ == "__main__": unittest.main() diff --git a/bindings/mnt/pyfiction/test/algorithms/physical_design/test_post_layout_optimization.py b/bindings/mnt/pyfiction/test/algorithms/physical_design/test_post_layout_optimization.py index 100fd3e5c..a274db3d6 100644 --- a/bindings/mnt/pyfiction/test/algorithms/physical_design/test_post_layout_optimization.py +++ b/bindings/mnt/pyfiction/test/algorithms/physical_design/test_post_layout_optimization.py @@ -49,7 +49,7 @@ def test_post_layout_optimization_with_stats(self): post_layout_optimization(layout, statistics=stats) self.assertEqual(equivalence_checking(network, layout), eq_type.STRONG) - self.assertGreater(stats.time_total.total_seconds(), 0) + self.assertGreater(stats.time_total, 0) self.assertEqual(stats.x_size_before, 6) self.assertEqual(stats.y_size_before, 8) self.assertEqual(stats.x_size_after, 6) @@ -71,7 +71,7 @@ def test_post_layout_optimization_with_stats_and_parameters(self): post_layout_optimization(layout, params, statistics=stats) self.assertEqual(equivalence_checking(network, layout), eq_type.STRONG) - self.assertGreater(stats.time_total.total_seconds(), 0) + self.assertGreater(stats.time_total, 0) self.assertEqual(stats.x_size_before, 6) self.assertEqual(stats.y_size_before, 8) self.assertEqual(stats.x_size_after, 6) diff --git a/bindings/mnt/pyfiction/test/algorithms/physical_design/test_wiring_reduction.py b/bindings/mnt/pyfiction/test/algorithms/physical_design/test_wiring_reduction.py index d8047d200..93687608b 100644 --- a/bindings/mnt/pyfiction/test/algorithms/physical_design/test_wiring_reduction.py +++ b/bindings/mnt/pyfiction/test/algorithms/physical_design/test_wiring_reduction.py @@ -49,7 +49,7 @@ def test_wiring_reduction_with_stats(self): wiring_reduction(layout, statistics=stats) self.assertEqual(equivalence_checking(network, layout), eq_type.STRONG) - self.assertGreater(stats.time_total.total_seconds(), 0) + self.assertGreater(stats.time_total, 0) self.assertEqual(stats.x_size_before, 6) self.assertEqual(stats.y_size_before, 8) self.assertEqual(stats.x_size_after, 6) @@ -73,7 +73,7 @@ def test_wiring_reduction_with_stats_and_parameters(self): wiring_reduction(layout, params, stats) self.assertEqual(equivalence_checking(network, layout), eq_type.STRONG) - self.assertGreater(stats.time_total.total_seconds(), 0) + self.assertGreater(stats.time_total, 0) self.assertEqual(stats.x_size_before, 6) self.assertEqual(stats.y_size_before, 8) self.assertEqual(stats.x_size_after, 6) diff --git a/bindings/mnt/pyfiction/test/layouts/test_coordinates.py b/bindings/mnt/pyfiction/test/layouts/test_coordinates.py index 7ab56b93b..18bf81574 100644 --- a/bindings/mnt/pyfiction/test/layouts/test_coordinates.py +++ b/bindings/mnt/pyfiction/test/layouts/test_coordinates.py @@ -1,6 +1,6 @@ import unittest -from mnt.pyfiction import cube_coordinate, offset_coordinate, siqad_coordinate +from mnt.pyfiction import area, cube_coordinate, offset_coordinate, siqad_coordinate, volume class TestCoordinates(unittest.TestCase): @@ -32,6 +32,10 @@ def test_unsigned_offset_coordinates(self): self.assertEqual(offset_coordinate(3, 2, 1).__repr__(), "(3,2,1)") + self.assertEqual(area(offset_coordinate(3, 2)), 12) + self.assertEqual(area(offset_coordinate(3, 2, 1)), 12) + self.assertEqual(volume(offset_coordinate(3, 2, 1)), 24) + def test_signed_cube_coordinates(self): cube_coordinate((1, 0)) cube_coordinate((1, 0, 0)) @@ -60,6 +64,10 @@ def test_signed_cube_coordinates(self): self.assertEqual(cube_coordinate(3, 2, 1).__repr__(), "(3,2,1)") + self.assertEqual(area(cube_coordinate(3, 2)), 12) + self.assertEqual(area(cube_coordinate(3, 2, 1)), 12) + self.assertEqual(volume(cube_coordinate(3, 2, 1)), 24) + def test_signed_siqad_coordinates(self): siqad_coordinate((1, 0)) siqad_coordinate((1, 0, 0)) @@ -88,6 +96,9 @@ def test_signed_siqad_coordinates(self): self.assertEqual(siqad_coordinate(3, 2, 1).__repr__(), "(3,2,1)") + self.assertEqual(area(siqad_coordinate(3, 2, 1)), 24) + self.assertEqual(volume(siqad_coordinate(3, 2, 1)), 24) + if __name__ == "__main__": unittest.main() diff --git a/bindings/mnt/pyfiction/test/technology/test_sidb_nm_distance.py b/bindings/mnt/pyfiction/test/technology/test_sidb_nm_distance.py index 29e506419..3e02c23a3 100644 --- a/bindings/mnt/pyfiction/test/technology/test_sidb_nm_distance.py +++ b/bindings/mnt/pyfiction/test/technology/test_sidb_nm_distance.py @@ -1,6 +1,6 @@ import unittest -from mnt.pyfiction import sidb_100_lattice, sidb_111_lattice, sidb_nm_distance_100, sidb_nm_distance_111 +from mnt.pyfiction import sidb_100_lattice, sidb_111_lattice, sidb_nm_distance class TestSiDBNmDistance(unittest.TestCase): @@ -8,25 +8,25 @@ def test_sidb_nm_distance_100_lattice(self): layout_one = sidb_100_lattice((10, 10)) # Replace the placeholders with actual values or function calls - self.assertEqual(sidb_nm_distance_100(layout_one, (0, 0), (0, 0)), 0) - self.assertEqual(sidb_nm_distance_100(layout_one, (1, 0), (1, 0)), 0) - self.assertEqual(sidb_nm_distance_100(layout_one, (1, 1), (1, 1)), 0) + self.assertEqual(sidb_nm_distance(layout_one, (0, 0), (0, 0)), 0) + self.assertEqual(sidb_nm_distance(layout_one, (1, 0), (1, 0)), 0) + self.assertEqual(sidb_nm_distance(layout_one, (1, 1), (1, 1)), 0) # Replace the placeholders with actual values or function calls - self.assertAlmostEqual(sidb_nm_distance_100(layout_one, (0, 0), (2, 0)), 2 * 0.384) - self.assertAlmostEqual(sidb_nm_distance_100(layout_one, (0, 0), (0, 1)), 0.225) + self.assertAlmostEqual(sidb_nm_distance(layout_one, (0, 0), (2, 0)), 2 * 0.384) + self.assertAlmostEqual(sidb_nm_distance(layout_one, (0, 0), (0, 1)), 0.225) def test_sidb_nm_distance_111_lattice(self): layout_one = sidb_111_lattice((10, 10)) # Replace the placeholders with actual values or function calls - self.assertEqual(sidb_nm_distance_111(layout_one, (0, 0), (0, 0)), 0) - self.assertEqual(sidb_nm_distance_111(layout_one, (1, 0), (1, 0)), 0) - self.assertEqual(sidb_nm_distance_111(layout_one, (1, 1), (1, 1)), 0) + self.assertEqual(sidb_nm_distance(layout_one, (0, 0), (0, 0)), 0) + self.assertEqual(sidb_nm_distance(layout_one, (1, 0), (1, 0)), 0) + self.assertEqual(sidb_nm_distance(layout_one, (1, 1), (1, 1)), 0) # Replace the placeholders with actual values or function calls - self.assertAlmostEqual(sidb_nm_distance_111(layout_one, (0, 0), (2, 0)), 1.33) - self.assertAlmostEqual(sidb_nm_distance_111(layout_one, (0, 0), (0, 1)), 0.3839967) + self.assertAlmostEqual(sidb_nm_distance(layout_one, (0, 0), (2, 0)), 1.33) + self.assertAlmostEqual(sidb_nm_distance(layout_one, (0, 0), (0, 1)), 0.3839967) if __name__ == "__main__": diff --git a/docs/algorithms/sidb_simulation.rst b/docs/algorithms/sidb_simulation.rst index 4c3e9f30a..73b981f70 100644 --- a/docs/algorithms/sidb_simulation.rst +++ b/docs/algorithms/sidb_simulation.rst @@ -313,6 +313,8 @@ Determine Physically Valid Parameters .. doxygenfunction:: fiction::determine_physically_valid_parameters .. tab:: Python + .. autoclass:: mnt.pyfiction.physically_valid_parameters_domain + :members: .. autoclass:: mnt.pyfiction.determine_physically_valid_parameters diff --git a/docs/layouts/coordinates.rst b/docs/layouts/coordinates.rst index 17330647f..722dba4dd 100644 --- a/docs/layouts/coordinates.rst +++ b/docs/layouts/coordinates.rst @@ -59,15 +59,9 @@ Utility functions .. doxygenfunction:: fiction::siqad::to_siqad_coord .. tab:: Python - .. autofunction:: mnt.pyfiction.offset_area - .. autofunction:: mnt.pyfiction.cube_area - .. autofunction:: mnt.pyfiction.siqad_area - - .. autofunction:: mnt.pyfiction.offset_volume - .. autofunction:: mnt.pyfiction.cube_volume - .. autofunction:: mnt.pyfiction.siqad_volume + .. autofunction:: mnt.pyfiction.area + .. autofunction:: mnt.pyfiction.volume .. autofunction:: mnt.pyfiction.to_offset_coord .. autofunction:: mnt.pyfiction.to_cube_coord - .. autofunction:: mnt.pyfiction.to_siqad_coord diff --git a/include/fiction/algorithms/physical_design/color_routing.hpp b/include/fiction/algorithms/physical_design/color_routing.hpp index 2b76f8ff3..c93c72e14 100644 --- a/include/fiction/algorithms/physical_design/color_routing.hpp +++ b/include/fiction/algorithms/physical_design/color_routing.hpp @@ -10,12 +10,12 @@ #include "fiction/traits.hpp" #include "fiction/utils/routing_utils.hpp" -#include #include #include -#include -#include +#include +#include +#include #include namespace fiction diff --git a/include/fiction/algorithms/physical_design/exact.hpp b/include/fiction/algorithms/physical_design/exact.hpp index 12f5eb7dd..dcb7d66c3 100644 --- a/include/fiction/algorithms/physical_design/exact.hpp +++ b/include/fiction/algorithms/physical_design/exact.hpp @@ -25,7 +25,6 @@ #include #include #include -#include #include #include #include @@ -36,19 +35,18 @@ #include #include -#include #include #include #include #include #include #include +#include #include #include #include #include #include -#include #include #include #include @@ -940,7 +938,7 @@ class exact_impl /** * Constructs a series of expressions to evaluate how many tiles were occupied by a given edge. Therefore, all * te variables are translated to expressions of the form ite(te, 1, 0) which allows for applying z3::sum to - * them. This is a work around because no such api function for pseudo boolean exists. + * them. This is a workaround because no such api function for pseudo boolean exists. * * @param e Edge to consider. * @param ve Vector of expressions to extend. @@ -958,7 +956,7 @@ class exact_impl // an artificial latch variable counts as an extra 1 clock cycle (n clock phases) if (has_synchronization_elements_v && params.synchronization_elements && !params.desynchronize) { - ve.push_back(z3::ite(get_te(t, e), get_tse(t) * num_phases + one, zero)); + ve.push_back(z3::ite(get_te(t, e), (get_tse(t) * num_phases) + one, zero)); } else { @@ -2366,7 +2364,7 @@ class exact_impl */ void black_list_gates() // TODO take advantage of incremental solving { - const auto gather_black_list_expr = [this](const auto& port, const auto& t) noexcept + const auto gather_black_list_expr = [this](const auto& port, const auto& t) { z3::expr_vector iop{*ctx}; diff --git a/include/fiction/algorithms/verification/equivalence_checking.hpp b/include/fiction/algorithms/verification/equivalence_checking.hpp index 87eb91077..f35b74230 100644 --- a/include/fiction/algorithms/verification/equivalence_checking.hpp +++ b/include/fiction/algorithms/verification/equivalence_checking.hpp @@ -8,15 +8,14 @@ #include "fiction/algorithms/properties/critical_path_length_and_throughput.hpp" #include "fiction/algorithms/verification/design_rule_violations.hpp" #include "fiction/traits.hpp" -#include "fiction/utils/name_utils.hpp" -#include #include #include #include #include #include +#include #include #include #include @@ -27,7 +26,7 @@ namespace fiction /** * The different equivalence types possible. */ -enum class eq_type +enum class eq_type : uint8_t { /** * `Spec` and `Impl` are logically not equivalent OR `Impl` has DRVs. diff --git a/include/fiction/technology/sidb_lattice.hpp b/include/fiction/technology/sidb_lattice.hpp index 60781e766..96c37d269 100644 --- a/include/fiction/technology/sidb_lattice.hpp +++ b/include/fiction/technology/sidb_lattice.hpp @@ -64,7 +64,7 @@ class sidb_lattice : public Lyt * @param ar Highest possible position in the layout. * @param name Layout name. */ - explicit sidb_lattice(const aspect_ratio& ar, const std::string& name = "") : Lyt(ar, name) + explicit sidb_lattice(const aspect_ratio& ar = {}, const std::string& name = "") : Lyt(ar, name) { static_assert(is_cell_level_layout_v, "Lyt is not a cell-level layout"); static_assert(has_sidb_technology_v, "Lyt is not an SiDB layout");