Skip to content

Commit

Permalink
✨ Finalized technology package in pyfiction
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelwa committed Nov 21, 2023
1 parent 0379977 commit 5284fed
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 12 deletions.
21 changes: 10 additions & 11 deletions bindings/pyfiction/include/pyfiction/technology/sidb_defects.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

#include <fiction/technology/sidb_defects.hpp>

#include <pybind11/operators.h>
#include <pybind11/pybind11.h>

namespace pyfiction
Expand All @@ -17,7 +18,7 @@ namespace pyfiction
inline void sidb_defects(pybind11::module& m)
{
namespace py = pybind11;
using namespace pybind11::literals;
using namespace py::literals;

py::enum_<fiction::sidb_defect_type>(m, "sidb_defect_type", DOC(fiction_sidb_defect_type))
.value("NONE", fiction::sidb_defect_type::NONE, DOC(fiction_sidb_defect_type_NONE))
Expand Down Expand Up @@ -49,20 +50,18 @@ inline void sidb_defects(pybind11::module& m)
.def_readonly("epsilon_r", &fiction::sidb_defect::epsilon_r, DOC(fiction_sidb_defect_epsilon_r))
.def_readonly("lambda_tf", &fiction::sidb_defect::lambda_tf, DOC(fiction_sidb_defect_lambda_tf))

.def(py::self == py::self, "rhs"_a)
//, DOC(fiction_sidb_defect_operator_eq))
.def(py::self != py::self, "rhs"_a)
//, DOC(fiction_sidb_defect_operator_ne))
.def(py::self == py::self, "rhs"_a, DOC(fiction_sidb_defect_operator_eq))
.def(py::self != py::self, "rhs"_a, DOC(fiction_sidb_defect_operator_ne))

;

m.def("is_charged_defect", &fiction::is_charged_defect, "defect"_a, DOC(fiction_is_charged_defect));
m.def("is_positively_charged_defect", &fiction::is_positively_charged_defect, "defect"_a);
//, DOC(fiction_is_positively_charged_defect));
m.def("is_negatively_charged_defect", &fiction::is_negatively_charged_defect, "defect"_a);
//, DOC(fiction_is_negatively_charged_defect));
m.def("is_neutrally_charged_defect", &fiction::is_neutrally_charged_defect, "defect"_a);
// ,DOC(fiction_is_neutrally_charged_defect));
m.def("is_positively_charged_defect", &fiction::is_positively_charged_defect, "defect"_a,
DOC(fiction_is_positively_charged_defect));
m.def("is_negatively_charged_defect", &fiction::is_negatively_charged_defect, "defect"_a,
DOC(fiction_is_negatively_charged_defect));
m.def("is_neutrally_charged_defect", &fiction::is_neutrally_charged_defect, "defect"_a,
DOC(fiction_is_neutrally_charged_defect));

m.def("defect_extent", &fiction::defect_extent, "defect"_a, DOC(fiction_defect_extent));
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
//
// Created by marcel on 21.11.23.
//

#ifndef PYFICTION_SIDB_NM_POSITION_HPP
#define PYFICTION_SIDB_NM_POSITION_HPP

#include "pyfiction/documentation.hpp"
#include "pyfiction/types.hpp"

#include <fiction/technology/sidb_nm_position.hpp>

#include <pybind11/pybind11.h>
#include <pybind11/stl.h>

namespace pyfiction
{

namespace detail
{

template <typename Lyt>
void sidb_nm_position(pybind11::module& m)
{
using namespace pybind11::literals;

m.def("sidb_nm_position", &fiction::sidb_nm_position<Lyt>, "sp"_a, "c"_a, DOC(fiction_sidb_nm_position));
}

} // namespace detail

inline void sidb_nm_position(pybind11::module& m)
{
detail::sidb_nm_position<py_charge_distribution_surface>(m);
}

} // namespace pyfiction

#endif // PYFICTION_SIDB_NM_POSITION_HPP
4 changes: 3 additions & 1 deletion bindings/pyfiction/pyfiction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
// #include "pyfiction/algorithms/simulation/sidb/random_sidb_layout_generator.hpp"
#include "pyfiction/algorithms/simulation/sidb/assess_physical_population_stability.hpp"
#include "pyfiction/algorithms/simulation/sidb/convert_potential_to_distance.hpp"
#include "pyfiction/algorithms/simulation/sidb/sidb_charge_state.hpp"
#include "pyfiction/algorithms/simulation/sidb/sidb_simulation_engine.hpp"
#include "pyfiction/algorithms/simulation/sidb/sidb_simulation_parameters.hpp"
#include "pyfiction/algorithms/simulation/sidb/sidb_simulation_result.hpp"
Expand Down Expand Up @@ -69,7 +68,9 @@
#include "pyfiction/networks/truth_tables.hpp"
#include "pyfiction/technology/area.hpp"
#include "pyfiction/technology/charge_distribution_surface.hpp"
#include "pyfiction/technology/sidb_charge_state.hpp"
#include "pyfiction/technology/sidb_defects.hpp"
#include "pyfiction/technology/sidb_nm_position.hpp"
#include "pyfiction/utils/routing_utils.hpp"
#include "pyfiction/utils/truth_table_utils.hpp"

Expand Down Expand Up @@ -164,6 +165,7 @@ PYBIND11_MODULE(pyfiction, m)
pyfiction::area(m);
pyfiction::sidb_defects(m);
pyfiction::sidb_charge_state(m);
pyfiction::sidb_nm_position(m);
pyfiction::charge_distribution_surface(m);
/**
* Input/Output
Expand Down
1 change: 1 addition & 0 deletions include/fiction/technology/sidb_nm_position.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ template <typename Lyt>

return std::make_pair(x, y);
}

} // namespace fiction

#endif // FICTION_NM_POSITION_HPP

0 comments on commit 5284fed

Please sign in to comment.