|
k-dot-p 0.1
|
00001 /* 00002 *Provides a nice class to house an effective mass wavefunction. 00003 00004 Copyright (C) 2010 Joseph Pingenot 00005 00006 This program is free software: you can redistribute it and/or modify 00007 it under the terms of the GNU Affero General Public License as published by 00008 the Free Software Foundation, either version 3 of the License, or 00009 (at your option) any later version. 00010 00011 This program is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 GNU Affero General Public License for more details. 00015 00016 You should have received a copy of the GNU Affero General Public License 00017 along with this program. If not, see <http://www.gnu.org/licenses/>. 00018 00019 */ 00020 00021 #ifndef ___WAVEFUNCTION_CARTESIAN_EFFECTIVE_MASS_HXX___ 00022 #define ___WAVEFUNCTION_CARTESIAN_EFFECTIVE_MASS_HXX___ 00023 00024 #include <glib.h> 00025 #include <libkdotp/gcc_hints.h> 00026 #include <libkdotp/hamiltonian_cartesian_effective_mass.h++> 00027 #include <libpostproc/density_1d.h> 00028 #include <libpostproc/fftw_wavefunc.h> 00029 00030 namespace kdotp { 00031 namespace libkdotp { 00032 namespace wavefunction { 00033 00034 /**Class to deal with eigenfunctions of effective mass Hamiltonians 00035 *\note a "block" is as returned by LAPACK; N eigenvectors, placed into an array one after the other (index with L*eigvec + i) 00036 */ 00037 class cartesian_effective_mass { 00038 public: 00039 /**The wavefunction*/ 00040 double* wf; 00041 /**The energy of this wavefunction*/ 00042 double E; 00043 /**Grid spacing*/ 00044 double dx; 00045 /**Number of grid sites*/ 00046 unsigned int L; 00047 /**Constructor from a block of eigenvectors 00048 */ 00049 cartesian_effective_mass(double* eigenvector_block, unsigned int eigvec, double dx, unsigned int L, double energy); 00050 }; 00051 00052 /**Gets the index into a block (returned by e.g. LAPACK) of eigenvecs 00053 *\param i grid site of the eigenvector 00054 *\param eigvec which eigenvec in the block 00055 *\param L the number of grid sites 00056 */ 00057 ___const unsigned int get_cartesian_effective_mass_block_index(unsigned int i, unsigned int eigvec, unsigned int L); 00058 00059 /**Gets the average of a function with an eigenvector in the block of eigvecs 00060 *\param block the block to get the eigenvector 00061 *\param eigvec which eigenvector in the block 00062 *\param L number of grid sites in a wavefunc 00063 *\param values pointer to an array of doubles holding the function across the wavefunction 00064 *\return the expectation value of the function 00065 */ 00066 double get_average_with_cartesian_effective_mass_block(double* block, unsigned int eigvec, unsigned int L, double* func); 00067 00068 GError* init_density_1d_from_cartesian_effective_mass_block(double* block, unsigned int eigvec, unsigned int L, double dx, struct density_1d *density); 00069 00070 double get_cartesian_effective_mass_block_max_delta(double* block1, unsigned vec1, double* block2, unsigned vec2, unsigned int L); 00071 } 00072 } 00073 } 00074 00075 #endif