tensor-fourindex conversions for some more symemtries

This commit is contained in:
2025-10-24 14:17:12 +02:00
parent 874c2d5f83
commit f1060245a0
3 changed files with 160 additions and 5 deletions

44
t.cc
View File

@@ -3704,7 +3704,7 @@ cout <<"Error = "<<(x1-y).norm()<<endl;
}
if(1)
if(0)
{
int n;
cin>>n;
@@ -3717,5 +3717,47 @@ tensor2fourindex(t,ff);
cout <<"Error = "<<(f-ff).norm()<<endl;
}
if(0)
{
int n;
cin>>n;
fourindex_dense<twoelectronrealmullikanAB,double,int> f(n);
f.randomize(1.);
Tensor<double> t=fourindex2tensor(f);
cout <<t;
fourindex_dense<twoelectronrealmullikanAB,double,int> ff;
tensor2fourindex(t,ff);
cout <<"Error = "<<(f-ff).norm()<<endl;
}
if(0)
{
int n;
cin>>n;
fourindex_dense<twoelectronrealmullikan,double,int> f(n);
f.randomize(1.);
Tensor<double> t=fourindex2tensor(f);
cout <<t;
fourindex_dense<twoelectronrealmullikan,double,int> ff;
tensor2fourindex(t,ff);
cout <<"Error = "<<(f-ff).norm()<<endl;
}
if(1)
{
//check also index order
int n;
cin>>n;
fourindex_dense<T2IjAb_aces,double,int> f(n+1,n,n+3,n+2);
f.randomize(1.);
Tensor<double> t=fourindex2tensor(f);
cout <<t;
fourindex_dense<T2IjAb_aces,double,int> ff;
tensor2fourindex(t,ff);
cout <<"Error = "<<(f-ff).norm()<<endl;
}
}//main