Skip to content

Commit

Permalink
Corrected t_atm name and capitalization
Browse files Browse the repository at this point in the history
  • Loading branch information
Paolo Fittipaldi committed Jul 4, 2024
1 parent fc3883b commit feb0f59
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
15 changes: 6 additions & 9 deletions quisp/channels/FreeSpaceQuantumChannel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ class FreeSpaceQuantumChannel : public FreeSpaceChannel {

Matrix<double, 5, 5> transition_matrix;
channel_error_model err;
OrbitalDataParser *Aatm_CSV;
OrbitalDataParser *t_atm_csv;

// Loss model - see 10.1038/s42005-022-01123-7
double distance = 0; // in m
double lambda = 0;
double Dt = 0;
double Dr = 0;
double r0 = 0;
double Aatm = 1;
double t_atm = 1;

// calculated in the code from the parameters above
double theta_diff = 0;
Expand All @@ -68,7 +68,7 @@ FreeSpaceQuantumChannel::FreeSpaceQuantumChannel() {}
void FreeSpaceQuantumChannel::initialize() {
FreeSpaceChannel::initialize();
distance = par("distance").doubleValueInUnit("m");
Aatm_CSV = new OrbitalDataParser(par("Aatm_CSV"));
t_atm_csv = new OrbitalDataParser(par("t_atm_csv"));
lambda = par("wavelength");
Dt = par("transmitter_telescope_diameter");
Dr = par("receiver_telescope_diameter");
Expand All @@ -95,16 +95,13 @@ cChannel::Result FreeSpaceQuantumChannel::processMessage(cMessage *msg, const Se

if (q == nullptr) {
throw new cRuntimeError("something other than photonic qubit is sent through quantum channel");
}

}

if (!isRecipientVisible()) {
q->setLost(true);
return {false, getDelay(), 0};
}



MatrixXd probability_vector(1, 5); // I, X, Z, Y, Photon Lost
if (q->isLost()) {
probability_vector << 0, 0, 0, 0, 1; // Photon already lost due to the coupling lost.
Expand Down Expand Up @@ -165,15 +162,15 @@ void FreeSpaceQuantumChannel::validateParameters() {
double FreeSpaceQuantumChannel::calculateLossRate() {
// hard-coded values from 10.1038/s42005-022-01123-7
distance = parameter_distance.doubleValue();
attenuation_rate = ((pow(theta_diff, 2) + pow(theta_atm, 2)) / (pow(Dr, 2))) * pow(distance, 2) / Aatm; // from 10.1038/s42005-022-01123-7
attenuation_rate = ((pow(theta_diff, 2) + pow(theta_atm, 2)) / (pow(Dr, 2))) * pow(distance, 2) / t_atm; // from 10.1038/s42005-022-01123-7
loss_rate = 1 - 1 / attenuation_rate;

return loss_rate;
}

void FreeSpaceQuantumChannel::recalculateChannelParameters() {
FreeSpaceChannel::recalculateChannelParameters();
Aatm = Aatm_CSV->getPropertyAtTime(simTime().dbl());
t_atm = t_atm_csv->getPropertyAtTime(simTime().dbl());
err.loss_rate = calculateLossRate();
err.error_rate = err.x_error_rate + err.y_error_rate + err.z_error_rate + err.loss_rate;
rereadPars();
Expand Down
2 changes: 1 addition & 1 deletion quisp/channels/channels.ned
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,5 @@ channel FreeSpaceQuantumChannel extends FreeSpaceChannel
double fried_parameter @unit(m) = default(10cm);
double elevation_angle @unit(rad) = default(90deg); //TODO: this should be a function of time!
double atmospheric_attenuation_zenith @unit(dB) = default(-3dB);
string Aatm_CSV;
string t_atm_csv;
}

0 comments on commit feb0f59

Please sign in to comment.