Class find_embedding::embedding_problem_base#

class embedding_problem_base#

Common form for all embedding problems.

Needs to be extended with a fixed handler and domain handler to be complete.

Subclassed by find_embedding::embedding_problem< fixed_handler, domain_handler, output_handler >

Public Functions

inline void reset_mood()#

resets some internal, ephemeral, variables to a default state

inline void populate_weight_table(int max_weight)#

precomputes a table of weights corresponding to various overlap values c, for c from 0 to max_weight, inclusive.

inline distance_t weight(unsigned int c) const#

returns the precomputed weight associated with an overlap value of c

inline const vector<int> &var_neighbors(int u) const#

a vector of neighbors for the variable u

inline const vector<int> &var_neighbors(int u, shuffle_first)#

a vector of neighbors for the variable u, pre-shuffling them

inline const vector<int> &var_neighbors(int u, rndswap_first)#

a vector of neighbors for the variable u, applying a random transposition before returning the reference

inline const vector<int> &qubit_neighbors(int q) const#

a vector of neighbors for the qubit q

inline int num_vars() const#

number of variables which are not fixed

inline int num_qubits() const#

number of qubits which are not reserved

inline int num_fixed() const#

number of fixed variables

inline int num_reserved() const#

number of reserved qubits

inline int randint(int a, int b)#

make a random integer between 0 and m-1

template<typename A, typename B>
inline void shuffle(A a, B b)#

shuffle the data bracketed by iterators a and b

inline void qubit_component(int q0, vector<int> &component, vector<int> &visited)#

compute the connected component of the subset component of qubits, containing q0, and usingvisited as an indicator for which qubits have been explored

inline const vector<int> &var_order(VARORDER order = VARORDER_SHUFFLE)#

compute a variable ordering according to the order strategy

inline void dfs_component(int x, const vector<vector<int>> &neighbors, vector<int> &component, vector<int> &visited)#

Perform a depth first search.

Public Members

optional_parameters &params#

A mutable reference to the user specified parameters.