Develop and Download Open Source Software

Browse Subversion Repository

Contents of /trunk/calcunits/QC_pauliX.cpp

Parent Directory Parent Directory | Revision Log 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-c++src
File size: 1093 byte(s)
First commit
1 //---------------------------------------------------------------------------
2 #include "QC_pauliX.h"
3 #include "QC_not.h"
4 //---------------------------------------------------------------------------
5 /**
6 * Constructor
7 */
8 QC_pauliX::QC_pauliX(int _Target) : QCalcUnit() {
9 Target = _Target;
10 }
11 //---------------------------------------------------------------------------
12 /**
13 * Calculate
14 */
15 void
16 QC_pauliX::calc(int target, double R[], double I[], int NumberOfBits) {
17 QC_not::calc(target, R, I, NumberOfBits);
18 }
19 //---------------------------------------------------------------------------
20 void
21 QC_pauliX::Calc(QBits *qBits) {
22 int N = qBits->GetNumberOfQBits();
23 double *R = qBits->GetBitsR();//Real Part
24 double *I = qBits->GetBitsI();//Imaginary Part
25
26 QC_pauliX::calc(Target, R, I, N);
27 }
28 //---------------------------------------------------------------------------
29 #ifdef __USE__MPI
30 void
31 QC_pauliX::calcmpi(int t1, double R[], double I[], int N) {
32 QC_not::calcmpi(t1,R,I,N);
33 }
34 #endif
35 //---------------------------------------------------------------------------

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26