Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Lowering Ion dialect to llvm dialect #1466

Open
wants to merge 35 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
ec6c1cc
Added convert-ion-to-llvm pass infrustructure
mehrdad2m Jan 16, 2025
3b8c0aa
Added IonOp lowering
mehrdad2m Jan 16, 2025
82b5228
Added test for IonOp lowering
mehrdad2m Jan 16, 2025
4550b41
make format
mehrdad2m Jan 16, 2025
74e1fbe
Added Type conversion
mehrdad2m Jan 16, 2025
8e0bb28
code factor
mehrdad2m Jan 16, 2025
c38ce84
Simplify position
mehrdad2m Jan 16, 2025
a790a6e
make test more readable
mehrdad2m Jan 16, 2025
3eb0d4b
make format
mehrdad2m Jan 16, 2025
a11d2fc
make format
mehrdad2m Jan 16, 2025
0255597
Added pulseOp lowring
mehrdad2m Jan 20, 2025
36f97b6
Add Transition index
mehrdad2m Jan 20, 2025
638fbfd
Added test case
mehrdad2m Jan 20, 2025
a87a17f
make format
mehrdad2m Jan 20, 2025
6921087
formating
mehrdad2m Jan 20, 2025
3545ba1
remove reduntant code
mehrdad2m Jan 20, 2025
6d7467a
[PLXPR] Add fixture to ensure capture has been disabled after test ru…
erick-xanadu Jan 16, 2025
2be908f
Fix failing standalone plugin tests (#1465)
joeycarter Jan 16, 2025
68ff565
Fix rendering in autograph.rst (#1467)
dime10 Jan 16, 2025
83069d5
[no ci] bump nightly version
ringo-but-quantum Jan 17, 2025
d15a1b7
[no ci] bump nightly version
ringo-but-quantum Jan 18, 2025
9c63407
Fix failing test after API change in MultiControlledX (#1472)
joeycarter Jan 20, 2025
9200c66
Fixed Z gate name matching in Ion decomposition pass (#1469)
mehrdad2m Jan 20, 2025
fc76b07
Fix pulse target qubit in MS gate lowering (#1473)
paul0403 Jan 20, 2025
f287fbe
Fix some typos in 'tracing.py' doc strings (#1474)
rauletorresc Jan 20, 2025
8512093
[no ci] bump nightly version
ringo-but-quantum Jan 21, 2025
f56c232
Optimized Ion Dialect to minimize redundant code in IonOp (#1471)
mehrdad2m Jan 21, 2025
2cbdd08
Ensure an `ion.yield` operation is returning a region output to all p…
paul0403 Jan 21, 2025
a35ff8f
[no ci] bump nightly version
ringo-but-quantum Jan 22, 2025
6124de7
[no ci] bump nightly version
ringo-but-quantum Jan 23, 2025
0580d78
Remove test randomization on mac (#1481)
dime10 Jan 23, 2025
e3ad98b
Fixed incorrect use of walrus operator (#1478)
lasradorohan Jan 23, 2025
a6073f8
Add label string to levelAttr
mehrdad2m Jan 23, 2025
08f4dc9
Added ssa value for the output of pulseOp
mehrdad2m Jan 24, 2025
8360fcf
Merge branch 'main' into ion-to-llvm-lowering
mehrdad2m Jan 27, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions mlir/include/Ion/Transforms/Passes.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@
namespace catalyst {

std::unique_ptr<mlir::Pass> createQuantumToIonPass();
std::unique_ptr<mlir::Pass> createIonConversionPass();

} // namespace catalyst
12 changes: 12 additions & 0 deletions mlir/include/Ion/Transforms/Passes.td
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,16 @@ def QuantumToIonPass : Pass<"quantum-to-ion"> {
let constructor = "catalyst::createQuantumToIonPass()";
}

def IonConversionPass : Pass<"convert-ion-to-llvm"> {
let summary = "Perform a dialect conversion from ion to LLVM";

let dependentDialects = [
"mlir::func::FuncDialect",
"mlir::LLVM::LLVMDialect",
"catalyst::quantum::QuantumDialect"
];

let constructor = "catalyst::createIonConversionPass()";
}

#endif // ION_PASSES
2 changes: 2 additions & 0 deletions mlir/include/Ion/Transforms/Patterns.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ namespace catalyst {
namespace ion {

void populateQuantumToIonPatterns(mlir::RewritePatternSet &, const OQDDatabaseManager &);
void populateConversionPatterns(mlir::LLVMTypeConverter &typeConverter,
mlir::RewritePatternSet &patterns);

} // namespace ion
} // namespace catalyst
1 change: 1 addition & 0 deletions mlir/lib/Catalyst/Transforms/RegisterAllPasses.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ void catalyst::registerAllCatalystPasses()
mlir::registerPass(catalyst::createGradientLoweringPass);
mlir::registerPass(catalyst::createHloCustomCallLoweringPass);
mlir::registerPass(catalyst::createInlineNestedModulePass);
mlir::registerPass(catalyst::createIonConversionPass);
mlir::registerPass(catalyst::createMemrefCopyToLinalgCopyPass);
mlir::registerPass(catalyst::createMemrefToLLVMWithTBAAPass);
mlir::registerPass(catalyst::createMitigationLoweringPass);
Expand Down
2 changes: 2 additions & 0 deletions mlir/lib/Driver/CompilerDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
#include "Gradient/IR/GradientDialect.h"
#include "Gradient/IR/GradientInterfaces.h"
#include "Gradient/Transforms/Passes.h"
#include "Ion/IR/IonDialect.h"
#include "Mitigation/IR/MitigationDialect.h"
#include "Mitigation/Transforms/Passes.h"
#include "Quantum/IR/QuantumDialect.h"
Expand Down Expand Up @@ -294,6 +295,7 @@ void registerAllCatalystDialects(DialectRegistry &registry)
// Catalyst
registry.insert<CatalystDialect>();
registry.insert<quantum::QuantumDialect>();
registry.insert<ion::IonDialect>();
registry.insert<gradient::GradientDialect>();
registry.insert<mitigation::MitigationDialect>();
}
Expand Down
4 changes: 4 additions & 0 deletions mlir/lib/Ion/Transforms/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
set(LIBRARY_NAME ion-transforms)

file(GLOB SRC
ion-to-llvm.cpp
ConversionPatterns.cpp
quantum_to_ion.cpp
QuantumToIonPatterns.cpp
)
Expand Down Expand Up @@ -37,6 +39,8 @@ target_link_libraries(${LIBRARY_NAME} PRIVATE tomlplusplus::tomlplusplus)
# tmol++ source has a warning which we want to ignore
# This is because toml++ ships source-only, not an executable, so we have to compile it
set_source_files_properties(
ion-to-llvm.cpp
ConversionPatterns.cpp
quantum_to_ion.cpp
QuantumToIonPatterns.cpp
PROPERTIES
Expand Down
Loading
Loading