Greens-code
A modular quantum transport code
externalpotential.hpp
Go to the documentation of this file.
1 #ifndef EXTPOT_HEADER
2 #define EXTPOT_HEADER
3 
4 #include "abstract_potential.hpp"
5 #include "funcs_base.hpp"
6 
11 class point_Positions;
12 typedef STD_TR1::shared_ptr<point_Positions> point_Positions_ref;
13 
14 
16 
30 public:
31  ~y_dependent_Potential() throw(){};
32 
33 private:
34 
35  vector_Object::ref v;
36  function_Object::ref f;
37  function_Object::ref f_imag;
38 
39  point_Positions_ref points;
40 
41  const char* name() const { return "y_Potential";};
42 
43  void init_pot_();
44 
45  void prepare_pot_(const geometry_const_Iterator& p);
46  complex get_pot_(int iy) const;
47 
48 };
49 
51 
72 public:
73  ~absorbing_lower_Boundary() throw() {};
74 
75 private:
76  vector_Object::ref shape;
77  complex V_up;
78  complex V_low;
79  int index;
80 
81  const char* name() const { return "absorbing_lower_Potential";};
82 
83  void init_pot_();
84 
85 
86  void prepare_pot_(const geometry_const_Iterator& p);
87  complex get_pot_(int iy) const;
88 };
89 
91 
102 public:
103  ~x_dependent_Potential() throw(){};
104 
105 private:
106 
107  vector_Object::ref v;
108  function_Object::ref f;
109 
110  point_Positions_ref points;
111 
112  double e0;
113 
114  const char* name() const { return "x_Potential";};
115 
116  void init_pot_();
117 
118  void prepare_pot_(const geometry_const_Iterator& p);
119  complex get_pot_(int iy) const;
120 
121 };
122 
124 /*
125  Name: xy_Potential
126  Parameters:
127  Objects:
128  - data: a vector_Object, that contains the values of the potential as function of
129  position index
130  - [modulo_ny]: for layered structures, take iy % modulo_ny, so that both layers can see the same potential
131  - [global_geometry]: use global coordinate systems instead of local one
132  - [data_imag]: a vector_Object, that contains the imaginary part of the potential
133  (if it exists) as function of position index
134  - [force_ny]: An integer, default 0, that gives the leading dimension of the data array.
135  if 0, H%ny will be used.
136  - [smooth_sides] An integer, default 0. if the distance to the boundary is smaller
137  than smooth_sides, potential will be multiplied by (ix/smooth_sides)**2
138 */
139 
141 public:
142  ~xy_dependent_Potential() throw(){};
143 
144 private:
145 
146  vector_Object::ref v;
147  vector_Object::ref v_imag;
148 
149  function_Object::ref f;
150  function_Object::ref f_imag;
151 
152  int force_ny;
153  int modulo_ny;
154  int index;
155  int smooth_sides;
156  int only_one_smooth_side;
157 
158  bool global_geometry;
159 
160  double mult;
161 
162  const char* name() const { return "xy_Potential";};
163 
164  void init_pot_();
165 
166 
167  void prepare_pot_(const geometry_const_Iterator& p);
168  complex get_pot_(int iy) const;
169 
170 };
171 
179 public:
181 
182 private:
183  const char* name() const { return "xy_function2d_Potential";};
184 
185  function_complex2d_Object::ref f;
186 
187  STD_TR1::shared_ptr<std::vector<complex> > values;
188 
189  void init_pot_();
190 
191 
192  void prepare_pot_(const geometry_const_Iterator& p);
193  complex get_pot_(int iy) const;
194 };
195 
196 
197 
198 
200 class Puddles: public Potential{
201 friend class periodic_puddles;
202 public:
203  ~Puddles() throw() {};
204 protected:
205  STD_TR1::shared_ptr<std::vector<double> > positions_x;
206  STD_TR1::shared_ptr<std::vector<double> > positions_y;
207  STD_TR1::shared_ptr<std::vector<double> > depths;
208  STD_TR1::shared_ptr<std::vector<double> > widths;
209 
210  STD_TR1::shared_ptr<std::vector<complex> > values;
211 
212  STD_TR1::shared_ptr<function_complex_Object> dependence;
213 
214  size_t n_puddle;
215 
216  void init_posdep();
217 
218 private:
219 
220  const char* name() const { return "Puddles";};
221 
222  void init_pot_();
223  void prepare_pot_(const geometry_const_Iterator&);
224  complex get_pot_(int) const;
225 
226  complex get_puddle_pot(double, double, int);
227  virtual void cut_xy(double& x, double& y);
228 };
229 
231 //Two lattice vectors and a starting point should be given; the structure will then be repeated
232 //over the whole rectangle. Where to get its geometry has yet to be figured out.
233 //possible extension: more than one radially symmetrical potential being repeated
234 //angle turns clockwise because the coordinates start at the top left
235 
237 {
238 public:
239  ~periodic_puddles() throw() {};
240 
241 private:
242 
243  double vector1_x,vector1_y,vector2_x,vector2_y;
244  double cvector1_x,cvector1_y,cvector2_x,cvector2_y;
245  double start_x, start_y;
246 
247  void init_pot_();
248 
249  const char* name() const { return "periodic_puddles";};
250 
251  void cut_xy( double& x, double& y);
252 };
253 
254 
256 
277 class Edge_Roughness: public Potential{
278 public:
279  ~Edge_Roughness() throw() {};
280 
281 private:
282  function_complex_Object::ref f_up;
283  function_complex_Object::ref f_down;
284  vector_Object::ref edge_up;
285  vector_Object::ref edge_down;
286 
287  double dist_x;
288  int nx_;
289  int ny_;
290  int ix_;
291  int iwrap;
292  bool index_wrap;
293 
294  bool only_y;
295  bool left_to_right;
296 
297  point_Positions_ref points;
298 
299  const char* name() const { return "Edge_Roughness";};
300 
301  void init_pot_();
302  void prepare_pot_(const geometry_const_Iterator& );
303  complex get_pot_(int) const;
304 };
305 
307 
326 public:
327  ~Edge_Roughness_smooth() throw() {};
328 
329 private:
330  function_complex_Object::ref f_interior;
331 
332  function_complex_Object::ref f_up;
333  function_complex_Object::ref f_down;
334  function_Object::ref edge_up;
335  function_Object::ref edge_down;
336 
337  complex get_very_good_pot(int iy) const;
338  double get_up(int, function_Object::ref, function_Object::ref, int) const;
339 
340  double dist_x;
341  double pos_x_;
342  double dx_;
343  double wrap_;
344  double length_;
345  double width_;
346  double correct_dist_fac;
347  double estimate_side_dist_fac;
348 
349  bool index_wrap;
350  bool correct_dist;
351  bool very_good_pot;
352 
353  bool only_y;
354 
355  point_Positions_ref points;
356 
357  const char* name() const { return "Edge_Roughness_smoth";};
358 
359  complex effective_dist_down( double D ) const;
360  complex effective_dist_up( double D ) const;
361 
362  void init_pot_();
363  void prepare_pot_(const geometry_const_Iterator& );
364  complex get_pot_(int) const;
365 };
366 
368 
395 public:
396 
397  ~Lattice_vacancies() throw() {};
398 
399 private:
400  std::vector< int > disabled;
401  int pos;
402  int xmin;
403  int xmax;
404  int ymin;
405  int ymax;
406  int posinunit;
407  double E1;
408  double E2;
409  double prob;
410  bool do_symmetric;
411 
412  const char* name() const { return "Lattice_vacancies";};
413 
414  void init_pot_();
415  void prepare_pot_(const geometry_const_Iterator& );
416  complex get_pot_(int) const;
417 };
418 
419 // Point defects at fixed positions
420 
421 class Point_defects: public Potential{
422 public:
423  ~Point_defects() throw() {};
424 
425 private:
426  STD_TR1::shared_ptr<std::vector< int > > pos_x;
427  STD_TR1::shared_ptr<std::vector< int > > pos_y;
428  STD_TR1::shared_ptr<std::vector< double > > E_shift;
429 
430  size_t nsize;
431 
432  int current_ix;
433 
434  const char* name() const { return "Point_defects";};
435 
436  void init_pot_();
437  void prepare_pot_(const geometry_const_Iterator& );
438  complex get_pot_(int) const;
439 };
440 
442 
444 public:
445 
446  ~Linear_Potential() throw() {};
447 
448 private:
449  double linpot,vleft, vright;
450 
451  const char* name() const { return "Linear";};
452 
453  void init_pot_();
454  void prepare_pot_(const geometry_const_Iterator& );
455  complex get_pot_(int) const;
456 };
457 
458 class Sine_Potential: public Potential{
459 public:
460 
461  ~Sine_Potential() throw() {};
462 
463 private:
464  double sinpot,vleft, vright;
465 
466  const char* name() const { return "Sine";};
467 
468  void init_pot_();
469  void prepare_pot_(const geometry_const_Iterator& );
470  complex get_pot_(int) const;
471 };
472 
484 public:
485  ~multiband_Potential() throw (){};
486 
487 private:
488  Potential::ref pot;
489  int bands;
490  int ny;
491  int nx;
492  const char* name() const { return "multiband_Potential"; };
493  void init_pot_();
494  void prepare_pot_(const geometry_const_Iterator& p);
495  complex get_pot_(int iy) const;
496 };
497 
498 
499 #endif
A periodic potential defined by two lattice vectors and a radially symmetrical base potential...
Definition: externalpotential.hpp:236
Name: multiband_Potential (class multiband_Potential) Distributes a sub-potential correctly on multil...
Definition: externalpotential.hpp:483
Definition: externalpotential.hpp:421
Definition: iterators.hpp:13
An abstract base class defining potentials, use with ExtPot_Hamiltonian.
Definition: abstract_potential.hpp:38
A linear potential changing form vleft to vright.
Definition: externalpotential.hpp:443
Introduce lattice vacancies at random positions.
Definition: externalpotential.hpp:394
Divide vertically in a lower and upper region, impose a (possibly) complex potential on either side...
Definition: externalpotential.hpp:71
Definition: externalpotential.hpp:458
A Potential defining randomly distributed finite-size puddles.
Definition: externalpotential.hpp:200
An XY-dependent potential using a function2d-object.
Definition: externalpotential.hpp:178
A Potential to define edges of different shapes.
Definition: externalpotential.hpp:277
Definition of abstract base class Potential.
An XY-dependent potential.
Definition: externalpotential.hpp:140
Definition: points.hpp:86
An y-dependent potential.
Definition: externalpotential.hpp:29
An x-dependent potential.
Definition: externalpotential.hpp:101
A Potential to define smooth edges of different shapes.
Definition: externalpotential.hpp:325