Skip to content

Commit

Permalink
fix entanglement swapping error!!!
Browse files Browse the repository at this point in the history
  • Loading branch information
res6idue committed Jul 17, 2023
1 parent 59728b9 commit 6d26c5b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 3 additions & 3 deletions quisp/modules/QRSA/RuleEngine/RuleEngine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,13 @@ void RuleEngine::handleMessage(cMessage *msg) {
}
} else if (auto *notification_packet = dynamic_cast<EPPSTimingNotification *>(msg)) {
auto partner_address = notification_packet->getOtherQnicParentAddr();
auto partner_qnic_index = notification_packet->getOtherQnicIndex();
auto epps_address = notification_packet->getEPPSAddr();
auto qnic_index = notification_packet->getQnicIndex();
auto& msm_info = msm_info_map[qnic_index];
msm_info.partner_address = partner_address;
msm_info.epps_address = epps_address;
msm_info.interval = notification_packet->getInterval();
msm_info.partner_qnic_index = partner_qnic_index;
stopOnGoingPhotonEmission(QNIC_RP, qnic_index);
scheduleMSMPhotonEmission(QNIC_RP, qnic_index, notification_packet);
} else if (auto *click_result = dynamic_cast<SingleClickResult *>(msg)) {
Expand Down Expand Up @@ -205,8 +206,7 @@ void RuleEngine::handleSingleClickResult(SingleClickResult *click_result) {
auto interval = msm_info.interval;
auto qubit_index = msm_info.qubit_info_map[msm_info.iteration_index];
MSMResult *msm_result = new MSMResult();
// the qnic index we need here is the partner's one, isn't it? Might use MSM info map to store partner's qnic index and so on.
msm_result->setQnicIndex(qnic_index);
msm_result->setQnicIndex(msm_info.partner_qnic_index);
msm_result->setQnicType(QNIC_RP);
msm_result->setPhotonIndex(msm_info.photon_index_counter);
msm_result->setSuccess(click_result->getClickResult().success);
Expand Down
2 changes: 2 additions & 0 deletions quisp/modules/QRSA/RuleEngine/RuleEngine.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ class RuleEngine : public IRuleEngine, public Logger::LoggerBase {

struct MSMInfo {
int partner_address;
int partner_qnic_index;
int epps_address;
unsigned long long photon_index_counter;
int iteration_index;
Expand All @@ -119,6 +120,7 @@ class RuleEngine : public IRuleEngine, public Logger::LoggerBase {
// [Key: qnic_index, Value: qubit_index]
std::unordered_map<int, MSMInfo> msm_info_map;

int _num_bellpairs_generated;
};

Define_Module(RuleEngine);
Expand Down

0 comments on commit 6d26c5b

Please sign in to comment.