Skip to content

Commit

Permalink
🐍 small fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
Drewniok committed Jan 9, 2025
1 parent 155cc73 commit 1f3b31b
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 22 deletions.
8 changes: 4 additions & 4 deletions bindings/mnt/pyfiction/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
bdl_wire_selection,
calculate_energy_and_state_type_with_kinks_accepted,
calculate_energy_and_state_type_with_kinks_rejected,
can_positive_charge_occur,
can_positive_charges_occur,
cartesian_gate_layout,
# Layouts
cartesian_layout,
Expand Down Expand Up @@ -155,7 +155,7 @@
graph_oriented_layout_design,
graph_oriented_layout_design_params,
graph_oriented_layout_design_stats,
groundstate_from_simulation_results,
groundstate_from_simulation_result,
has_high_degree_fanin_nodes,
hexagonal_gate_layout,
hexagonal_layout,
Expand Down Expand Up @@ -348,7 +348,7 @@
"bdl_wire_selection",
"calculate_energy_and_state_type_with_kinks_accepted",
"calculate_energy_and_state_type_with_kinks_rejected",
"can_positive_charge_occur",
"can_positive_charges_occur",
"cartesian_gate_layout",
# Layouts
"cartesian_layout",
Expand Down Expand Up @@ -457,7 +457,7 @@
"graph_oriented_layout_design",
"graph_oriented_layout_design_params",
"graph_oriented_layout_design_stats",
"groundstate_from_simulation_results",
"groundstate_from_simulation_result",
"has_high_degree_fanin_nodes",
"hexagonal_gate_layout",
"hexagonal_layout",
Expand Down
2 changes: 1 addition & 1 deletion bindings/mnt/pyfiction/pyfiction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#include "pyfiction/algorithms/simulation/sidb/operational_domain_ratio.hpp"
#include "pyfiction/algorithms/simulation/sidb/physically_valid_parameters.hpp"
// #include "pyfiction/algorithms/simulation/sidb/defect_influence.hpp"
#include "pyfiction/algorithms/simulation/sidb/check_simulation_results_for_equivalence.hpp"
#include "pyfiction/algorithms/simulation/sidb/check_simulation_result_for_equivalence.hpp"
#include "pyfiction/algorithms/simulation/sidb/displacement_robustness_domain.hpp"
#include "pyfiction/algorithms/simulation/sidb/groundstate_from_simulation_result.hpp"
#include "pyfiction/algorithms/simulation/sidb/minimum_energy.hpp"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import unittest

