Qrack  9.0
General classical-emulating-quantum development framework
Classes | Namespaces | Macros | Typedefs | Functions
qcircuit.hpp File Reference
#include "qinterface.hpp"
#include <algorithm>
#include <iostream>
#include <iterator>
#include <list>
Include dependency graph for qcircuit.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  Qrack::QCircuitGate
 
class  Qrack::QCircuit
 

Namespaces

 Qrack
 

Macros

#define amp_leq_0(x)   (norm(x) <= FP_NORM_EPSILON)
 
#define __IS_REAL_1(r)   (abs(ONE_R1 - r) <= FP_NORM_EPSILON)
 
#define __IS_SAME(a, b)   (norm((a) - (b)) <= FP_NORM_EPSILON)
 
#define __IS_CTRLED_CLIFFORD(top, bottom)
 
#define __IS_CLIFFORD_PHASE_INVERT(top, bottom)
 
#define __IS_CLIFFORD(mtrx)
 
#define __IS_PHASE(mtrx)   (IS_NORM_0(mtrx[1U]) && IS_NORM_0(mtrx[2U]))
 
#define __IS_INVERT(mtrx)   (IS_NORM_0(mtrx[0U]) && IS_NORM_0(mtrx[3U]))
 

Typedefs

typedef std::shared_ptr< QCircuitGate > Qrack::QCircuitGatePtr
 
typedef std::shared_ptr< QCircuit > Qrack::QCircuitPtr
 

Functions

std::ostream & Qrack::operator<< (std::ostream &os, const QCircuitGatePtr g)
 
std::istream & Qrack::operator>> (std::istream &os, QCircuitGatePtr &g)
 
std::ostream & Qrack::operator<< (std::ostream &os, const QCircuitPtr g)
 
std::istream & Qrack::operator>> (std::istream &os, QCircuitPtr &g)
 

Macro Definition Documentation

◆ __IS_CLIFFORD

#define __IS_CLIFFORD (   mtrx)
Value:
((__IS_PHASE(mtrx) && __IS_CLIFFORD_PHASE_INVERT(mtrx[0], mtrx[3])) || \
(__IS_INVERT(mtrx) && __IS_CLIFFORD_PHASE_INVERT(mtrx[1], mtrx[2])) || \
((__IS_SAME(mtrx[0U], mtrx[1U]) || __IS_SAME(mtrx[0U], -mtrx[1U]) || \
__IS_SAME(mtrx[0U], I_CMPLX * mtrx[1U]) || __IS_SAME(mtrx[0U], -I_CMPLX * mtrx[1U])) && \
(__IS_SAME(mtrx[0U], mtrx[2U]) || __IS_SAME(mtrx[0U], -mtrx[2U]) || \
__IS_SAME(mtrx[0U], I_CMPLX * mtrx[2U]) || __IS_SAME(mtrx[0U], -I_CMPLX * mtrx[2U])) && \
(__IS_SAME(mtrx[0U], mtrx[3U]) || __IS_SAME(mtrx[0U], -mtrx[3U]) || \
__IS_SAME(mtrx[0U], I_CMPLX * mtrx[3U]) || IS_SAME(mtrx[0U], -I_CMPLX * mtrx[3U]))))
QRACK_CONST complex I_CMPLX
Definition: qrack_types.hpp:241
MICROSOFT_QUANTUM_DECL void U(_In_ uintq sid, _In_ uintq q, _In_ double theta, _In_ double phi, _In_ double lambda)
(External API) 3-parameter unitary gate
Definition: pinvoke_api.cpp:1362
#define __IS_CLIFFORD_PHASE_INVERT(top, bottom)
Definition: qcircuit.hpp:28
#define __IS_PHASE(mtrx)
Definition: qcircuit.hpp:40
#define __IS_INVERT(mtrx)
Definition: qcircuit.hpp:41
#define __IS_SAME(a, b)
Definition: qcircuit.hpp:24
#define IS_SAME(c1, c2)
Definition: qrack_types.hpp:28

◆ __IS_CLIFFORD_PHASE_INVERT

#define __IS_CLIFFORD_PHASE_INVERT (   top,
  bottom 
)
Value:
(__IS_SAME(top, bottom) || __IS_SAME(top, -bottom) || __IS_SAME(top, I_CMPLX * bottom) || \
__IS_SAME(top, -I_CMPLX * bottom))

◆ __IS_CTRLED_CLIFFORD

#define __IS_CTRLED_CLIFFORD (   top,
  bottom 
)
Value:
((__IS_REAL_1(std::real(top)) || __IS_REAL_1(std::imag(bottom))) && \
(__IS_SAME(top, bottom) || __IS_SAME(top, -bottom)))
#define __IS_REAL_1(r)
Definition: qcircuit.hpp:23

◆ __IS_INVERT

#define __IS_INVERT (   mtrx)    (IS_NORM_0(mtrx[0U]) && IS_NORM_0(mtrx[3U]))

◆ __IS_PHASE

#define __IS_PHASE (   mtrx)    (IS_NORM_0(mtrx[1U]) && IS_NORM_0(mtrx[2U]))

◆ __IS_REAL_1

#define __IS_REAL_1 (   r)    (abs(ONE_R1 - r) <= FP_NORM_EPSILON)

◆ __IS_SAME

#define __IS_SAME (   a,
 
)    (norm((a) - (b)) <= FP_NORM_EPSILON)

◆ amp_leq_0

#define amp_leq_0 (   x)    (norm(x) <= FP_NORM_EPSILON)