Skip to content

Commit 2e3a48f

Browse files
🎨 pre-commit fixes
1 parent 26029ae commit 2e3a48f

3 files changed

Lines changed: 32 additions & 25 deletions

File tree

CMakeLists.txt

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,15 @@ include(PackageAddTest)
2424
include(Cache)
2525
include(AddMQTCoreLibrary)
2626

27-
# include(FetchContent)
28-
# FetchContent_Declare(
29-
# armadillo
30-
# GIT_REPOSITORY https://gitlab.com/conradsnicta/armadillo-code.git
31-
# GIT_TAG 15.0.1
32-
# )
27+
# include(FetchContent) FetchContent_Declare( armadillo GIT_REPOSITORY
28+
# https://gitlab.com/conradsnicta/armadillo-code.git GIT_TAG 15.0.1 )
3329
# FetchContent_MakeAvailable(armadillo)
3430
find_package(Armadillo 15 REQUIRED)
3531
if(Armadillo_FOUND AND NOT TARGET Armadillo::Armadillo)
3632
add_library(Armadillo::Armadillo INTERFACE IMPORTED)
3733
set_target_properties(
38-
Armadillo::Armadillo
39-
PROPERTIES
40-
INTERFACE_LINK_LIBRARIES "${ARMADILLO_LIBRARIES}"
41-
INTERFACE_INCLUDE_DIRECTORIES "${ARMADILLO_INCLUDE_DIRS}"
42-
)
34+
Armadillo::Armadillo PROPERTIES INTERFACE_LINK_LIBRARIES "${ARMADILLO_LIBRARIES}"
35+
INTERFACE_INCLUDE_DIRECTORIES "${ARMADILLO_INCLUDE_DIRS}")
4336
endif()
4437

4538
option(BUILD_MQT_CORE_BINDINGS "Build the MQT Core Python bindings" OFF)

mlir/lib/Dialect/MQTOpt/Transforms/GateDecomposition.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ struct GateDecomposition final
4040
config.setUseTopDownTraversal(true);
4141

4242
// Apply patterns in an iterative and greedy manner.
43-
if (mlir::failed(mlir::applyPatternsGreedily(op, std::move(patterns), config))) {
43+
if (mlir::failed(
44+
mlir::applyPatternsGreedily(op, std::move(patterns), config))) {
4445
signalPassFailure();
4546
}
4647
}

