Skip to content

Commit

Permalink
fixed #99
Browse files Browse the repository at this point in the history
  • Loading branch information
vsoftco committed Jan 11, 2021
1 parent edab322 commit c300c50
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion include/qasm/ast.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,13 @@ static std::unordered_map<ident,
{"crz", [](const std::vector<double>& args) {
assert(!args.empty());
cmat mat{cmat::Identity(4, 4)};
mat.block(2, 2, 2, 2) = gt.RZ(args[0]);
// note the discrepancy; QISKIT defines it as CTRL-diag(1,
// e^{i\phi}) we comply to the QISKIT definition (and not the
// OPENQASM specs); see
// https://github.com/softwareQinc/qpp/issues/99 and
// https://github.com/softwareQinc/qpp/issues/70
mat.block(2, 2, 2, 2) =
std::exp(1_i * args[0] / 2.0) * gt.RZ(args[0]);
return mat;
}}};

Expand Down

0 comments on commit c300c50

Please sign in to comment.