Skip to content

Commit 8c199aa

Browse files
authored
🩹 fixes for noise-aware simulation in DDSIM (#551)
## Description This PR contains a couple of fixes for the noise-aware simulation techniques currently being reworked in cda-tum/mqt-ddsim#321. More precisely, this PR makes sure that the corresponding DD package configs are already defined in the mqt-core library and that explicit instantiations for the methods relevant for DDSIM are in place. ## Checklist: <!--- This checklist serves as a reminder of a couple of things that ensure your pull request will be merged swiftly. --> - [x] The pull request only contains commits that are related to it. - [x] I have added appropriate tests and documentation. - [x] I have made sure that all CI jobs on GitHub pass. - [x] The pull request introduces no new warnings and follows the project's style guidelines. --------- Signed-off-by: burgholzer <burgholzer@me.com>
1 parent 1db2860 commit 8c199aa

5 files changed

+526
-409
lines changed

include/mqt-core/dd/DDpackageConfig.hpp

+31-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#pragma once
22

3+
#include "operations/OpType.hpp"
4+
35
#include <cstddef>
46

57
namespace dd {
@@ -25,8 +27,36 @@ struct DDPackageConfig {
2527
static constexpr std::size_t CT_DM_ADD_NBUCKET = 1U;
2628

2729
// The number of different quantum operations. I.e., the number of operations
28-
// defined in the QFR OpType.hpp This parameter is required to initialize the
30+
// defined in OpType.hpp. This parameter is required to initialize the
2931
// StochasticNoiseOperationTable.hpp
3032
static constexpr std::size_t STOCHASTIC_CACHE_OPS = 1;
3133
};
34+
35+
struct StochasticNoiseSimulatorDDPackageConfig : public dd::DDPackageConfig {
36+
static constexpr std::size_t STOCHASTIC_CACHE_OPS = qc::OpType::OpCount;
37+
};
38+
39+
struct DensityMatrixSimulatorDDPackageConfig : public dd::DDPackageConfig {
40+
static constexpr std::size_t UT_DM_NBUCKET = 65536U;
41+
static constexpr std::size_t UT_DM_INITIAL_ALLOCATION_SIZE = 4096U;
42+
43+
static constexpr std::size_t CT_DM_DM_MULT_NBUCKET = 16384U;
44+
static constexpr std::size_t CT_DM_ADD_NBUCKET = 16384U;
45+
static constexpr std::size_t CT_DM_NOISE_NBUCKET = 4096U;
46+
47+
static constexpr std::size_t UT_MAT_NBUCKET = 16384U;
48+
static constexpr std::size_t CT_MAT_ADD_NBUCKET = 4096U;
49+
static constexpr std::size_t CT_VEC_ADD_NBUCKET = 4096U;
50+
static constexpr std::size_t CT_MAT_CONJ_TRANS_NBUCKET = 4096U;
51+
52+
static constexpr std::size_t CT_MAT_MAT_MULT_NBUCKET = 1U;
53+
static constexpr std::size_t CT_MAT_VEC_MULT_NBUCKET = 1U;
54+
static constexpr std::size_t UT_VEC_NBUCKET = 1U;
55+
static constexpr std::size_t UT_VEC_INITIAL_ALLOCATION_SIZE = 1U;
56+
static constexpr std::size_t UT_MAT_INITIAL_ALLOCATION_SIZE = 1U;
57+
static constexpr std::size_t CT_VEC_KRON_NBUCKET = 1U;
58+
static constexpr std::size_t CT_MAT_KRON_NBUCKET = 1U;
59+
static constexpr std::size_t CT_VEC_INNER_PROD_NBUCKET = 1U;
60+
static constexpr std::size_t STOCHASTIC_CACHE_OPS = 1U;
61+
};
3262
} // namespace dd

0 commit comments

Comments
 (0)