Skip to content
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ openql.egg-info
lab
env
.eggs/
examples/cpp-standalone-example/testb_build

# Temp files
*.dot
Expand Down
5 changes: 5 additions & 0 deletions include/ql/com/topology.h
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,11 @@ class Topology {

public:

/**
* Get the conectivity
*/
GridConnectivity get_connectivity();

/**
* Constructs the grid for the given number of qubits from the given JSON
* object. Refer to dump_docs() for details.
Expand Down
7 changes: 7 additions & 0 deletions src/ql/com/options.cc
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,13 @@ Options make_ql_options() {
true
);

options.add_bool(
"maprOEE",
"Applies the rOEE routing algorithm for multi-core architecures "
"with an all to all connection.",
false
);

#if 0 // FIXME: removed, use pass options
//========================================================================//
// Default-inserted CC code generation pass behavior //
Expand Down
9 changes: 9 additions & 0 deletions src/ql/com/topology.cc
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,14 @@ Topology::Neighbors Topology::get_neighbors(Qubit qubit) const {
}
}

/**
* Get the conectivity
*/
GridConnectivity Topology::get_connectivity(){
return connectivity;
}


/**
* Returns whether the given qubit is a communication qubit of a core.
*/
Expand Down Expand Up @@ -706,6 +714,7 @@ utils::UInt Topology::get_min_hops(Qubit source, Qubit target) const {
utils::UInt d = get_distance(source, target);
utils::UInt cd = get_core_distance(source, target);
QL_ASSERT(cd <= d);

if (cd == d) {
return d+2;
} else {
Expand Down
12 changes: 11 additions & 1 deletion src/ql/pass/map/qubits/map/detail/future.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/

#include "future.h"

#include <vector>
#include "ql/utils/filesystem.h"

namespace ql {
Expand Down Expand Up @@ -46,6 +46,7 @@ void Future::set_kernel(const ir::compat::KernelRef &kernel, const utils::Ptr<Sc
// and so also the original circuit can be output to after this
for (auto &gp : kernel->gates) {
scheduled.set(gp) = false; // none were scheduled
remaining_gates.push_back(gp);
}
scheduled.set(scheduler->instruction[scheduler->s]) = false; // also the dummy nodes not
scheduled.set(scheduler->instruction[scheduler->t]) = false;
Expand Down Expand Up @@ -137,6 +138,15 @@ void Future::completed_gate(const ir::compat::GateRef &gate) {
input_gatepp = std::next(input_gatepp);
} else {
scheduler->take_available(scheduler->node.at(gate), avlist, scheduled, rmgr::Direction::FORWARD);

std::list<ql::ir::compat::GateRef>::iterator it = remaining_gates.begin();
for(auto &i : remaining_gates){
if(i==gate){
remaining_gates.erase(it);
break;
}
it++;
}
}
}

Expand Down
6 changes: 6 additions & 0 deletions src/ql/pass/map/qubits/map/detail/future.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include "options.h"
#include "past.h"
#include "alter.h"
#include <vector>

namespace ql {
namespace pass {
Expand Down Expand Up @@ -111,6 +112,11 @@ class Future {
*/
utils::UInt approx_gates_remaining;

/**
* List of total number of gates remaining.
*/
utils::List<ir::compat::GateRef> remaining_gates;

/**
* Program-wide initialization function.
*/
Expand Down
Loading