27 #include "FourIndex.h"
35 SymmInfo.setGroup(nGroup);
37 Isizes =
new int[SymmInfo.getNumberOfIrreps()];
38 storage =
new long long****[SymmInfo.getNumberOfIrreps()];
40 for (
int Icenter=0; Icenter<SymmInfo.getNumberOfIrreps(); Icenter++){
41 Isizes[Icenter] = IrrepSizes[Icenter];
44 arrayLength = calcNumberOfUniqueElements(
true);
45 theElements =
new double[arrayLength];
51 SymmInfo = orig.SymmInfo;
53 Isizes =
new int[SymmInfo.getNumberOfIrreps()];
54 storage =
new long long****[SymmInfo.getNumberOfIrreps()];
56 memcpy(Isizes, orig.Isizes,
sizeof(
int)*SymmInfo.getNumberOfIrreps());
58 arrayLength = calcNumberOfUniqueElements(
true);
59 theElements =
new double[arrayLength];
61 memcpy(theElements, orig.theElements,
sizeof(
double)*arrayLength);
64 long long CheMPS2::FourIndex::calcNumberOfUniqueElements(
const bool allocate){
67 long long theTotalSize = 0;
69 for (
int Icenter=0; Icenter<SymmInfo.getNumberOfIrreps(); Icenter++){
70 if (allocate){ storage[Icenter] =
new long long***[SymmInfo.getNumberOfIrreps()]; }
71 for (
int I_i=0; I_i<SymmInfo.getNumberOfIrreps(); I_i++){
72 int I_j = Irreps::directProd(Icenter,I_i);
73 if ((Isizes[I_i]>0)&&(Isizes[I_j]>0)){
74 if (allocate){ storage[Icenter][I_i] =
new long long**[SymmInfo.getNumberOfIrreps()]; }
75 for (
int I_k=I_i; I_k<SymmInfo.getNumberOfIrreps(); I_k++){
76 int I_l = Irreps::directProd(Icenter,I_k);
77 if ((Isizes[I_k]>0)&&(Isizes[I_l]>0)){
78 if ((I_i <= I_j) && (I_j <= I_l)){
81 if (allocate){ storage[Icenter][I_i][I_k] =
new long long*[Isizes[I_i]*(Isizes[I_i]+1)/2]; }
82 for (
int i=0; i<Isizes[I_i]; i++){
83 for (
int k=i; k<Isizes[I_k]; k++){
85 storage[Icenter][I_i][I_k][i + k*(k+1)/2] =
new long long[Isizes[I_j]-i];
86 for (
int j=i; j<Isizes[I_j]; j++){
87 storage[Icenter][I_i][I_k][i + k*(k+1)/2][j-i] = theTotalSize;
88 theTotalSize += Isizes[I_l] - ((i==j) ? k : j);
91 delete [] storage[Icenter][I_i][I_k][i + k*(k+1)/2];
95 if (!allocate){
delete [] storage[Icenter][I_i][I_k]; }
97 if (allocate){ storage[Icenter][I_i][I_k] =
new long long*[Isizes[I_i]*Isizes[I_k]]; }
98 for (
int i=0; i<Isizes[I_i]; i++){
99 for (
int k=0; k<Isizes[I_k]; k++){
101 storage[Icenter][I_i][I_k][i + k*Isizes[I_i]] =
new long long[Isizes[I_j]-i];
102 for (
int j=i; j<Isizes[I_j]; j++){
103 storage[Icenter][I_i][I_k][i+k*Isizes[I_i]][j-i] = theTotalSize;
104 theTotalSize += Isizes[I_l] - ((i==j) ? k : 0 );
107 delete [] storage[Icenter][I_i][I_k][i + k*Isizes[I_i]];
111 if (!allocate){
delete [] storage[Icenter][I_i][I_k]; }
115 if (allocate){ storage[Icenter][I_i][I_k] =
new long long*[Isizes[I_i]*(Isizes[I_i]+1)/2]; }
116 for (
int i=0; i<Isizes[I_i]; i++){
117 for (
int k=i; k<Isizes[I_k]; k++){
119 storage[Icenter][I_i][I_k][i + k*(k+1)/2] =
new long long[Isizes[I_j]];
120 for (
int j=0; j<Isizes[I_j]; j++){
121 storage[Icenter][I_i][I_k][i + k*(k+1)/2][j] = theTotalSize;
122 theTotalSize += Isizes[I_l] - j;
125 delete [] storage[Icenter][I_i][I_k][i + k*(k+1)/2];
129 if (!allocate){
delete [] storage[Icenter][I_i][I_k]; }
131 if (allocate){ storage[Icenter][I_i][I_k] =
new long long*[Isizes[I_i]*Isizes[I_k]]; }
132 for (
int i=0; i<Isizes[I_i]; i++){
133 for (
int k=0; k<Isizes[I_k]; k++){
135 storage[Icenter][I_i][I_k][i + k*Isizes[I_i]] =
new long long[Isizes[I_j]];
136 for (
int j=0; j<Isizes[I_j]; j++){
137 storage[Icenter][I_i][I_k][i + k*Isizes[I_i]][j] = theTotalSize;
138 theTotalSize += Isizes[I_l];
141 delete [] storage[Icenter][I_i][I_k][i + k*Isizes[I_i]];
145 if (!allocate){
delete [] storage[Icenter][I_i][I_k]; }
151 if (!allocate){
delete [] storage[Icenter][I_i]; }
154 if (!allocate){
delete [] storage[Icenter]; }
163 arrayLength = calcNumberOfUniqueElements(
false);
164 delete [] theElements;
170 void CheMPS2::FourIndex::set(
const int irrep_i,
const int irrep_j,
const int irrep_k,
const int irrep_l,
const int i,
const int j,
const int k,
const int l,
const double val){
172 theElements[getPointer(irrep_i, irrep_j, irrep_k, irrep_l, i, j, k, l)] = val;
176 void CheMPS2::FourIndex::add(
const int irrep_i,
const int irrep_j,
const int irrep_k,
const int irrep_l,
const int i,
const int j,
const int k,
const int l,
const double val){
178 theElements[getPointer(irrep_i, irrep_j, irrep_k, irrep_l, i, j, k, l)] += val;
182 double CheMPS2::FourIndex::get(
const int irrep_i,
const int irrep_j,
const int irrep_k,
const int irrep_l,
const int i,
const int j,
const int k,
const int l)
const{
184 return theElements[getPointer(irrep_i, irrep_j, irrep_k, irrep_l, i, j, k, l)];
188 long long CheMPS2::FourIndex::getPointer(
const int irrep_i,
const int irrep_j,
const int irrep_k,
const int irrep_l,
const int i,
const int j,
const int k,
const int l)
const {
190 if (Irreps::directProd(irrep_i,irrep_j)==Irreps::directProd(irrep_k,irrep_l)){
192 if ((irrep_i <= irrep_j) && (irrep_i <= irrep_k) && (irrep_j <= irrep_l)){
193 return getPtrIrrepOrderOK(irrep_i,irrep_j,irrep_k,irrep_l,i,j,k,l);
196 if ((irrep_j <= irrep_i) && (irrep_j <= irrep_l) && (irrep_i <= irrep_k)){
197 return getPtrIrrepOrderOK(irrep_j,irrep_i,irrep_l,irrep_k,j,i,l,k);
200 if ((irrep_k <= irrep_j) && (irrep_k <= irrep_i) && (irrep_j <= irrep_l)){
201 return getPtrIrrepOrderOK(irrep_k,irrep_j,irrep_i,irrep_l,k,j,i,l);
204 if ((irrep_j <= irrep_k) && (irrep_j <= irrep_l) && (irrep_k <= irrep_i)){
205 return getPtrIrrepOrderOK(irrep_j,irrep_k,irrep_l,irrep_i,j,k,l,i);
208 if ((irrep_i <= irrep_l) && (irrep_i <= irrep_k) && (irrep_l <= irrep_j)){
209 return getPtrIrrepOrderOK(irrep_i,irrep_l,irrep_k,irrep_j,i,l,k,j);
212 if ((irrep_l <= irrep_i) && (irrep_l <= irrep_j) && (irrep_i <= irrep_k)){
213 return getPtrIrrepOrderOK(irrep_l,irrep_i,irrep_j,irrep_k,l,i,j,k);
216 if ((irrep_k <= irrep_l) && (irrep_k <= irrep_i) && (irrep_l <= irrep_j)){
217 return getPtrIrrepOrderOK(irrep_k,irrep_l,irrep_i,irrep_j,k,l,i,j);
220 if ((irrep_l <= irrep_k) && (irrep_l <= irrep_j) && (irrep_k <= irrep_i)){
221 return getPtrIrrepOrderOK(irrep_l,irrep_k,irrep_j,irrep_i,l,k,j,i);
230 long long CheMPS2::FourIndex::getPtrIrrepOrderOK(
const int irrep_i,
const int irrep_j,
const int irrep_k,
const int irrep_l,
const int i,
const int j,
const int k,
const int l)
const {
233 int Icenter = Irreps::directProd(irrep_i,irrep_j);
237 if (irrep_i == irrep_k){
240 if (l>=j)
return getPtrAllOK(5, Icenter, irrep_i, irrep_k, i, j, k, l);
241 else return getPtrAllOK(5, Icenter, irrep_i, irrep_k, i, l, k, j);
243 if (l>=j)
return getPtrAllOK(5, Icenter, irrep_k, irrep_i, k, j, i, l);
244 else return getPtrAllOK(5, Icenter, irrep_k, irrep_i, k, l, i, j);
247 }
else return getPtrAllOK(6, Icenter, irrep_i, irrep_k, i, j, k, l);
251 if (irrep_i == irrep_k){
254 if ((i < j) && (i <= k) && (j <= l))
return getPtrAllOK(2, Icenter, irrep_i, irrep_k, i, j, k, l);
255 if ((i == j) && (i <= k) && (j <= l)){
256 if (l>=k)
return getPtrAllOK(1, Icenter, irrep_i, irrep_k, i, j, k, l);
257 else return getPtrAllOK(1, Icenter, irrep_j, irrep_l, j, i, l, k);
259 if ((j < i) && (j <= l) && (i <= k))
return getPtrAllOK(2, Icenter, irrep_j, irrep_l, j, i, l, k);
262 if ((k < l) && (k <= i) && (l <= j))
return getPtrAllOK(2, Icenter, irrep_k, irrep_i, k, l, i, j);
263 if ((k == l) && (k <= i) && (l <= j)){
264 if (j>=i)
return getPtrAllOK(1, Icenter, irrep_k, irrep_i, k, l, i, j);
265 else return getPtrAllOK(1, Icenter, irrep_l, irrep_j, l, k, j, i);
267 if ((l < k) && (l <= j) && (k <= i))
return getPtrAllOK(2, Icenter, irrep_l, irrep_j, l, k, j, i);
270 if ((k < j) && (k <= i) && (j <= l))
return getPtrAllOK(2, Icenter, irrep_k, irrep_i, k, j, i, l);
271 if ((k == j) && (k <= i) && (j <= l)){
272 if (l>=i)
return getPtrAllOK(1, Icenter, irrep_k, irrep_i, k, j, i, l);
273 else return getPtrAllOK(1, Icenter, irrep_j, irrep_l, j, k, l, i);
275 if ((j < k) && (j <= l) && (k <= i))
return getPtrAllOK(2, Icenter, irrep_j, irrep_l, j, k, l, i);
278 if ((i < l) && (i <= k) && (l <= j))
return getPtrAllOK(2, Icenter, irrep_i, irrep_k, i, l, k, j);
279 if ((i == l) && (i <= k) && (l <= j)){
280 if (j>=k)
return getPtrAllOK(1, Icenter, irrep_i, irrep_k, i, l, k, j);
281 else return getPtrAllOK(1, Icenter, irrep_l, irrep_j, l, i, j, k);
283 if ((l < i) && (l <= j) && (i <= k))
return getPtrAllOK(2, Icenter, irrep_l, irrep_j, l, i, j, k);
288 if (l>=k)
return getPtrAllOK(3, Icenter, irrep_i, irrep_k, i, j, k, l);
289 else return getPtrAllOK(3, Icenter, irrep_j, irrep_l, j, i, l, k);
291 if (j>i)
return getPtrAllOK(4, Icenter, irrep_i, irrep_k, i, j, k, l);
292 else return getPtrAllOK(4, Icenter, irrep_j, irrep_l, j, i, l, k);
303 long long CheMPS2::FourIndex::getPtrAllOK(
const int number,
const int Icent,
const int irrep_i,
const int irrep_k,
const int i,
const int j,
const int k,
const int l)
const {
307 return storage[Icent][irrep_i][irrep_k][i + k*(k+1)/2][j-i] + l-k;
309 return storage[Icent][irrep_i][irrep_k][i + k*(k+1)/2][j-i] + l-j;
311 return storage[Icent][irrep_i][irrep_k][i + Isizes[irrep_i]*k][j-i] + l-k;
313 return storage[Icent][irrep_i][irrep_k][i + Isizes[irrep_i]*k][j-i] + l;
315 return storage[Icent][irrep_i][irrep_k][i + k*(k+1)/2][j] + l-j;
317 return storage[Icent][irrep_i][irrep_k][i + Isizes[irrep_i]*k][j] + l;
327 hid_t file_id = H5Fcreate(name.c_str(), H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
330 hid_t group_id = H5Gcreate(file_id,
"/MetaData", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
333 hsize_t dimarray = SymmInfo.getNumberOfIrreps();
334 hid_t dataspace_id = H5Screate_simple(1, &dimarray, NULL);
335 hid_t dataset_id = H5Dcreate(group_id,
"IrrepSizes", H5T_STD_I32LE, dataspace_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
336 H5Dwrite(dataset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, Isizes);
339 hid_t attribute_space_id1 = H5Screate(H5S_SCALAR);
340 hid_t attribute_id1 = H5Acreate(dataset_id,
"nGroup", H5T_STD_I32LE, attribute_space_id1, H5P_DEFAULT, H5P_DEFAULT);
341 int nGroup = SymmInfo.getGroupNumber();
342 H5Awrite(attribute_id1, H5T_NATIVE_INT, &nGroup);
344 hid_t attribute_space_id2 = H5Screate(H5S_SCALAR);
345 hid_t attribute_id2 = H5Acreate(dataset_id,
"nIrreps", H5T_STD_I32LE, attribute_space_id2, H5P_DEFAULT, H5P_DEFAULT);
346 int nIrreps = SymmInfo.getNumberOfIrreps();
347 H5Awrite(attribute_id2, H5T_NATIVE_INT, &nIrreps);
349 hid_t attribute_space_id3 = H5Screate(H5S_SCALAR);
350 hid_t attribute_id3 = H5Acreate(dataset_id,
"theTotalSize", H5T_STD_I64LE, attribute_space_id3, H5P_DEFAULT, H5P_DEFAULT);
351 H5Awrite(attribute_id3, H5T_NATIVE_LLONG, &arrayLength);
353 H5Aclose(attribute_id1);
354 H5Aclose(attribute_id2);
355 H5Aclose(attribute_id3);
356 H5Sclose(attribute_space_id1);
357 H5Sclose(attribute_space_id2);
358 H5Sclose(attribute_space_id3);
360 H5Dclose(dataset_id);
361 H5Sclose(dataspace_id);
366 hid_t group_id7 = H5Gcreate(file_id,
"/FourIndexObject", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
368 hsize_t dimarray7 = arrayLength;
369 hid_t dataspace_id7 = H5Screate_simple(1, &dimarray7, NULL);
370 hid_t dataset_id7 = H5Dcreate(group_id7,
"Matrix elements", H5T_IEEE_F64LE, dataspace_id7, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
371 H5Dwrite(dataset_id7, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, theElements);
373 H5Dclose(dataset_id7);
374 H5Sclose(dataspace_id7);
386 hid_t file_id = H5Fopen(name.c_str(), H5F_ACC_RDWR, H5P_DEFAULT);
388 hid_t group_id2 = H5Gcreate(file_id,
"FourIndex", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
391 hid_t group_id = H5Gcreate(group_id2,
"MetaData", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
394 hsize_t dimarray = SymmInfo.getNumberOfIrreps();
395 hid_t dataspace_id = H5Screate_simple(1, &dimarray, NULL);
396 hid_t dataset_id = H5Dcreate(group_id,
"IrrepSizes", H5T_STD_I32LE, dataspace_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
397 H5Dwrite(dataset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, Isizes);
400 hid_t attribute_space_id1 = H5Screate(H5S_SCALAR);
401 hid_t attribute_id1 = H5Acreate(dataset_id,
"nGroup", H5T_STD_I32LE, attribute_space_id1, H5P_DEFAULT, H5P_DEFAULT);
402 int nGroup = SymmInfo.getGroupNumber();
403 H5Awrite(attribute_id1, H5T_NATIVE_INT, &nGroup);
405 hid_t attribute_space_id2 = H5Screate(H5S_SCALAR);
406 hid_t attribute_id2 = H5Acreate(dataset_id,
"nIrreps", H5T_STD_I32LE, attribute_space_id2, H5P_DEFAULT, H5P_DEFAULT);
407 int nIrreps = SymmInfo.getNumberOfIrreps();
408 H5Awrite(attribute_id2, H5T_NATIVE_INT, &nIrreps);
410 hid_t attribute_space_id3 = H5Screate(H5S_SCALAR);
411 hid_t attribute_id3 = H5Acreate(dataset_id,
"theTotalSize", H5T_STD_I64LE, attribute_space_id3, H5P_DEFAULT, H5P_DEFAULT);
412 H5Awrite(attribute_id3, H5T_NATIVE_LLONG, &arrayLength);
414 H5Aclose(attribute_id1);
415 H5Aclose(attribute_id2);
416 H5Aclose(attribute_id3);
417 H5Sclose(attribute_space_id1);
418 H5Sclose(attribute_space_id2);
419 H5Sclose(attribute_space_id3);
421 H5Dclose(dataset_id);
422 H5Sclose(dataspace_id);
427 hid_t group_id7 = H5Gcreate(group_id2,
"FourIndexObject", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
429 hsize_t dimarray7 = arrayLength;
430 hid_t dataspace_id7 = H5Screate_simple(1, &dimarray7, NULL);
431 hid_t dataset_id7 = H5Dcreate(group_id7,
"Matrix elements", H5T_IEEE_F64LE, dataspace_id7, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
432 H5Dwrite(dataset_id7, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, theElements);
434 H5Dclose(dataset_id7);
435 H5Sclose(dataspace_id7);
448 hid_t file_id = H5Fopen(name.c_str(), H5F_ACC_RDONLY, H5P_DEFAULT);
451 hid_t group_id = H5Gopen(file_id,
"/MetaData",H5P_DEFAULT);
454 hid_t dataset_id = H5Dopen(group_id,
"IrrepSizes", H5P_DEFAULT);
457 hid_t attribute_id1 = H5Aopen_by_name(group_id,
"IrrepSizes",
"nGroup", H5P_DEFAULT, H5P_DEFAULT);
459 H5Aread(attribute_id1, H5T_NATIVE_INT, &nGroup);
460 assert( nGroup==SymmInfo.getGroupNumber() );
462 hid_t attribute_id2 = H5Aopen_by_name(group_id,
"IrrepSizes",
"nIrreps", H5P_DEFAULT, H5P_DEFAULT);
464 H5Aread(attribute_id2, H5T_NATIVE_INT, &nIrreps);
465 assert( nIrreps==SymmInfo.getNumberOfIrreps() );
467 hid_t attribute_id3 = H5Aopen_by_name(group_id,
"IrrepSizes",
"theTotalSize", H5P_DEFAULT, H5P_DEFAULT);
468 long long theTotalSize;
469 H5Aread(attribute_id3, H5T_NATIVE_LLONG, &theTotalSize);
470 assert( theTotalSize==arrayLength );
472 H5Aclose(attribute_id1);
473 H5Aclose(attribute_id2);
474 H5Aclose(attribute_id3);
476 int * IsizesAgain =
new int[SymmInfo.getNumberOfIrreps()];
477 H5Dread(dataset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, IsizesAgain);
478 for (
int cnt=0; cnt<SymmInfo.getNumberOfIrreps(); cnt++){
479 assert( IsizesAgain[cnt]==Isizes[cnt] );
481 delete [] IsizesAgain;
482 H5Dclose(dataset_id);
486 std::cout <<
"FourIndex::read : loading " << arrayLength <<
" doubles." << std::endl;
489 hid_t group_id7 = H5Gopen(file_id,
"/FourIndexObject", H5P_DEFAULT);
491 hid_t dataset_id7 = H5Dopen(group_id7,
"Matrix elements", H5P_DEFAULT);
492 H5Dread(dataset_id7, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, theElements);
493 H5Dclose(dataset_id7);
499 std::cout <<
"FourIndex::read : everything loaded!" << std::endl;
507 hid_t file_id = H5Fopen(name.c_str(), H5F_ACC_RDONLY, H5P_DEFAULT);
510 hid_t group_id = H5Gopen(file_id,
"/FourIndex/MetaData",H5P_DEFAULT);
513 hid_t dataset_id = H5Dopen(group_id,
"IrrepSizes", H5P_DEFAULT);
516 hid_t attribute_id1 = H5Aopen_by_name(group_id,
"IrrepSizes",
"nGroup", H5P_DEFAULT, H5P_DEFAULT);
518 H5Aread(attribute_id1, H5T_NATIVE_INT, &nGroup);
519 assert( nGroup==SymmInfo.getGroupNumber() );
521 hid_t attribute_id2 = H5Aopen_by_name(group_id,
"IrrepSizes",
"nIrreps", H5P_DEFAULT, H5P_DEFAULT);
523 H5Aread(attribute_id2, H5T_NATIVE_INT, &nIrreps);
524 assert( nIrreps==SymmInfo.getNumberOfIrreps() );
526 hid_t attribute_id3 = H5Aopen_by_name(group_id,
"IrrepSizes",
"theTotalSize", H5P_DEFAULT, H5P_DEFAULT);
527 long long theTotalSize;
528 H5Aread(attribute_id3, H5T_NATIVE_LLONG, &theTotalSize);
529 assert( theTotalSize==arrayLength );
531 H5Aclose(attribute_id1);
532 H5Aclose(attribute_id2);
533 H5Aclose(attribute_id3);
535 int * IsizesAgain =
new int[SymmInfo.getNumberOfIrreps()];
536 H5Dread(dataset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, IsizesAgain);
537 for (
int cnt=0; cnt<SymmInfo.getNumberOfIrreps(); cnt++){
538 assert( IsizesAgain[cnt]==Isizes[cnt] );
540 delete [] IsizesAgain;
541 H5Dclose(dataset_id);
545 std::cout <<
"FourIndex::read : loading " << arrayLength <<
" doubles." << std::endl;
548 hid_t group_id7 = H5Gopen(file_id,
"/FourIndex/FourIndexObject", H5P_DEFAULT);
550 hid_t dataset_id7 = H5Dopen(group_id7,
"Matrix elements", H5P_DEFAULT);
551 H5Dread(dataset_id7, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, theElements);
552 H5Dclose(dataset_id7);
558 std::cout <<
"FourIndex::read : everything loaded!" << std::endl;
563 memset(theElements, 0,
sizeof(
double)*arrayLength);
void save(const std::string name) const
Save the FourIndex object.
void save2(const std::string name) const
void read2(const std::string name)
void reset()
set everything to zero
double get(const int irrep_i, const int irrep_j, const int irrep_k, const int irrep_l, const int i, const int j, const int k, const int l) const
Get an element.
virtual ~FourIndex()
Destructor.
void set(const int irrep_i, const int irrep_j, const int irrep_k, const int irrep_l, const int i, const int j, const int k, const int l, const double val)
Set an element.
FourIndex(const int nGroup, const int *IrrepSizes)
Constructor.
void add(const int irrep_i, const int irrep_j, const int irrep_k, const int irrep_l, const int i, const int j, const int k, const int l, const double val)
Add a double to an element.
void read(const std::string name)
Load the FourIndex object.