File DensityNode.hpp¶
Density-matrix DD node, edge and cached-edge types.
This is a self-contained copy of the density-matrix support that used to live in the MQT Core DD package (dd::dNode, dd::dEdge, dd::dCachedEdge) before it was removed in https://github.com/munich-quantum-toolkit/core/pull/1466. It lives in the separate namespace dd::ddsim so that it can coexist with a Core version that still provides the old types.
-
namespace dd
-
namespace ddsim
-
Functions
-
struct dCachedEdge¶
- #include <DensityNode.hpp>
A density-matrix DD node with a cached (non-canonical) edge weight.
Public Functions
-
dCachedEdge() = default¶
-
inline bool operator==(const dCachedEdge &other) const¶
-
inline bool operator!=(const dCachedEdge &other) const¶
-
inline bool isTerminal() const¶
-
inline bool isIdentity(bool upToGlobalPhase = true) const¶
Public Static Functions
-
static inline dCachedEdge terminal(const dd::ComplexValue &w)¶
-
static inline dCachedEdge terminal(const std::complex<dd::fp> &w)¶
-
static inline dCachedEdge terminal(const dd::Complex &w)¶
-
static inline dCachedEdge zero()¶
-
static inline dCachedEdge one()¶
-
static auto normalize(dNode *p, const std::array<dCachedEdge, dd::NEDGE> &e, dd::MemoryManager &mm, dd::ComplexNumbers &cn) -> dCachedEdge¶
Get a normalized density-matrix DD from a fresh node and its edges.
-
dCachedEdge() = default¶
-
struct dEdge¶
- #include <DensityNode.hpp>
A weighted edge pointing to a density-matrix DD node.
Public Functions
-
inline bool isTerminal() const¶
-
inline bool isZeroTerminal() const¶
-
inline bool isOneTerminal() const¶
-
inline bool isIdentity(bool upToGlobalPhase = true) const¶
-
std::size_t size() const¶
Get the size of the DD (number of nodes including the terminal).
-
void mark() const noexcept¶
Mark the edge (and its sub-DD) as used.
-
void unmark() const noexcept¶
Unmark the edge (and its sub-DD).
Public Static Functions
-
static constexpr dEdge terminal(const dd::Complex &w)¶
Inline definitions that require the complete
dNodetype
-
inline bool isTerminal() const¶
-
struct dNode : public dd::NodeBase¶
- #include <DensityNode.hpp>
A density-matrix DD node.
Data Layout (8)|(2|2|4)|(24|24|24|24) = 112B
Public Functions
-
inline constexpr void unsetTempDensityMatrixFlags() noexcept¶
-
void setDensityMatrixNodeFlag(bool densityMatrix) noexcept¶
Public Static Functions
-
static inline constexpr bool tempDensityMatrixFlagsEqual(const std::uint8_t a, const std::uint8_t b) noexcept¶
-
static inline constexpr bool isConjugateTempFlagSet(const std::uintptr_t p) noexcept¶
-
static inline constexpr bool isNonReduceTempFlagSet(const std::uintptr_t p) noexcept¶
-
static inline constexpr bool isDensityMatrixTempFlagSet(const std::uintptr_t p) noexcept¶
-
static inline bool isDensityMatrixNode(const std::uintptr_t p) noexcept¶
-
static inline constexpr std::uintptr_t getDensityMatrixTempFlags(const std::uintptr_t a) noexcept¶
-
inline constexpr void unsetTempDensityMatrixFlags() noexcept¶
-
struct dCachedEdge¶
-
namespace ddsim