计算重叠积分的第二种方法

重叠积分可表示为

其中

其中的F函数就是前文得到的FmNN(  int m ,int N, int N1    )方法,gαβ函数就是前文得到的gαβ( int La, int Lb, int λ, int α ,int β   )方法,由这个公式得到了第二种计算重叠积分的方法Sab(double R,double za,double zb, int n1,int L1 ,int mm ,int n2 ,int L2   )。

如计算

double d= Sab ( 2.5, 4.2, 4.4 ,    2, 1 , 1 ,3 ,2 ); // -0.012921364537272557

*Computation of Overlap Integrals Over Slater-Type Orbitals Using Auxiliary Functions

I. I. GUSEINOV, A. OZMEN, U. ATAV, H. YUKSEL

Department of Physics, Faculty of Arts and Sciences, Selc ¸ uk University, 42079 Campus, Konya,Turkey

Received 6 January 1997; revised 5 July 1997; accepted 30 September 1997

*《量子化学》徐光宪 P547

Java 程序

package greenwood;

import java.io.DataInputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.text.DecimalFormat;
import java.text.ParseException;

public class auxiliarySab {
	 
		
	 
	      public static  double FACT( double n ) throws IOException, ParseException {
			
			
			double prodt=1.0;
			for(int a=1 ;a<n+1 ;a++)
			{
				prodt=prodt*a;
			}
			
			if(n<0){
				   System.out.println( prodt+   "  负数阶乘 "  );

			   }
			  
			
			return prodt;
			
		}
		
		
	     //38a
	     public static  double FmNN( int m ,int N, int N1    ) throws IOException, ParseException, InterruptedException {
		
		 //System.out.println(  m+"  "+N+"  "+N1+ " **** m N N1"  );
		
		double d=0.0;
		double d1=0.0;
		double d2=0.0;
		 
		double f1=0;
		 
		for(int k=0 ;k<N1+1;k++){
		
			 
			if(k<0||m-k<0||N1-k<0 || N-m+k<0 ){
				d2=0;
			}
			
			if(k>=0&&m-k>=0&&N1-k>=0 && N-m+k>=0 ){
				d=Math.pow( -1, k );
				d1=FACT(k)*FACT(m-k)*FACT(N1-k)*FACT(N-m+k);
				d2=d/d1;
			}
		
			f1=f1+d2;
			
			//System.out.println(k+"  "+  (m-k)+"  "+(N1-k)+"  "+(N-m+k)+" ** FmNN  "+d1+"  "+d2 +"  "+f1 );
			
		}
		
		double d3=FACT(N)*FACT(N1)*f1;
		
		//System.out.println(  d3+"  "+f1+" ** d3 FmNN "  );
				
		
		return d3;
	}
	   
		  
		//https://blog.csdn.net/georgesale/article/details/118762949
	    public static  double calc2( String stra ) throws IOException, ParseException, InterruptedException {
			
			FileWriter fileWriter5 = new FileWriter("d:/工业/hk/python/表达式.csv");
			
			//stra="hin( fx1,fx1)";
			//stra="jin( rj1,rj2)";
			
			stra=stra.replaceAll(",","#");
					
			fileWriter5.write( stra + "\r\n");
			fileWriter5.flush();
			
			String exe = "python";
			String command = "D:/Download/cal.py";	
			
			String[] cmdArr = new String[] {exe ,command  };
			Process process = Runtime.getRuntime().exec(cmdArr);
			InputStream is = process.getInputStream();
			DataInputStream dis = new DataInputStream(is);
			String str = dis.readLine();
			process.waitFor();
			//System.out.println(str); 
			
			double df= Double.parseDouble(str.trim());	 
			return df;
		}

	 	public static  double Ak(int k, double p ) throws IOException, ParseException, InterruptedException {
			
			//System.out.println( N+"  "+N1+"  "+q+ " ** QNNq "  );
			
				
			String s1="μ**"+k+"*sympy.exp(-"+p+"*μ)";
			
			String s2= "integrate("+  s1 +  ", (μ , 1, float('inf')))";
			
			//System.out.println( s2+ " ** ak"  );
			
			double ds=calc2(  s2 );
			
			return ds;
		}
		
