XACC
default_placement.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 QUANTUM_GATE_COMPILER_DEFAULT_PLACEMENT_HPP_
14 #define QUANTUM_GATE_COMPILER_DEFAULT_PLACEMENT_HPP_
15 
16 #include "IRTransformation.hpp"
17 namespace xacc {
18 namespace quantum {
19 
21 
22 public:
23  DefaultPlacement() {}
24  void apply(std::shared_ptr<CompositeInstruction> program,
25  const std::shared_ptr<Accelerator> accelerator,
26  const HeterogeneousMap& options = {}) override {
27  if (options.keyExists<std::vector<int>>("qubit-map")) {
28  auto map = options.get<std::vector<int>>("qubit-map");
29  std::vector<std::size_t> tmp;
30  for (auto& m : map) tmp.push_back(m);
31  program->mapBits(tmp);
32  }
33  return;
34  }
35  const IRTransformationType type() const override {return IRTransformationType::Placement;}
36 
37  const std::string name() const override { return "default-placement"; }
38  const std::string description() const override { return ""; }
39 
40 
41 };
42 } // namespace quantum
43 } // namespace xacc
44 
45 #endif
Definition: IRTransformation.hpp:24
Definition: Accelerator.hpp:25
const std::string description() const override
Definition: default_placement.hpp:38
Definition: heterogeneous.hpp:45
Definition: default_placement.hpp:20
const std::string name() const override
Definition: default_placement.hpp:37