QuISP
Loading...
Searching...
No Matches
BellStateAnalyzer.h
Go to the documentation of this file.
1#pragma once
2
3#include <omnetpp.h>
4
5#include "PhotonicQubit_m.h"
6#include "backends/Backends.h"
8#include "messages/BSA_ipc_messages_m.h"
11
13enum class PortNumber : int { First = 0, Second };
14
25
26namespace quisp::modules {
27class BellStateAnalyzer : public omnetpp::cSimpleModule {
28 public:
30 void resetState();
31
32 protected:
33 virtual void initialize() override;
34 virtual void finish() override;
35 virtual void handleMessage(omnetpp::cMessage *msg) override;
36
37 private:
38 void discardPhoton(PhotonRecord &photon);
39 PhotonRecord getPhotonRecordFromMessage(messages::PhotonicQubit *);
42 void measureSuccessfully(PhotonRecord &left_photon, PhotonRecord &right_photon, bool is_psi_plus);
43 void validateProperties();
44
45 // device parameters
46 double collection_efficiency; // might get deleted later if collection efficiency is implemented at StationaryQubit during emission
49 omnetpp::simtime_t indistinguishability_window; // Precision of photon arrivial time ~1.5ns
50
51 // data members for processing
53 std::vector<PhotonRecord> first_port_records;
54 std::vector<PhotonRecord> second_port_records;
57
58 // for testing and debugging
59 long long no_error_count = 0;
60 long long x_error_count = 0;
61 long long y_error_count = 0;
62 long long z_error_count = 0;
63};
64} // namespace quisp::modules
BSAState
Definition BellStateAnalyzer.h:12
@ AcceptingFirstPort
@ SecondPortArrive
@ FirstPortArrive
@ AcceptingSecondPort
PortNumber
Definition BellStateAnalyzer.h:13
The abstract interface for a quantum backend.
Definition IQuantumBackend.h:19
Definition IQubit.h:30
BellStateAnalyzer.
Definition BellStateAnalyzer.h:27
double detection_efficiency
Definition BellStateAnalyzer.h:48
void measureSuccessfully(PhotonRecord &left_photon, PhotonRecord &right_photon, bool is_psi_plus)
Definition BellStateAnalyzer.cc:182
long long z_error_count
Definition BellStateAnalyzer.h:62
long long y_error_count
Definition BellStateAnalyzer.h:61
long long no_error_count
Definition BellStateAnalyzer.h:59
backends::IQuantumBackend * backend
Definition BellStateAnalyzer.h:56
void resetState()
Definition BellStateAnalyzer.cc:161
void discardPhoton(PhotonRecord &photon)
Definition BellStateAnalyzer.cc:218
double collection_efficiency
Definition BellStateAnalyzer.h:46
physical::types::BSAClickResult processIndistinguishPhotons(PhotonRecord &left_photon, PhotonRecord &right_photon)
Definition BellStateAnalyzer.cc:128
virtual void handleMessage(omnetpp::cMessage *msg) override
Handle the flying photonic qubits coming in to the BSA. If the two photons arrive at the same time (w...
Definition BellStateAnalyzer.cc:42
void validateProperties()
Definition BellStateAnalyzer.cc:167
virtual void finish() override
Definition BellStateAnalyzer.cc:213
void processPhotonRecords()
Definition BellStateAnalyzer.cc:95
long long x_error_count
Definition BellStateAnalyzer.h:60
virtual void initialize() override
Definition BellStateAnalyzer.cc:24
utils::ComponentProvider provider
Definition BellStateAnalyzer.h:55
BSAState state
Definition BellStateAnalyzer.h:52
BellStateAnalyzer()
Definition BellStateAnalyzer.cc:22
std::vector< PhotonRecord > first_port_records
Definition BellStateAnalyzer.h:53
PhotonRecord getPhotonRecordFromMessage(messages::PhotonicQubit *)
Definition BellStateAnalyzer.cc:115
std::vector< PhotonRecord > second_port_records
Definition BellStateAnalyzer.h:54
omnetpp::simtime_t indistinguishability_window
Definition BellStateAnalyzer.h:49
double darkcount_probability
Definition BellStateAnalyzer.h:47
ComponentProvider class provides a way to access other quisp other modules.
Definition ComponentProvider.h:22
Definition Application.cc:16
Definition BellStateAnalyzer.h:15
bool is_last
Definition BellStateAnalyzer.h:21
bool is_lost
Definition BellStateAnalyzer.h:19
bool is_first
Definition BellStateAnalyzer.h:20
PortNumber from_port
Definition BellStateAnalyzer.h:18
bool has_x_error
Definition BellStateAnalyzer.h:22
omnetpp::simtime_t arrival_time
Definition BellStateAnalyzer.h:17
quisp::backends::abstract::IQubit * qubit_ref
Definition BellStateAnalyzer.h:16
bool has_z_error
Definition BellStateAnalyzer.h:23