mlir/lib/Dialect/MQTOpt/Transforms/a.cpp

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
/*
2+
* Copyright (c) 2023 - 2025 Chair for Design Automation, TUM
3+
* Copyright (c) 2025 Munich Quantum Software Company GmbH
4+
* All rights reserved.
5+
*
6+
* SPDX-License-Identifier: MIT
7+
*
8+
* Licensed under the MIT License
9+
*/
10+
111
#include <array>
212
#include <complex>
313
#include <iomanip>
@@ -32,7 +42,7 @@ matrix4x4 zgemm2(matrix4x4 a, matrix4x4 b) {
3242
qfp z__1;
3343
qfp z__2;
3444
qfp temp;
35-
qfp alpha {1.0, 0.0};
45+
qfp alpha{1.0, 0.0};
3646
for (auto j = 0; j < i__1; ++j) {
3747
for (auto i__ = 0; i__ < 4; ++i__) {
3848
auto i__3 = i__ + j * 4;
@@ -71,18 +81,17 @@ matrix4x4 zgemm2(matrix4x4 a, matrix4x4 b) {
7181
}
7282

7383
int zgemm_(char* transa, char* transb, integer* m, integer* n, integer* k,
74-
doublecomplex* alpha, matrix4x4 a, integer* lda,
75-
matrix4x4 b, integer* ldb, doublecomplex* beta,
76-
matrix4x4& c__, integer* ldc);
84+
doublecomplex* alpha, matrix4x4 a, integer* lda, matrix4x4 b,
85+
integer* ldb, doublecomplex* beta, matrix4x4& c__, integer* ldc);
7786
matrix4x4 zgemm(matrix4x4 a, matrix4x4 b) {
7887
qfp alpha{1.0, 0.0};
7988
qfp beta{1.0, 0.0};
8089
int dimension = 4;
8190
matrix4x4 result{};
8291
// zgemm_("n", "n", &dimension, &dimension, &dimension, &alpha, a.data(),
8392
// &dimension, b.data(), &dimension, &beta, result.data(), &dimension);
84-
zgemm_("N", "N", &dimension, &dimension, &dimension, &alpha, a,
85-
&dimension, b, &dimension, &beta, result, &dimension);
93+
zgemm_("N", "N", &dimension, &dimension, &dimension, &alpha, a, &dimension, b,
94+
&dimension, &beta, result, &dimension);
8695
return result;
8796
}
8897

@@ -91,8 +100,7 @@ void d_cnjg(doublecomplex* r, doublecomplex* z) { *r = std::conj(*z); }
91100
/* Subroutine */ int zgemm_(char* transa, char* transb, integer* m, integer* n,
92101
integer* k, doublecomplex* alpha, matrix4x4 a,
93102
integer* lda, matrix4x4 b, integer* ldb,
94-
doublecomplex* beta, matrix4x4& c__,
95-
integer* ldc) {
103+
doublecomplex* beta, matrix4x4& c__, integer* ldc) {
96104
/* System generated locals */
97105
integer a_dim1, a_offset, b_dim1, b_offset, c_dim1, c_offset, i__1, i__2,
98106
i__3, i__4, i__5, i__6;
@@ -360,14 +368,16 @@ void d_cnjg(doublecomplex* r, doublecomplex* z) { *r = std::conj(*z); }
360368
beta->imag() * c__[i__4 - c_offset].imag()),
361369
z__1.imag(beta->real() * c__[i__4 - c_offset].imag() +
362370
beta->imag() * c__[i__4 - c_offset].real());
363-
c__[i__3 - c_offset].real(z__1.real()), c__[i__3 - c_offset].imag(z__1.imag());
371+
c__[i__3 - c_offset].real(z__1.real()),
372+
c__[i__3 - c_offset].imag(z__1.imag());
364373
/* L60: */
365374
}
366375
}
367376
i__2 = *k;
368377
for (l = 1; l <= i__2; ++l) {
369378
i__3 = l + j * b_dim1;
370-
if (b[i__3 - b_offset].real() != 0. || b[i__3 - b_offset].imag() != 0.) {
379+
if (b[i__3 - b_offset].real() != 0. ||
380+
b[i__3 - b_offset].imag() != 0.) {
371381
i__3 = l + j * b_dim1;
372382
z__1.real(alpha->real() * b[i__3 - b_offset].real() -
373383
alpha->imag() * b[i__3 - b_offset].imag()),
@@ -385,7 +395,8 @@ void d_cnjg(doublecomplex* r, doublecomplex* z) { *r = std::conj(*z); }
385395
temp.imag() * a[i__6 - a_offset].real());
386396
z__1.real(c__[i__5 - c_offset].real() + z__2.real()),
387397
z__1.imag(c__[i__5 - c_offset].imag() + z__2.imag());
388-
c__[i__4 - c_offset].real(z__1.real()), c__[i__4 - c_offset].imag(z__1.imag());
398+
c__[i__4 - c_offset].real(z__1.real()),
399+
c__[i__4 - c_offset].imag(z__1.imag());
389400
/* L70: */
390401
}
391402
}
@@ -421,7 +432,8 @@ void d_cnjg(doublecomplex* r, doublecomplex* z) { *r = std::conj(*z); }
421432
alpha->imag() * temp.imag()),
422433
z__1.imag(alpha->real() * temp.imag() +
423434
alpha->imag() * temp.real());
424-
c__[i__3 - c_offset].real(z__1.real()), c__[i__3 - c_offset].imag(z__1.imag());
435+
c__[i__3 - c_offset].real(z__1.real()),
436+
c__[i__3 - c_offset].imag(z__1.imag());
425437
} else {
426438
i__3 = i__ + j * c_dim1;
427439
z__2.real(alpha->real() * temp.real() -
@@ -435,7 +447,8 @@ void d_cnjg(doublecomplex* r, doublecomplex* z) { *r = std::conj(*z); }
435447
beta->imag() * c__[i__4 - c_offset].real());
436448
z__1.real(z__2.real() + z__3.real()),
437449
z__1.imag(z__2.imag() + z__3.imag());
438-
c__[i__3 - c_offset].real(z__1.real()), c__[i__3 - c_offset].imag(z__1.imag());
450+
c__[i__3 - c_offset].real(z__1.real()),
451+
c__[i__3 - c_offset].imag(z__1.imag());
439452
}
440453
/* L110: */
441454
}

0 commit comments

Comments
 (0)