Browse Subversion Repository
Contents of /trunk/calcunits/QC_ccnot.h
Parent Directory
| Revision Log
Revision 1 -
( show annotations)
( download)
( as text)
Wed Aug 3 10:14:23 2011 UTC
(12 years, 9 months ago)
by kaityo
File MIME type: text/x-chdr
File size: 817 byte(s)
First commit
| 1 |
//--------------------------------------------------------------------------- |
| 2 |
// Cotroled controled not gate |
| 3 |
//--------------------------------------------------------------------------- |
| 4 |
#ifndef QC_ccnotH |
| 5 |
#define QC_ccnotH |
| 6 |
|
| 7 |
#include "QCalcUnit.h" |
| 8 |
//--------------------------------------------------------------------------- |
| 9 |
class QC_ccnot : public QCalcUnit |
| 10 |
{ |
| 11 |
private: |
| 12 |
int ControlBit1; |
| 13 |
int ControlBit2; |
| 14 |
int TargetBit; |
| 15 |
|
| 16 |
public: |
| 17 |
|
| 18 |
QC_ccnot(int TargetBit,int ControllBit1, int ControlBit2); |
| 19 |
|
| 20 |
static void calc(int t, int c1, int c2, double R[], double I[], int bits); |
| 21 |
virtual void Calc(QBits *QBits); |
| 22 |
virtual std::string GetName(void) const { |
| 23 |
return "Toffoli"; |
| 24 |
} |
| 25 |
|
| 26 |
|
| 27 |
#ifdef __USE__MPI |
| 28 |
static void calcmpi(int t1, int c1, int c2, double R[], double I[], int N); |
| 29 |
#endif |
| 30 |
}; |
| 31 |
#endif |
| |