Sequential Quantum Gate Decomposer  v1.9.6
Powerful decomposition of general unitarias into one- and two-qubit gates gates
Macros | Functions
qgd_math.h File Reference
#include <cstddef>
#include <cmath>
#include <math.h>
Include dependency graph for qgd_math.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define M_1_PI   0.318309886183790671538
 
#define M_2_PI   0.636619772367581343076
 
#define M_2_SQRTPI   1.12837916709551257390
 
#define M_E   2.71828182845904523536
 
#define M_LN10   2.30258509299404568402
 
#define M_LN2   0.693147180559945309417
 
#define M_LOG10E   0.434294481903251827651
 
#define M_LOG2E   1.44269504088896340736
 
#define M_PI   3.14159265358979323846
 
#define M_PI_2   1.57079632679489661923
 
#define M_PI_4   0.785398163397448309616
 
#define M_SQRT1_2   0.707106781186547524401
 
#define M_SQRT2   1.41421356237309504880
 

Functions

template<typename T >
T qgd_cos (T x)
 
template<>
double qgd_cos< double > (double x)
 
template<>
float qgd_cos< float > (float x)
 
template<typename T >
T qgd_sin (T x)
 
template<>
double qgd_sin< double > (double x)
 
template<>
float qgd_sin< float > (float x)
 
template<typename T >
void qgd_sincos (T x, T *s, T *c)
 
template<>
void qgd_sincos< double > (double x, double *s, double *c)
 
template<>
void qgd_sincos< float > (float x, float *s, float *c)
 
template<typename T >
void qgd_sincos_batch (const T *input, T *output, std::size_t count, int stride)
 
template<>
void qgd_sincos_batch< double > (const double *input, double *output, std::size_t count, int stride)
 
template<>
void qgd_sincos_batch< float > (const float *input, float *output, std::size_t count, int stride)
 

Macro Definition Documentation

◆ M_1_PI

#define M_1_PI   0.318309886183790671538

Definition at line 54 of file qgd_math.h.

◆ M_2_PI

#define M_2_PI   0.636619772367581343076

Definition at line 58 of file qgd_math.h.

◆ M_2_SQRTPI

#define M_2_SQRTPI   1.12837916709551257390

Definition at line 62 of file qgd_math.h.

◆ M_E

#define M_E   2.71828182845904523536

Definition at line 22 of file qgd_math.h.

◆ M_LN10

#define M_LN10   2.30258509299404568402

Definition at line 38 of file qgd_math.h.

◆ M_LN2

#define M_LN2   0.693147180559945309417

Definition at line 34 of file qgd_math.h.

◆ M_LOG10E

#define M_LOG10E   0.434294481903251827651

Definition at line 30 of file qgd_math.h.

◆ M_LOG2E

#define M_LOG2E   1.44269504088896340736

Definition at line 26 of file qgd_math.h.

◆ M_PI

#define M_PI   3.14159265358979323846

Definition at line 42 of file qgd_math.h.

◆ M_PI_2

#define M_PI_2   1.57079632679489661923

Definition at line 46 of file qgd_math.h.

◆ M_PI_4

#define M_PI_4   0.785398163397448309616

Definition at line 50 of file qgd_math.h.

◆ M_SQRT1_2

#define M_SQRT1_2   0.707106781186547524401

Definition at line 70 of file qgd_math.h.

◆ M_SQRT2

#define M_SQRT2   1.41421356237309504880

Definition at line 66 of file qgd_math.h.

Function Documentation

◆ qgd_cos()

template<typename T >
T qgd_cos ( T  x)
inline

◆ qgd_cos< double >()

template<>
double qgd_cos< double > ( double  x)
inline

Definition at line 101 of file qgd_math.h.

◆ qgd_cos< float >()

template<>
float qgd_cos< float > ( float  x)
inline

Definition at line 96 of file qgd_math.h.

◆ qgd_sin()

template<typename T >
T qgd_sin ( T  x)
inline

◆ qgd_sin< double >()

template<>
double qgd_sin< double > ( double  x)
inline

Definition at line 91 of file qgd_math.h.

◆ qgd_sin< float >()

template<>
float qgd_sin< float > ( float  x)
inline

Definition at line 86 of file qgd_math.h.

◆ qgd_sincos()

template<typename T >
void qgd_sincos ( T  x,
T s,
T c 
)
inline

◆ qgd_sincos< double >()

template<>
void qgd_sincos< double > ( double  x,
double *  s,
double *  c 
)
inline

Definition at line 118 of file qgd_math.h.

Here is the caller graph for this function:

◆ qgd_sincos< float >()

template<>
void qgd_sincos< float > ( float  x,
float *  s,
float *  c 
)
inline

Definition at line 106 of file qgd_math.h.

Here is the caller graph for this function:

◆ qgd_sincos_batch()

template<typename T >
void qgd_sincos_batch ( const T input,
T output,
std::size_t  count,
int  stride 
)
inline

◆ qgd_sincos_batch< double >()

template<>
void qgd_sincos_batch< double > ( const double *  input,
double *  output,
std::size_t  count,
int  stride 
)
inline

Definition at line 138 of file qgd_math.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ qgd_sincos_batch< float >()

template<>
void qgd_sincos_batch< float > ( const float *  input,
float *  output,
std::size_t  count,
int  stride 
)
inline

Definition at line 130 of file qgd_math.h.

Here is the call graph for this function:
Here is the caller graph for this function: