MLIR Passes v1.0
Loading...
Searching...
No Matches
Transforms.hpp File Reference

Go to the source code of this file.

Macros

#define CUDAQ_PREFIX_FUNCTION   "__nvqpp__mlirgen__"
 Macro defining the prefix of each quantum kernel generated by MLIR/Quake. This macro is used to identify MLIR/Quake quantum kernels.
 
#define GEN_PASS_DECL
 Macro for declaring passes for registration.
 
#define GEN_PASS_REGISTRATION
 Macro for pass registration.
 

Functions

std::unique_ptr< mlir::Pass > mqss::opt::createQuakeQMapPass (Architecture &architecture, const Configuration &settings)
 MLIR/Quake pass to perform the mapping of quantum circuits to superconducting devices using the MQT-QMAP.
 
std::unique_ptr< mlir::Pass > mqss::opt::createCommuteCxRxPass ()
 MLIR/Quake pass that operates on the pattern composed of Cx and Rx.
 
std::unique_ptr< mlir::Pass > mqss::opt::createCommuteCxXPass ()
 MLIR/Quake pass that operates on the pattern composed of two-qubits Cx and a single-qubit Cx.
 
std::unique_ptr< mlir::Pass > mqss::opt::createCommuteCxZPass ()
 MLIR/Quake pass that operates on the pattern composed of two-qubits Cx and a single-qubit Z.
 
std::unique_ptr< mlir::Pass > mqss::opt::createCommuteRxCxPass ()
 MLIR/Quake pass that operates on the pattern composed of Rx and a two-qubits CNot.
 
std::unique_ptr< mlir::Pass > mqss::opt::createCommuteXCxPass ()
 MLIR/Quake pass that operates on the pattern composed of X and a two-qubits CNot.
 
std::unique_ptr< mlir::Pass > mqss::opt::createCommuteZCxPass ()
 MLIR/Quake pass that operates on the pattern composed of Z and a two-qubits CNot.
 
std::unique_ptr< mlir::Pass > mqss::opt::createCancellationDoubleCxPass ()
 MLIR/Quake pass that operates on the pattern composed of CNot and CNot.
 
std::unique_ptr< mlir::Pass > mqss::opt::createNormalizeArgAnglePass ()
 MLIR/Quake pass that operates on each rotation Rx, Ry, and Rz gate in a given quantum circuit.
 
std::unique_ptr< mlir::Pass > mqss::opt::createCancellationNullRotationPass ()
 MLIR/Quake pass that operates on each rotation Rx, Ry, and Rz gate in a given quantum circuit and removes each rotation that results in a null rotation.
 
std::unique_ptr< mlir::Pass > mqss::opt::createHXHToZPass ()
 MLIR/Quake pass that operates on the pattern composed of Hadamard, X and Hadamard a replaces it by a Z gate.
 
std::unique_ptr< mlir::Pass > mqss::opt::createHZHToXPass ()
 MLIR/Quake pass that operates on the pattern composed of Hadamard, Z and Hadamard a replaces it by a X gate.
 
std::unique_ptr< mlir::Pass > mqss::opt::createSwitchPauliHPass ()
 MLIR/Quake pass that operates on the pattern composed of Pauli single-qubit gates {X, Y, Z} and Hadamard a switches accordingly.
 
std::unique_ptr< mlir::Pass > mqss::opt::createSwitchXHPass ()
 MLIR/Quake pass that operates on the pattern composed of single-qubit gate X and Hadamard a switches to Z gate and Hadamard.
 
std::unique_ptr< mlir::Pass > mqss::opt::createSwitchYHPass ()
 MLIR/Quake pass that operates on the pattern composed of single-qubit gate Y and Hadamard a switches to Y and Hadamard.
 
std::unique_ptr< mlir::Pass > mqss::opt::createSwitchZHPass ()
 MLIR/Quake pass that operates on the pattern composed of single-qubit gate Z and Hadamard to X and Hadamard.
 
std::unique_ptr< mlir::Pass > mqss::opt::createSwitchHXPass ()
 MLIR/Quake pass that operates on the pattern composed of Hadamard and single-qubit gate X a switches to Z gate and Hadamard.
 
std::unique_ptr< mlir::Pass > mqss::opt::createSwitchHYPass ()
 MLIR/Quake pass that operates on the pattern composed of Hadamard and single-qubit gate Y a switches to Y gate and Hadamard.
 
std::unique_ptr< mlir::Pass > mqss::opt::createSwitchHZPass ()
 MLIR/Quake pass that operates on the pattern composed of Hadamard and single-qubit gate Z a switches to X gate and Hadamard.
 

Detailed Description

Header file that defines the signature for each MLIR/Quake defined into the Munich Quantum Software Stack (MQSS).

This header must be included to use the collection of transforms passes that are part of the MQSS.

Function Documentation

◆ createCancellationDoubleCxPass()

std::unique_ptr< mlir::Pass > mqss::opt::createCancellationDoubleCxPass ( )

MLIR/Quake pass that operates on the pattern composed of CNot and CNot.

This method constructs an mlir::Pass of the type DoubleCnotCancellationPass. This pass operates on all the patterns composed of a CNot and CNot operating on the same control and target, in a given MLIR/Quake module and removes it from the module, as follows.

Returns
An mlir::Pass object containing the definition of the DoubleCnotCancellationPass. This mlir::Pass object has to be passed to an mlir::PassManager to take effect on any given MLIR module.

◆ createCancellationNullRotationPass()

std::unique_ptr< mlir::Pass > mqss::opt::createCancellationNullRotationPass ( )

MLIR/Quake pass that operates on each rotation Rx, Ry, and Rz gate in a given quantum circuit and removes each rotation that results in a null rotation.

This method constructs an mlir::Pass of the type NullRotationCancellationPass. This pass operates on rotation Rx, Ry, and Rz gates an removes the rotation if the angle results in a null rotation, as follows.

Returns
An mlir::Pass object containing the definition of the NullRotationCancellationPass. This mlir::Pass object has to be passed to an mlir::PassManager to take effect on any given MLIR module.

◆ createCommuteCxRxPass()

std::unique_ptr< mlir::Pass > mqss::opt::createCommuteCxRxPass ( )

MLIR/Quake pass that operates on the pattern composed of Cx and Rx.

This method constructs an mlir::Pass of the type CommuteCNotRxPass. This pass operates on all the patterns composed of a Cx and Rx in a given MLIR/Quake module and performs its replacement by a pattern composed of Rx and Cx (commuting), as follows.

Returns
An mlir::Pass object containing the definition of the CommuteCNotRxPass. This mlir::Pass object has to be passed to an mlir::PassManager to take effect on any given MLIR module.

◆ createCommuteCxXPass()

std::unique_ptr< mlir::Pass > mqss::opt::createCommuteCxXPass ( )

MLIR/Quake pass that operates on the pattern composed of two-qubits Cx and a single-qubit Cx.

This method constructs an mlir::Pass of the type CommuteCNotXPass. This pass operates on all the patterns composed of a two-qubits Cx and single-qubit Cx in a given MLIR/Quake module and performs its replacement by a pattern composed of the single-qubit Cx and the two-qubits Cx (commuting), as follows.

Returns
An mlir::Pass object containing the definition of the CommuteCNotXPass. This mlir::Pass object has to be passed to an mlir::PassManager to take effect on any given MLIR module.

◆ createCommuteCxZPass()

std::unique_ptr< mlir::Pass > mqss::opt::createCommuteCxZPass ( )

MLIR/Quake pass that operates on the pattern composed of two-qubits Cx and a single-qubit Z.

This method constructs an mlir::Pass of the type CommuteCNotZPass. This pass operates on all the patterns composed of a two-qubits Cx and single-qubit Z in a given MLIR/Quake module and performs its replacement by a pattern composed of the single-qubit Z and the two-qubits Cx (commuting), as follows.

Example 1:

Example 2:

Returns
An mlir::Pass object containing the definition of the CommuteCNotZPass. This mlir::Pass object has to be passed to an mlir::PassManager to take effect on any given MLIR module.

◆ createCommuteRxCxPass()

std::unique_ptr< mlir::Pass > mqss::opt::createCommuteRxCxPass ( )

MLIR/Quake pass that operates on the pattern composed of Rx and a two-qubits CNot.

This method constructs an mlir::Pass of the type CommuteRxCNotPass. This pass operates on all the patterns composed of a Rx and a two-qubits CNot in a given MLIR/Quake module and performs its replacement by a pattern composed of CNot and Rx (commuting), as follows.

