| 5 | 1/1 | 返回列表 |
| 查看: 1922 | 回復: 5 | |||
| 當前只顯示滿足指定條件的回帖,點擊這里查看本話題的所有回帖 | |||
那年的小艾金蟲 (初入文壇)
|
[求助]
F軌道電子云分布 已有1人參與
|
||
| F軌道的電子云分布應該怎么畫,用一些簡單的軟件可以做么?我想畫出非共線情況下的F軌道的電子云分布,有沒有大俠會的,望指教一二。還有想問下網(wǎng)絡上的一些軌道電子云彩圖中對稱結構中用的兩種顏色是不是區(qū)別自旋向上向下的? |
木蟲 (著名寫手)
|
F軌道實際上是角動量模方算符L^2對應的l=3的本征態(tài)波函數(shù)。在中心勢場(比如氫原子)中,L^2與哈密頓量對易,而在固體或分子中,L^2與哈密頓量不一定對易。一般程序輸出的是哈密頓量與某個算符的本征態(tài)(對固體為平移算符),對這些本征態(tài)無法斷定l的取值。 如果是單原子,可以根據(jù)氫原子薛定諤方程解析解求出在一系列格點上的波函數(shù)值寫入cube文件,然后就可以用vesta之類的軟件打開看了。 網(wǎng)上的程序給出的電子云圖有兩種:一種直接輸出|n,l,m>,另一種輸出|n,l,m>的線性組合。第一種波函數(shù)值是復數(shù),作圖時給出的是實部或虛部;第二種波函數(shù)值是實數(shù),常說的px,py,pz就是這種。這兩種情況下顏色一般用來區(qū)分波函數(shù)值的正負。不是自旋。 |
木蟲 (著名寫手)
|
這是之前寫的一個輸出cube格式的程序源代碼: /****************************************************************************** This program generates wavefunction for hydrogen-like atoms using analytical solution to Shrodinger's equation. This program requires no command-line parameters, but an input file called orb.inp. This input file must be in the form: --------------------------------------------- H4f2.real.cube // output filename 1 // which part to output, 1 for real, -1 for imaginary 1 // Zval of the nuclea 4 3 2 // n l m 20.0 20.0 20.0 // size of the box, which will be multiplied by 2 0.20 0.20 0.20 // resolution ---------------------------------------------- ******************************************************************************/ #include <stdio.h> #include <math.h> #include <stdlib.h> double factor( int ); double ReNormFactor( int, int, int ); double KummerFunc( int, int, double ); double RadialFunc( int, int, int, double ); double RealSphereHarm( int, int, double, double ); double ImagSphereHarm( int, int, double, double ); int checkinp( int, int, int ); double factor( int n ) { if ( n == 0 ) return 1.0; else{ double y; int i; y = 1.0; for( i = 1; i < n + 1; i ++ ) y = y * (double)(i); return y; } } double ReNormFactor( int Z, int n, int l ) { double A, B, C; A = 2.0 / ( (double)(n*n) * factor(2*l+1)); B = sqrt( factor(n+l) / factor(n-l-1) ); C = sqrt( (double)(Z*Z*Z) ); return A * B * C; } double KummerFunc( int alpha, int gamma, double ita ) { double sum, ck; int k; sum = 1.0; ck = 1.0; for( k = 1; k < -alpha+1; k ++ ) { ck = ck * (double)(alpha+k-1) / (double)(gamma+k-1) * (1.0/(double)(k)); sum = sum+ ck * pow( ita, (double)(k) ); } return sum; } double RadialFunc( int Z, int n, int l, double r ) { double ita, NormFactor, A, B, C; ita = 2.0 * (double)(Z) / (double)(n) * r; NormFactor = ReNormFactor( Z, n, l ); A = exp( -0.5 * ita ); B = pow( ita, (double)(l) ); C = KummerFunc( -n+l+1, 2*l+2, ita ); return NormFactor * A * B * C; } double RealSphereHarm( int l, int m, double theta, double phi ) { if (l == 0) return 2.820947917738782e-1; else if (l == 1) switch(m) { case -1: return 3.454941494713355e-1 * cos(m*phi) * sin(theta); break; case 0: return 4.886025119029199e-1 * cos(m*phi) * cos(theta); break; case 1: return -3.454941494713355e-1 * cos(m*phi) * sin(theta); break; default: return 0.0; break; } else if (l == 2) switch(m) { case -2: return 3.862742020231896e-1 * cos(m*phi) * sin(theta) * sin(theta); break; case -1: return 7.725484040463792e-1 * cos(m*phi) * sin(theta) * cos(theta); break; case 0: return 3.153915652525200e-1 * cos(m*phi) * ( 3.0*cos(theta)*cos(theta) - 1.0 ); break; case 1: return -7.725484040463792e-1 * cos(m*phi) * sin(theta) * cos(theta); break; case 2: return 3.862742020231896e-1 * cos(m*phi) * sin(theta) * sin(theta); break; default: return 0.0; break; } else if (l == 3) switch(m) { case -3: return 4.172238236327841e-1 * cos(m*phi) * sin(theta) * sin(theta) * sin(theta); break; case -2: return 1.021985476433282 * cos(m*phi) * sin(theta) * sin(theta) * cos(theta); break; case -1: return 3.231801841141507e-1 * cos(m*phi) * sin(theta) * ( 5.0*cos(theta)*cos(theta) - 1.0 ); break; case 0: return 3.731763325901154e-1 * cos(m*phi) * cos(theta) * ( 5.0*cos(theta)*cos(theta) - 3.0 ); break; case 1: return -3.231801841141507e-1 * cos(m*phi) * sin(theta) * ( 5.0*cos(theta)*cos(theta) - 1.0 ); break; case 2: return 1.021985476433282 * cos(m*phi) * sin(theta) * sin(theta) * cos(theta); break; case 3: return -4.172238236327841e-1 * cos(m*phi) * sin(theta) * sin(theta) * sin(theta); break; default: return 0.0; break; } else return 0.0; } double ImagSphereHarm( int l, int m, double theta, double phi ) { if (l == 0) return 0.0; else if (l == 1) switch(m) { case -1: return 3.454941494713355e-1 * sin(m*phi) * sin(theta); break; case 0: return 4.886025119029199e-1 * sin(m*phi) * cos(theta); break; case 1: return -3.454941494713355e-1 * sin(m*phi) * sin(theta); break; default: return 0.0; break; } else if (l == 2) switch(m) { case -2: return 3.862742020231896e-1 * sin(m*phi) * sin(theta) * sin(theta); break; case -1: return 7.725484040463792e-1 * sin(m*phi) * sin(theta) * cos(theta); break; case 0: return 3.153915652525200e-1 * sin(m*phi) * ( 3.0*cos(theta)*cos(theta) - 1.0 ); break; case 1: return -7.725484040463792e-1 * sin(m*phi) * sin(theta) * cos(theta); break; case 2: return 3.862742020231896e-1 * sin(m*phi) * sin(theta) * sin(theta); break; default: return 0.0; break; } else if (l == 3) switch(m) { case -3: return 4.172238236327841e-1 * sin(m*phi) * sin(theta) * sin(theta) * sin(theta); break; case -2: return 1.021985476433282 * sin(m*phi) * sin(theta) * sin(theta) * cos(theta); break; case -1: return 3.231801841141507e-1 * sin(m*phi) * sin(theta) * ( 5.0*cos(theta)*cos(theta) - 1.0 ); break; case 0: return 3.731763325901154e-1 * sin(m*phi) * cos(theta) * ( 5.0*cos(theta)*cos(theta) - 3.0 ); break; case 1: return -3.231801841141507e-1 * sin(m*phi) * sin(theta) * ( 5.0*cos(theta)*cos(theta) - 1.0 ); break; case 2: return 1.021985476433282 * sin(m*phi) * sin(theta) * sin(theta) * cos(theta); break; case 3: return -4.172238236327841e-1 * sin(m*phi) * sin(theta) * sin(theta) * sin(theta); break; default: return 0.0; break; } else return 0.0; } int checkinp( int l, int m, int flavor ) { if ( l < 0 ) return -1; else if ( l > 3 ) return -2; else if ( m < 0 && -m > l ) return -3; else if ( m >= 0 && m > l ) return -3; else if ( flavor != -1 && flavor != 1 ) return -4; else return 0; } int main( void ) { // these variables are related to orb.inp char cubename[32]; int flavor; int Z; int n, l, m; double xmax, ymax, zmax; double hx, hy, hz; // these variables are related to mesh-info int NGX, NGY, NGZ, NX, NY, NZ; int i, j, k; double orgx, orgy, orgz; double x, y, z, r, theta, phi, gridval; // files used through the program FILE *cube, *inp; // program status int status; // global constant const double PI = 3.14159265358979; // read in 'orb.inp' inp = fopen("orb.inp","r" ;fscanf( inp, "%s\n", &cubename ); fscanf( inp, "%d\n", &flavor ); fscanf( inp, "%d\n", &Z ); fscanf( inp, "%d%d%d\n", &n, &l, &m ); fscanf( inp, "%lf%lf%lf\n", &xmax, &ymax, &zmax ); fscanf( inp, "%lf%lf%lf\n", &hx, &hy, &hz ); fclose( inp ); // check input parameters status = checkinp( l, m, flavor ); if ( status != 0 ) { printf( "\nProgram exited with error code:" ); printf( "%4d\n", status ); printf( "Check your input" ); printf("\n" ;return status; } else { // calculate NGX, NGY, NGZ NGX = (int)(xmax/hx); NGY = (int)(ymax/hy); NGZ = (int)(zmax/hz); // origin of grid orgx = -hx * (NGX - 1) + hx * 0.5; orgy = -hy * (NGY - 1) + hy * 0.5; orgz = -hz * (NGZ - 1) + hz * 0.5; // size of grid NX = 2 * NGX; NY = 2 * NGY; NZ = 2 * NGZ; // open cube file cube = fopen(cubename,"w" ;// write first 2 lines to cube if ( flavor == 1) fprintf( cube, "Real part of atomic orbitals of H-like atoms\n" ;else fprintf( cube, "Imag part of atomic orbitals of H-like atoms\n" ;fprintf( cube, "Generated by programm orb.x\n" ;// write natom and origin of data fprintf( cube, "%5d%12.6f%12.6f%12.6f\n", 1, orgx, orgy, orgz ); // write mesh info fprintf( cube, "%5d%12.6f%12.6f%12.6f\n", NX, hx, 0.0, 0.0 ); fprintf( cube, "%5d%12.6f%12.6f%12.6f\n", NY, 0.0, hy, 0.0 ); fprintf( cube, "%5d%12.6f%12.6f%12.6f\n", NZ, 0.0, 0.0, hz ); // write atoms info fprintf( cube, "%5d%12.6f%12.6f%12.6f%12.6f\n", Z, 1.0*Z, 0.0, 0.0, 0.0 ); // entering main loop if ( flavor == 1 ) { for ( i = 1; i <= NX; i ++ ) for ( j = 1; j <= NY; j ++ ) for( k = 1; k <= NZ; k ++ ) { x = orgx + hx * ( i - 1 ); y = orgy + hy * ( j - 1 ); z = orgz + hz * ( k - 1 ); r = sqrt( x*x + y*y + z*z ); theta = acos( z/r ); if ( y >= 0.0 ) phi = acos( x / sqrt(x*x+y*y) ); else phi = 2.0 * PI - acos( x / sqrt(x*x+y*y) ); gridval = RadialFunc( Z, n, l, r ) * RealSphereHarm( l, m, theta, phi ); fprintf( cube, "%13.5e", gridval ); if ( k == NZ || k%6==0 ) fprintf( cube, "\n" ); } } else { for ( i = 1; i <= NX; i ++ ) for ( j = 1; j <= NY; j ++ ) for( k = 1; k <= NZ; k ++ ) { x = orgx + hx * ( i - 1 ); y = orgy + hy * ( j - 1 ); z = orgz + hz * ( k - 1 ); r = sqrt( x*x + y*y + z*z ); theta = acos( z/r ); if ( y >= 0.0 ) phi = acos( x / sqrt(x*x+y*y) ); else phi = 2.0 * PI - acos( x / sqrt(x*x+y*y) ); gridval = RadialFunc( Z, n, l, r ) * ImagSphereHarm( l, m, theta, phi ); fprintf( cube, "%13.5e", gridval ); if ( k == NZ || k%6==0 ) fprintf( cube, "\n" ); } } fclose(cube); return 0; } } |
木蟲 (著名寫手)
| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 調劑310 +10 | 溫柔的晚安 2026-03-25 | 11/550 |
|
|---|---|---|---|---|
|
[考研] 一志愿南昌大學324求調劑 +3 | hanamiko 2026-03-29 | 3/150 |
|
|
[考研] 334分 一志愿武理 材料求調劑 +5 | 李李不服輸 2026-03-26 | 5/250 |
|
|
[考研] 329求調劑 +10 | 鈕恩雪 2026-03-25 | 10/500 |
|
|
[考研] 318一志愿吉林大學生物與醫(yī)藥 求調劑 +4 | 篤行致遠. 2026-03-28 | 4/200 |
|
|
[考研] 0703化學 +11 | 妮妮ninicgb 2026-03-27 | 11/550 |
|
|
[考研] 289求調劑 +13 | 新時代材料 2026-03-27 | 13/650 |
|
|
[考研] 311求調劑 +9 | lin0039 2026-03-26 | 9/450 |
|
|
[考研] 085701環(huán)境工程求調劑 +9 | 多久上課 2026-03-27 | 9/450 |
|
|
[考研] 275求調劑 +10 | jjjjjjjjjjl 2026-03-27 | 10/500 |
|
|
[考研] 考研調劑 +4 | Sanmu-124 2026-03-26 | 4/200 |
|
|
[考研] 298調劑 +3 | jiyingjie123 2026-03-27 | 3/150 |
|
|
[考研] 調劑推薦 +5 | 清酒714 2026-03-26 | 6/300 |
|
|
[考研] 276求調劑。有半年電池和半年高分子實習經(jīng)歷 +10 | 材料學257求調劑 2026-03-23 | 11/550 |
|
|
[考研] 一志愿上海交大生物與醫(yī)藥專碩324分,求調劑 +6 | jiajunX 2026-03-22 | 6/300 |
|
|
[考研] 材料與化工304求B區(qū)調劑 +3 | 邱gl 2026-03-25 | 3/150 |
|
|
[考研] 材料專碩 335 分求調劑 +4 | 拒絕冷暴力 2026-03-25 | 4/200 |
|
|
[考研] 一志愿南航材料專317分求調劑 +5 | 炸呀炸呀炸薯條 2026-03-23 | 5/250 |
|
|
[考研] 292求調劑 +4 | 鵝鵝鵝額額額額?/a> 2026-03-24 | 4/200 |
|
|
[考研]
|
13659058978 2026-03-24 | 4/200 |
|