MLIR Passes v1.0
|
Go to the source code of this file.
Functions | |
Value | mqss::support::quakeDialect::createFloatValue (OpBuilder &builder, Location loc, double value) |
Function that creates an mlir::Value associated to a numeric value. | |
double | mqss::support::quakeDialect::extractDoubleArgumentValue (Operation *op) |
Function that extracts a double numeric value from a numeric value in an MLIR module. | |
int64_t | mqss::support::quakeDialect::extractIndexFromQuakeExtractRefOp (Operation *op) |
Function that extracts an index of a given ExtractRefOp operation. | |
int | mqss::support::quakeDialect::getNumberOfQubits (func::FuncOp circuit) |
Function that get the number of qubits used by a given quantum kernel. | |
int | mqss::support::quakeDialect::getNumberOfClassicalBits (func::FuncOp circuit, std::map< int, int > &measurements) |
Function that get the number of classical bits used by a given quantum kernel. | |
int | mqss::support::quakeDialect::getNumberOfClassicalBits (func::FuncOp circuit) |
Function that get the number of classical bits used by a given quantum kernel. | |
std::vector< int > | mqss::support::quakeDialect::getIndicesOfValueRange (mlir::ValueRange array) |
Function that get a vector of indices associated with a given mlir::ValueRange . | |
std::vector< double > | mqss::support::quakeDialect::getParametersValues (mlir::ValueRange array) |
Function that get a vector of numerical values associated with a given mlir::ValueRange . | |
mlir::Operation * | mqss::support::quakeDialect::getPreviousOperationOnTarget (mlir::Operation *currentOp, mlir::Value targetQubit) |
Function get the previous operation on a given target qubit. | |
mlir::Operation * | mqss::support::quakeDialect::getNextOperationOnTarget (mlir::Operation *currentOp, mlir::Value targetQubit) |
Function get the next operation on a given target qubit. | |
This header defines a set of functions that are useful to get information from MLIR modules. E.g., extract the number of qubits, the classical registers. Moreover, it also allows to define variables as MLIR constructs.
Value mqss::support::quakeDialect::createFloatValue | ( | OpBuilder & | builder, |
Location | loc, | ||
double | value ) |
Function that creates an mlir::Value
associated to a numeric value.
This functions appends an mlir::Value
into an MLIR module associated to the input OpBuilder
.
[out] | builder | is an OpBuilder object associated with a MLIR module. It is used to insert new instructions to the corresponding MLIR module. |
[in] | loc | is the location of the new inserted instruction. |
[in] | value | is the numeric value to be defined into the MLIR module. |
mlir::Value
object of the inserted numerical value. double mqss::support::quakeDialect::extractDoubleArgumentValue | ( | Operation * | op | ) |
Function that extracts a double numeric value from a numeric value in an MLIR module.
This functions extracts a double
from an MLIR Operation
.
[in] | op | is the MLIR Operation containing a numerical value. |
double
with the numerical value of op. int64_t mqss::support::quakeDialect::extractIndexFromQuakeExtractRefOp | ( | Operation * | op | ) |
Function that extracts an index of a given ExtractRefOp
operation.
Given an ExtractRefOp
, this function extracts the integer of the index pointing that reference (qubit index), returns -1 when fail.
[in] | op | is the MLIR ExtractRefOp . |
int
with the index of the given ExtractRefOp
. std::vector< int > mqss::support::quakeDialect::getIndicesOfValueRange | ( | mlir::ValueRange | array | ) |
Function that get a vector of indices associated with a given mlir::ValueRange
.
Given a mlir::ValueRange
that stores a list of indices. This function converts the mlir::ValueRange
to a vector of int
.
[in] | array | is the input mlir::ValueRange . |
mlir::ValueRange
object. mlir::Operation * mqss::support::quakeDialect::getNextOperationOnTarget | ( | mlir::Operation * | currentOp, |
mlir::Value | targetQubit ) |
Function get the next operation on a given target qubit.
Given a mlir::Operation
and a target qubit. This function get the next operation on the given target qubit, starting from currentOp
.
[in] | currentOp | is current quantum gate. |
[in] | targetQubit | is the target qubit to be used as reference. |
int mqss::support::quakeDialect::getNumberOfClassicalBits | ( | func::FuncOp | circuit | ) |
Function that get the number of classical bits used by a given quantum kernel.
Given a func::FuncOp
that stores a quantum kernel in Quake. This function returns the number of declared classical bits within the given quantum kernel.
[in] | circuit | is the input quantum kernel |
int mqss::support::quakeDialect::getNumberOfClassicalBits | ( | func::FuncOp | circuit, |
std::map< int, int > & | measurements ) |
Function that get the number of classical bits used by a given quantum kernel.
Given a func::FuncOp
that stores a quantum kernel in Quake. This function returns the number of declared classical bits within the given quantum kernel.
[in] | circuit | is the input quantum kernel |
[out] | measurements | is a std::map<int, int> . This map maps the qubits with its corresponding classical bit. The key is the qubit index and the value is the classical bit index. |
int mqss::support::quakeDialect::getNumberOfQubits | ( | func::FuncOp | circuit | ) |
Function that get the number of qubits used by a given quantum kernel.
Given a func::FuncOp
that stores a quantum kernel in Quake. This function returns the number of declared qubits within the given quantum kernel.
[in] | circuit | is the input quantum kernel |
int
with the number of declared qubits. std::vector< double > mqss::support::quakeDialect::getParametersValues | ( | mlir::ValueRange | array | ) |
Function that get a vector of numerical values associated with a given mlir::ValueRange
.
Given a mlir::ValueRange
that stores a list of parameters, i.e., rotation angles. This function converts the mlir::ValueRange
to a vector of double
.
[in] | array | is the input mlir::ValueRange containing the parameters. |
mlir::ValueRange
object. mlir::Operation * mqss::support::quakeDialect::getPreviousOperationOnTarget | ( | mlir::Operation * | currentOp, |
mlir::Value | targetQubit ) |
Function get the previous operation on a given target qubit.
Given a mlir::Operation
and a target qubit. This function get the previous operation on the given target qubit, starting from currentOp
.
[in] | currentOp | is current quantum gate. |
[in] | targetQubit | is the target qubit to be used as reference. |