inlib  1.2.0
/Users/barrand/private/dev/softinex/old/inexlib-1.2/inlib/inlib/a2z
Go to the documentation of this file.
00001 // Copyright (C) 2010, Guy Barrand. All rights reserved.
00002 // See the file inlib.license for terms.
00003 
00004 #ifndef inlib_a2z
00005 #define inlib_a2z
00006 
00007 // Inheritance :
00008 #include "a2"
00009 
00010 #include <complex>
00011 
00012 namespace inlib {
00013 namespace a2z {  //z is for complex
00014 
00018 
00019 class id : public a2::sqm< std::complex<double> > {
00020 public:
00021   id(){
00022     typedef std::complex<double> z;
00023     z e(1,0);
00024     v00(e);
00025     v11(e);
00026   }
00027 };
00028 
00029 //  epsilon :
00030 //    0  1
00031 //   -1  0
00032 class epsilon : public a2::sqm< std::complex<double> > {
00033 public:
00034   epsilon(){
00035     v01(1);
00036     v10(-1);
00037   }
00038 };
00039 
00040 }}
00041 
00042 namespace inlib {
00043 
00044 //  Pauli matrices :
00045 //  P1      P2      P3
00046 //    0  1    0 -i    1  0
00047 //    1  0    i  0    0 -1
00048 class P1 : public a2::sqm< std::complex<double> > {
00049 public:
00050   P1(){
00051     v01(1);
00052     v10(1);
00053   }
00054 };
00055 
00056 class P2 : public a2::sqm< std::complex<double> > {
00057 public:
00058   P2(){
00059     typedef std::complex<double> z;
00060     z i(0,1);
00061     v01(-i);
00062     v10( i);
00063   }
00064 };
00065 
00066 class P3 : public a2::sqm< std::complex<double> > {
00067 public:
00068   P3(){
00069     v00(1);
00070     v11(-1);
00071   }
00072 };
00073 
00074 }
00075 
00076 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines