Defect Simulation

Displacement Robustness Domain

Header: fiction/technology/sidb/simulation/defects/displacement_robustness_domain.hpp

struct displacement_robustness_domain

The displacement robustness domain of an SiDB gate: every analyzed displaced layout together with its operational status.

Public Members

std::vector<std::pair<layout, logic::operational_status>> operational_values = {}

The displaced layouts and their operational status.

struct displacement_robustness_domain_params

Parameters of the displacement robustness analysis.

Public Types

enum class displacement_analysis_mode : uint8_t

Whether every displaced layout is analyzed or only a random share.

Values:

enumerator EXHAUSTIVE

All displaced layouts are analyzed.

enumerator RANDOM

A random share of the displaced layouts is analyzed.

enum class dimer_displacement_policy : uint8_t

Whether a displaced SiDB may leave its dimer.

Values:

enumerator STAY_ON_ORIGINAL_DIMER

The SiDB stays on its dimer: only the two sites of the dimer are possible positions.

enumerator ALLOW_OTHER_DIMER

The SiDB may be displaced across dimers.

Public Members

displacement_analysis_mode analysis_mode = {displacement_analysis_mode::EXHAUSTIVE}

The analysis mode.

double percentage_of_analyzed_displaced_layouts = {1.0}

Share of the displaced layouts to analyze in RANDOM mode.

std::pair<uint64_t, uint64_t> displacement_variations = {1, 0}

Maximum displacement in columns and rows; the displaced sites must remain representable.

logic::is_operational_params operational_params = {}

Operational parameters. Their timeout bounds the entire displacement analysis across all layouts and workers. Finite budgets reject ClusterComplete and throw utils::timeout_error on expiration.

std::set<lattice_site> fixed_sidbs = {}

SiDBs that are not displaced.

dimer_displacement_policy dimer_policy = {dimer_displacement_policy::STAY_ON_ORIGINAL_DIMER}

The dimer policy.

std::size_t number_of_threads = {std::max(std::size_t{std::thread::hardware_concurrency()}, std::size_t{1})}

Number of threads to use.

utils::progress_callback on_progress = {}

Callback that receives the number of analyzed displaced layouts.

struct displacement_robustness_domain_stats

Statistics of the displacement robustness analysis.

Public Members

mockturtle::stopwatch::duration time_total = {0}

Total runtime.

std::size_t num_operational_sidb_displacements = {0}

Number of operational displaced layouts.

std::size_t num_non_operational_sidb_displacements = {0}

Number of non-operational displaced layouts.

inline displacement_robustness_domain fiction::sidb::simulation::defects::determine_displacement_robustness_domain(const layout &lyt, const std::vector<kitty::dynamic_truth_table> &spec, const displacement_robustness_domain_params &params = {}, displacement_robustness_domain_stats *stats = nullptr)

During fabrication, SiDBs may not align precisely with their intended atomic positions, resulting in displacement. This means that an SiDB is fabricated close to the desired one, typically one or a few H-Si positions away. Consequently, depending on the fabrication speed, a certain number of SiDBs may experience displacement.

This function determines the operational status of all possible displacements of the SiDBs of the given SiDB layout, based on the provided truth table specification and displacement robustness computation parameters. The number of displacements grows exponentially with the number of SiDBs. For small layouts, all displacements can be analyzed. For larger layouts, random sampling can be applied, controllable by the analysis_mode and percentage_of_analyzed_displaced_layouts in params.

Displaced layouts retain the layout name and the defects at their original positions.

Parameters:
  • lyt – The SiDB layout which is analyzed.

  • spec – Vector of truth table specifications.

  • params – Parameters for the displacement robustness computation.

  • stats – Statistics related to the displacement robustness computation.

Throws:

std::out_of_range – if a displacement exceeds the lattice-site range.

Returns:

The displacement robustness domain of the SiDB layout.

inline double fiction::sidb::simulation::defects::determine_probability_of_fabricating_operational_gate(const layout &lyt, const std::vector<kitty::dynamic_truth_table> &spec, const displacement_robustness_domain_params &params = {}, const double fabrication_error_rate = 1.0)

During fabrication, SiDBs may not align precisely with their intended atomic positions, resulting in displacement. This means that an SiDB is fabricated close to the desired one, typically one or a few H-Si positions away. The percentage of displaced SiDBs depends on the fabrication speed. Therefore, SiDB layouts with high displacement tolerance are preferred to speed up the fabrication process.

This function calculates the probability of fabricating an operational SiDB layout for an originally given SiDB layout and a given fabrication error rate. A fabrication error rate of 0.0 or negative indicates that the SiDB layout is designed without displacement.

