Loading examples/qaoa/qaoa_example.cpp +0 −3 Original line number Diff line number Diff line Loading @@ -13,9 +13,6 @@ __qpu__ void qaoa_ansatz(qreg q, int n_steps, std::vector<double> gamma, H(q[0]); } // auto cost_ham_ptr = createObservable(cost_ham_str); // auto& cost_ham = *cost_ham_ptr.get(); // Get all non-identity hamiltonian terms // for the following exp(H_i) trotterization auto cost_terms = cost_ham.getNonIdentitySubTerms(); Loading mlir/parsers/qasm3/qasm3_visitor.hpp +1 −1 Original line number Diff line number Diff line Loading @@ -240,7 +240,7 @@ class qasm3_visitor : public qasm3::qasm3BaseVisitor { // corresponding AllocOp of a given 1d shape. mlir::Value allocate_1d_memory(mlir::Location location, int64_t shape, mlir::Type type) { llvm::ArrayRef<int64_t> shaperef{shape}; llvm::ArrayRef<int64_t> shaperef(shape); auto mem_type = mlir::MemRefType::get(shaperef, type); mlir::Value allocation = builder.create<mlir::AllocaOp>(location, mem_type); Loading mlir/parsers/qasm3/utils/expression_handler.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -973,7 +973,7 @@ antlrcpp::Any qasm3_expression_generator::visitExpressionTerminator( auto int_value_type = builder.getIntegerType(bit_width); auto init_attr = mlir::IntegerAttr::get(int_value_type, 0); llvm::ArrayRef<int64_t> shaperef{1}; llvm::ArrayRef<int64_t> shaperef(1); auto mem_type = mlir::MemRefType::get(shaperef, int_value_type); mlir::Value init_allocation = builder.create<mlir::AllocaOp>(location, mem_type); Loading mlir/parsers/qasm3/utils/qasm3_utils.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -154,7 +154,7 @@ mlir::Type convertQasm3Type(qasm3::qasm3Parser::ClassicalTypeContext* ctx, auto bit_size = symbol_table.evaluate_constant_integer_expression(idx_str); mlir::Type mlir_type; llvm::ArrayRef<int64_t> shaperef{bit_size}; llvm::ArrayRef<int64_t> shaperef(bit_size); mlir_type = mlir::MemRefType::get(shaperef, result_type); return mlir_type; } else if (type == "bool") { Loading mlir/parsers/qasm3/visitor_handlers/classical_types_handler.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -385,7 +385,7 @@ antlrcpp::Any qasm3_visitor::visitBitDeclaration( auto location = get_location(builder, file_name, context); // First case is indexIdentifierList, no initialization std::size_t size = 1; int64_t size = 1; if (auto index_ident_list = context->indexIdentifierList()) { for (auto idx_identifier : index_ident_list->indexIdentifier()) { auto var_name = idx_identifier->Identifier()->getText(); Loading @@ -412,6 +412,7 @@ antlrcpp::Any qasm3_visitor::visitBitDeclaration( builder.create<mlir::StoreOp>(location, init_values[0], allocation); symbol_table.add_symbol(var_name, allocation); } else { auto allocation = allocate_1d_memory_and_initialize( location, size, builder.getI1Type(), init_values, llvm::makeArrayRef(init_indices)); Loading Loading
examples/qaoa/qaoa_example.cpp +0 −3 Original line number Diff line number Diff line Loading @@ -13,9 +13,6 @@ __qpu__ void qaoa_ansatz(qreg q, int n_steps, std::vector<double> gamma, H(q[0]); } // auto cost_ham_ptr = createObservable(cost_ham_str); // auto& cost_ham = *cost_ham_ptr.get(); // Get all non-identity hamiltonian terms // for the following exp(H_i) trotterization auto cost_terms = cost_ham.getNonIdentitySubTerms(); Loading
mlir/parsers/qasm3/qasm3_visitor.hpp +1 −1 Original line number Diff line number Diff line Loading @@ -240,7 +240,7 @@ class qasm3_visitor : public qasm3::qasm3BaseVisitor { // corresponding AllocOp of a given 1d shape. mlir::Value allocate_1d_memory(mlir::Location location, int64_t shape, mlir::Type type) { llvm::ArrayRef<int64_t> shaperef{shape}; llvm::ArrayRef<int64_t> shaperef(shape); auto mem_type = mlir::MemRefType::get(shaperef, type); mlir::Value allocation = builder.create<mlir::AllocaOp>(location, mem_type); Loading
mlir/parsers/qasm3/utils/expression_handler.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -973,7 +973,7 @@ antlrcpp::Any qasm3_expression_generator::visitExpressionTerminator( auto int_value_type = builder.getIntegerType(bit_width); auto init_attr = mlir::IntegerAttr::get(int_value_type, 0); llvm::ArrayRef<int64_t> shaperef{1}; llvm::ArrayRef<int64_t> shaperef(1); auto mem_type = mlir::MemRefType::get(shaperef, int_value_type); mlir::Value init_allocation = builder.create<mlir::AllocaOp>(location, mem_type); Loading
mlir/parsers/qasm3/utils/qasm3_utils.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -154,7 +154,7 @@ mlir::Type convertQasm3Type(qasm3::qasm3Parser::ClassicalTypeContext* ctx, auto bit_size = symbol_table.evaluate_constant_integer_expression(idx_str); mlir::Type mlir_type; llvm::ArrayRef<int64_t> shaperef{bit_size}; llvm::ArrayRef<int64_t> shaperef(bit_size); mlir_type = mlir::MemRefType::get(shaperef, result_type); return mlir_type; } else if (type == "bool") { Loading
mlir/parsers/qasm3/visitor_handlers/classical_types_handler.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -385,7 +385,7 @@ antlrcpp::Any qasm3_visitor::visitBitDeclaration( auto location = get_location(builder, file_name, context); // First case is indexIdentifierList, no initialization std::size_t size = 1; int64_t size = 1; if (auto index_ident_list = context->indexIdentifierList()) { for (auto idx_identifier : index_ident_list->indexIdentifier()) { auto var_name = idx_identifier->Identifier()->getText(); Loading @@ -412,6 +412,7 @@ antlrcpp::Any qasm3_visitor::visitBitDeclaration( builder.create<mlir::StoreOp>(location, init_values[0], allocation); symbol_table.add_symbol(var_name, allocation); } else { auto allocation = allocate_1d_memory_and_initialize( location, size, builder.getI1Type(), init_values, llvm::makeArrayRef(init_indices)); Loading