	 	public static  double Bk(int k, double p, double t ) throws IOException, ParseException, InterruptedException {
			
		
	 		String s1="v**"+k+"*sympy.exp(-"+p*t+"*v)";
	 		
			String s2= "integrate("+  s1 +  ",  ( v , -1, 1))";
			
			//System.out.println( s2+ " ** bk"  );
			
			double ds=calc2(  s2 );
			
			return ds;
		}
		
		
	  
		public static  double Sab(double R,double za,double zb, int n1,int L1 ,int mm ,int n2 ,int L2   ) throws IOException, ParseException, InterruptedException {
			double f=0;
			
			DecimalFormat df = new DecimalFormat( "0.00000000");  
			
			double p=R*(za+zb)/2;
			double t=(za-zb)/(za+zb);
		
			double d3= Math.pow((2*za),(n1+0.5))* Math.pow((2*zb) ,(n2+0.5) )/  Math.pow( (  FACT(2*n1)*FACT(2*n2) ),0.5)  * Math.pow( (R/2),(n1+n2+1)) ;
			
			 
			int λ=mm; 
			
			double f3=0;
		
				 for( int α=-λ  ;  α<L1+1   ;α++ ){
		
					   for(int  β=λ  ; β<L2+1    ;β++ ){
					
					  double d4= gαβP.gαβ( L1, L2,  λ,  α , β   );
					  
					  System.out.println( d4+" *** d4 " +L1+"  "+L2+"  "+ λ+"  λ  "+α+"  "+β+"  α+β+1  "+ (α+β+1)  );
						
					  double f1=0;
					  if(Math.abs(d4)>1e-6)
					  {
					   for(int q=0 ;q<α+β+1; q++){
						   
						   double d5=FmNN( q ,α+λ , β- λ   );
						  
					   double f2=0;
					   
					   if(Math.abs(d5)>1e-6){
						   
					   for(int m=0 ;m<n1+n2-α-β+1 ;m++){
						   
						  double d6=FmNN( m ,n1-α , n2-β   );
					      double d7=0;
					      if(Math.abs(d6)>1e-6){
					    		  d7=Ak( n1+n2-α-β-m+q, p)*Bk(m+q,p,t);
					      }
					   
					      f2=f2+d6*d7;
					      System.out.println( df.format(d6)+" d6 "+df.format(d7)+"  "+df.format(f2)+ "  f2   "+m);
					     }
					   
					   }
					   
					   f1=f1+d5*f2;				   
					   System.out.println( q+"  q  "+df.format(d5)+" d5 "+df.format(f2)+"         *** f1 " +f1+"  * "+ (n1+n2-α-β+1 ) );
					   }
					   
				   }
					   f3=f3+d4*f1;
					   
					   System.out.println( d4+" "+f1+"         *** f3 " +f3 +"  ***  "+α+"  "+β );
			 
				   }
			 }
			 
			
			 f=Math.pow(-1 , L2+mm )*d3*f3;
			 
			 //System.out.println( d3+" "+f3+ "       *** d f"  );
	
			return f;
		}
			
		
		public static  void so(    ) throws IOException, ParseException, InterruptedException {
			
	
			  //double d= Sab ( 2.5, 4.2, 4.4 ,    2, 1 , 1 ,3 ,2 );   //-0.012921364533721143  -0.012921364537272557 
			  //double d= Sab ( 2.5, 2.3, 2.3,    3, 2, 0, 2, 1  );  //-0.2252196665380932  -0.2252196665381199
			  double d= Sab ( 0.2, 5.8, 4.5,    3, 2, 2, 3, 2  );  //0.8783587074281796  0.8783587025446252
			 
			 System.out.println( d+ "       *** d ***"  );
		}
			

		
		public static void main(String[] args) throws IOException, ParseException, InterruptedException {
			  
			  so(    );
	 
	  		}

	}

                   

        

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

黑榆

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值