QuISP
Loading...
Searching...
No Matches
RuleSetGenerator.h
Go to the documentation of this file.
1#pragma once
2#include <map>
3#include <utility>
4
5#include <nlohmann/json.hpp>
6
8#include "rules/RuleSet.h"
9
11
13 public:
15
23 std::map<int, nlohmann::json> generateRuleSets(messages::ConnectionSetupRequest* req, unsigned long ruleset_id);
24
34 void generateReverseSwapAtHalfRuleSets(int left_node_index, int right_node_index, std::map<int, std::vector<std::unique_ptr<rules::Rule>>>& rules_map, std::vector<int>& path,
35 int& shared_rule_tag);
36
37 protected:
44 std::vector<int> collectPath(messages::ConnectionSetupRequest* req);
45
55 std::unique_ptr<rules::Rule> tomographyRule(int partner_address, int owner_address, int num_measure, int shared_rule_tag);
56
65 std::unique_ptr<rules::Rule> purifyRule(int partner_address, rules::PurType purification_type, int shared_rule_tag);
66
75 std::unique_ptr<rules::Rule> purificationCorrelationRule(int partner_address, rules::PurType purification_protocol, int shared_rule_tag);
76
84 std::unique_ptr<rules::Rule> swapRule(std::pair<int, int> partner_address, int shared_rule_tag);
85
93 std::unique_ptr<rules::Rule> swapCorrectionRule(int swapper_address, int shared_rule_tag);
94
96};
97} // namespace quisp::modules::ruleset_gen
Definition RuleSetGenerator.h:12
int responder_addr
Definition RuleSetGenerator.h:95
std::unique_ptr< rules::Rule > swapRule(std::pair< int, int > partner_address, int shared_rule_tag)
create entanglement swapping rule
Definition RuleSetGenerator.cc:159
std::unique_ptr< rules::Rule > swapCorrectionRule(int swapper_address, int shared_rule_tag)
create rule that waits for the swapping correction/notification from swapper node
Definition RuleSetGenerator.cc:175
RuleSetGenerator(int responder_addr)
Definition RuleSetGenerator.h:14
void generateReverseSwapAtHalfRuleSets(int left_node_index, int right_node_index, std::map< int, std::vector< std::unique_ptr< rules::Rule > > > &rules_map, std::vector< int > &path, int &shared_rule_tag)
generate rules for each node in the path.
Definition RuleSetGenerator.cc:12
std::vector< int > collectPath(messages::ConnectionSetupRequest *req)
collect path infomation from initiator to responder
Definition RuleSetGenerator.cc:79
std::unique_ptr< rules::Rule > purificationCorrelationRule(int partner_address, rules::PurType purification_protocol, int shared_rule_tag)
create rule that waits for purification measurement result and check for its correlation
Definition RuleSetGenerator.cc:144
std::unique_ptr< rules::Rule > purifyRule(int partner_address, rules::PurType purification_type, int shared_rule_tag)
create purification rule
Definition RuleSetGenerator.cc:109
std::unique_ptr< rules::Rule > tomographyRule(int partner_address, int owner_address, int num_measure, int shared_rule_tag)
create tomography rule
Definition RuleSetGenerator.cc:90
std::map< int, nlohmann::json > generateRuleSets(messages::ConnectionSetupRequest *req, unsigned long ruleset_id)
generate RuleSets for the given connection setup request.
Definition RuleSetGenerator.cc:32
Definition RuleSetGenerator.cc:8
PurType
Definition Action.h:15