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

Some helper functions for Key.hpp. More...

#include <vector>
#include <math.h>
#include <string>
#include <algorithm>
#include <sstream>
#include <complex>

Namespaces

namespace  numbers
 Short handle for pi.
 

Functions

int facut (int i)
 Recrusive definition of the faculty. Up to 12, this is just a look-up.
 
template<class R , class I >
binomialCoeff (I n, I k)
 Returns the binomial coefficient n over k. Shouldn't be used for large numbers and is only used for n<=12.
 

Variables

const int FACUT12 [13] = {1, 1, 2, 6, 24, 120, 720, 5040, 40320, 362880, 3628800, 39916800, 479001600}
 Pre-computed faculties up to 12! as this is the maximal number of photons in the circuit.
 
const double numbers::pi = 3.14159265358979323846
 

Detailed Description

Some helper functions for Key.hpp.

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

◆ binomialCoeff()

template<class R , class I >
R binomialCoeff ( I n,
I k )

Returns the binomial coefficient n over k. Shouldn't be used for large numbers and is only used for n<=12.

Template Parameters
RReal-type for the output.
IInteger number type used for input.
Parameters
nUpper number of the binomial coefficient, 0<=n<=12.
kLower number of the binomial coefficient, 0<=k<=n.
Returns
R n over k.

◆ facut()

int facut ( int i)

Recrusive definition of the faculty. Up to 12, this is just a look-up.

Parameters
iInput to compute the faculty of.
Returns
int The fuculty of i, i.e. i!.