-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
77 lines (53 loc) · 2.3 KB
/
main.cpp
File metadata and controls
77 lines (53 loc) · 2.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#include <iostream>
#include <fstream>
#include <armadillo>
#include "gnuplot-iostream.h"
#include "Compound.h"
#include "PotWell.h"
#include "HamiltonianMaker.h"
#include "MatrixSolver.h"
int main(int argc, char** argv){
Gnuplot gp;
Compound GaAs(gaas_params);
arma::vec k_vector = arma::linspace<arma::vec>(-3,3);
int num_elem_kvec = k_vector.n_elem;
PotWell potential_well_x("x");
HamiltonianMaker hamiltonian_maker_x(&GaAs, &potential_well_x);
MatrixSolver matrix_solver_x(&hamiltonian_maker_x);
arma::vec heavy_hole_fractions_x = matrix_solver_x.heavy_hole_mixing(k_vector);
arma::vec light_hole_fractions_x = matrix_solver_x.light_hole_mixing(k_vector);
arma::vec rotated_heavy_hole_fractions_x = matrix_solver_x.rotated_heavy_hole_mixing(k_vector);
arma::vec rotated_light_hole_fractions_x = matrix_solver_x.rotated_light_hole_mixing(k_vector);
arma::mat hh_x = arma::zeros<arma::mat>(num_elem_kvec, 2);
arma::mat lh_x = arma::zeros<arma::mat>(num_elem_kvec, 2);
arma::mat rot_hh_x = arma::zeros<arma::mat>(num_elem_kvec, 2);
arma::mat rot_lh_x = arma::zeros<arma::mat>(num_elem_kvec, 2);
hh_x.col(0) = k_vector;
hh_x.col(1) = heavy_hole_fractions_x;
lh_x.col(0) = k_vector;
lh_x.col(1) = light_hole_fractions_x;
rot_hh_x.col(0) = k_vector;
rot_hh_x.col(1) = rotated_heavy_hole_fractions_x;
rot_lh_x.col(0) = k_vector;
rot_lh_x.col(1) = rotated_light_hole_fractions_x;
PotWell potential_well_z("z");
HamiltonianMaker hamiltonian_maker_z(&GaAs, &potential_well_z);
MatrixSolver matrix_solver_z(&hamiltonian_maker_z);
arma::vec heavy_hole_fractions_z = matrix_solver_z.heavy_hole_mixing(k_vector);
arma::vec light_hole_fractions_z = matrix_solver_z.light_hole_mixing(k_vector);
arma::mat hh_z = arma::zeros<arma::mat>(num_elem_kvec, 2);
arma::mat lh_z = arma::zeros<arma::mat>(num_elem_kvec, 2);
hh_z.col(0) = k_vector;
hh_z.col(1) = heavy_hole_fractions_z;
lh_z.col(0) = k_vector;
lh_z.col(1) = light_hole_fractions_z;
gp << "set term png\n";
gp << "set output 'HHRotHALLELUJA.png'\n";
gp << "set xrange [-3:3]\nset yrange [0:1]\n";
gp << "plot ";
gp << gp.binFile1d(lh_z, "record") << "with lines title 'heavy hole_z'";
gp << ", ";
gp << gp.binFile1d(rot_lh_x, "record") << "with points title 'rot heavy hole_x'";
gp << std::endl;
return 0;
}