35#include "Constants.hpp"
36#include "ir/parsers/qasm3_parser/Parser.hpp"
37#include "ir/parsers/qasm3_parser/Statement.hpp"
38#include "ir/parsers/qasm3_parser/Types.hpp"
39#include "mlir/Pass/Pass.h"
40#include "mlir/Pass/PassManager.h"
41#include "mlir/Pass/PassRegistry.h"
62namespace mqss::interfaces {
82 std::vector<mlir::Value> vecParams,
83 std::vector<mlir::Value> vecControls,
84 std::vector<mlir::Value> vecTargets,
128void insertGate(
const std::shared_ptr<qasm3::GateCallStatement> &gateCall,
129 OpBuilder &builder, Location loc, mlir::Operation *inOp,
148 const std::vector<std::shared_ptr<qasm3::Statement>> &statements,
149 OpBuilder &builder, Location loc, mlir::Operation *inOp,
176 const std::vector<std::shared_ptr<qasm3::Statement>> &program,
177 OpBuilder &builder, Location loc, mlir::Operation *inOp);
size_t getNumControls(const std::string &gateType)
Given a gate type as a string, this functions returns the number of control outputs associated with t...
void insertGate(const std::shared_ptr< qasm3::GateCallStatement > &gateCall, OpBuilder &builder, Location loc, mlir::Operation *inOp, QASMVectorToQuakeVector QASMToVectors)
This function inserts a gate into a MLIR/Quake module.
void insertQASMGateIntoQuakeModule(std::string gateId, OpBuilder &builder, Location loc, std::vector< mlir::Value > vecParams, std::vector< mlir::Value > vecControls, std::vector< mlir::Value > vecTargets, bool adj)
Given a gate type as a string, this functions inserts the corresponding Quake gate in the given build...
double evaluateExpression(const std::shared_ptr< qasm3::Expression > &expr)
Function that evaluates a numeric expression in the AST.
std::vector< std::pair< std::string, int > > QuantumVectorsOrder
The QuantumVectorsOrder is list of pairs. Each entry of the pair is composed of a string that is the ...
Definition QASMToQuake.hpp:60
void parseAndInsertMeasurements(const std::vector< std::shared_ptr< qasm3::Statement > > &statements, OpBuilder &builder, Location loc, mlir::Operation *inOp, QASMVectorToQuakeVector QASMToVectors)
This function inserts measurements into a MLIR/Quake module.
std::tuple< QASMVectorToQuakeVector, QuantumVectorsOrder > insertAllocatedQubits(const std::vector< std::shared_ptr< qasm3::Statement > > &program, OpBuilder &builder, Location loc, mlir::Operation *inOp)
This function return the quantum vectors and its order, given a Abstract Syntax Tree of a QASM progra...
bool isMultiQubitGate(const std::string &gateType)
Given a gate type as a string, this functions checks if the given gate type has control outputs.
std::unordered_map< std::string, mlir::Value > QASMVectorToQuakeVector
The QASMVectorToQuakeVector is a map of type std::unordered_map<std::string, mlir::Value>....
Definition QASMToQuake.hpp:52