Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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/PauliFrame/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
add_subdirectory(IR)
add_subdirectory(Transforms)
27 changes: 27 additions & 0 deletions mlir/include/PauliFrame/Transforms/Passes.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Copyright 2025 Xanadu Quantum Technologies Inc.

// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at

// http://www.apache.org/licenses/LICENSE-2.0

// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#pragma once

#include "mlir/Pass/Pass.h"

namespace catalyst {
namespace pauli_frame {

#define GEN_PASS_DECL
#define GEN_PASS_REGISTRATION
#include "PauliFrame/Transforms/Passes.h.inc"

} // namespace pauli_frame
} // namespace catalyst
30 changes: 30 additions & 0 deletions mlir/include/PauliFrame/Transforms/Passes.td
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// Copyright 2025 Xanadu Quantum Technologies Inc.

// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at

// http://www.apache.org/licenses/LICENSE-2.0

// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef PAULI_FRAME_PASSES
#define PAULI_FRAME_PASSES

include "mlir/Pass/PassBase.td"

def CliffordTToPauliFramePass : Pass<"to-pauli-frame"> {
let summary = "Apply the Pauli frame tracking protocols to a Clifford+T quantum program.";

let dependentDialects = [
"scf::SCFDialect",
"catalyst::quantum::QuantumDialect",
"catalyst::pauli_frame::PauliFrameDialect"
];
}

#endif // PAULI_FRAME_PASSES
25 changes: 25 additions & 0 deletions mlir/include/PauliFrame/Transforms/Patterns.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Copyright 2025 Xanadu Quantum Technologies Inc.

// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at

// http://www.apache.org/licenses/LICENSE-2.0

// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#pragma once

#include "mlir/IR/PatternMatch.h"

namespace catalyst {
namespace pauli_frame {

void populateCliffordTToPauliFramePatterns(mlir::RewritePatternSet &patterns);

} // namespace pauli_frame
} // namespace catalyst
2 changes: 2 additions & 0 deletions mlir/include/RegisterAllPasses.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "Ion/Transforms/Passes.h"
#include "MBQC/Transforms/Passes.h"
#include "Mitigation/Transforms/Passes.h"
#include "PauliFrame/Transforms/Passes.h"
#include "QEC/Transforms/Passes.h"
#include "Quantum/Transforms/Passes.h"
#include "Test/Transforms/Passes.h"
Expand All @@ -34,6 +35,7 @@ inline void registerAllPasses()
ion::registerIonPasses();
mbqc::registerMBQCPasses();
mitigation::registerMitigationPasses();
pauli_frame::registerPauliFramePasses();
qec::registerQECPasses();
quantum::registerQuantumPasses();
test::registerTestPasses();
Expand Down
2 changes: 2 additions & 0 deletions mlir/lib/Driver/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ set(LIBS
mbqc-transforms
MLIRMitigation
mitigation-transforms
MLIRPauliFrame
pauli-frame-transforms
MLIRIon
ion-transforms
MLIRRTIO
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 @@ -72,6 +72,7 @@
#include "Ion/IR/IonDialect.h"
#include "MBQC/IR/MBQCDialect.h"
#include "Mitigation/IR/MitigationDialect.h"
#include "PauliFrame/IR/PauliFrameDialect.h"
#include "QEC/IR/QECDialect.h"
#include "Quantum/IR/QuantumDialect.h"
#include "Quantum/Transforms/BufferizableOpInterfaceImpl.h"
Expand Down Expand Up @@ -380,6 +381,7 @@ void registerAllCatalystDialects(DialectRegistry &registry)
registry.insert<rtio::RTIODialect>();
registry.insert<gradient::GradientDialect>();
registry.insert<mitigation::MitigationDialect>();
registry.insert<pauli_frame::PauliFrameDialect>();
}
} // namespace

Expand Down
1 change: 1 addition & 0 deletions mlir/lib/PauliFrame/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
add_subdirectory(IR)
add_subdirectory(Transforms)
27 changes: 27 additions & 0 deletions mlir/lib/PauliFrame/Transforms/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
set(LIBRARY_NAME pauli-frame-transforms)


file(GLOB SRC
CliffordTToPauliFramePatterns.cpp
to_pauli_frame.cpp
)

get_property(dialect_libs GLOBAL PROPERTY MLIR_DIALECT_LIBS)
get_property(conversion_libs GLOBAL PROPERTY MLIR_CONVERSION_LIBS)
set(LIBS
${dialect_libs}
${conversion_libs}
MLIRPauliFrame
)

set(DEPENDS
MLIRPauliFramePassIncGen
)

add_mlir_library(${LIBRARY_NAME} STATIC ${SRC} LINK_LIBS PRIVATE ${LIBS} DEPENDS ${DEPENDS})
target_compile_features(${LIBRARY_NAME} PUBLIC cxx_std_20)

target_include_directories(${LIBRARY_NAME} PUBLIC
.
${PROJECT_SOURCE_DIR}/include
${CMAKE_BINARY_DIR}/include)
Loading