MLIR Passes v1.0
Loading...
Searching...
No Matches
Transforms.hpp
Go to the documentation of this file.
1/* This code and any associated documentation is provided "as is"
2
3Copyright 2024 Munich Quantum Software Stack Project
4
5Licensed under the Apache License, Version 2.0 with LLVM Exceptions (the
6"License"); you may not use this file except in compliance with the License.
7You may obtain a copy of the License at
8
9https://github.com/Munich-Quantum-Software-Stack/passes/blob/develop/LICENSE
10
11Unless required by applicable law or agreed to in writing, software
12distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14License for the specific language governing permissions and limitations under
15the License.
16
17SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
18*************************************************************************
19 author Martin Letras
20 date February 2025
21 version 1.0
22*************************************************************************/
33#pragma once
34
35#include "mlir/Pass/Pass.h"
36#include "mlir/Pass/PassManager.h"
37#include "mlir/Pass/PassRegistry.h"
38
39#include "llvm/Support/raw_ostream.h"
40
41#include <stdexcept>
42// #include "qdmi.h"
43#include "sc/heuristic/HeuristicMapper.hpp"
44
50#define CUDAQ_PREFIX_FUNCTION "__nvqpp__mlirgen__"
51
52namespace mqss::opt {
53
82std::unique_ptr<mlir::Pass> createQuakeQMapPass(Architecture &architecture,
83 const Configuration &settings);
84
98std::unique_ptr<mlir::Pass> createCommuteCxRxPass();
99
115std::unique_ptr<mlir::Pass> createCommuteCxXPass();
116
135std::unique_ptr<mlir::Pass> createCommuteCxZPass();
136
151std::unique_ptr<mlir::Pass> createCommuteRxCxPass();
152
167std::unique_ptr<mlir::Pass> createCommuteXCxPass();
168
186std::unique_ptr<mlir::Pass> createCommuteZCxPass();
187
202std::unique_ptr<mlir::Pass> createCancellationDoubleCxPass();
203
217std::unique_ptr<mlir::Pass> createNormalizeArgAnglePass();
218
234std::unique_ptr<mlir::Pass> createCancellationNullRotationPass();
235
248std::unique_ptr<mlir::Pass> createHXHToZPass();
249
262std::unique_ptr<mlir::Pass> createHZHToXPass();
263
284std::unique_ptr<mlir::Pass> createSwitchPauliHPass();
285
299std::unique_ptr<mlir::Pass> createSwitchXHPass();
300
314std::unique_ptr<mlir::Pass> createSwitchYHPass();
315
329std::unique_ptr<mlir::Pass> createSwitchZHPass();
330
344std::unique_ptr<mlir::Pass> createSwitchHXPass();
345
359std::unique_ptr<mlir::Pass> createSwitchHYPass();
360
374std::unique_ptr<mlir::Pass> createSwitchHZPass();
375} // namespace mqss::opt
376
381// declarative passes
382#define GEN_PASS_DECL
387#define GEN_PASS_REGISTRATION
388#include "Passes/Transforms.h.inc"
std::unique_ptr< mlir::Pass > createQuakeQMapPass(Architecture &architecture, const Configuration &settings)
MLIR/Quake pass to perform the mapping of quantum circuits to superconducting devices using the MQT-Q...
std::unique_ptr< mlir::Pass > createSwitchPauliHPass()
MLIR/Quake pass that operates on the pattern composed of Pauli single-qubit gates {X,...
std::unique_ptr< mlir::Pass > createSwitchHZPass()
MLIR/Quake pass that operates on the pattern composed of Hadamard and single-qubit gate Z a switches ...
std::unique_ptr< mlir::Pass > createSwitchHYPass()
MLIR/Quake pass that operates on the pattern composed of Hadamard and single-qubit gate Y a switches ...
std::unique_ptr< mlir::Pass > createCommuteCxRxPass()
MLIR/Quake pass that operates on the pattern composed of Cx and Rx.
std::unique_ptr< mlir::Pass > createHZHToXPass()
MLIR/Quake pass that operates on the pattern composed of Hadamard, Z and Hadamard a replaces it by a ...
std::unique_ptr< mlir::Pass > createCommuteCxZPass()
MLIR/Quake pass that operates on the pattern composed of two-qubits Cx and a single-qubit Z.
std::unique_ptr< mlir::Pass > createSwitchZHPass()
MLIR/Quake pass that operates on the pattern composed of single-qubit gate Z and Hadamard to X and Ha...
std::unique_ptr< mlir::Pass > createHXHToZPass()
MLIR/Quake pass that operates on the pattern composed of Hadamard, X and Hadamard a replaces it by a ...
std::unique_ptr< mlir::Pass > createSwitchYHPass()
MLIR/Quake pass that operates on the pattern composed of single-qubit gate Y and Hadamard a switches ...
std::unique_ptr< mlir::Pass > createCancellationNullRotationPass()
MLIR/Quake pass that operates on each rotation Rx, Ry, and Rz gate in a given quantum circuit and rem...
std::unique_ptr< mlir::Pass > createCommuteRxCxPass()
MLIR/Quake pass that operates on the pattern composed of Rx and a two-qubits CNot.
std::unique_ptr< mlir::Pass > createCommuteCxXPass()
MLIR/Quake pass that operates on the pattern composed of two-qubits Cx and a single-qubit Cx.
std::unique_ptr< mlir::Pass > createSwitchHXPass()
MLIR/Quake pass that operates on the pattern composed of Hadamard and single-qubit gate X a switches ...
std::unique_ptr< mlir::Pass > createCommuteXCxPass()
MLIR/Quake pass that operates on the pattern composed of X and a two-qubits CNot.
std::unique_ptr< mlir::Pass > createSwitchXHPass()
MLIR/Quake pass that operates on the pattern composed of single-qubit gate X and Hadamard a switches ...
std::unique_ptr< mlir::Pass > createCommuteZCxPass()
MLIR/Quake pass that operates on the pattern composed of Z and a two-qubits CNot.
std::unique_ptr< mlir::Pass > createNormalizeArgAnglePass()
MLIR/Quake pass that operates on each rotation Rx, Ry, and Rz gate in a given quantum circuit.
std::unique_ptr< mlir::Pass > createCancellationDoubleCxPass()
MLIR/Quake pass that operates on the pattern composed of CNot and CNot.