Returns
An mlir::Pass object containing the definition of the CommuteRxCNotPass. This mlir::Pass object has to be passed to an mlir::PassManager to take effect on any given MLIR module.

◆ createCommuteXCxPass()

std::unique_ptr< mlir::Pass > mqss::opt::createCommuteXCxPass ( )

MLIR/Quake pass that operates on the pattern composed of X and a two-qubits CNot.

This method constructs an mlir::Pass of the type CommuteXCNotPass. This pass operates on all the patterns composed of a single qubit X and a two-qubits CNot in a given MLIR/Quake module and performs its replacement by a pattern composed of CNot and X (commuting), as follows.

Returns
An mlir::Pass object containing the definition of the CommuteXCNotPass. This mlir::Pass object has to be passed to an mlir::PassManager to take effect on any given MLIR module.

◆ createCommuteZCxPass()

std::unique_ptr< mlir::Pass > mqss::opt::createCommuteZCxPass ( )

MLIR/Quake pass that operates on the pattern composed of Z and a two-qubits CNot.

This method constructs an mlir::Pass of the type CommuteZCNotPass. This pass operates on all the patterns composed of a Z and a two-qubits CNot in a given MLIR/Quake module and performs its replacement by a pattern composed of CNot and Z (commuting), as follows.

Example 1:

Example 2:

Returns
An mlir::Pass object containing the definition of the CommuteZCNotPass. This mlir::Pass object has to be passed to an mlir::PassManager to take effect on any given MLIR module.

◆ createHXHToZPass()

std::unique_ptr< mlir::Pass > mqss::opt::createHXHToZPass ( )

MLIR/Quake pass that operates on the pattern composed of Hadamard, X and Hadamard a replaces it by a Z gate.

This method constructs an mlir::Pass of the type HXHToZPass. This pass operates on the pattern Hadamard, X and Hadamard, as follows.

Returns
An mlir::Pass object containing the definition of the HXHToZPass. This mlir::Pass object has to be passed to an mlir::PassManager to take effect on any given MLIR module.

◆ createHZHToXPass()

std::unique_ptr< mlir::Pass > mqss::opt::createHZHToXPass ( )

MLIR/Quake pass that operates on the pattern composed of Hadamard, Z and Hadamard a replaces it by a X gate.

This method constructs an mlir::Pass of the type HZHToXPass. This pass operates on the pattern Hadamard, Z and Hadamard, as follows.

Returns
An mlir::Pass object containing the definition of the HZHToXPass. This mlir::Pass object has to be passed to an mlir::PassManager to take effect on any given MLIR module.

◆ createNormalizeArgAnglePass()

std::unique_ptr< mlir::Pass > mqss::opt::createNormalizeArgAnglePass ( )

MLIR/Quake pass that operates on each rotation Rx, Ry, and Rz gate in a given quantum circuit.

This method constructs an mlir::Pass of the type NormalizeArgAnglePass. This pass operates on rotation Rx, Ry, and Rz gates an normalizes the angle, as follows.

Returns
An mlir::Pass object containing the definition of the NormalizeArgAnglePass. This mlir::Pass object has to be passed to an mlir::PassManager to take effect on any given MLIR module.

◆ createQuakeQMapPass()

std::unique_ptr< mlir::Pass > mqss::opt::createQuakeQMapPass ( Architecture & architecture,
const Configuration & settings )

MLIR/Quake pass to perform the mapping of quantum circuits to superconducting devices using the MQT-QMAP.

This method constructs an mlir::Pass of the type QuakeQMapPass. This pass operates on any MLIR/Quake module and performs the mapping of any given quantum circuit to an specific quantum superconducting device.

Parameters
[out]architectureis the selected superconducting quantum device configuration, including important information for mapping, i.e., connectivity of all the qubits
[out]settingsdefines the configuration of the mapper, for more details visit MQT-QMAP official documentation.

For example, given the following connectivity graph describing the relation of qubits in quantum arquictecture:

The MQT-QMAP tool re-maps the following two input circuits as follows:

Returns
An mlir::Pass object containing the definition of the QuakeQMapPass. This mlir::Pass object has to be passed to an mlir::PassManager to take effect on any given MLIR module. After applying this pass, any given circuit is transformed to fulfill the physical constraints imposed by the selected quantum device architecture and settings.