Parameters:
  • lyt – The SiDB layout which is analyzed.

  • spec – Vector of truth table specifications.

  • params – Parameters for the displacement robustness computation.

  • fabrication_error_rate – The fabrication error rate. For example, 0.1 describes that 10% of all manufactured SiDBs have a slight displacement.

Throws:

std::out_of_range – if a displacement exceeds the lattice-site range.

Returns:

The probability of fabricating an operational SiDB layout.

class dimer_displacement_policy(*values)

Whether a displaced SiDB may leave its dimer.

STAY_ON_ORIGINAL_DIMER = 0
ALLOW_OTHER_DIMER = 1
class displacement_analysis_mode(*values)

Whether every displaced layout is analyzed or only a random share.

EXHAUSTIVE = 0
RANDOM = 1
class displacement_robustness_domain_params

Parameters of the displacement robustness analysis.

property analysis_mode

The analysis mode.

property dimer_policy

The dimer policy.

property displacement_variations

Maximum displacement in columns and rows; the displaced sites must remain representable.

property fixed_sidbs

SiDBs that are not displaced.

property number_of_threads

Number of threads to use.

property on_progress

Callback that receives the number of analyzed displaced layouts.

property operational_params

Operational parameters. Their timeout bounds the entire displacement analysis across all layouts and workers. Finite budgets reject ClusterComplete and throw utils::timeout_error on expiration.

property percentage_of_analyzed_displaced_layouts

Share of the displaced layouts to analyze in RANDOM mode.

class displacement_robustness_domain_stats

Statistics of the displacement robustness analysis.

property num_non_operational_sidb_displacements

Number of non-operational displaced layouts.

property num_operational_sidb_displacements

Number of operational displaced layouts.

property time_total

Total runtime.

class displacement_robustness_domain

The displacement robustness domain of an SiDB gate: every analyzed displaced layout together with its operational status.

property influence_information

The displaced layouts and their operational status.

determine_displacement_robustness_domain(layout: mnt.pyfiction.sidb.sidb_layout, spec: collections.abc.Sequence[mnt.pyfiction.synthesis.dynamic_truth_table], params: mnt.pyfiction.sidb.simulation.defects.displacement_robustness_domain_params = <mnt.pyfiction.sidb.simulation.defects.displacement_robustness_domain_params object at 0x579c36dead50>, stats: mnt.pyfiction.sidb.simulation.defects.displacement_robustness_domain_stats | None = None) → displacement_robustness_domain

During fabrication, SiDBs may not align precisely with their intended atomic positions, resulting in displacement. This means that an SiDB is fabricated close to the desired one, typically one or a few H-Si positions away. Consequently, depending on the fabrication speed, a certain number of SiDBs may experience displacement.

This function determines the operational status of all possible displacements of the SiDBs of the given SiDB layout, based on the provided truth table specification and displacement robustness computation parameters. The number of displacements grows exponentially with the number of SiDBs. For small layouts, all displacements can be analyzed. For larger layouts, random sampling can be applied, controllable by the analysis_mode and percentage_of_analyzed_displaced_layouts in params.

Displaced layouts retain the layout name and the defects at their original positions.

Parameters:
  • lyt – The SiDB layout which is analyzed.

  • spec – Vector of truth table specifications.

  • params – Parameters for the displacement robustness computation.

  • stats – Statistics related to the displacement robustness computation.

Returns:

The displacement robustness domain of the SiDB layout.

Raises:

std::out_of_range – if a displacement exceeds the lattice-site range.

Defect Influence

Header: fiction/technology/sidb/simulation/defects/defect_influence.hpp

struct defect_influence_params

Parameters of the defect influence analysis.

Public Types

enum class influence_definition : uint8_t

What counts as an influence of the defect on the layout.

Values:

enumerator OPERATIONALITY_CHANGE

The defect changes the operational status of the layout (a specification is required).

enumerator GROUND_STATE_CHANGE

The defect changes the ground state of the layout (for every input pattern if a specification is given).

Public Members

model::defect defect = {}

The defect to place.

logic::is_operational_params operational_params = {}

Operational and simulation parameters. Their timeout bounds the entire defect domain calculation, including ground-state comparisons. Expiration throws utils::timeout_error without returning a partial result.

std::pair<int32_t, int32_t> additional_scanning_area = {50, 6}

The scanning area extends the layout’s bounding box by this many columns and rows in every direction.

influence_definition influence_def = {influence_definition::OPERATIONALITY_CHANGE}

The influence definition.

std::size_t number_of_threads = {std::max(std::size_t{std::thread::hardware_concurrency()}, std::size_t{1})}

Number of threads to use.

