C++QEDElements  v2 Milestone 10
a framework for simulating open quantum dynamics – generic elements
Qbit_.h
Go to the documentation of this file.
1 // Copyright András Vukics 2006–2014. Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE.txt)
3 // -*- C++ -*-
4 #ifndef CPPQEDELEMENTS_FREES_QBIT__H_INCLUDED
5 #define CPPQEDELEMENTS_FREES_QBIT__H_INCLUDED
6 
7 #include "Qbit_Fwd.h"
8 
9 #include "ParsQbit.h"
10 
11 #include "Mode_.h"
12 #include "StateVector.h"
13 
14 // Qbit traced back to Mode with dim=2
15 
16 namespace qbit {
17 
18 using mode::NoTime;
19 
20 const std::string keyTitle="Qbit";
21 
22 
23 class Averaged
24  : public structure::ElementAveraged<1>
25 {
26 public:
28 
29  Averaged();
30 
31 private:
32  const Averages average_v(NoTime, const LazyDensityOperator&) const;
33 
34 };
35 
36 
37 } // qbit
38 
39 
40 
41 
42 class QbitBase
43  : public ModeBase, public qbit::Averaged
44 {
45 public:
46  explicit QbitBase(const RealFreqs& =emptyRF, const ComplexFreqs& =emptyCF);
47 
48  explicit QbitBase(const ComplexFreqs& complexFreqs) : QbitBase(emptyRF,complexFreqs) {}
49  explicit QbitBase(RealFreqsInitializer rf, ComplexFreqsInitializer cf={}) : QbitBase(RealFreqs(rf),ComplexFreqs(cf)) {}
50  explicit QbitBase(ComplexFreqsInitializer cf) : QbitBase(RealFreqsInitializer(),cf) {}
51  explicit QbitBase(RF rf, CF cf=CF()) : QbitBase(RealFreqsInitializer{rf}, cf==CF() ? ComplexFreqsInitializer{} : ComplexFreqsInitializer{cf}) {}
52  explicit QbitBase(CF cf) : QbitBase(ComplexFreqsInitializer{cf}) {}
53  explicit QbitBase(RealFreqsInitializer rf, CF cf) : QbitBase(rf,{cf}) {}
54  explicit QbitBase(RF rf, ComplexFreqsInitializer cf) : QbitBase({rf},cf) {}
55 
56  virtual ~QbitBase() {}
57 
58 };
59 
60 
61 namespace qbit {
62 
63 using namespace structure::freesystem;
64 
65 typedef boost::shared_ptr<const QbitBase> Ptr;
66 
67 inline const Tridiagonal sigmaop(Ptr qbit) {return mode::aop(qbit);}
68 
69 const Tridiagonal sigmadagsigmaop();
70 
71 const Tridiagonal sigmaxop(Ptr);
72 const Tridiagonal sigmayop(Ptr);
73 const Tridiagonal sigmazop();
74 
75 
76 inline double saturation(const StateVectorLow& psi) {return mode::photonNumber(psi);}
77 
78 inline double saturation(const LazyDensityOperator& m) {return mode::photonNumber(m);}
79 
80 
81 inline const StateVector state0() {return mode::fock(0,2);}
82 inline const StateVector state1() {return mode::fock(1,2);}
83 const StateVector init(const dcomp& psi1);
84 inline const StateVector init(const Pars& p) {return init(p.qbitInit);}
85 
86 
87 Ptr make(const ParsPumpedLossy&, QM_Picture);
88 
89 
90 
91 
92 class Exact : public mode::Exact
93 {
94 public:
95  Exact(const dcomp& zI) : mode::Exact(zI,2) {}
96 
97 };
98 
99 
100 
101 template<bool IS_TIME_DEPENDENT>
102 class Hamiltonian : public mode::Hamiltonian<IS_TIME_DEPENDENT>
103 {
104 public:
105  Hamiltonian(const dcomp& zSch, const dcomp& zI, const dcomp& eta)
106  : mode::Hamiltonian<true >(zSch,zI,-eta,2) {}
107 
108  Hamiltonian(const dcomp& zSch, const dcomp& eta)
109  : mode::Hamiltonian<false>(zSch, -eta,2) {}
110 
111 };
112 
113 
114 
115 class Liouvillean : public mode::Liouvillean<false>
116 {
117 protected:
118  Liouvillean(double gamma) : mode::Liouvillean<false>(gamma,0,keyTitle) {}
119 
120 };
121 
122 
124 {
125 protected:
126  LiouvilleanPhaseNoise(double gamma_perpendicular, double gamma_parallel);
127 
128 };
129 
130 
131 } // qbit
132 
133 
134 
136 //
137 // Highest level
138 //
140 
141 
142 class Qbit
143  : public qbit::Exact, public QbitBase
144 {
145 public:
146  Qbit(const qbit::Pars&);
147 };
148 
149 typedef Qbit QbitUIP;
150 
151 
152 class QbitSch
153  : public qbit::Hamiltonian<false>, public QbitBase
154 {
155 public:
156  QbitSch(const qbit::Pars&);
157 };
158 
159 
161  : public qbit::Hamiltonian<true>, public QbitBase
162 {
163 public:
164  PumpedQbit(const qbit::ParsPumped&);
165 };
166 
167 typedef PumpedQbit PumpedQbitUIP;
168 
169 
171  : public qbit::Hamiltonian<false>, public QbitBase
172 {
173 public:
174  PumpedQbitSch(const qbit::ParsPumped&);
175 };
176 
177 
179  : public qbit::Liouvillean, public qbit::Exact, public QbitBase
180 {
181 public:
182  LossyQbit(const qbit::ParsLossy&);
183 };
184 
185 
187  : public qbit::Liouvillean, public qbit::Hamiltonian<false>, public QbitBase
188 {
189 public:
190  LossyQbitSch(const qbit::ParsLossy&);
191 };
192 
193 
195  : public qbit::Liouvillean, public qbit::Hamiltonian<true>, public QbitBase
196 {
197 public:
198  LossyQbitUIP(const qbit::ParsLossy&);
199 };
200 
201 
203  : public qbit::Liouvillean, public qbit::Hamiltonian<true>, public QbitBase
204 {
205 public:
206  PumpedLossyQbit(const qbit::ParsPumpedLossy&);
207 };
208 
209 
211  : public qbit::Liouvillean, public qbit::Hamiltonian<true>, public QbitBase
212 {
213 public:
214  PumpedLossyQbitUIP(const qbit::ParsPumpedLossy&);
215 };
216 
217 
219  : public qbit::Liouvillean, public qbit::Hamiltonian<false>, public QbitBase
220 {
221 public:
222  PumpedLossyQbitSch(const qbit::ParsPumpedLossy&);
223 };
224 
225 
227  : public qbit::Exact, public qbit::LiouvilleanPhaseNoise, public QbitBase
228 {
229 public:
230  LossyQbitWithPhaseNoise(const qbit::ParsLossy&, double gamma_parallel);
231 
232 };
233 
234 
236  : public qbit::Hamiltonian<true>, public qbit::LiouvilleanPhaseNoise, public QbitBase
237 {
238 public:
239  LossyQbitWithPhaseNoiseUIP(const qbit::ParsLossy&, double gamma_parallel);
240 
241 };
242 
243 
244 #endif // CPPQEDELEMENTS_FREES_QBIT__H_INCLUDED
boost::shared_ptr< const Base > Ptr
Definition: Qbit_.h:142
std::tuple< std::string, dcomp, double > CF
quantumdata::Types< 1 >::StateVectorLow StateVectorLow
Defines the Mode bundle (tackling the dynamics of a single harmonic-oscillator mode) ...
std::list< CF > ComplexFreqs
Definition: Qbit_.h:16
const StateVector init(const Pars &)
Dispatcher for initial condition.
Definition: Qbit_.h:84
Definition: Qbit_.h:42
std::list< RF > RealFreqs
Definition: Qbit_.h:152
std::tuple< std::string, double, double > RF
std::complex< double > dcomp
const Ptr make(const IA &ia)