◆ createSwitchHXPass()

std::unique_ptr< mlir::Pass > mqss::opt::createSwitchHXPass ( )

MLIR/Quake pass that operates on the pattern composed of Hadamard and single-qubit gate X a switches to Z gate and Hadamard.

This method constructs an mlir::Pass of the type HadamardAndXGateSwitchPass. This pass operates on the pattern Hadamard and X, as follows.

Returns
An mlir::Pass object containing the definition of the HadamardAndXGateSwitchPass. This mlir::Pass object has to be passed to an mlir::PassManager to take effect on any given MLIR module.

◆ createSwitchHYPass()

std::unique_ptr< mlir::Pass > mqss::opt::createSwitchHYPass ( )

MLIR/Quake pass that operates on the pattern composed of Hadamard and single-qubit gate Y a switches to Y gate and Hadamard.

This method constructs an mlir::Pass of the type HadamardAndYGateSwitchPass. This pass operates on the pattern Hadamard and Y, as follows.

Returns
An mlir::Pass object containing the definition of the HadamardAndYGateSwitchPass. This mlir::Pass object has to be passed to an mlir::PassManager to take effect on any given MLIR module.

◆ createSwitchHZPass()

std::unique_ptr< mlir::Pass > mqss::opt::createSwitchHZPass ( )

MLIR/Quake pass that operates on the pattern composed of Hadamard and single-qubit gate Z a switches to X gate and Hadamard.

This method constructs an mlir::Pass of the type HadamardAndZGateSwitchPass. This pass operates on the pattern Hadamard and Z, as follows.

Returns
An mlir::Pass object containing the definition of the HadamardAndZGateSwitchPass. This mlir::Pass object has to be passed to an mlir::PassManager to take effect on any given MLIR module.

◆ createSwitchPauliHPass()

std::unique_ptr< mlir::Pass > mqss::opt::createSwitchPauliHPass ( )

MLIR/Quake pass that operates on the pattern composed of Pauli single-qubit gates {X, Y, Z} and Hadamard a switches accordingly.

This method constructs an mlir::Pass of the type PauliGateAndHadamardSwitchPass. This pass operates on the pattern {X,Y,Z} and Hadamard, as follows.

Example 1:

Example 2:

Example 3:

Returns
An mlir::Pass object containing the definition of the PauliGateAndHadamardSwitchPass. This mlir::Pass object has to be passed to an mlir::PassManager to take effect on any given MLIR module.

◆ createSwitchXHPass()

std::unique_ptr< mlir::Pass > mqss::opt::createSwitchXHPass ( )

MLIR/Quake pass that operates on the pattern composed of single-qubit gate X and Hadamard a switches to Z gate and Hadamard.

This method constructs an mlir::Pass of the type XGateAndHadamardSwitchPass. This pass operates on the pattern X and Hadamard, as follows.

Returns
An mlir::Pass object containing the definition of the XGateAndHadamardSwitchPass. This mlir::Pass object has to be passed to an mlir::PassManager to take effect on any given MLIR module.

◆ createSwitchYHPass()

std::unique_ptr< mlir::Pass > mqss::opt::createSwitchYHPass ( )

MLIR/Quake pass that operates on the pattern composed of single-qubit gate Y and Hadamard a switches to Y and Hadamard.

This method constructs an mlir::Pass of the type YGateAndHadamardSwitchPass. This pass operates on the pattern Y and Hadamard, as follows.

Returns
An mlir::Pass object containing the definition of the YGateAndHadamardSwitchPass. This mlir::Pass object has to be passed to an mlir::PassManager to take effect on any given MLIR module.

◆ createSwitchZHPass()

std::unique_ptr< mlir::Pass > mqss::opt::createSwitchZHPass ( )

MLIR/Quake pass that operates on the pattern composed of single-qubit gate Z and Hadamard to X and Hadamard.

This method constructs an mlir::Pass of the type ZGateAndHadamardSwitchPass. This pass operates on the pattern Z and Hadamard, as follows.

Returns
An mlir::Pass object containing the definition of the ZGateAndHadamardSwitchPass. This mlir::Pass object has to be passed to an mlir::PassManager to take effect on any given MLIR module.