utils::progress_callback on_progress = {}

Callback that receives the number of evaluated defect positions or, for QuickTrace, contour points.

enum class fiction::sidb::simulation::defects::defect_influence_status : uint8_t

Whether a defect at a position influences the layout.

Values:

enumerator INFLUENTIAL

The defect influences the layout.

enumerator NON_INFLUENTIAL

The defect does not influence the layout.

class defect_influence_domain : public fiction::sidb::simulation::domain<lattice_site, defect_influence_status>

The influence of a defect on a layout for every evaluated defect position.

struct defect_influence_stats

Statistics of the defect influence analysis.

inline defect_influence_domain fiction::sidb::simulation::defects::defect_influence_grid_search(const layout &lyt, const std::vector<kitty::dynamic_truth_table> &spec, const defect_influence_params &params = {}, const std::size_t step_size = 1, defect_influence_stats *stats = nullptr)

This algorithm uses a grid search to determine the defect influence domain. The grid search is performed by exhaustively sweeping all possible atomic defect positions in x and y dimensions.

Parameters:
  • lyt – Layout to compute the defect influence domain for.

  • spec – Expected Boolean function of the layout given as a multi-output truth table.

  • step_size – The parameter specifying the interval between consecutive defect positions to be evaluated.

  • params – Defect influence domain computation parameters.

  • stats – Statistics.

Throws:
  • std::invalid_argument – if step_size is zero.

  • std::invalid_argument – if spec is empty.

  • std::invalid_argument – if params.additional_scanning_area contains a negative value.

Returns:

The defect influence domain of the layout.

inline defect_influence_domain fiction::sidb::simulation::defects::defect_influence_grid_search(const layout &lyt, const defect_influence_params &params = {}, const std::size_t step_size = 1, defect_influence_stats *stats = nullptr)

This algorithm uses a grid search to determine the defect influence domain. The grid search is performed by exhaustively sweeping all possible atomic defect positions in x and y dimensions.

Set params.influence_def to GROUND_STATE_CHANGE to compare ground states without a truth table. With OPERATIONALITY_CHANGE, this overload classifies sampled defect positions as non-influential.

Parameters:
  • lyt – Layout to compute the defect influence domain for.

  • step_size – The parameter specifying the interval between consecutive defect positions to be evaluated.

  • params – Defect influence domain computation parameters.

  • stats – Statistics.

Throws:
  • std::invalid_argument – if step_size is zero.

  • std::invalid_argument – if params.additional_scanning_area contains a negative value.

Returns:

The defect influence domain of the layout.

inline defect_influence_domain fiction::sidb::simulation::defects::defect_influence_random_sampling(const layout &lyt, const std::vector<kitty::dynamic_truth_table> &spec, const std::size_t samples, const defect_influence_params &params = {}, defect_influence_stats *stats = nullptr)

This algorithm uses random sampling to find a part of the defect influence domain that might not be complete. It performs a total of samples uniformly-distributed random samples within the specified area.

Parameters:
  • lyt – Layout to compute the defect influence domain for.

  • spec – Expected Boolean function of the layout given as a multi-output truth table.

  • samples – Number of random samples to perform.

  • params – Defect influence domain computation parameters.

  • stats – Statistics.

Throws:
  • std::invalid_argument – if spec is empty.

  • std::invalid_argument – if params.additional_scanning_area contains a negative value.

Returns:

The (partial) defect influence domain of the layout.

inline defect_influence_domain fiction::sidb::simulation::defects::defect_influence_random_sampling(const layout &lyt, const std::size_t samples, const defect_influence_params &params = {}, defect_influence_stats *stats = nullptr)

This algorithm uses random sampling to find a part of the defect influence domain that might not be complete. It performs a total of samples uniformly-distributed random samples within the specified area.

Set params.influence_def to GROUND_STATE_CHANGE to compare ground states without a truth table. With OPERATIONALITY_CHANGE, this overload classifies sampled defect positions as non-influential.

Parameters:
  • lyt – Layout to compute the defect influence domain for.

  • samples – Number of random samples to perform.

  • params – Defect influence domain computation parameters.

  • stats – Statistics.

Throws:

std::invalid_argument – if params.additional_scanning_area contains a negative value.

Returns:

The (partial) defect influence domain of the layout.

inline defect_influence_domain fiction::sidb::simulation::defects::defect_influence_quicktrace(const layout &lyt, const std::vector<kitty::dynamic_truth_table> &spec, const std::size_t samples, const defect_influence_params &params = {}, defect_influence_stats *stats = nullptr)

