Skip to content

Commit

Permalink
operator bugfix (#490)
Browse files Browse the repository at this point in the history
  • Loading branch information
gitpeterwind authored Aug 11, 2024
1 parent ad561b7 commit 03862bb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/tensor/RankZeroOperator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ ComplexDouble RankZeroOperator::dagger(const mrcpp::Coord<3> &r) const {
* is added upp with the corresponding coefficient.
*/
Orbital RankZeroOperator::operator()(Orbital inp) {
if (not mrcpp::mpi::my_orb(inp)) return inp.paramCopy();
if (inp.getNNodes(NUMBER::Total) == 0) return inp.paramCopy();

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

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

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

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

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

0 comments on commit 03862bb

Please sign in to comment.