diff --git a/src/QCViewer/QCLib/gates/RGate.cpp b/src/QCViewer/QCLib/gates/RGate.cpp index f2a4a4f..c12a3df 100644 --- a/src/QCViewer/QCLib/gates/RGate.cpp +++ b/src/QCViewer/QCLib/gates/RGate.cpp @@ -181,11 +181,11 @@ State RGate::ApplyU (index_t bits) const float_type cosr = cos (M_PI*rot); float_type sinr = sin (M_PI*rot); if (GetRegister (bits, targets.at (0))) { - answer = State (complex(sinr,0),BuildBitString(bits,0)); + answer = State (complex(0,-sinr),BuildBitString(bits,0)); answer += State (complex(cosr,0),BuildBitString(bits,1)); } else { - answer = State (complex(-cosr,0),BuildBitString(bits,0)); - answer += State (complex(sinr,0),BuildBitString(bits,1)); + answer = State (complex(cosr,0),BuildBitString(bits,0)); + answer += State (complex(0,-sinr),BuildBitString(bits,1)); } } break; @@ -193,11 +193,11 @@ State RGate::ApplyU (index_t bits) const float_type cosr = cos (M_PI*rot); float_type sinr = sin (M_PI*rot); if (GetRegister (bits, targets.at (0))) { - answer = State (complex(0,-sinr),BuildBitString(bits,0)); + answer = State (complex(-sinr,0),BuildBitString(bits,0)); answer += State (complex(cosr,0),BuildBitString(bits,1)); } else { - answer = State (complex(-cosr,0),BuildBitString(bits,0)); - answer += State (complex(0,sinr),BuildBitString(bits,1)); + answer = State (complex(cosr,0),BuildBitString(bits,0)); + answer += State (complex(sinr,0),BuildBitString(bits,1)); } } break;