Commit cae1cfd5 authored by Nguyen, Thien's avatar Nguyen, Thien

Boilerplate code for QLanczos Algorithm plugin

Signed-off-by: Nguyen, Thien's avatarThien Nguyen <nguyentm@ornl.gov>
parent 84eaaff9
......@@ -33,8 +33,10 @@ public:
/**
*/
void Start(BundleContext context) {
auto c = std::make_shared<xacc::algorithm::QITE>();
context.RegisterService<xacc::Algorithm>(c);
auto qite = std::make_shared<xacc::algorithm::QITE>();
context.RegisterService<xacc::Algorithm>(qite);
auto qlanczos = std::make_shared<xacc::algorithm::QLanczos>();
context.RegisterService<xacc::Algorithm>(qlanczos);
}
/**
......
......@@ -607,5 +607,10 @@ std::vector<double> QITE::execute(const std::shared_ptr<AcceleratorBuffer> buffe
xacc::error("This method is unsupported!");
return {};
}
void QLanczos::execute(const std::shared_ptr<AcceleratorBuffer> buffer) const
{
// TODO
}
} // namespace algorithm
} // namespace xacc
\ No newline at end of file
......@@ -66,5 +66,15 @@ private:
// prepare the initial state.
int m_initialState;
};
// QLanczos Algorithm: extends QITE and
// typically provides better energy convergence.
class QLanczos : public QITE {
public:
const std::string name() const override { return "QLanczos"; }
const std::string description() const override { return ""; }
void execute(const std::shared_ptr<AcceleratorBuffer> buffer) const override;
DEFINE_ALGORITHM_CLONE(QLanczos)
};
} // namespace algorithm
} // namespace xacc
......@@ -12,4 +12,7 @@
# *******************************************************************************/
include_directories(${CMAKE_BINARY_DIR})
add_xacc_test(QITE)
target_link_libraries(QITETester xacc xacc-pauli)
\ No newline at end of file
target_link_libraries(QITETester xacc xacc-pauli)
add_xacc_test(QLanczos)
target_link_libraries(QLanczosTester xacc xacc-pauli)
\ No newline at end of file
/*******************************************************************************
* Copyright (c) 2020 UT-Battelle, LLC.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Eclipse Distribution License v1.0 which accompanies this
* distribution. The Eclipse Public License is available at
* http://www.eclipse.org/legal/epl-v10.html and the Eclipse Distribution
*License is available at https://eclipse.org/org/documents/edl-v10.php
*
* Contributors:
* Thien Nguyen - initial API and implementation
*******************************************************************************/
#include <gtest/gtest.h>
#include "xacc.hpp"
#include "xacc_service.hpp"
TEST(QLanczosTester, checkSimple)
{
// TODO
}
int main(int argc, char **argv) {
xacc::Initialize(argc, argv);
::testing::InitGoogleTest(&argc, argv);
auto ret = RUN_ALL_TESTS();
xacc::Finalize();
return ret;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment