Loading runtime/qrt/impls/ftqc/ftqc_qrt.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -95,6 +95,10 @@ class FTQC : public quantum::QuantumRuntime { applyGate("CRZ", {src_idx.second, tgt_idx.second}, {theta}); } virtual void fsim(const qubit &q1, const qubit &q2, const double theta, const double phi) override { applyGate("fSim", {q1.second, q2.second}, {theta, phi}); } // exponential of i * theta * H, where H is an Observable pointer virtual void exp(qreg q, const double theta, xacc::Observable &H) override { /* TODO */ Loading runtime/qrt/impls/nisq/nisq_qrt.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -144,6 +144,11 @@ class NISQ : public ::quantum::QuantumRuntime, two_qubit_inst("CRZ", src_idx, tgt_idx, {theta}); } void fsim(const qubit &q1, const qubit &q2, const double theta, const double phi) override { two_qubit_inst("fSim", q1, q2, {theta, phi}); } void general_instruction(std::shared_ptr<xacc::Instruction> inst) override { std::vector<double> params; for (auto p : inst->getParameters()) { Loading runtime/qrt/qrt.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -191,6 +191,11 @@ void crz(const qubit &src_idx, const qubit &tgt_idx, const double theta) { qrt_impl->crz(src_idx, tgt_idx, theta); } void fsim(const qubit &q1, const qubit &q2, const double theta, const double phi) { qrt_impl->fsim(q1, q2, theta, phi); } void exp(qreg q, const double theta, xacc::Observable &H) { qrt_impl->exp(q, theta, H); } Loading runtime/qrt/qrt.hpp +4 −1 Original line number Diff line number Diff line Loading @@ -58,6 +58,8 @@ public: const double theta) = 0; virtual void crz(const qubit &src_idx, const qubit &tgt_idx, const double theta) = 0; virtual void fsim(const qubit &q1, const qubit &q2, const double theta, const double phi) = 0; // exponential of i * theta * H, where H is an Observable pointer virtual void exp(qreg q, const double theta, xacc::Observable &H) = 0; Loading Loading @@ -147,7 +149,8 @@ void swap(const qubit &src_idx, const qubit &tgt_idx); // Common parameterized 2 qubit gates. void cphase(const qubit &src_idx, const qubit &tgt_idx, const double theta); void crz(const qubit &src_idx, const qubit &tgt_idx, const double theta); void fsim(const qubit &q1, const qubit &q2, const double theta, const double phi); // exponential of i * theta * H, where H is an Observable pointer void exp(qreg q, const double theta, xacc::Observable &H); void exp(qreg q, const double theta, xacc::Observable *H); Loading runtime/qrt/qrt_mapper.hpp +1 −0 Original line number Diff line number Diff line Loading @@ -89,6 +89,7 @@ public: void visit(CRZ &crz) override { addTwoQubitGate("crz", crz); } void visit(CH &ch) override { addTwoQubitGate("ch", ch); } void visit(CPhase &cphase) override { addTwoQubitGate("cphase", cphase); } void visit(fSim &fsim) override { addTwoQubitGate("fsim", fsim); } void visit(Measure &measure) override { addOneQubitGate("mz", measure); } void visit(Identity &i) override { addOneQubitGate("i", i); } Loading Loading
runtime/qrt/impls/ftqc/ftqc_qrt.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -95,6 +95,10 @@ class FTQC : public quantum::QuantumRuntime { applyGate("CRZ", {src_idx.second, tgt_idx.second}, {theta}); } virtual void fsim(const qubit &q1, const qubit &q2, const double theta, const double phi) override { applyGate("fSim", {q1.second, q2.second}, {theta, phi}); } // exponential of i * theta * H, where H is an Observable pointer virtual void exp(qreg q, const double theta, xacc::Observable &H) override { /* TODO */ Loading
runtime/qrt/impls/nisq/nisq_qrt.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -144,6 +144,11 @@ class NISQ : public ::quantum::QuantumRuntime, two_qubit_inst("CRZ", src_idx, tgt_idx, {theta}); } void fsim(const qubit &q1, const qubit &q2, const double theta, const double phi) override { two_qubit_inst("fSim", q1, q2, {theta, phi}); } void general_instruction(std::shared_ptr<xacc::Instruction> inst) override { std::vector<double> params; for (auto p : inst->getParameters()) { Loading
runtime/qrt/qrt.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -191,6 +191,11 @@ void crz(const qubit &src_idx, const qubit &tgt_idx, const double theta) { qrt_impl->crz(src_idx, tgt_idx, theta); } void fsim(const qubit &q1, const qubit &q2, const double theta, const double phi) { qrt_impl->fsim(q1, q2, theta, phi); } void exp(qreg q, const double theta, xacc::Observable &H) { qrt_impl->exp(q, theta, H); } Loading
runtime/qrt/qrt.hpp +4 −1 Original line number Diff line number Diff line Loading @@ -58,6 +58,8 @@ public: const double theta) = 0; virtual void crz(const qubit &src_idx, const qubit &tgt_idx, const double theta) = 0; virtual void fsim(const qubit &q1, const qubit &q2, const double theta, const double phi) = 0; // exponential of i * theta * H, where H is an Observable pointer virtual void exp(qreg q, const double theta, xacc::Observable &H) = 0; Loading Loading @@ -147,7 +149,8 @@ void swap(const qubit &src_idx, const qubit &tgt_idx); // Common parameterized 2 qubit gates. void cphase(const qubit &src_idx, const qubit &tgt_idx, const double theta); void crz(const qubit &src_idx, const qubit &tgt_idx, const double theta); void fsim(const qubit &q1, const qubit &q2, const double theta, const double phi); // exponential of i * theta * H, where H is an Observable pointer void exp(qreg q, const double theta, xacc::Observable &H); void exp(qreg q, const double theta, xacc::Observable *H); Loading
runtime/qrt/qrt_mapper.hpp +1 −0 Original line number Diff line number Diff line Loading @@ -89,6 +89,7 @@ public: void visit(CRZ &crz) override { addTwoQubitGate("crz", crz); } void visit(CH &ch) override { addTwoQubitGate("ch", ch); } void visit(CPhase &cphase) override { addTwoQubitGate("cphase", cphase); } void visit(fSim &fsim) override { addTwoQubitGate("fsim", fsim); } void visit(Measure &measure) override { addOneQubitGate("mz", measure); } void visit(Identity &i) override { addOneQubitGate("i", i); } Loading