File pathfinder.hpp¶
-
namespace
find_embedding -
template <typename embedding_problem_t>
class find_embeddingpathfinder_base - #include <pathfinder.hpp>
Subclassed by find_embedding::pathfinder_parallel< embedding_problem_t >, find_embedding::pathfinder_serial< embedding_problem_t >
Public Types
-
template<>
using find_embedding::pathfinder_base<embedding_problem_t>embedding_t= embedding<embedding_problem_t>¶
Public Functions
-
find_embedding::pathfinder_base
pathfinder_base(optional_parameters &p_, int &n_v, int &n_f, int &n_q, int &n_r, vector<vector<int>> &v_n, vector<vector<int>> &q_n)¶
-
virtual find_embedding::pathfinder_base
~pathfinder_base()¶
-
int find_embedding::pathfinder_base
check_improvement(const embedding_t &emb) nonzero return if this is an improvement on our previous best embedding
-
const chain &find_embedding::pathfinder_base
get_chain(int u) const chain accessor
-
int find_embedding::pathfinder_base
heuristicEmbedding() perform the heuristic embedding, returning 1 if an embedding was found and 0 otherwise
Protected Functions
-
int find_embedding::pathfinder_base
find_chain(embedding_t &emb, const int u)¶ tear out and replace the chain in
embfor variableu
-
int find_embedding::pathfinder_base
initialization_pass(embedding_t &emb)¶ sweep over all variables, either keeping them if they are pre-initialized and connected, and otherwise finding new chains for them (each, in turn, seeking connection only with neighbors that already have chains)
-
int find_embedding::pathfinder_base
improve_overfill_pass(embedding_t &emb)¶ tear up and replace each variable
-
int find_embedding::pathfinder_base
pushdown_overfill_pass(embedding_t &emb)¶ tear up and replace each chain, strictly improving or maintaining the maximum qubit fill seen by each chain
-
int find_embedding::pathfinder_base
improve_chainlength_pass(embedding_t &emb)¶ tear up and replace each chain, attempting to rebalance the chains and lower the maximum chainlength
-
void find_embedding::pathfinder_base
accumulate_distance_at_chain(const embedding_t &emb, const int v)¶ incorporate the qubit weights associated with the chain for
vintototal_distance
-
void find_embedding::pathfinder_base
accumulate_distance(const embedding_t &emb, const int v, vector<int> &visited, const int start, const int stop)¶ incorporate the distances associated with the chain for
vintototal_distance
-
void find_embedding::pathfinder_base
accumulate_distance(const embedding_t &emb, const int v, vector<int> &visited)¶ a wrapper for
accumulate_distanceandaccumulate_distance_at_chain
-
void find_embedding::pathfinder_base
compute_distances_from_chain(const embedding_t &emb, const int &v, vector<int> &visited)¶ run dijkstra’s algorithm, seeded at the chain for
v, using thevisitedvector note: qubits are only visited ifvisited[q] = 1.the value
-1is used to prevent searching of overfull qubits
-
void find_embedding::pathfinder_base
compute_qubit_weights(const embedding_t &emb)¶ compute the weight of each qubit, first selecting
alpha
-
void find_embedding::pathfinder_base
compute_qubit_weights(const embedding_t &emb, const int alpha, const int maxwid, const int start, const int stop)¶ compute the weight of each qubit in the range from
starttostop, where the weight is2^(alpha*fill)wherefillis the number of chains which use that qubit
Protected Attributes
-
embedding_problem_t find_embedding::pathfinder_base
ep¶
-
embedding_t find_embedding::pathfinder_base
bestEmbedding¶
-
embedding_t find_embedding::pathfinder_base
lastEmbedding¶
-
embedding_t find_embedding::pathfinder_base
currEmbedding¶
-
embedding_t find_embedding::pathfinder_base
initEmbedding¶
-
int find_embedding::pathfinder_base
num_qubits¶
-
int find_embedding::pathfinder_base
num_reserved¶
-
int find_embedding::pathfinder_base
num_vars¶
-
int find_embedding::pathfinder_base
num_fixed¶
-
vector<vector<int>> find_embedding::pathfinder_base
parents¶
-
vector<distance_t> find_embedding::pathfinder_base
total_distance¶
-
vector<int> find_embedding::pathfinder_base
tmp_space¶
-
vector<int> find_embedding::pathfinder_base
min_list¶
-
int_queue find_embedding::pathfinder_base
intqueue¶
-
vector<distance_t> find_embedding::pathfinder_base
qubit_weight¶
-
vector<int> find_embedding::pathfinder_base
tmp_stats¶
-
vector<int> find_embedding::pathfinder_base
best_stats¶
-
int find_embedding::pathfinder_base
pushback¶
-
clock::time_point find_embedding::pathfinder_base
stoptime¶
-
vector<distance_queue> find_embedding::pathfinder_base
dijkstras¶
Private Functions
-
virtual void find_embedding::pathfinder_base
prepare_root_distances(const embedding_t &emb, const int u) = 0¶ compute the distances from all neighbors of
uto all qubits
-
int find_embedding::pathfinder_base
find_chain(embedding_t &emb, const int u, int target_chainsize)¶ after
uhas been torn out, perform searches from each neighboring chain, select a minimum-distance root, and construct the chain
Friends
-
friend
find_embedding::pathfinder_serial< embedding_problem_t >
-
friend
find_embedding::pathfinder_parallel< embedding_problem_t >
-
template<>
-
template <typename embedding_problem_t>
class find_embeddingpathfinder_parallel: public find_embedding::pathfinder_base<embedding_problem_t> - #include <pathfinder.hpp>
A pathfinder where the Dijkstra-from-neighboring-chain passes are done serially.
Public Types
-
template<>
using find_embedding::pathfinder_parallel<embedding_problem_t>super= pathfinder_base<embedding_problem_t>¶
-
template<>
using find_embedding::pathfinder_parallel<embedding_problem_t>embedding_t= embedding<embedding_problem_t>¶
Public Functions
-
find_embedding::pathfinder_parallel
pathfinder_parallel(optional_parameters &p_, int n_v, int n_f, int n_q, int n_r, vector<vector<int>> &v_n, vector<vector<int>> &q_n)¶
-
virtual find_embedding::pathfinder_parallel
~pathfinder_parallel()¶
-
virtual void find_embedding::pathfinder_parallel
prepare_root_distances(const embedding_t &emb, const int u) compute the distances from all neighbors of
uto all qubits
Private Functions
-
void find_embedding::pathfinder_parallel
run_in_thread(const embedding_t &emb, const int u)¶
-
template <typename C>
void find_embedding::pathfinder_parallelexec_chunked(C e_chunk)¶
-
template <typename C>
void find_embedding::pathfinder_parallelexec_indexed(C e_chunk)¶
Private Members
-
int find_embedding::pathfinder_parallel
num_threads¶
-
vector<vector<int>> find_embedding::pathfinder_parallel
visited_list¶
-
vector<std::future<void>> find_embedding::pathfinder_parallel
futures¶
-
vector<int> find_embedding::pathfinder_parallel
thread_weight¶
-
mutex find_embedding::pathfinder_parallel
get_job¶
-
unsigned int find_embedding::pathfinder_parallel
nbr_i¶
-
int find_embedding::pathfinder_parallel
neighbors_embedded¶
-
template<>
-
template <typename embedding_problem_t>
class find_embeddingpathfinder_serial: public find_embedding::pathfinder_base<embedding_problem_t> - #include <pathfinder.hpp>
A pathfinder where the Dijkstra-from-neighboring-chain passes are done serially.
Public Types
-
template<>
using find_embedding::pathfinder_serial<embedding_problem_t>super= pathfinder_base<embedding_problem_t>¶
-
template<>
using find_embedding::pathfinder_serial<embedding_problem_t>embedding_t= embedding<embedding_problem_t>¶
Public Functions
-
find_embedding::pathfinder_serial
pathfinder_serial(optional_parameters &p_, int n_v, int n_f, int n_q, int n_r, vector<vector<int>> &v_n, vector<vector<int>> &q_n)¶
-
virtual find_embedding::pathfinder_serial
~pathfinder_serial()¶
-
virtual void find_embedding::pathfinder_serial
prepare_root_distances(const embedding_t &emb, const int u) compute the distances from all neighbors of
uto all qubits
Private Members
-
vector<int> find_embedding::pathfinder_serial
visited¶
-
template<>
-
template <typename embedding_problem_t>