00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00019
00020 #ifndef QOPERATORS_H
00021 #define QOPERATORS_H
00022
00023 #include "SMatrix.h"
00024 #include "Bra.h"
00025
00027
00028 class EXPORTED_FUNCTION QOperator: public SMatrix
00029 {
00030 public:
00031 QOperator(int dim_i = 1):SMatrix(dim_i) {}
00032 QOperator(int dim_i,complex<double> diag):SMatrix(dim_i,diag) {}
00033 QOperator(int dim_i,const complex<double> *Mtab_i):SMatrix(dim_i,Mtab_i) {}
00034 QOperator(int dim_i,double *real,double *imag):SMatrix(dim_i,real,imag) {}
00035 QOperator(const SMatrix & m):SMatrix(m) {}
00036 QOperator(const QOperator & m):SMatrix(m) {}
00037
00038
00039 friend EXPORTED_FUNCTION Ket operator*(const QOperator & m,const Ket & ket);
00040 friend EXPORTED_FUNCTION Bra operator*(const Bra & bra, const QOperator & m);
00041 };
00042
00044
00045 class EXPORTED_FUNCTION QCreation: public QOperator
00046 {
00047 public:
00048 QCreation(int dim_i = 1);
00049 };
00050
00052
00053 class EXPORTED_FUNCTION QAnnihilation: public QOperator
00054 {
00055 public:
00056 QAnnihilation(int dim_i = 1);
00057 };
00058
00060
00061 class EXPORTED_FUNCTION QDisplacement: public QOperator
00062 {
00063 private:
00064 QCreation *ac;
00065 QAnnihilation *aa;
00066 public:
00067 QDisplacement(int dim_i = 1);
00068 ~QDisplacement();
00069
00071 QOperator operator() (complex<double> alpha) const {
00072 return exp(-pow(abs(alpha),2)/2.0)*(alpha*ac).getexpm()*(-conj(alpha)*aa).getexpm();
00073 }
00074 };
00075
00077
00078 class EXPORTED_FUNCTION QParity: public QOperator
00079 {
00080 public:
00081 QParity(int dim_i = 1);
00082 };
00083
00084 #endif
00085