XACC
vqe.hpp
1 /*******************************************************************************
2  * Copyright (c) 2019 UT-Battelle, LLC.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * and Eclipse Distribution License v1.0 which accompanies this
6  * distribution. The Eclipse Public License is available at
7  * http://www.eclipse.org/legal/epl-v10.html and the Eclipse Distribution
8  *License is available at https://eclipse.org/org/documents/edl-v10.php
9  *
10  * Contributors:
11  * Alexander J. McCaskey - initial API and implementation
12  *******************************************************************************/
13 #ifndef XACC_ALGORITHM_VQE_HPP_
14 #define XACC_ALGORITHM_VQE_HPP_
15 
16 #include "Algorithm.hpp"
17 #include "AlgorithmGradientStrategy.hpp"
18 
19 namespace xacc {
20 namespace algorithm {
21 class VQE : public Algorithm {
22 protected:
23  Observable * observable;
24  Optimizer * optimizer;
25  CompositeInstruction * kernel;
26  Accelerator * accelerator;
27  std::vector<double> initial_params;
28  AlgorithmGradientStrategy * gradientStrategy;
29 
30  HeterogeneousMap parameters;
31 
32 public:
33  bool initialize(const HeterogeneousMap &parameters) override;
34  const std::vector<std::string> requiredParameters() const override;
35 
36  void execute(const std::shared_ptr<AcceleratorBuffer> buffer) const override;
37  std::vector<double> execute(const std::shared_ptr<AcceleratorBuffer> buffer,
38  const std::vector<double> &parameters) override;
39  const std::string name() const override { return "vqe"; }
40  const std::string description() const override { return ""; }
41  DEFINE_ALGORITHM_CLONE(VQE)
42 };
43 } // namespace algorithm
44 } // namespace xacc
45 #endif
const std::string name() const override
Definition: vqe.hpp:39
Definition: Algorithm.hpp:34
Definition: Accelerator.hpp:25
Definition: Accelerator.hpp:44
Definition: heterogeneous.hpp:45
Definition: vqe.hpp:21
Definition: Optimizer.hpp:48
const std::string description() const override
Definition: vqe.hpp:40
Definition: Observable.hpp:31
Definition: CompositeInstruction.hpp:72
Definition: AlgorithmGradientStrategy.hpp:21