Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make changes to rely on ADL get instead of std::get in AFQMC #5239

Merged
merged 2 commits into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/AFQMC/Estimators/BackPropagatedEstimator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,15 +187,16 @@ class BackPropagatedEstimator : public EstimatorBase
int ncol(NAEA + ((walker_type == CLOSED) ? 0 : NAEB));
int nx((walker_type == COLLINEAR) ? 2 : 1);

using std::get;
// 1. check structures
if (std::get<0>(Refs.sizes()) != wset.size() || std::get<1>(Refs.sizes()) != nrefs || std::get<2>(Refs.sizes()) != nrow * ncol)
if (get<0>(Refs.sizes()) != wset.size() || get<1>(Refs.sizes()) != nrefs || get<2>(Refs.sizes()) != nrow * ncol)
Refs = mpi3CTensor({wset.size(), nrefs, nrow * ncol}, Refs.get_allocator());
DeviceBufferManager buffer_manager;
StaticMatrix detR({wset.size(), nrefs * nx},
buffer_manager.get_generator().template get_allocator<ComplexType>());

int n0, n1;
std::tie(n0, n1) = FairDivideBoundary(TG.getLocalTGRank(), int(std::get<2>(Refs.sizes())), TG.getNCoresPerTG());
std::tie(n0, n1) = FairDivideBoundary(TG.getLocalTGRank(), int(get<2>(Refs.sizes())), TG.getNCoresPerTG());
boost::multi::array_ref<ComplexType, 3> Refs_(to_address(Refs.origin()), Refs.extensions());

// 2. setup back propagated references
Expand Down
8 changes: 5 additions & 3 deletions src/AFQMC/Estimators/EnergyEstimator.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,13 @@ class EnergyEstimator : public EstimatorBase
{
ScopedTimer local_timer(AFQMCTimers[energy_timer]);
size_t nwalk = wset.size();
if (std::get<0>(eloc.sizes()) != nwalk || std::get<1>(eloc.sizes()) != 3)

using std::get;
if (get<0>(eloc.sizes()) != nwalk || get<1>(eloc.sizes()) != 3)
eloc.reextent({static_cast<boost::multi::size_t>(nwalk), 3});
if (std::get<0>(ovlp.sizes()) != nwalk)
if (get<0>(ovlp.sizes()) != nwalk)
ovlp.reextent(iextensions<1u>(nwalk));
if (std::get<0>(wprop.sizes()) != 4 || std::get<1>(wprop.sizes()) != nwalk)
if (get<0>(wprop.sizes()) != 4 || get<1>(wprop.sizes()) != nwalk)
wprop.reextent({4, static_cast<boost::multi::size_t>(nwalk)});

ComplexType dum, et;
Expand Down
6 changes: 4 additions & 2 deletions src/AFQMC/Estimators/FullObsHandler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,12 @@ class FullObsHandler : public AFQMCInfo
APP_ABORT("Runtime Error: iav out of range in full1rdm::accumulate. \n\n\n");

int nw(wset.size());
int nrefs(std::get<1>(Refs.sizes()));

using std::get;
int nrefs(get<1>(Refs.sizes()));
double LogOverlapFactor(wset.getLogOverlapFactor());
LocalTGBufferManager shm_buffer_manager;
StaticSHM4Tensor G4D({nw, nspins, std::get<0>(Gdims), std::get<1>(Gdims)},
StaticSHM4Tensor G4D({nw, nspins, get<0>(Gdims), get<1>(Gdims)},
shm_buffer_manager.get_generator().template get_allocator<ComplexType>());
StaticSHMVector DevOv(iextensions<1u>{2 * nw},
shm_buffer_manager.get_generator().template get_allocator<ComplexType>());
Expand Down
12 changes: 8 additions & 4 deletions src/AFQMC/Estimators/MixedRDMEstimator.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,11 @@ class MixedRDMEstimator : public EstimatorBase
wset.getProperty(WEIGHT, wgt);

int nx((wset.getWalkerType() == COLLINEAR) ? 2 : 1);
if (std::get<0>(wDMsum.sizes()) != wset.size() || std::get<1>(wDMsum.sizes()) != nx)

using std::get;
if (get<0>(wDMsum.sizes()) != wset.size() || get<1>(wDMsum.sizes()) != nx)
wDMsum.reextent({wset.size(), nx});
if (std::get<0>(wOvlp.sizes()) != wset.size() || std::get<1>(wOvlp.sizes()) != nx)
if (get<0>(wOvlp.sizes()) != wset.size() || get<1>(wOvlp.sizes()) != nx)
wOvlp.reextent({wset.size(), nx});

if (!importanceSampling)
Expand Down Expand Up @@ -126,8 +128,10 @@ class MixedRDMEstimator : public EstimatorBase
denom_average[0] /= block_size;
dump.push("Mixed");
std::string padded_iblock = std::string(n_zero - std::to_string(iblock).length(), '0') + std::to_string(iblock);
boost::multi::array_ref<ComplexType, 1> wOvlp_(wOvlp.origin(), {std::get<0>(wOvlp.sizes()) * std::get<1>(wOvlp.sizes())});
boost::multi::array_ref<ComplexType, 1> wDMsum_(wDMsum.origin(), {std::get<0>(wDMsum.sizes()) * std::get<1>(wDMsum.sizes())});

using std::get;
boost::multi::array_ref<ComplexType, 1> wOvlp_(wOvlp.origin(), {get<0>(wOvlp.sizes()) * get<1>(wOvlp.sizes())});
boost::multi::array_ref<ComplexType, 1> wDMsum_(wDMsum.origin(), {get<0>(wDMsum.sizes()) * get<1>(wDMsum.sizes())});
dump.write(DMAverage, "one_rdm_" + padded_iblock);
dump.write(denom_average, "one_rdm_denom_" + padded_iblock);
dump.write(wOvlp_, "one_rdm_walker_overlaps_" + padded_iblock);
Expand Down
21 changes: 11 additions & 10 deletions src/AFQMC/Estimators/Observables/atomcentered_correlators.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -253,26 +253,27 @@ class atomcentered_correlators : public AFQMCInfo
else
nsp = 2;

using std::get;
// check structure dimensions
if (iref == 0)
{
if (denom.size() != nw)
{
denom = mpi3CVector(iextensions<1u>{nw}, shared_allocator<ComplexType>{TG.TG_local()});
}
if (std::get<0>(DMWork1D.sizes()) != nw || std::get<1>(DMWork1D.sizes()) != 3 || std::get<2>(DMWork1D.sizes()) != nsites)
if (get<0>(DMWork1D.sizes()) != nw || get<1>(DMWork1D.sizes()) != 3 || get<2>(DMWork1D.sizes()) != nsites)
{
DMWork1D = mpi3CTensor({nw, 3, nsites}, shared_allocator<ComplexType>{TG.TG_local()});
}
if (std::get<0>(DMWork2D.sizes()) != nw || std::get<1>(DMWork2D.sizes()) != 3 || std::get<2>(DMWork2D.sizes()) != ns2)
if (get<0>(DMWork2D.sizes()) != nw || get<1>(DMWork2D.sizes()) != 3 || get<2>(DMWork2D.sizes()) != ns2)
{
DMWork2D = mpi3CTensor({nw, 3, ns2}, shared_allocator<ComplexType>{TG.TG_local()});
}
if (std::get<0>(NwIJ.sizes()) != nsp || std::get<1>(NwIJ.sizes()) != nw || std::get<2>(NwIJ.sizes()) != nsites || std::get<3>(NwIJ.sizes()) != nsites)
if (get<0>(NwIJ.sizes()) != nsp || get<1>(NwIJ.sizes()) != nw || get<2>(NwIJ.sizes()) != nsites || get<3>(NwIJ.sizes()) != nsites)
{
NwIJ = mpi3C4Tensor({nsp, nw, nsites, nsites}, shared_allocator<ComplexType>{TG.TG_local()});
}
if (std::get<0>(NwI.sizes()) != nsp || std::get<1>(NwI.sizes()) != nw || std::get<2>(NwI.sizes()) != nsites)
if (get<0>(NwI.sizes()) != nsp || get<1>(NwI.sizes()) != nw || get<2>(NwI.sizes()) != nsites)
{
NwI = mpi3CTensor({nsp, nw, nsites}, shared_allocator<ComplexType>{TG.TG_local()});
}
Expand All @@ -284,12 +285,12 @@ class atomcentered_correlators : public AFQMCInfo
}
else
{
if (std::get<0>(denom.sizes()) != nw || std::get<0>(DMWork1D.sizes()) != nw || std::get<1>(DMWork1D.sizes()) != 3 || std::get<2>(DMWork1D.sizes()) != nsites ||
std::get<0>(DMWork2D.sizes()) != nw || std::get<1>(DMWork2D.sizes()) != 3 || std::get<2>(DMWork2D.sizes()) != ns2 || std::get<0>(NwI.sizes()) != nsp ||
std::get<1>(NwI.sizes()) != nw || std::get<2>(NwI.sizes()) != nsites || std::get<0>(NwIJ.sizes()) != nsp || std::get<1>(NwIJ.sizes()) != nw ||
std::get<2>(NwIJ.sizes()) != nsites || std::get<3>(NwIJ.sizes()) != nsites || std::get<0>(DMAverage1D.sizes()) != nave || std::get<1>(DMAverage1D.sizes()) != 3 ||
std::get<2>(DMAverage1D.sizes()) != nsites || std::get<0>(DMAverage2D.sizes()) != nave || std::get<1>(DMAverage2D.sizes()) != 3 ||
std::get<2>(DMAverage2D.sizes()) != ns2)
if (get<0>(denom.sizes()) != nw || get<0>(DMWork1D.sizes()) != nw || get<1>(DMWork1D.sizes()) != 3 || get<2>(DMWork1D.sizes()) != nsites ||
get<0>(DMWork2D.sizes()) != nw || get<1>(DMWork2D.sizes()) != 3 || get<2>(DMWork2D.sizes()) != ns2 || get<0>(NwI.sizes()) != nsp ||
get<1>(NwI.sizes()) != nw || get<2>(NwI.sizes()) != nsites || get<0>(NwIJ.sizes()) != nsp || get<1>(NwIJ.sizes()) != nw ||
get<2>(NwIJ.sizes()) != nsites || get<3>(NwIJ.sizes()) != nsites || get<0>(DMAverage1D.sizes()) != nave || get<1>(DMAverage1D.sizes()) != 3 ||
get<2>(DMAverage1D.sizes()) != nsites || get<0>(DMAverage2D.sizes()) != nave || get<1>(DMAverage2D.sizes()) != 3 ||
get<2>(DMAverage2D.sizes()) != ns2)
APP_ABORT(" Error: Invalid state in accumulate_reference. \n\n\n");
}

Expand Down
7 changes: 4 additions & 3 deletions src/AFQMC/Estimators/Observables/diagonal2rdm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,14 +133,15 @@ class diagonal2rdm : public AFQMCInfo
assert(G.num_elements() == G_host.num_elements());
assert(G.extensions() == G_host.extensions());

using std::get;
// check structure dimensions
if (iref == 0)
{
if (denom.size() != nw)
{
denom = mpi3CVector(iextensions<1u>{nw}, shared_allocator<ComplexType>{TG.TG_local()});
}
if (std::get<0>(DMWork.sizes()) != nw || std::get<1>(DMWork.sizes()) != dm_size)
if (get<0>(DMWork.sizes()) != nw || get<1>(DMWork.sizes()) != dm_size)
{
DMWork = mpi3CMatrix({nw, dm_size}, shared_allocator<ComplexType>{TG.TG_local()});
}
Expand All @@ -149,8 +150,8 @@ class diagonal2rdm : public AFQMCInfo
}
else
{
if (std::get<0>(denom.sizes()) != nw || std::get<0>(DMWork.sizes()) != nw || std::get<1>(DMWork.sizes()) != dm_size || std::get<0>(DMAverage.sizes()) != nave ||
std::get<1>(DMAverage.sizes()) != dm_size)
if (get<0>(denom.sizes()) != nw || get<0>(DMWork.sizes()) != nw || get<1>(DMWork.sizes()) != dm_size || get<0>(DMAverage.sizes()) != nave ||
get<1>(DMAverage.sizes()) != dm_size)
APP_ABORT(" Error: Invalid state in accumulate_reference. \n\n\n");
}

Expand Down
21 changes: 13 additions & 8 deletions src/AFQMC/Estimators/Observables/full1rdm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ class full1rdm : public AFQMCInfo
stdCMatrix R;
if (!dump.readEntry(R, "RotationMatrix"))
APP_ABORT("Error reading RotationMatrix.\n");
if (std::get<1>(R.sizes()) != NMO)
using std::get;
if (get<1>(R.sizes()) != NMO)
APP_ABORT("Error Wrong dimensions in RotationMatrix.\n");
dim[0] = R.size();
dim[1] = 0;
Expand All @@ -143,9 +144,10 @@ class full1rdm : public AFQMCInfo
{
if (!dump.readEntry(I, "Indices"))
APP_ABORT("Error reading Indices.\n");
if (std::get<1>(I.sizes()) != 2)
using std::get;
if (get<1>(I.sizes()) != 2)
APP_ABORT("Error Wrong dimensions in Indices.\n");
dim[1] = std::get<0>(I.sizes());
dim[1] = get<0>(I.sizes());
}
TG.Node().broadcast_n(dim, 2, 0);
XRot = sharedCMatrix({dim[0], NMO}, make_node_allocator<ComplexType>(TG));
Expand Down Expand Up @@ -244,14 +246,15 @@ class full1rdm : public AFQMCInfo
assert(G.num_elements() == G_host.num_elements());
assert(G.extensions() == G_host.extensions());

using std::get;
// check structure dimensions
if (iref == 0)
{
if (denom.size() != nw)
{
denom = mpi3CVector(iextensions<1u>{nw}, shared_allocator<ComplexType>{TG.TG_local()});
}
if (std::get<0>(DMWork.sizes()) != nw || std::get<1>(DMWork.sizes()) != dm_size)
if (get<0>(DMWork.sizes()) != nw || get<1>(DMWork.sizes()) != dm_size)
{
DMWork = mpi3CMatrix({nw, dm_size}, shared_allocator<ComplexType>{TG.TG_local()});
}
Expand All @@ -260,8 +263,8 @@ class full1rdm : public AFQMCInfo
}
else
{
if (std::get<0>(denom.sizes()) != nw || std::get<0>(DMWork.sizes()) != nw || std::get<1>(DMWork.sizes()) != dm_size || std::get<0>(DMAverage.sizes()) != nave ||
std::get<1>(DMAverage.sizes()) != dm_size)
if (get<0>(denom.sizes()) != nw || get<0>(DMWork.sizes()) != nw || get<1>(DMWork.sizes()) != dm_size || get<0>(DMAverage.sizes()) != nave ||
get<1>(DMAverage.sizes()) != dm_size)
APP_ABORT(" Error: Invalid state in accumulate_reference. \n\n\n");
}

Expand Down Expand Up @@ -427,9 +430,11 @@ class full1rdm : public AFQMCInfo
template<class MatG, class CVec>
void acc_with_rotation(MatG&& G, CVec&& Xw)
{
using std::get;

int nw(G.size());
assert(std::get<2>(G.sizes()) == std::get<3>(G.sizes()));
assert(std::get<2>(G.sizes()) == std::get<1>(XRot.sizes()));
assert(get<2>(G.sizes()) == get<3>(G.sizes()));
assert(get<2>(G.sizes()) == get<1>(XRot.sizes()));

if (walker_type == NONCOLLINEAR)
APP_ABORT("Error: Not yet implemented: acc_with_rotation && noncollinear.\n");
Expand Down
11 changes: 7 additions & 4 deletions src/AFQMC/Estimators/Observables/full2rdm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ class full2rdm : public AFQMCInfo
apply_rotation = true;
int dim[2];

using std::get;

hdf_archive dump;
if (TG.Node().root())
{
Expand All @@ -124,7 +126,7 @@ class full2rdm : public AFQMCInfo
stdCMatrix R;
if (!dump.readEntry(R, "RotationMatrix"))
APP_ABORT("Error reading RotationMatrix.\n");
if (std::get<1>(R.sizes()) != NMO)
if (get<1>(R.sizes()) != NMO)
APP_ABORT("Error Wrong dimensions in RotationMatrix.\n");
dim[0] = R.size();
dim[1] = 0;
Expand Down Expand Up @@ -196,14 +198,15 @@ class full2rdm : public AFQMCInfo
assert(G.num_elements() == G_host.num_elements());
assert(G.extensions() == G_host.extensions());

using std::get;
// check structure dimensions
if (iref == 0)
{
if (denom.size() != nw)
{
denom = mpi3CVector(iextensions<1u>{nw}, shared_allocator<ComplexType>{TG.TG_local()});
}
if (std::get<0>(DMWork.sizes()) != nw || std::get<1>(DMWork.sizes()) != dm_size)
if (get<0>(DMWork.sizes()) != nw || get<1>(DMWork.sizes()) != dm_size)
{
DMWork = mpi3CMatrix({nw, dm_size}, shared_allocator<ComplexType>{TG.TG_local()});
}
Expand All @@ -212,8 +215,8 @@ class full2rdm : public AFQMCInfo
}
else
{
if (std::get<0>(denom.sizes()) != nw || std::get<0>(DMWork.sizes()) != nw || std::get<1>(DMWork.sizes()) != dm_size || std::get<0>(DMAverage.sizes()) != nave ||
std::get<1>(DMAverage.sizes()) != dm_size)
if (get<0>(denom.sizes()) != nw || get<0>(DMWork.sizes()) != nw || get<1>(DMWork.sizes()) != dm_size || get<0>(DMAverage.sizes()) != nave ||
get<1>(DMAverage.sizes()) != dm_size)
APP_ABORT(" Error: Invalid state in accumulate_reference. \n\n\n");
}

Expand Down
7 changes: 4 additions & 3 deletions src/AFQMC/Estimators/Observables/generalizedFockMatrix.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,14 +133,15 @@ class generalizedFockMatrix : public AFQMCInfo
assert(G.extensions() == G_host.extensions());
assert(G[0].num_elements() == dm_size);

using std::get;
// check structure dimensions
if (iref == 0)
{
if (denom.size() != nw)
{
denom = mpi3CVector(iextensions<1u>{nw}, shared_allocator<ComplexType>{TG.TG_local()});
}
if (std::get<0>(DMWork.sizes()) != 3 || std::get<1>(DMWork.sizes()) != nw || std::get<2>(DMWork.sizes()) != dm_size)
if (get<0>(DMWork.sizes()) != 3 || get<1>(DMWork.sizes()) != nw || get<2>(DMWork.sizes()) != dm_size)
{
DMWork = mpi3CTensor({3, nw, dm_size}, shared_allocator<ComplexType>{TG.TG_local()});
}
Expand All @@ -149,8 +150,8 @@ class generalizedFockMatrix : public AFQMCInfo
}
else
{
if (std::get<0>(denom.sizes()) != nw || std::get<0>(DMWork.sizes()) != 2 || std::get<1>(DMWork.sizes()) != nw || std::get<2>(DMWork.sizes()) != dm_size ||
std::get<0>(DMAverage.sizes()) != 2 || std::get<1>(DMAverage.sizes()) != nave || std::get<2>(DMAverage.sizes()) != dm_size)
if (get<0>(denom.sizes()) != nw || get<0>(DMWork.sizes()) != 2 || get<1>(DMWork.sizes()) != nw || get<2>(DMWork.sizes()) != dm_size ||
get<0>(DMAverage.sizes()) != 2 || get<1>(DMAverage.sizes()) != nave || get<2>(DMAverage.sizes()) != dm_size)
APP_ABORT(" Error: Invalid state in accumulate_reference. \n\n\n");
}

Expand Down
7 changes: 4 additions & 3 deletions src/AFQMC/Estimators/Observables/n2r.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,14 +224,15 @@ class n2r : public AFQMCInfo
else
nsp = 2;

using std::get;
// check structure dimensions
if (iref == 0)
{
if (denom.size() != nw)
{
denom = mpi3CVector(iextensions<1u>{nw}, shared_allocator<ComplexType>{TG.TG_local()});
}
if (std::get<0>(DMWork.sizes()) != nw || std::get<1>(DMWork.sizes()) != dm_size)
if (get<0>(DMWork.sizes()) != nw || get<1>(DMWork.sizes()) != dm_size)
{
DMWork = mpi3CMatrix({nw, dm_size}, shared_allocator<ComplexType>{TG.TG_local()});
}
Expand All @@ -240,8 +241,8 @@ class n2r : public AFQMCInfo
}
else
{
if (std::get<0>(denom.sizes()) != nw || std::get<0>(DMWork.sizes()) != nw || std::get<1>(DMWork.sizes()) != dm_size || std::get<0>(DMAverage.sizes()) != nave ||
std::get<1>(DMAverage.sizes()) != dm_size)
if (get<0>(denom.sizes()) != nw || get<0>(DMWork.sizes()) != nw || get<1>(DMWork.sizes()) != dm_size || get<0>(DMAverage.sizes()) != nave ||
get<1>(DMAverage.sizes()) != dm_size)
APP_ABORT(" Error: Invalid state in accumulate_reference. \n\n\n");
}

Expand Down
16 changes: 9 additions & 7 deletions src/AFQMC/Estimators/Observables/realspace_correlators.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,9 @@ class realspace_correlators : public AFQMCInfo
using std::fill_n;
// assumes G[nwalk][spin][M][M]
int nw(G.size());
int npts(std::get<1>(Orbitals.sizes()));

using std::get;
int npts(get<1>(Orbitals.sizes()));
assert(G.size() == wgt.size());
assert(wgt.size() == nw);
assert(Xw.size() == nw);
Expand All @@ -245,11 +247,11 @@ class realspace_correlators : public AFQMCInfo
{
denom = mpi3CVector(iextensions<1u>{nw}, shared_allocator<ComplexType>{TG.TG_local()});
}
if (std::get<0>(DMWork.sizes()) != nw || std::get<1>(DMWork.sizes()) != 3 || std::get<2>(DMWork.sizes()) != dm_size)
if (get<0>(DMWork.sizes()) != nw || get<1>(DMWork.sizes()) != 3 || get<2>(DMWork.sizes()) != dm_size)
{
DMWork = mpi3CTensor({nw, 3, dm_size}, shared_allocator<ComplexType>{TG.TG_local()});
}
if (std::get<0>(Gr_host.sizes()) != nw || std::get<1>(Gr_host.sizes()) != nsp || std::get<2>(Gr_host.sizes()) != npts || std::get<3>(Gr_host.sizes()) != npts)
if (get<0>(Gr_host.sizes()) != nw || get<1>(Gr_host.sizes()) != nsp || get<2>(Gr_host.sizes()) != npts || get<3>(Gr_host.sizes()) != npts)
{
Gr_host = mpi3C4Tensor({nw, nsp, npts, npts}, shared_allocator<ComplexType>{TG.TG_local()});
}
Expand All @@ -258,9 +260,9 @@ class realspace_correlators : public AFQMCInfo
}
else
{
if (std::get<0>(denom.sizes()) != nw || std::get<0>(DMWork.sizes()) != nw || std::get<1>(DMWork.sizes()) != 3 || std::get<2>(DMWork.sizes()) != dm_size ||
std::get<0>(Gr_host.sizes()) != nw || std::get<1>(Gr_host.sizes()) != nsp || std::get<2>(Gr_host.sizes()) != npts || std::get<3>(Gr_host.sizes()) != npts ||
std::get<0>(DMAverage.sizes()) != nave || std::get<1>(DMAverage.sizes()) != 3 || std::get<2>(DMAverage.sizes()) != dm_size)
if (get<0>(denom.sizes()) != nw || get<0>(DMWork.sizes()) != nw || get<1>(DMWork.sizes()) != 3 || get<2>(DMWork.sizes()) != dm_size ||
get<0>(Gr_host.sizes()) != nw || get<1>(Gr_host.sizes()) != nsp || get<2>(Gr_host.sizes()) != npts || get<3>(Gr_host.sizes()) != npts ||
get<0>(DMAverage.sizes()) != nave || get<1>(DMAverage.sizes()) != 3 || get<2>(DMAverage.sizes()) != dm_size)
APP_ABORT(" Error: Invalid state in accumulate_reference. \n\n\n");
}

Expand All @@ -277,7 +279,7 @@ class realspace_correlators : public AFQMCInfo

// T1[iw][ispin][i][r] = sum_j G[iw][ispin][i][j] * Psi(j,r)
int i0, iN;
std::tie(i0, iN) = FairDivideBoundary(TG.TG_local().rank(), int(std::get<0>(G2D.sizes())), TG.TG_local().size());
std::tie(i0, iN) = FairDivideBoundary(TG.TG_local().rank(), int(get<0>(G2D.sizes())), TG.TG_local().size());
ma::product(G2D.sliced(i0, iN), Orbitals, T.sliced(i0, iN));
TG.TG_local().barrier();

Expand Down
8 changes: 5 additions & 3 deletions src/AFQMC/Estimators/tests/test_estimators.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,11 @@ void reduced_density_matrix(boost::mpi3::communicator& world)

WalkerSet wset(TG, doc3.getRoot(), InfoMap["info0"], rng);
auto initial_guess = WfnFac.getInitialGuess(wfn_name);
REQUIRE(std::get<0>(initial_guess.sizes()) == 2);
REQUIRE(std::get<1>(initial_guess.sizes()) == NMO);
REQUIRE(std::get<2>(initial_guess.sizes()) == NAEA);

using std::get;
REQUIRE(get<0>(initial_guess.sizes()) == 2);
REQUIRE(get<1>(initial_guess.sizes()) == NMO);
REQUIRE(get<2>(initial_guess.sizes()) == NAEA);
wset.resize(nwalk, initial_guess[0], initial_guess[0]);
using EstimPtr = std::shared_ptr<EstimatorBase>;
std::vector<EstimPtr> estimators;
Expand Down
Loading
Loading