Commit 764ba1da authored by Mccaskey, Alex's avatar Mccaskey, Alex
Browse files

saving work done on removing gate registry, this branch is broken


Signed-off-by: Mccaskey, Alex's avatarAlex McCaskey <mccaskeyaj@ornl.gov>
parent 420a6ea4
...@@ -12,9 +12,6 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") ...@@ -12,9 +12,6 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(CMAKE_MACOSX_RPATH ON) set(CMAKE_MACOSX_RPATH ON)
endif() endif()
#find_package(PythonLibs)
#if(PythonLibs_FOUND)
set(CppMicroServices_DIR "${CPPUS_LIBRARY_DIR}/../share/cppmicroservices3/cmake") set(CppMicroServices_DIR "${CPPUS_LIBRARY_DIR}/../share/cppmicroservices3/cmake")
# Modify our CMAKE_MODULE_PATH # Modify our CMAKE_MODULE_PATH
...@@ -53,16 +50,18 @@ if (NOT cppus_has_d_suffix) ...@@ -53,16 +50,18 @@ if (NOT cppus_has_d_suffix)
endif() endif()
target_link_libraries(pyxacc PRIVATE xacc xacc-quantum-gate xacc-quantum-aqc ${CppUsLib} ${Boost_LIBRARIES} cpprest ${OPENSSL_LIBRARIES}) target_link_libraries(pyxacc PRIVATE xacc xacc-quantum-gate xacc-quantum-aqc ${CppUsLib} ${Boost_LIBRARIES} cpprest ${OPENSSL_LIBRARIES})
if(APPLE)
set_target_properties(pyxacc PROPERTIES INSTALL_RPATH "@loader_path/lib")
else()
set_target_properties(pyxacc PROPERTIES INSTALL_RPATH "$ORIGIN/lib")
endif()
if (FROM_SETUP_PY) if (FROM_SETUP_PY)
install(TARGETS pyxacc DESTINATION ${CMAKE_INSTALL_PREFIX}) if(APPLE)
set_target_properties(pyxacc PROPERTIES INSTALL_RPATH "@loader_path/lib")
else()
set_target_properties(pyxacc PROPERTIES INSTALL_RPATH "$ORIGIN/lib")
endif()
install(TARGETS pyxacc DESTINATION ${CMAKE_INSTALL_PREFIX})
else() else()
install(TARGETS pyxacc DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/python) if(APPLE)
set_target_properties(pyxacc PROPERTIES INSTALL_RPATH "@loader_path/..")
else()
set_target_properties(pyxacc PROPERTIES INSTALL_RPATH "$ORIGIN/..")
endif()
install(TARGETS pyxacc DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/python)
endif() endif()
#endif()
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include "GateInstruction.hpp" #include "GateInstruction.hpp"
#include "GateFunction.hpp" #include "GateFunction.hpp"
#include "GateQIR.hpp" #include "GateQIR.hpp"
#include "InstructionService.hpp"
namespace py = pybind11; namespace py = pybind11;
using namespace xacc; using namespace xacc;
...@@ -29,14 +30,12 @@ namespace pybind11 { namespace detail { ...@@ -29,14 +30,12 @@ namespace pybind11 { namespace detail {
}; };
}} // namespace pybind11::detail }} // namespace pybind11::detail
std::shared_ptr<GateInstruction> create(const std::string& name, std::vector<int> qbits, std::vector<InstructionParameter> params = std::vector<InstructionParameter>{}) { std::shared_ptr<Instruction> create(const std::string& name,
auto g = GateInstructionRegistry::instance()->create(name, qbits); std::vector<int> qbits, std::vector<InstructionParameter> params =
int idx = 0; std::vector<InstructionParameter> { }) {
for (auto& a : params) { std::cout << "HELLO WORLD " << name << "\n";
g->setParameter(idx, a); auto service = ServiceRegistry::instance()->getService<InstructionService>("gate");
idx++; return service->create(name, qbits, params);
}
return g;
} }
void setCredentials(const std::string& accelerator, const std::string& apiKey, const std::string& url = "", const std::string& userId = "") { void setCredentials(const std::string& accelerator, const std::string& apiKey, const std::string& url = "", const std::string& userId = "") {
...@@ -106,7 +105,7 @@ PYBIND11_MODULE(pyxacc, m) { ...@@ -106,7 +105,7 @@ PYBIND11_MODULE(pyxacc, m) {
// Expose the Instruction interface // Expose the Instruction interface
py::class_<xacc::Instruction, std::shared_ptr<xacc::Instruction>> inst(m, "Instruction", "Instruction wraps the XACC C++ Instruction class -" py::class_<xacc::Instruction, std::shared_ptr<xacc::Instruction>> inst(m, "Instruction", "Instruction wraps the XACC C++ Instruction class -"
" the base for all XACC intermediate representation instructions. Instructions, for example, can be common gates like Hadamard or CNOT."); " the base for all XACC intermediate representation instructions. Instructions, for example, can be common gates like Hadamard or CNOT.");
inst.def("getName", &xacc::Instruction::getName, "Return the name of this Instruction."); inst.def("name", &xacc::Instruction::name, "Return the name of this Instruction.");
inst.def("nParameters", &xacc::Instruction::nParameters, "Return the number of parameters this Instruction has."); inst.def("nParameters", &xacc::Instruction::nParameters, "Return the number of parameters this Instruction has.");
// Expose the Function interface // Expose the Function interface
...@@ -217,6 +216,7 @@ PYBIND11_MODULE(pyxacc, m) { ...@@ -217,6 +216,7 @@ PYBIND11_MODULE(pyxacc, m) {
m.def("optionExists", &xacc::optionExists, "Set an XACC framework option."); m.def("optionExists", &xacc::optionExists, "Set an XACC framework option.");
// m.def("translate", &xacc::translate, "Translate one language quantum kernel to another"); // m.def("translate", &xacc::translate, "Translate one language quantum kernel to another");
// m.def("translateWithVisitor", &xacc::translateWithVisitor, "Translate one language quantum kernel to another"); // m.def("translateWithVisitor", &xacc::translateWithVisitor, "Translate one language quantum kernel to another");
m.def("getInstructionService", &xacc::getService<InstructionService>, "");
m.def("Finalize", &xacc::Finalize, "Finalize the framework"); m.def("Finalize", &xacc::Finalize, "Finalize the framework");
py::module gatesub = m.def_submodule("gate", "Gate model quantum computing data structures."); py::module gatesub = m.def_submodule("gate", "Gate model quantum computing data structures.");
...@@ -225,7 +225,7 @@ PYBIND11_MODULE(pyxacc, m) { ...@@ -225,7 +225,7 @@ PYBIND11_MODULE(pyxacc, m) {
std::shared_ptr<xacc::quantum::GateInstruction>> gateinst(gatesub, std::shared_ptr<xacc::quantum::GateInstruction>> gateinst(gatesub,
"GateInstruction", "GateInstruction",
"GateInstruction models gate model quantum computing instructions."); "GateInstruction models gate model quantum computing instructions.");
gateinst.def("getName", &xacc::quantum::GateInstruction::getName, "Return the name of this Instruction."); gateinst.def("name", &xacc::quantum::GateInstruction::name, "Return the name of this Instruction.");
gateinst.def("bits", &xacc::quantum::GateInstruction::bits, "Return the qubits this gate operates on"); gateinst.def("bits", &xacc::quantum::GateInstruction::bits, "Return the qubits this gate operates on");
gateinst.def("nParameters", &xacc::quantum::GateInstruction::nParameters, "Return the number of parameters this gate requires."); gateinst.def("nParameters", &xacc::quantum::GateInstruction::nParameters, "Return the number of parameters this gate requires.");
gateinst.def("getParameter", &xacc::quantum::GateInstruction::getParameter, "Return the parameter at the given index"); gateinst.def("getParameter", &xacc::quantum::GateInstruction::getParameter, "Return the parameter at the given index");
...@@ -238,7 +238,7 @@ PYBIND11_MODULE(pyxacc, m) { ...@@ -238,7 +238,7 @@ PYBIND11_MODULE(pyxacc, m) {
"GateFunction description, fill this in later"); "GateFunction description, fill this in later");
gatefunction.def(py::init<const std::string&>(), "The constructor"); gatefunction.def(py::init<const std::string&>(), "The constructor");
gatefunction.def(py::init<const std::string&, std::vector<xacc::InstructionParameter>>(), "The constructor"); gatefunction.def(py::init<const std::string&, std::vector<xacc::InstructionParameter>>(), "The constructor");
gatefunction.def("getName", &xacc::quantum::GateFunction::getName, "Return the name of this Instruction."); gatefunction.def("name", &xacc::quantum::GateFunction::name, "Return the name of this Instruction.");
gatefunction.def("add", &xacc::quantum::GateFunction::addInstruction, "Add an Instruction to this function."); gatefunction.def("add", &xacc::quantum::GateFunction::addInstruction, "Add an Instruction to this function.");
gatefunction.def("toString", &xacc::quantum::GateFunction::toString, "Return the function as a string representation."); gatefunction.def("toString", &xacc::quantum::GateFunction::toString, "Return the function as a string representation.");
......
Metadata-Version: 1.0
Name: xacc
Version: 0.1.0
Summary: Hardware-agnostic quantum programming framework
Home-page: UNKNOWN
Author: Alex McCaskey
Author-email: xacc-dev@eclipse.org
License: UNKNOWN
Description: XACC provides a language and hardware agnostic programming framework for hybrid classical-quantum applications.
Platform: UNKNOWN
README.md
setup.py
python/xacc.egg-info/PKG-INFO
python/xacc.egg-info/SOURCES.txt
python/xacc.egg-info/dependency_links.txt
python/xacc.egg-info/not-zip-safe
python/xacc.egg-info/top_level.txt
tools/framework/xacc-framework
\ No newline at end of file
...@@ -62,12 +62,12 @@ public: ...@@ -62,12 +62,12 @@ public:
virtual bool kernelExists(const std::string& name) { virtual bool kernelExists(const std::string& name) {
return std::any_of(kernels.cbegin(), kernels.cend(), return std::any_of(kernels.cbegin(), kernels.cend(),
[=](std::shared_ptr<Function> i) {return i->getName() == name;}); [=](std::shared_ptr<Function> i) {return i->name() == name;});
} }
virtual std::shared_ptr<Function> getKernel(const std::string& name) { virtual std::shared_ptr<Function> getKernel(const std::string& name) {
for (auto f : kernels) { for (auto f : kernels) {
if (f->getName() == name) { if (f->name() == name) {
return f; return f;
} }
} }
......
...@@ -30,7 +30,7 @@ protected: ...@@ -30,7 +30,7 @@ protected:
std::list<InstPtr> instructions; std::list<InstPtr> instructions;
std::string name; std::string _name;
public: public:
...@@ -41,7 +41,7 @@ public: ...@@ -41,7 +41,7 @@ public:
* @param id * @param id
* @param name * @param name
*/ */
DWKernel(std::string kernelName) : name(kernelName) { DWKernel(std::string kernelName) : _name(kernelName) {
} }
virtual const int nInstructions() { virtual const int nInstructions() {
...@@ -104,8 +104,12 @@ public: ...@@ -104,8 +104,12 @@ public:
* Return the name of this function * Return the name of this function
* @return * @return
*/ */
virtual const std::string getName() { virtual const std::string name() const {
return name; return _name;
}
virtual const std::string description() const {
return "";
} }
/** /**
......
...@@ -95,10 +95,12 @@ public: ...@@ -95,10 +95,12 @@ public:
* *
* @return name The name of this Instruction * @return name The name of this Instruction
*/ */
virtual const std::string getName() { virtual const std::string name() const {
return "dw-qmi"; return "dw-qmi";
} }
virtual const std::string description() const {
return "";
}
virtual const std::string getTag() { virtual const std::string getTag() {
return ""; return "";
} }
......
...@@ -30,7 +30,7 @@ BOOST_AUTO_TEST_CASE(checkDWKernelConstruction) { ...@@ -30,7 +30,7 @@ BOOST_AUTO_TEST_CASE(checkDWKernelConstruction) {
kernel.addInstruction(qmi3); kernel.addInstruction(qmi3);
BOOST_VERIFY(kernel.nInstructions() == 3); BOOST_VERIFY(kernel.nInstructions() == 3);
BOOST_VERIFY(kernel.getName() == "foo"); BOOST_VERIFY(kernel.name() == "foo");
BOOST_VERIFY(kernel.getInstruction(0) == qmi); BOOST_VERIFY(kernel.getInstruction(0) == qmi);
BOOST_VERIFY(kernel.getInstruction(1) == qmi2); BOOST_VERIFY(kernel.getInstruction(1) == qmi2);
BOOST_VERIFY(kernel.getInstruction(2) == qmi3); BOOST_VERIFY(kernel.getInstruction(2) == qmi3);
......
...@@ -57,7 +57,6 @@ usFunctionEmbedResources(TARGET ${LIBRARY_NAME} ...@@ -57,7 +57,6 @@ usFunctionEmbedResources(TARGET ${LIBRARY_NAME}
) )
link_directories(${Boost_LIBRARY_DIR}) link_directories(${Boost_LIBRARY_DIR})
set(CppUsLib CppMicroServicesd) set(CppUsLib CppMicroServicesd)
link_directories(${CPPUS_LIBRARY_DIR}) link_directories(${CPPUS_LIBRARY_DIR})
......
...@@ -19,6 +19,22 @@ ...@@ -19,6 +19,22 @@
#include "cppmicroservices/BundleContext.h" #include "cppmicroservices/BundleContext.h"
#include "cppmicroservices/ServiceProperties.h" #include "cppmicroservices/ServiceProperties.h"
#include "GateInstructionService.hpp"
#include "Hadamard.hpp"
#include "CNOT.hpp"
#include "X.hpp"
#include "Y.hpp"
#include "Z.hpp"
#include "ConditionalFunction.hpp"
#include "Rz.hpp"
#include "Rx.hpp"
#include "Ry.hpp"
#include "CPhase.hpp"
#include "Swap.hpp"
#include "Measure.hpp"
#include "Identity.hpp"
#include "CZ.hpp"
#include <memory> #include <memory>
#include <set> #include <set>
...@@ -46,6 +62,9 @@ public: ...@@ -46,6 +62,9 @@ public:
auto readout = std::make_shared<xacc::quantum::ReadoutErrorIRPreprocessor>(); auto readout = std::make_shared<xacc::quantum::ReadoutErrorIRPreprocessor>();
auto qbitmap = std::make_shared<xacc::quantum::QubitMapIRPreprocessor>(); auto qbitmap = std::make_shared<xacc::quantum::QubitMapIRPreprocessor>();
auto giservice = std::make_shared<xacc::quantum::GateInstructionService>();
context.RegisterService<xacc::InstructionService>(giservice);
context.RegisterService<xacc::Preprocessor>(kp); context.RegisterService<xacc::Preprocessor>(kp);
context.RegisterService<xacc::IRGenerator>(iqft); context.RegisterService<xacc::IRGenerator>(iqft);
context.RegisterService<xacc::IRGenerator>(qft); context.RegisterService<xacc::IRGenerator>(qft);
...@@ -53,6 +72,34 @@ public: ...@@ -53,6 +72,34 @@ public:
context.RegisterService<xacc::IRPreprocessor>(readout); context.RegisterService<xacc::IRPreprocessor>(readout);
context.RegisterService<xacc::IRPreprocessor>(qbitmap); context.RegisterService<xacc::IRPreprocessor>(qbitmap);
auto h = std::make_shared<xacc::quantum::Hadamard>();
auto cn = std::make_shared<xacc::quantum::CNOT>();
auto cp = std::make_shared<xacc::quantum::CPhase>();
auto cz = std::make_shared<xacc::quantum::CZ>();
auto id = std::make_shared<xacc::quantum::Identity>();
auto m = std::make_shared<xacc::quantum::Measure>();
auto rx = std::make_shared<xacc::quantum::Rx>();
auto ry = std::make_shared<xacc::quantum::Ry>();
auto rz = std::make_shared<xacc::quantum::Rz>();
auto x = std::make_shared<xacc::quantum::X>();
auto y = std::make_shared<xacc::quantum::Y>();
auto z = std::make_shared<xacc::quantum::Z>();
auto sw = std::make_shared<xacc::quantum::Swap>();
context.RegisterService<xacc::quantum::GateInstruction>(h);
context.RegisterService<xacc::quantum::GateInstruction>(cn);
context.RegisterService<xacc::quantum::GateInstruction>(cp);
context.RegisterService<xacc::quantum::GateInstruction>(cz);
context.RegisterService<xacc::quantum::GateInstruction>(id);
context.RegisterService<xacc::quantum::GateInstruction>(m);
context.RegisterService<xacc::quantum::GateInstruction>(rx);
context.RegisterService<xacc::quantum::GateInstruction>(ry);
context.RegisterService<xacc::quantum::GateInstruction>(rz);
context.RegisterService<xacc::quantum::GateInstruction>(x);
context.RegisterService<xacc::quantum::GateInstruction>(y);
context.RegisterService<xacc::quantum::GateInstruction>(z);
context.RegisterService<xacc::quantum::GateInstruction>(sw);
} }
/** /**
......
...@@ -77,7 +77,7 @@ std::vector<std::shared_ptr<AcceleratorBuffer>> ReadoutErrorAcceleratorBufferPos ...@@ -77,7 +77,7 @@ std::vector<std::shared_ptr<AcceleratorBuffer>> ReadoutErrorAcceleratorBufferPos
first = true; first = true;
} }
xacc::info(kernel->getName() + " - Computing measurement probability for bit string = " + localBitStr); xacc::info(kernel->name() + " - Computing measurement probability for bit string = " + localBitStr);
probs.push_back(subList[i]->computeMeasurementProbability(localBitStr)); probs.push_back(subList[i]->computeMeasurementProbability(localBitStr));
counter++; counter++;
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include "XACC.hpp" #include "XACC.hpp"
#include "GateFunction.hpp" #include "GateFunction.hpp"
#include "GateInstruction.hpp" #include "GateInstruction.hpp"
#include "GateInstructionService.hpp"
using namespace xacc; using namespace xacc;
...@@ -33,6 +34,8 @@ std::shared_ptr<IR> createXACCIR(std::unordered_map<std::string, Term> terms) { ...@@ -33,6 +34,8 @@ std::shared_ptr<IR> createXACCIR(std::unordered_map<std::string, Term> terms) {
int counter = 0; int counter = 0;
auto pi = boost::math::constants::pi<double>(); auto pi = boost::math::constants::pi<double>();
GateInstructionService gateRegistry;
// Populate GateQIR now... // Populate GateQIR now...
for (auto& inst : terms) { for (auto& inst : terms) {
...@@ -46,7 +49,7 @@ std::shared_ptr<IR> createXACCIR(std::unordered_map<std::string, Term> terms) { ...@@ -46,7 +49,7 @@ std::shared_ptr<IR> createXACCIR(std::unordered_map<std::string, Term> terms) {
// Loop over all terms in the Spin Instruction // Loop over all terms in the Spin Instruction
// and create instructions to run on the Gate QPU. // and create instructions to run on the Gate QPU.
std::vector<std::shared_ptr<xacc::quantum::GateInstruction>> measurements; std::vector<std::shared_ptr<xacc::Instruction>> measurements;
std::vector<std::pair<int, std::string>> terms; std::vector<std::pair<int, std::string>> terms;
for (auto& kv : spinInst) { for (auto& kv : spinInst) {
...@@ -58,20 +61,18 @@ std::shared_ptr<IR> createXACCIR(std::unordered_map<std::string, Term> terms) { ...@@ -58,20 +61,18 @@ std::shared_ptr<IR> createXACCIR(std::unordered_map<std::string, Term> terms) {
for (int i = terms.size() - 1; i >= 0; i--) { for (int i = terms.size() - 1; i >= 0; i--) {
auto qbit = terms[i].first; auto qbit = terms[i].first;
auto gateName = terms[i].second; auto gateName = terms[i].second;
auto gateRegistry = auto meas = gateRegistry.create("Measure",
xacc::quantum::GateInstructionRegistry::instance();
auto meas = gateRegistry->create("Measure",
std::vector<int> { qbit }); std::vector<int> { qbit });
xacc::InstructionParameter classicalIdx(qbit); xacc::InstructionParameter classicalIdx(qbit);
meas->setParameter(0, classicalIdx); meas->setParameter(0, classicalIdx);
measurements.push_back(meas); measurements.push_back(meas);
if (gateName == "X") { if (gateName == "X") {
auto hadamard = gateRegistry->create("H", std::vector<int> { auto hadamard = gateRegistry.create("H", std::vector<int> {
qbit }); qbit });
gateFunction->addInstruction(hadamard); gateFunction->addInstruction(hadamard);
} else if (gateName == "Y") { } else if (gateName == "Y") {
auto rx = gateRegistry->create("Rx", std::vector<int> { qbit }); auto rx = gateRegistry.create("Rx", std::vector<int> { qbit });
InstructionParameter p(pi / 2.0); InstructionParameter p(pi / 2.0);
rx->setParameter(0, p); rx->setParameter(0, p);
gateFunction->addInstruction(rx); gateFunction->addInstruction(rx);
...@@ -115,10 +116,11 @@ public: ...@@ -115,10 +116,11 @@ public:
BOOST_AUTO_TEST_CASE(checkSimple) { BOOST_AUTO_TEST_CASE(checkSimple) {
xacc::Initialize();
// Simple example H = X0 // Simple example H = X0
std::vector<std::string> orderedTerms{"Z0"}; std::vector<std::string> orderedTerms{"Z0"};
auto gateRegistry = GateInstructionRegistry::instance(); auto gateRegistry = xacc::getService<InstructionService>("gate");
// Construct IR for this // Construct IR for this
auto ir = createXACCIR( { { "Z0", Term { { 0, "Z" } } } }); auto ir = createXACCIR( { { "Z0", Term { { 0, "Z" } } } });
...@@ -158,6 +160,7 @@ BOOST_AUTO_TEST_CASE(checkSimple) { ...@@ -158,6 +160,7 @@ BOOST_AUTO_TEST_CASE(checkSimple) {
std::cout << "HELLO: " << fixed[0]->getExpectationValueZ() << "\n"; std::cout << "HELLO: " << fixed[0]->getExpectationValueZ() << "\n";
xacc::Finalize();
// BOOST_VERIFY(std::fabs(fixed[0]->getExpectationValueZ() - .911111) < 1e-6); // BOOST_VERIFY(std::fabs(fixed[0]->getExpectationValueZ() - .911111) < 1e-6);
} }
...@@ -54,14 +54,6 @@ public: ...@@ -54,14 +54,6 @@ public:
std::shared_ptr<Compiler> compiler, std::shared_ptr<Compiler> compiler,
std::shared_ptr<Accelerator> accelerator); std::shared_ptr<Accelerator> accelerator);
/**
* Return the name of this Preprocessor
* @return name Preprocessor name
*/
virtual const std::string getName() {
return "kernel-replacement";
}
virtual const std::string name() const { virtual const std::string name() const {
return "kernel-replacement"; return "kernel-replacement";
} }
......
...@@ -68,10 +68,6 @@ public: ...@@ -68,10 +68,6 @@ public:
return translated; return translated;
} }
virtual const std::string getName() {
return "Dummy";
}
virtual const std::string name() const { virtual const std::string name() const {
return ""; return "";
} }
......
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
#ifndef QUANTUM_GATEQIR_QFUNCTION_HPP_ #ifndef QUANTUM_GATEQIR_QFUNCTION_HPP_
#define QUANTUM_GATEQIR_QFUNCTION_HPP_ #define QUANTUM_GATEQIR_QFUNCTION_HPP_
#include "Registry.hpp"
#include "Function.hpp" #include "Function.hpp"
#include "XACC.hpp" #include "XACC.hpp"
...@@ -138,10 +137,18 @@ public: ...@@ -138,10 +137,18 @@ public:
* Return the name of this function * Return the name of this function
* @return * @return
*/ */
virtual const std::string getName() { virtual const std::string name() const {
return functionName; return functionName;
} }
/**
* Return the description of this instance
* @return description The description of this object.
*/
virtual const std::string description() const {
return "";
}
/** /**
* Return the qubits this function acts on. * Return the qubits this function acts on.
* @return * @return
...@@ -230,7 +237,7 @@ public: ...@@ -230,7 +237,7 @@ public:
if (inst->isComposite()) { if (inst->isComposite()) {
std::dynamic_pointer_cast<Function>(inst)->evaluateVariableParameters( std::dynamic_pointer_cast<Function>(inst)->evaluateVariableParameters(
runtimeParameters); runtimeParameters);
} else if (inst->isParameterized() && inst->getName() != "Measure") { } else if (inst->isParameterized() && inst->name() != "Measure") {
for (int j = 0; j < inst->nParameters(); ++j) { for (int j = 0; j < inst->nParameters(); ++j) {
auto instParam = inst->getParameter(j); auto instParam = inst->getParameter(j);
......
...@@ -14,18 +14,22 @@ ...@@ -14,18 +14,22 @@
#define QUANTUM_GATE_GATEQIR_GATEINSTRUCTION_HPP_ #define QUANTUM_GATE_GATEQIR_GATEINSTRUCTION_HPP_
#include "Instruction.hpp" #include "Instruction.hpp"
#include "Registry.hpp"
#include <boost/lexical_cast.hpp> #include <boost/lexical_cast.hpp>
#include "Cloneable.hpp"
namespace xacc { <