File StochasticNoiseOperationTable.hpp

Data structure for caching computed results of stochastic operations.

Self-contained copy of the MQT Core dd::StochasticNoiseOperationTable that was removed alongside the density-matrix support. The number of cached operations is provided explicitly instead of being derived from the (removed) noise OpTypes.

namespace dd
namespace ddsim
template<class Edge>
class StochasticNoiseOperationTable

Public Functions

inline StochasticNoiseOperationTable(const std::size_t nv, const std::size_t numberOfStochasticOperations)
inline const auto &getTable() const

Get a reference to the table.

inline const auto &getStats() const noexcept

Get a reference to the statistics.

inline void resize(const std::size_t nq)
inline void insert(std::uint8_t kind, qc::Qubit target, const Edge &r)
inline Edge *lookup(std::uint8_t kind, qc::Qubit target)
inline void clear()

Private Members

std::size_t nvars
std::size_t numberOfOperations
std::vector<std::vector<Edge>> table
dd::TableStatistics stats = {}