|
gimme-alpha 0.1
|
00001 /** @file */ 00002 /* 00003 ** alpha_calc.h 00004 ** 00005 ** Made by Johnny Q. Hacker 00006 ** Login <solarion@borkborkbork> 00007 00008 Copyright (C) 2009 Joseph Pingenot 00009 00010 This program is free software: you can redistribute it and/or modify 00011 it under the terms of the GNU Affero General Public License as published by 00012 the Free Software Foundation, either version 3 of the License, or 00013 (at your option) any later version. 00014 00015 This program is distributed in the hope that it will be useful, 00016 but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00018 GNU Affero General Public License for more details. 00019 00020 You should have received a copy of the GNU Affero General Public License 00021 along with this program. If not, see <http://www.gnu.org/licenses/>. 00022 00023 ** Started on Fri Mar 6 11:21:51 2009 Johnny Q. Hacker 00024 ** Last update Fri Mar 6 11:21:51 2009 Johnny Q. Hacker 00025 */ 00026 00027 #ifndef ALPHA_CALC_H_ 00028 # define ALPHA_CALC_H_ 00029 00030 #include <glib-2.0/glib.h> 00031 #include <libmodeling/wavefunction.h> 00032 #include <libmodeling/bands.h> 00033 #include <libnextnano/read_nextnano_bandstructure.h> 00034 #include <libcommon/gimme-alpha_structs.h> 00035 00036 #ifdef __cplusplus 00037 extern "C" { 00038 #endif 00039 00040 /*Helps to investigate the inner workings of the electric field term.*/ 00041 struct alpha_integrand_verificator { 00042 int N; /*Number of points*/ 00043 double *x; /*Position (nm)*/ 00044 double *prob_density; /*Psi star psi (1/nm)*/ 00045 double *integrand; /*Value of the integrand at x (1/(eV^2 nm))*/ 00046 double *pot_deriv; /*Value of the derivative of the potential at x (V/nm)*/ 00047 double *iface_equiv; /*Equivalent of the interface product 00048 (1/(E-epsilon_gamma_x-phi(x)))*|psi(x)|^2, 00049 for unit checks (1/ev^2)*/ 00050 double *sob; /*Split-off band (eV)*/ 00051 double *avg; /*Averaged HH, LH states (eV)*/ 00052 double *oo_sob; /*1/sob (1/eV)*/ 00053 double *oo_avg; /*1/avg (1/eV)*/ 00054 double *pot; /*potential*/ 00055 }; 00056 00057 struct alpha_integrand_verificator_2 { 00058 int N; /*Number of points*/ 00059 double *x; /*Position (nm)*/ 00060 double *prob_density; /*Psi star psi (1/nm)*/ 00061 double *d_prob_density; /*Derivative of |Psi|^2*/ 00062 double *band_term; /*difference of oo_sob and oo_avg*/ 00063 double *sob; /*Split-off band (eV)*/ 00064 double *avg; /*Averaged HH, LH states (eV)*/ 00065 double *oo_sob; /*1/sob (1/eV)*/ 00066 double *oo_avg; /*1/avg (1/eV)*/ 00067 double *integrand; /*Value of the integrand at x (1/(eV^2 nm))*/ 00068 }; 00069 00070 /*Calculates the interface portion of the Rashba coefficient 00071 \param wf 1-dimensional, *LAPACK-normalized* effective mass wavefunction. 00072 \param hh_band heavy-hole band as a function of position, with electric field (eV) 00073 \param lh_band light-hole band as a function of position, with electric field (eV) 00074 \param so_band split-off band as a function of position, with electric field (eV) 00075 \param cb_band conduction band as a function of position, with electric field (eV) 00076 \param pot electrostatic potential (V) 00077 \param ifs GList of pointers to doubles, the interface positions (nm) 00078 \return the Rashba coefficient (eV m^2) 00079 \note "LAPACK-normalized" means that the wavefunction has been multiplied by the square root of the grid spacing, and thus the wavefunction at each point should sum to 1. 00080 */ 00081 double alpha_interface_term_mstar_nostrain(const struct mstar_wavefunction_1d *wf, const struct band *hh_band, const struct band *lh_band, const struct band *so_band, const struct band *cb_band, const struct potential *pot, GList* ifs, double Ep); 00082 00083 /*Calculates the electric field portion of the Rashba coefficient 00084 \param wf 1-dimensional, *LAPACK-normalized* effective mass wavefunction. 00085 \param hh_band heavy-hole band as a function of position, with electric field (eV) 00086 \param lh_band light-hole band as a function of position, with electric field (eV) 00087 \param so_band split-off band as a function of position, with electric field (eV) 00088 \param cb_band conduction band as a function of position, with electric field (eV) 00089 \param pot electrostatic potential (V) 00090 \param ifs GList of pointers to doubles, the interface positions (nm) 00091 \param vfp pointer to an alpha_integrand_verificator struct, for returning plots of various integration inputs, for troubleshooting. 00092 \param integration_error pointer to a double for storing the final integraion error 00093 \param abserr requested absolute integration error 00094 \param relerr requested relative integration error 00095 \return the eletric field portion of the Rashba coefficient (eV m^2) 00096 \note "LAPACK-normalized" means that the wavefunction has been multiplied by the square root of the grid spacing, and thus the wavefunction at each point should sum to 1. 00097 */ 00098 double alpha_electric_term_mstar_nostrain(const struct mstar_wavefunction_1d *wf, const struct band *hh_band, const struct band *lh_band, const struct band *so_band, const struct band *cb_band, const struct potential *pot, struct alpha_integrand_verificator *vfp, double *integration_error, double abserr, double relerr, gboolean no_integrate, double Ep); 00099 00100 double average_discrete_function(const double *function, const double* x, int N, const struct mstar_wavefunction_1d *wf, short int derivative, double abserr, double relerr, double* err); 00101 00102 /*Calculates the electric field portion of the Rashba coefficient 00103 \param wf 1-dimensional, *LAPACK-normalized* effective mass wavefunction. 00104 \param hh_band heavy-hole band as a function of position, with electric field (eV) 00105 \param lh_band light-hole band as a function of position, with electric field (eV) 00106 \param so_band split-off band as a function of position, with electric field (eV) 00107 \param cb_band conduction band as a function of position, with electric field (eV) 00108 \param pot electrostatic potential (V) 00109 \param ifs GList of pointers to doubles, the interface positions (nm) 00110 \param vfp pointer to an alpha_integrand_verificator_2 struct, for returning plots of various integration inputs, for troubleshooting. 00111 \param integration_error pointer to a double for storing the final integraion error 00112 \param abserr requested absolute integration error 00113 \param relerr requested relative integration error 00114 \return the eletric field portion of the Rashba coefficient (eV m^2) 00115 \note "LAPACK-normalized" means that the wavefunction has been multiplied by the square root of the grid spacing, and thus the wavefunction at each point should sum to 1. 00116 */ 00117 double alpha_from_del_psi2_nostrain(const struct mstar_wavefunction_1d *wf, const struct band *hh_band, const struct band *lh_band, const struct band *so_band, const struct band *cb_band, const struct potential *pot, struct alpha_integrand_verificator_2 *vfp2, double *integration_error, double abserr, double relerr, gboolean no_integrate, double Ep); 00118 00119 GError* alpha_write_verificator_data(GFile* f, const struct alpha_integrand_verificator* vf); 00120 GError* alpha_write_verificator2_data(GFile* f, const struct alpha_integrand_verificator_2* vf2); 00121 00122 00123 /**frees the *data* in a verificator. The struct itself is still kept (so you can point to a stack-allocated struct safely**/ 00124 void alpha_free_verificator_data(struct alpha_integrand_verificator *vf); 00125 /**frees the *data* in a verificator2. The struct itself is still kept (so you can point to a stack-allocated struct safely**/ 00126 void alpha_free_verificator2_data(struct alpha_integrand_verificator_2* vf2); 00127 00128 #ifdef __cplusplus 00129 } 00130 #endif 00131 00132 #endif /* !ALPHA_CALC_H_ */