Code for: The Influence of Experimental Imperfections on Photonic GHZ State Generation
Loading...
Searching...
No Matches
/Users/fabianwiesner/Desktop/Work/PhotonicQC/FidCodeUpdate/simphoqcirc/simFid.hpp File Reference

Defines the function used for the simulation of GHZ state generation with imperfections. More...

#include "State.hpp"
#include "Key.hpp"
#include "simAux.hpp"
#include <iomanip>

Functions

template<class K , class V , class R >
void cleanOvlGHZ (State< K, V, R > &S, int a)
 Cleans input such that only the keys with the same DMode in one of the parts of the GHZ state remain.
 
void fid (const std::vector< std::array< State< Key< int >, float, float >, 8 > > &PreData, const std::vector< std::array< State< Key< int >, float, float >, 8 > > &Compl, const float &ovl, const std::vector< float > &angErrs, const std::vector< int > &doublePrep, const std::vector< int > &lossPos, const std::string &path, int rank)
 Computes the fidelity for pre-computed data and writes it to a file.
 
template<class K , class V , class R >
void circuitFid (State< K, V, R > &S, const std::vector< int > &lossPos, const std::array< std::vector< V >, 15 > &apl)
 The photonic circuit we considered to create a GHZ state.
 
void fidsim (const std::vector< float > &ovls, const std::vector< int > &doublePrep, const std::vector< int > &lossPos, const std::vector< float > &angErrs, const std::array< std::vector< float >, 15 > &apl, const std::string &path, int rank)
 Computes the fidelity for a given parameters.
 
void schedulerGHZshuffled (const std::vector< float > &ovls, std::vector< float > &angErrs, std::string path, int global_lower, int global_upper, int rank_off, int rank, int size, std::string shuffle_path)
 This function iterates over most likely 10214 combinations of loss and two-photon creation and saves the fidelity and the probailities for all of them.
 

Detailed Description

Defines the function used for the simulation of GHZ state generation with imperfections.

Author
Fabian Wiesner (fabia.nosp@m.n.wi.nosp@m.esner.nosp@m.97@g.nosp@m.mail..nosp@m.com)
Version
0.1
Date
2024-06-06

Function Documentation

◆ circuitFid()

template<class K , class V , class R >
void circuitFid ( State< K, V, R > & S,
const std::vector< int > & lossPos,
const std::array< std::vector< V >, 15 > & apl )
inline

The photonic circuit we considered to create a GHZ state.

Template Parameters
KKey-type, cf. State
VValue-type, cf. State
RReal-type, cf. State
Parameters
SState to perform the circuit on.
lossPosPositions where loss happens
aplRotations as unitaries repr. as single line unitaries

◆ cleanOvlGHZ()

template<class K , class V , class R >
void cleanOvlGHZ ( State< K, V, R > & S,
int a )
inline

Cleans input such that only the keys with the same DMode in one of the parts of the GHZ state remain.

Template Parameters
KKey-type, cf. State
VValue-type, cf. State
RReal-type, cf. State
Parameters
SState to compute to overlap for
aphase for GHZ state - either 1 or -1

◆ fid()

void fid ( const std::vector< std::array< State< Key< int >, float, float >, 8 > > & PreData,
const std::vector< std::array< State< Key< int >, float, float >, 8 > > & Compl,
const float & ovl,
const std::vector< float > & angErrs,
const std::vector< int > & doublePrep,
const std::vector< int > & lossPos,
const std::string & path,
int rank )
inline

Computes the fidelity for pre-computed data and writes it to a file.

Parameters
PreDataVector of Arrays (one for every input combination of DModes) of the remaining states after the measurement already projected onto the spatial and polarization modes of the GHZ state
ComplSame data structure as PreData. These contains the complement of the states after the measurement, i.e. those parts orthogonal to the GHZ state.
ovlPairwise overlap
angErrsAngle errors in the setup
doublePrepEvents/positions of double-preparation
lossPosEvents/positions of loss
pathThe path to the folder where the data should be saves.
rankThe rank of the current process. Used for saving the data to the file.

◆ fidsim()

void fidsim ( const std::vector< float > & ovls,
const std::vector< int > & doublePrep,
const std::vector< int > & lossPos,
const std::vector< float > & angErrs,
const std::array< std::vector< float >, 15 > & apl,
const std::string & path,
int rank )

Computes the fidelity for a given parameters.

Parameters
ovlsOverlaps, for all of them the fidelity is computed
doublePrepSpatial modes with two-photon preparation
lossPosPositions where loss happens
angErrsRotation-errors for wave-plates
aplRotations as unitaries repr. as single line unitaries (already including the rotation errors)
pathPathsuffix where to save the outcome
rankRank of the process (used for saving the outcome)

◆ schedulerGHZshuffled()

void schedulerGHZshuffled ( const std::vector< float > & ovls,
std::vector< float > & angErrs,
std::string path,
int global_lower,
int global_upper,
int rank_off,
int rank,
int size,
std::string shuffle_path )

This function iterates over most likely 10214 combinations of loss and two-photon creation and saves the fidelity and the probailities for all of them.

Parameters
ovlsOverlaps, for all of them the fidelity is computed
angErrsRotation-errors for wave-plates
pathPathsuffix where to save the outcome
global_lowerLower end of the intervall, between 0 and 10214
global_upperUpper end of the intervall, between 0 and 10214
rank_offOffset for the rank, which is used for saving the result
rankRank of the process (used for saving the outcome)
sizeNumber of processes
shuffle_pathPath to a file where all 10214 combinations are shuffeled