Skip to content

Commit

Permalink
🩹 fixes for noise-aware simulation in DDSIM (#551)
Browse files Browse the repository at this point in the history
## 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 <[email protected]>
  • Loading branch information
burgholzer authored Feb 23, 2024
1 parent 1db2860 commit 8c199aa
Show file tree
Hide file tree
Showing 5 changed files with 526 additions and 409 deletions.
32 changes: 31 additions & 1 deletion include/mqt-core/dd/DDpackageConfig.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#pragma once

#include "operations/OpType.hpp"

#include <cstddef>

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

// The number of different quantum operations. I.e., the number of operations
// defined in the QFR OpType.hpp This parameter is required to initialize the
// defined in OpType.hpp. This parameter is required to initialize the
// StochasticNoiseOperationTable.hpp
static constexpr std::size_t STOCHASTIC_CACHE_OPS = 1;
};

struct StochasticNoiseSimulatorDDPackageConfig : public dd::DDPackageConfig {
static constexpr std::size_t STOCHASTIC_CACHE_OPS = qc::OpType::OpCount;
};

struct DensityMatrixSimulatorDDPackageConfig : public dd::DDPackageConfig {
static constexpr std::size_t UT_DM_NBUCKET = 65536U;
static constexpr std::size_t UT_DM_INITIAL_ALLOCATION_SIZE = 4096U;

static constexpr std::size_t CT_DM_DM_MULT_NBUCKET = 16384U;
static constexpr std::size_t CT_DM_ADD_NBUCKET = 16384U;
static constexpr std::size_t CT_DM_NOISE_NBUCKET = 4096U;

static constexpr std::size_t UT_MAT_NBUCKET = 16384U;
static constexpr std::size_t CT_MAT_ADD_NBUCKET = 4096U;
static constexpr std::size_t CT_VEC_ADD_NBUCKET = 4096U;
static constexpr std::size_t CT_MAT_CONJ_TRANS_NBUCKET = 4096U;

static constexpr std::size_t CT_MAT_MAT_MULT_NBUCKET = 1U;
static constexpr std::size_t CT_MAT_VEC_MULT_NBUCKET = 1U;
static constexpr std::size_t UT_VEC_NBUCKET = 1U;
static constexpr std::size_t UT_VEC_INITIAL_ALLOCATION_SIZE = 1U;
static constexpr std::size_t UT_MAT_INITIAL_ALLOCATION_SIZE = 1U;
static constexpr std::size_t CT_VEC_KRON_NBUCKET = 1U;
static constexpr std::size_t CT_MAT_KRON_NBUCKET = 1U;
static constexpr std::size_t CT_VEC_INNER_PROD_NBUCKET = 1U;
static constexpr std::size_t STOCHASTIC_CACHE_OPS = 1U;
};
} // namespace dd
Loading

0 comments on commit 8c199aa

Please sign in to comment.