from mnt.pyfiction import (
can_positive_charge_occur,
can_positive_charges_occur,
sidb_100_lattice,
sidb_111_lattice,
sidb_simulation_parameters,
Expand All @@ -16,11 +16,11 @@ def test_three_DBs_100_lattice(self):
layout.assign_cell_type((1, 0), sidb_technology.cell_type.NORMAL)
layout.assign_cell_type((2, 0), sidb_technology.cell_type.NORMAL)

self.assertTrue(can_positive_charge_occur(layout, sidb_simulation_parameters()))
self.assertTrue(can_positive_charges_occur(layout, sidb_simulation_parameters()))

params = sidb_simulation_parameters()
params.mu_minus = -0.8
self.assertFalse(can_positive_charge_occur(layout, params))
self.assertFalse(can_positive_charges_occur(layout, params))

def test_three_DBs_111_lattice(self):
layout = sidb_111_lattice((2, 3))
Expand All @@ -31,10 +31,10 @@ def test_three_DBs_111_lattice(self):
params = sidb_simulation_parameters()
params.mu_minus = -0.05

self.assertTrue(can_positive_charge_occur(layout, params))
self.assertTrue(can_positive_charges_occur(layout, params))

params.mu_minus = -0.8
self.assertFalse(can_positive_charge_occur(layout, params))
self.assertFalse(can_positive_charges_occur(layout, params))


if __name__ == "__main__":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
charge_distribution_surface_100,
charge_distribution_surface_111,
exhaustive_ground_state_simulation,
groundstate_from_simulation_results,
groundstate_from_simulation_result,
sidb_100_lattice,
sidb_111_lattice,
sidb_charge_state,
Expand Down Expand Up @@ -54,7 +54,7 @@ def test_perturber_and_sidb_pair_111(self):

self.assertEqual(result.algorithm_name, "ExGS")

groundstate = groundstate_from_simulation_results(result)
groundstate = groundstate_from_simulation_result(result)

self.assertEqual(len(groundstate), 1)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from mnt.pyfiction import (
charge_distribution_surface_100,
charge_distribution_surface_111,
groundstate_from_simulation_results,
groundstate_from_simulation_result,
sidb_100_lattice,
sidb_111_lattice,
sidb_charge_state,
Expand Down Expand Up @@ -32,7 +32,7 @@ def test_three_DBs_100_lattice(self):
results = sidb_simulation_result_100()
results.charge_distributions = [cds1, cds2, cds3]

ground_state = groundstate_from_simulation_results(results)
ground_state = groundstate_from_simulation_result(results)
self.assertEqual(len(ground_state), 1)

groundstate = ground_state[0]
Expand All @@ -57,7 +57,7 @@ def test_three_DBs_111_lattice(self):
results = sidb_simulation_result_111()
results.charge_distributions = [cds1, cds2, cds3]

result = groundstate_from_simulation_results(results)
result = groundstate_from_simulation_result(results)
self.assertEqual(len(result), 1)

ground_state = result[0]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
automatic_base_number_detection,
charge_distribution_surface_100,
charge_distribution_surface_111,
groundstate_from_simulation_results,
groundstate_from_simulation_result,
quickexact,
quickexact_params,
sidb_100_lattice,
Expand Down Expand Up @@ -66,7 +66,7 @@ def test_perturber_and_sidb_pair_111(self):

self.assertEqual(result.algorithm_name, "QuickExact")

groundstate = groundstate_from_simulation_results(result)
groundstate = groundstate_from_simulation_result(result)

self.assertEqual(len(groundstate), 1)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from mnt.pyfiction import (
charge_distribution_surface,
charge_distribution_surface_111,
groundstate_from_simulation_results,
groundstate_from_simulation_result,
quicksim,
quicksim_params,
sidb_100_lattice,
Expand Down Expand Up @@ -71,7 +71,7 @@ def test_perturber_and_sidb_pair_111(self):

self.assertEqual(result.algorithm_name, "QuickSim")

groundstate = groundstate_from_simulation_results(result)
groundstate = groundstate_from_simulation_result(result)

self.assertEqual(len(groundstate), 1)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from mnt.pyfiction import (
charge_distribution_surface_100,
charge_distribution_surface_111,
groundstate_from_simulation_results,
groundstate_from_simulation_result,
sidb_100_lattice,
sidb_111_lattice,
sidb_charge_state,
Expand All @@ -29,7 +29,7 @@ def test_negative_and_neutral_layout_100_lattice(self):

result.charge_distributions = [cds_negative, cds_neutral]

groundstate = groundstate_from_simulation_results(result)
groundstate = groundstate_from_simulation_result(result)

self.assertEqual(len(groundstate), 1)
self.assertEqual(groundstate[0].get_charge_state((0, 1)), sidb_charge_state.NEUTRAL)
Expand All @@ -49,7 +49,7 @@ def test_negative_and_neutral_layout_111_lattice(self):

result.charge_distributions = [cds_negative, cds_neutral]

groundstate = groundstate_from_simulation_results(result)
groundstate = groundstate_from_simulation_result(result)

self.assertEqual(len(groundstate), 1)
self.assertEqual(groundstate[0].get_charge_state((0, 1)), sidb_charge_state.NEUTRAL)
Expand Down

0 comments on commit 1f3b31b

Please sign in to comment.