Ejemplo n.º 1
0
Archivo: dirac.c Proyecto: Fudge/rb-gsl
static void Init_gsl_dirac_const(VALUE module)
{
  define_eye(module);
  define_pauli(module);
  define_beta(module);
  define_alpha(module);
  define_gamma(module);
  define_lambda(module);
}
Ejemplo n.º 2
0
void W(point & r1, point_ & r1_, point & r2, point_ & r2_, n_type &u, n_type & a1, n_type &a2)
//"perturbation generator"
//generates time points and zone numbers, so that U=\bar{u}
{
double tau=beta*rnd();  
r1.t=tau; r1_.t=tau; r2.t=tau; r2_.t=tau;
int i=0;  
//int i=rnd(n_part);
//int j=rnd(n_part);
//while (j==i) j=rnd(n_part);


//int n_terms=density_density?3:5;
int n_terms=4;
int n_sum=2;
int term=rnd(n_terms);

if (term==0)
{
   int p=rnd(n_part);
   r1.i=p; r1_.i=p; r2.i=1-p; r2_.i=1-p;
   r1.z=1; r1_.z=1; r2.z=1; r2_.z=1;   
   u=n_terms*beta*n_sum*(U/2); //Hubbard U for localized electrons: localized=zone1, conduction=zone0
;}
if (term==1) // s_zs_z (nn1/2)
{
   int p=rnd(n_part);
   r1.i=p; r1_.i=p; r2.i=p; r2_.i=p;
   r1.z=1; r1_.z=1; r2.z=0; r2_.z=0;   
   u=n_terms*n_sum*beta*(J/4);	//C?????
;}
if (term==2) //nn(2/2)
{
   int p=rnd(n_part);
   r1.i=p; r1_.i=p; r2.i=1-p; r2_.i=1-p;
   r1.z=1; r1_.z=1; r2.z=0; r2_.z=0;   
   u=-1.0*n_sum*n_terms*beta*(J/4);
;}
if (term==3) //sx and sy term 1 and 2
{
   int p=rnd(n_part);
   r1.i=p; r1_.i=1-p; r2.i=1-p; r2_.i=p;
   r1.z=1; r1_.z=1; r2.z=0; r2_.z=0;   
   u=n_terms*beta*n_sum*(J/2);
;}

define_alpha(r1,r1_,r2,r2_,u,a1,a2);//alpha's are defined by a standard recipe
   
;}
Ejemplo n.º 3
0
void W(point & r1, point_ & r1_, point & r2, point_ & r2_, n_type &u, n_type & a1, n_type &a2)
//"perturbation generator"
//generates time points and zone numbers, so that U=\bar{u}
{
double tau=beta*rnd();  
r1.t=tau; r1_.t=tau; r2.t=tau; r2_.t=tau;
r1.i=0; r1_.i=0; r2.i=0; r2_.i=0;

int i=rnd(n_zone/2);
int j=rnd(n_zone/2);
while (j==i) j=rnd(n_zone/2);

int n_terms=4;
int term=rnd(n_terms);
n_type C=n_zone/2;

switch (term)
	{
	case 0 : // nn
		{
//		   r1.i=i; r1_.i=i; r2.i=i; r2_.i=i;
		   int z=rnd(2);
		   r1.z=2*i+z; r1_.z=2*i+z; r2.z=2*i+1-z; r2_.z=2*i+1-z;   
		   u=n_terms*beta*U*C;
		   break;
		;}
		
	case 1 : // ss
		{
//		   r1.i=i; r1_.i=i; r2.i=j; r2_.i=j;
		   int z=rnd(2);
		   r1.z=2*i+z; r1_.z=2*i+z; r2.z=2*j+1-z; r2_.z=2*j+1-z;   
		   u=n_terms*beta*(U-2*J)*C*(C-1);
		   break;
		;}
	case 2 : //s
		{
//		   r1.i=i; r1_.i=i; r2.i=j; r2_.i=j;
		   int z=rnd(2);
		   r1.z=2*i+z; r1_.z=2*i+z; r2.z=2*j+z; r2_.z=2*j+z;   
		   u=n_terms*beta*(U-3*J)*C*(C-1);
		   break;
		;}
	case 3 : //ss
		{
//		   r1.i=i; r1_.i=j; r2.i=j; r2_.i=i;
		   int z=rnd(2);
		   r1.z=2*i+z; r1_.z=2*j+z; r2.z=2*j+1-z; r2_.z=2*i+1-z;   
		   u=-n_terms*beta*J*C*(C-1);
		   break;
		;}
/*	case 4 : //pair hopping 2
		{
//		   r1.i=j; r1_.i=i; r2.i=j; r2_.i=i;
		   int z=rnd(2);
		   r1.z=2*j+z; r1_.z=2*i+z; r2.z=2*j+1-z; r2_.z=2*i+1-z;   
		   u=-n_terms*beta*J*C*(C-1);
		   break;
		;}*/
	}
 define_alpha(r1,r1_,r2,r2_,u,a1,a2);//alpha's are defined by a standard recipe
   
;}