Skip to content

Commit

Permalink
Merge pull request #391 from Cytnx-dev/zn_reverse
Browse files Browse the repository at this point in the history
Zn symmetry combine/inverse rule
  • Loading branch information
jeffry1829 authored Dec 1, 2023
2 parents 016b6de + c06e131 commit 694f543
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/Symmetry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,16 +155,14 @@ namespace cytnx {
}
void cytnx::ZnSymmetry::combine_rule_(cytnx_int64 &out, const cytnx_int64 &inL,
const cytnx_int64 &inR, const bool &is_reverse) {
out = (inL + inR) % (this->n);

if (is_reverse)
this->reverse_rule_(out, (inL + inR) % (this->n));
else
out = (inL + inR) % (this->n);
}
void cytnx::ZnSymmetry::reverse_rule_(cytnx_int64 &out, const cytnx_int64 &in) {
// out = -in<0?-in+this->n:-in;
out = in * -1;
out = -in + this->n;
}

void cytnx::ZnSymmetry::print_info() const {
Expand Down

0 comments on commit 694f543

Please sign in to comment.