The QuickTrace algorithm which was proposed in “QuickTrace: An Efficient Contour Tracing Algorithm for Defect Robustness Simulation of Silicon Dangling Bond Logic” by J. Drewniok, M. Walter, and R. Wille in ISCAS 2025 (https://ieeexplore.ieee.org/document/11044082) applies contour tracing to identify the boundary (contour) between influencing and non-influencing defect positions for a given SiDB layout.

The algorithm uses a screened Coulomb potential, where the electrostatic interaction weakens as distance increases. If a defect at position p causes the SiDB layout to be non-influential, then defects further away from the layout are also likely to have no influence on the layout’s functionality or performance. Conversely, defects closer to the layout may cause it to fail. This behavior allows for efficient contour tracing of the transition between influential and non-influential states.

The process is as follows:

  1. Initialization: Randomly select samples initial defect positions several nanometers away from the layout where they are unlikely to influence the layout.

  2. Contour Tracing: For each position, perform a defect-aware physical simulation to identify adjacent positions along the x-axis that influence the layout.

  3. Contour Following: Trace the contour of non-influential positions until the starting point is reached again, thereby closing the contour.

  4. Repetition: Repeat steps 1-3 for multiple initial heights to identify additional contours, since multiple influential-to-non-influential contours may exist. This process helps to detect all relevant transitions in the layout. This algorithm uses contour tracing to identify the transition between influencing and non-influencing defect positions of the SiDB layout. It starts by searching for defect locations on the left side (bounding_box + additional scanning area). The y-coordinate for these positions is chosen randomly. The number of samples is determined by the samples parameter. Then, the algorithm moves each defect position to the right, searching for the last non-influencing defect position.

Parameters:
  • lyt – Layout to compute the defect influence domain for.

  • spec – Expected Boolean function of the layout given as a multi-output truth table.

  • samples – Number of samples to perform.

  • params – Defect influence domain computation parameters.

  • stats – Defect influence computation statistics.

Throws:
  • std::invalid_argument – if spec is empty.

  • std::invalid_argument – if params.additional_scanning_area contains a negative value.

Returns:

The (partial) defect influence domain of the layout.

inline defect_influence_domain fiction::sidb::simulation::defects::defect_influence_quicktrace(const layout &lyt, const std::size_t samples, const defect_influence_params &params = {}, defect_influence_stats *stats = nullptr)

Applies contour tracing to identify the boundary (contour) between influencing and non-influencing defect positions for a given SiDB layout.

The algorithm uses a screened Coulomb potential, where the electrostatic interaction weakens as distance increases. If a defect at position p causes the SiDB layout to be non-influential, then defects further away from the layout are also likely to have no influence on the layout’s functionality or performance. Conversely, defects closer to the layout may cause it to fail. This behavior allows for efficient contour tracing of the transition between influential and non-influential states.

The process is as follows:

  1. Initialization: Randomly select samples initial defect positions several nanometers away from the layout where they are unlikely to influence the layout.

  2. Contour Tracing: For each position, perform a defect-aware physical simulation to identify adjacent positions along the x-axis that influence the layout.

  3. Contour Following: Trace the contour of non-influential positions until the starting point is reached again, thereby closing the contour.

  4. Repetition: Repeat steps 1-3 for multiple initial heights to identify additional contours, since multiple influential-to-non-influential contours may exist. This process helps to detect all relevant transitions in the layout.

Set params.influence_def to GROUND_STATE_CHANGE to compare ground states without a truth table. With OPERATIONALITY_CHANGE, this overload classifies sampled defect positions as non-influential.

Parameters:
  • lyt – Layout to compute the defect influence domain for.

  • samples – Number of samples to perform.

  • params – Defect influence domain computation parameters.

  • stats – Defect influence computation statistics.

Throws:

std::invalid_argument – if params.additional_scanning_area contains a negative value.

Returns:

The (partial) defect influence domain of the layout.

Header: fiction/technology/sidb/simulation/defects/defect_clearance.hpp

struct defect_clearance

The defect clearance of a layout: the farthest influential defect position, measured by the distance to the closest SiDB, and that distance.

Public Members

lattice_site defect_position = {}

The influential defect position farthest from the layout.

double defect_clearance_distance = {}

Its distance to the closest SiDB (unit: nm).

inline defect_clearance fiction::sidb::simulation::defects::calculate_defect_clearance(const layout &lyt, const defect_influence_domain &defect_inf_domain) noexcept

Computes the defect clearance from a defect influence domain: for every influential position, the distance to the closest SiDB of the layout is determined, and the maximum of those distances is the clearance. Any defect farther away than that does not influence the layout.

Parameters:
  • lyt – The layout.

  • defect_inf_domain – The defect influence domain of lyt.

Returns:

The defect clearance.