Skip to content

Commit 03862bb

Browse files
authored
operator bugfix (#490)
1 parent ad561b7 commit 03862bb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/tensor/RankZeroOperator.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ ComplexDouble RankZeroOperator::dagger(const mrcpp::Coord<3> &r) const {
241241
* is added upp with the corresponding coefficient.
242242
*/
243243
Orbital RankZeroOperator::operator()(Orbital inp) {
244-
if (not mrcpp::mpi::my_orb(inp)) return inp.paramCopy();
244+
if (inp.getNNodes(NUMBER::Total) == 0) return inp.paramCopy();
245245

246246
RankZeroOperator &O = *this;
247247
std::vector<mrcpp::ComplexFunction> func_vec;
@@ -262,7 +262,7 @@ Orbital RankZeroOperator::operator()(Orbital inp) {
262262
* NOT IMPLEMENTED
263263
*/
264264
Orbital RankZeroOperator::dagger(Orbital inp) {
265-
if (not mrcpp::mpi::my_orb(inp)) return inp.paramCopy();
265+
if (inp.getNNodes(NUMBER::Total) == 0) return inp.paramCopy();
266266

267267
RankZeroOperator &O = *this;
268268
std::vector<mrcpp::ComplexFunction> func_vec;
@@ -470,7 +470,7 @@ ComplexDouble RankZeroOperator::trace(const Nuclei &nucs) {
470470
*/
471471
Orbital RankZeroOperator::applyOperTerm(int n, Orbital inp) {
472472
if (n >= this->oper_exp.size()) MSG_ABORT("Invalid oper term");
473-
if (not mrcpp::mpi::my_orb(inp)) return inp.paramCopy();
473+
if (inp.getNNodes(NUMBER::Total) == 0) return inp.paramCopy();
474474

475475
Orbital out = inp;
476476
for (auto O_nm : this->oper_exp[n]) {
@@ -482,7 +482,7 @@ Orbital RankZeroOperator::applyOperTerm(int n, Orbital inp) {
482482

483483
Orbital RankZeroOperator::daggerOperTerm(int n, Orbital inp) {
484484
if (n >= this->oper_exp.size()) MSG_ABORT("Invalid oper term");
485-
if (not mrcpp::mpi::my_orb(inp)) return inp.paramCopy();
485+
if (inp.getNNodes(NUMBER::Total) == 0) return inp.paramCopy();
486486

487487
Orbital out = inp;
488488
for (int i = this->oper_exp[n].size() - 1; i >= 0; i--) {

0 commit comments

Comments
 (0)