Commit 98ca9c07 authored by Mccaskey, Alex's avatar Mccaskey, Alex
Browse files

removing some old print stmts


Signed-off-by: Mccaskey, Alex's avatarAlex McCaskey <mccaskeyaj@ornl.gov>
parent d6c489c1
Pipeline #97885 passed with stage
in 78 minutes and 12 seconds
......@@ -66,6 +66,21 @@ TEST(XASMCompilerTester, checkCanParse) {
rx(3.3) q[0];
measure q -> c;
)"));
std::cout << "hello\n";
EXPECT_TRUE(compiler->canParse(R"(
__qpu__ void ansatz(qreg q, std::vector<double> x) {
for (int i = 0; i < 2; i++) {
Rx(q[i], x[i]);
Rz(q[i], x[2 + i]);
}
CX(q[1], q[0]);
for (int i = 0; i < 2; i++) {
Rx(q[i], x[i + 4]);
Rz(q[i], x[i + 4 + 2]);
Rx(q[i], x[i + 4 + 4]);
}
})"));
}
TEST(XASMCompilerTester, checkSimple) {
......
......@@ -36,6 +36,9 @@ bool XASMCompiler::canParse(const std::string &src) {
void syntaxError(Recognizer *recognizer, Token *offendingSymbol,
size_t line, size_t charPositionInLine,
const std::string &msg, std::exception_ptr e) override {
std::cout << "XASM Cannot parse this source: " << msg << "\n";
std::cout << line << ": " << charPositionInLine << "\n";
std::cout << offendingSymbol->getText() << "\n";
throw std::runtime_error("Cannot parse this XASM source string.");
}
};
......
......@@ -27,8 +27,6 @@ namespace xacc {
void XASMListener::for_stmt_update_inst_args(Instruction *inst) {
auto parameters = inst->getParameters();
for (int i = 0; i < parameters.size(); i++) {
std::cout << "HELLO: " << inst->name() << ", " << parameters[i].toString()
<< "\n";
if (parameters[i].isVariable()) {
auto arg = function->getArgument(parameters[i].toString());
......@@ -42,13 +40,11 @@ void XASMListener::for_stmt_update_inst_args(Instruction *inst) {
[](char c) { return !std::isalpha(c); }),
param_str.end());
std::cout << "IS THSI HRE: " << param_str << "\n";
arg = function->getArgument(param_str);
if (arg && arg->type.find("std::vector<double>") != std::string::npos) {
// this was a container-like type
// give the instruction a mapping from i to vector idx
std::cout << "HELLO " << arg->name << "\n";
auto tmp_str = parameters[i].toString();
tmp_str.erase(
......
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