diff --git a/src/madness/mra/mraimpl.h b/src/madness/mra/mraimpl.h index 283d060803b..54c4e19528b 100644 --- a/src/madness/mra/mraimpl.h +++ b/src/madness/mra/mraimpl.h @@ -3213,10 +3213,21 @@ template return woT::task(world.rank(),&implT::compress_op, key, v, nonstandard1); } else { - Future result(node.coeff()); - if (!keepleaves) node.clear_coeff(); - node.set_dnorm(0.0); - return result; + // special case: tree has only root node: keep sum coeffs and make zero diff coeffs + if (key.level()==0) { +// if (0) { + Future result(node.coeff()); + coeffT sdcoeff(cdata.v2k,this->get_tensor_type()); + sdcoeff(cdata.s0)+=node.coeff(); + node.coeff()=sdcoeff; + node.set_dnorm(0.0); + return result; + } else { + Future result(node.coeff()); + if (!keepleaves) node.clear_coeff(); + node.set_dnorm(0.0); + return result; + } } }