-
Notifications
You must be signed in to change notification settings - Fork 86
/
QuilCompiler.hpp
73 lines (59 loc) · 1.97 KB
/
QuilCompiler.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/*******************************************************************************
* Copyright (c) 2019 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:
* Alexander J. McCaskey - initial API and implementation
*******************************************************************************/
#ifndef IMPLS_RIGETTI_QUILCOMPILER_HPP_
#define IMPLS_RIGETTI_QUILCOMPILER_HPP_
#include "Compiler.hpp"
#include "Utils.hpp"
namespace xacc {
namespace quantum {
/**
*/
class QuilCompiler : public xacc::Compiler {
public:
QuilCompiler();
/**
* Translate Quil to the
* XACC intermediate representation.
*
* @return ir XACC intermediate representation
*/
virtual std::shared_ptr<xacc::IR> compile(const std::string &src,
std::shared_ptr<Accelerator> acc);
bool canParse(const std::string& src) override;
/**
*
* @param src
* @return
*/
virtual std::shared_ptr<xacc::IR> compile(const std::string &src);
/**
* This produces a Quil source code representation of the
* given IR Function
*
* @param function The XACC IR Function to translate
* @return src The source code as a string
*/
virtual const std::string translate(std::shared_ptr<CompositeInstruction> function);
virtual const std::string name() const { return "quil"; }
virtual const std::string description() const {
return "The Quil Compiler compiles kernels written in the Quil "
"intermediate language.";
}
/**
* The destructor
*/
virtual ~QuilCompiler() {}
};
} // namespace quantum
} // namespace xacc
#endif