Skip to content

Commit

Permalink
Introduced SatelliteQNode, related ModuleType, MM topology and .ini file
Browse files Browse the repository at this point in the history
  • Loading branch information
Paolo Fittipaldi committed Jun 20, 2024
1 parent 45b222a commit 47323ec
Show file tree
Hide file tree
Showing 6 changed files with 144 additions and 4 deletions.
2 changes: 1 addition & 1 deletion quisp/modules/Common/Router.cc
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ void Router::handleOspfHelloPacket(cMessage *msg) {
}
}

bool Router::parentModuleIsQNode() { return provider.getNode()->getModuleType() == cModuleType::get("modules.QNode"); }
bool Router::parentModuleIsQNode() {auto *type = provider.getNode()->getModuleType(); return (type == cModuleType::get("modules.QNode") or type == cModuleType::get("modules.SatelliteQNode")); }

/**
* @details Unlike QNodes, BSA nodes are connected to only two nodes (at least that is the assumption)
Expand Down
30 changes: 30 additions & 0 deletions quisp/modules/SatelliteQNode.ned
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package modules;
@namespace(quisp::modules);

import modules.Satellite.*;
import modules.Common.GatedQueue;

module SatelliteQNode extends QNode
{
parameters:
bool is_satellite = default(false);

gates:

submodules:
ps[sizeof(port)]: PointingSystem;
Gqueue[sizeof(port)]: GatedQueue {
parameters:
address = index;
@display("p=338,234");
}
connections:
for i=0..sizeof(port)-1 {
router.toQueue[i] --> { @reconnect; } --> Gqueue[i].in; // Each routing port is connected to its own queue
router.fromQueue[i] <-- { @reconnect; } <-- Gqueue[i].out;
Gqueue[i].line <--> { @reconnect; } <--> port[i];
Gqueue[i].to_ps --> ps[i].req;
Gqueue[i].from_ps <-- ps[i].ans;
}

}
35 changes: 35 additions & 0 deletions quisp/networks/topology_simple_satellite_network.ned
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package networks;

import ned.DatarateChannel;
import ned.IdealChannel;

import modules.*;
import modules.Backend.Backend;
import modules.Logger.Logger;
import modules.SharedResource.SharedResource;
import channels.*;



network Simple_Satellite_MM
{
submodules:
backend: Backend;
logger: Logger;
sharedResource: SharedResource;
EndNode1: SatelliteQNode {
address = 1;
is_satellite=true;
node_type = "EndNode";
@display("i=COMP;p=104,48,m,5,60,60");
}
EndNode2: SatelliteQNode {
address = 2;
node_type = "EndNode";
@display("i=COMP;p=253,248,m,5,60,60");
}

connections:
EndNode1.port++ <--> FreeSpaceChannel { distance = 1000km; } <--> EndNode2.port++;
EndNode1.quantum_port++ <--> FreeSpaceQuantumChannel { distance = 1000km; } <--> EndNode2.quantum_port_receiver++;
}
72 changes: 72 additions & 0 deletions quisp/simulations/satellite_simulation_test.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
[General]
seed-set = 1
sim-time-limit = 1d
**.initial_notification_timing_buffer = 10s # when to start the BSA timing notification.
**.app.request_generation_interval = 2s
**.logger.enabled_log = false
**.logger.log_filename = "networks/${resultdir}/${configname}-${runnumber}.jsonl"
**.tomography_output_filename = "${resultdir}/${configname}.output"
**.statistic-recording = false
**.scalar-recording = false
**.vector-recording = false
**.speed_of_light_in_fiber = 208189.206944km
**.speed_of_light_in_freespace = 299792.458km

**.channel_loss_rate = 0
**.channel_x_error_rate = 0
**.channel_z_error_rate = 0
**.channel_y_error_rate = 0

**.collection_efficiency = 1
**.darkcount_probability = 0
**.detection_efficiency = 1
**.indistinguishable_time_window = 1.5ns
**.photon_detection_per_second = 1000000

**.x_gate_error_rate = 0
**.x_gate_x_error_ratio = 0
**.x_gate_y_error_ratio = 0
**.x_gate_z_error_ratio = 0

**.z_gate_error_rate = 0
**.z_gate_x_error_ratio = 0
**.z_gate_y_error_ratio = 0
**.z_gate_z_error_ratio = 0

**.cnot_gate_error_rate = 0
**.cnot_gate_iz_error_ratio = 0
**.cnot_gate_zi_error_ratio = 0
**.cnot_gate_zz_error_ratio = 0
**.cnot_gate_ix_error_ratio = 0
**.cnot_gate_xi_error_ratio = 0
**.cnot_gate_xx_error_ratio = 0
**.cnot_gate_iy_error_ratio = 0
**.cnot_gate_yi_error_ratio = 0
**.cnot_gate_yy_error_ratio = 0

**.memory_x_error_rate = 0
**.memory_y_error_rate = 0
**.memory_z_error_rate = 0
**.memory_energy_excitation_rate = 0
**.memory_energy_relaxation_rate = 0
**.memory_completely_mixed_rate = 0

**.x_measurement_error_rate = 0
**.z_measurement_error_rate = 0
**.y_measurement_error_rate = 0

**.app.number_of_bellpair = 10000
**.buffers = 100
**.qrsa.hm.num_measure = 10000

###########################
# Link Generations Tests
###########################

[Config NoErrorSatelliteMM]
network = networks.Simple_Satellite_MM
**.qrsa.hm.link_tomography = true
**.qrsa.hm.initial_purification = 0
**.qrsa.hm.purification_type = 0
**.distance_csv = "../../satellite_test_csvs/S-C1_distance.csv"
**.Aatm_CSV = "../../satellite_test_csvs/S-C1_tatm_1550.csv"
8 changes: 5 additions & 3 deletions quisp/utils/DefaultComponentProviderStrategy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ DefaultComponentProviderStrategy::DefaultComponentProviderStrategy(cModule *_sel

cModule *DefaultComponentProviderStrategy::getQNode() {
cModule *currentModule = self->getParentModule();
while (currentModule->getModuleType() != QNodeType) {
auto *mod_type = currentModule->getModuleType();
while (!isQNodeType(mod_type)) {
currentModule = currentModule->getParentModule();
mod_type = currentModule->getModuleType();
if (currentModule == nullptr) {
throw cRuntimeError("QNode module not found. Have you changed the type name in ned file?");
}
Expand All @@ -20,7 +22,7 @@ cModule *DefaultComponentProviderStrategy::getQNode() {
cModule *DefaultComponentProviderStrategy::getNode() {
cModule *currentModule = self->getParentModule();
auto *mod_type = currentModule->getModuleType();
while (mod_type != QNodeType && mod_type != BSAType && mod_type != EPPSType) {
while (mod_type != QNodeType && mod_type != SatelliteQNodeType && mod_type != BSAType && mod_type != EPPSType) {
currentModule = currentModule->getParentModule();
mod_type = currentModule->getModuleType();
if (currentModule == nullptr) {
Expand Down Expand Up @@ -118,6 +120,6 @@ cModule *DefaultComponentProviderStrategy::getQRSA() {
}

bool DefaultComponentProviderStrategy::isBSANodeType(const cModuleType *const type) { return type == BSAType; }
bool DefaultComponentProviderStrategy::isQNodeType(const cModuleType *const type) { return type == QNodeType; }
bool DefaultComponentProviderStrategy::isQNodeType(const cModuleType *const type) { return (type == QNodeType or type == SatelliteQNodeType); }
bool DefaultComponentProviderStrategy::isEPPSNodeType(const cModuleType *const type) { return type == EPPSType; }
} // namespace quisp::utils
1 change: 1 addition & 0 deletions quisp/utils/DefaultComponentProviderStrategy.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class DefaultComponentProviderStrategy : public IComponentProviderStrategy {

private:
const cModuleType *const QNodeType = cModuleType::get("modules.QNode");
const cModuleType *const SatelliteQNodeType = cModuleType::get("modules.SatelliteQNode");
const cModuleType *const EPPSType = cModuleType::get("modules.EPPSNode");
const cModuleType *const BSAType = cModuleType::get("modules.BSANode");
cModule *self;
Expand Down

0 comments on commit 47323ec

Please sign in to comment.