File find_embedding.hpp#
-
namespace find_embedding
Functions
-
int findEmbedding(graph::input_graph &var_g, graph::input_graph &qubit_g, optional_parameters ¶ms, vector<vector<int>> &chains)#
The main entry function of this library.
This method primarily dispatches the proper implementation of the algorithm where some parameters/behaviours have been fixed at compile time.
In terms of dispatch, there are three dynamically-selected classes which are combined, each according to a specific optional parameter.
a domain_handler, described in embedding_problem.hpp, manages constraints of the form “variable a’s chain must be a subset of…”
a fixed_handler, described in embedding_problem.hpp, manages contstraints of the form “variable a’s chain must be exactly…”
a pathfinder, described in pathfinder.hpp, which come in two flavors, serial and parallel The optional parameters themselves can be found in util.hpp. Respectively, the controlling options for the above are restrict_chains, fixed_chains, and threads.
-
class parameter_processor
- #include <find_embedding.hpp>
Public Functions
-
inline parameter_processor(graph::input_graph &var_g, graph::input_graph &qubit_g, optional_parameters ¶ms_)#
-
inline map<int, vector<int>> input_chains(map<int, vector<int>> &m)#
-
inline vector<int> input_vars(vector<int> &V)#
Public Members
-
unsigned int num_vars#
-
unsigned int num_qubits#
-
vector<int> qub_reserved_unscrewed#
-
vector<int> var_fixed_unscrewed#
-
unsigned int num_reserved#
-
graph::components qub_components#
-
unsigned int problem_qubits#
-
unsigned int problem_reserved#
-
unsigned int num_fixed#
-
vector<int> unscrew_vars#
-
vector<int> screw_vars#
-
optional_parameters params#
-
vector<vector<int>> var_nbrs#
-
vector<vector<int>> qubit_nbrs#
Private Functions
-
inline unsigned int _reserved(optional_parameters ¶ms_)#
-
inline vector<int> _filter_fixed_vars()#
-
inline vector<int> _inverse_permutation(vector<int> &f)#
-
inline parameter_processor(graph::input_graph &var_g, graph::input_graph &qubit_g, optional_parameters ¶ms_)#
-
template<bool parallel, bool fixed, bool restricted, bool verbose>
class pathfinder_type - #include <find_embedding.hpp>
Public Types
-
typedef std::conditional<fixed, fixed_handler_hival, fixed_handler_none>::type fixed_handler_t#
-
typedef std::conditional<restricted, domain_handler_masked, domain_handler_universe>::type domain_handler_t#
-
typedef output_handler<verbose> output_handler_t#
-
typedef embedding_problem<fixed_handler_t, domain_handler_t, output_handler_t> embedding_problem_t#
-
typedef std::conditional<parallel, pathfinder_parallel<embedding_problem_t>, pathfinder_serial<embedding_problem_t>>::type pathfinder_t#
-
typedef std::conditional<fixed, fixed_handler_hival, fixed_handler_none>::type fixed_handler_t#
-
class pathfinder_wrapper
- #include <find_embedding.hpp>
Public Functions
-
inline pathfinder_wrapper(graph::input_graph &var_g, graph::input_graph &qubit_g, optional_parameters ¶ms_)#
-
inline ~pathfinder_wrapper()#
-
inline void get_chain(int u, vector<int> &output) const#
-
inline int heuristicEmbedding()#
-
inline int num_vars()#
-
inline void set_initial_chains(map<int, vector<int>> &init)#
-
inline void quickPass(vector<int> &varorder, int chainlength_bound, int overlap_bound, bool local_search, bool clear_first, double round_beta)#
Private Functions
-
template<bool parallel, bool fixed, bool restricted, bool verbose, typename ...Args>
inline std::unique_ptr<pathfinder_public_interface> _pf_parse4(Args&&... args)#
-
template<bool parallel, bool fixed, bool restricted, typename ...Args>
inline std::unique_ptr<pathfinder_public_interface> _pf_parse3(Args&&... args)#
-
template<bool parallel, bool fixed, typename ...Args>
inline std::unique_ptr<pathfinder_public_interface> _pf_parse2(Args&&... args)#
-
template<bool parallel, typename ...Args>
inline std::unique_ptr<pathfinder_public_interface> _pf_parse1(Args&&... args)#
-
template<typename ...Args>
inline std::unique_ptr<pathfinder_public_interface> _pf_parse(Args&&... args)#
-
inline pathfinder_wrapper(graph::input_graph &var_g, graph::input_graph &qubit_g, optional_parameters ¶ms_)#
-
int findEmbedding(graph::input_graph &var_g, graph::input_graph &qubit_g, optional_parameters ¶ms, vector<vector<int>> &chains)#