Commit 52db5221 authored by Mccaskey, Alex's avatar Mccaskey, Alex
Browse files

removed nlopt submodule

parent f6574f98
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
[submodule "runtime/nlopt-optimizers/nlopt"]
	path = runtime/nlopt-optimizers/nlopt
	url = https://github.com/stevengj/nlopt

runtime/algorithm.hpp

deleted100644 → 0
+0 −38
Original line number Diff line number Diff line
#ifndef RUNTIME_ALGORITHM_HPP_
#define RUNTIME_ALGORITHM_HPP_

#include "Identifiable.hpp"
#include <memory>

namespace xacc {
class Observable;
class AcceleratorBuffer;
class Function;
class Accelerator;
} // namespace xacc

namespace qcor {

class Optimizer;
namespace algorithm {

class Algorithm : public xacc::Identifiable {

protected:
  std::shared_ptr<xacc::Function> kernel;
  std::shared_ptr<xacc::AcceleratorBuffer> buffer;
  std::shared_ptr<xacc::Accelerator> accelerator;
public:
  void initialize(std::shared_ptr<xacc::Function> k,
                   std::shared_ptr<xacc::Accelerator> acc,
                  std::shared_ptr<xacc::AcceleratorBuffer> b) {
    kernel = k;
    buffer = b;
    accelerator = acc;
  }

  virtual void execute(xacc::Observable &observable, Optimizer &optimizer) = 0;
};
} // namespace algorithm
} // namespace qcor
#endif
 No newline at end of file

runtime/algorithms/CMakeLists.txt

deleted100644 → 0
+0 −1
Original line number Diff line number Diff line
add_subdirectory(vqe)
 No newline at end of file
+0 −37
Original line number Diff line number Diff line

set(LIBRARY_NAME qcor-algorithm-vqe)

file(GLOB SRC *.cpp)

usfunctiongetresourcesource(TARGET ${LIBRARY_NAME} OUT SRC)
usfunctiongeneratebundleinit(TARGET ${LIBRARY_NAME} OUT SRC)

add_library(${LIBRARY_NAME} SHARED ${SRC})

target_include_directories(
  ${LIBRARY_NAME}
  PUBLIC . ../..)

target_link_libraries(${LIBRARY_NAME} PUBLIC CppMicroServices)

set(_bundle_name qcor_algorithm_vqe)
set_target_properties(${LIBRARY_NAME}
                      PROPERTIES COMPILE_DEFINITIONS
                                 US_BUNDLE_NAME=${_bundle_name}
                                 US_BUNDLE_NAME
                                 ${_bundle_name})

usfunctionembedresources(TARGET
                         ${LIBRARY_NAME}
                         WORKING_DIRECTORY
                         ${CMAKE_CURRENT_SOURCE_DIR}
                         FILES
                         manifest.json)

qcor_enable_rpath(${LIBRARY_NAME})

if(QCOR_BUILD_TESTS)
  add_subdirectory(tests)
endif()

install(TARGETS ${LIBRARY_NAME} DESTINATION ${CMAKE_INSTALL_PREFIX}/plugins)
+0 −35
Original line number Diff line number Diff line
#include "vqe.hpp"

#include "cppmicroservices/BundleActivator.h"
#include "cppmicroservices/BundleContext.h"
#include "cppmicroservices/ServiceProperties.h"

#include <memory>
#include <set>

using namespace cppmicroservices;

namespace {

/**
 */
class US_ABI_LOCAL VQEActivator : public BundleActivator {

public:
  VQEActivator() {}

  /**
   */
  void Start(BundleContext context) {
    auto c = std::make_shared<qcor::algorithm::VQE>();
    context.RegisterService<qcor::algorithm::Algorithm>(c);
  }

  /**
   */
  void Stop(BundleContext /*context*/) {}
};

} // namespace

CPPMICROSERVICES_EXPORT_BUNDLE_ACTIVATOR(VQEActivator)
Loading