Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ releases may include breaking changes.

### Added

- ✨ Expose the optional QDMI device queue depth through the C++ and Python
FoMaC APIs ([#2010]) ([**@burgholzer**])
- ✨ Add PennyLane support for gate-based QDMI devices ([#2005])
([**@burgholzer**])
- ✨ Integrate QDMI devices as MLIR compiler targets across C++, Python, and
Expand Down Expand Up @@ -720,6 +722,7 @@ for previous changelogs._

<!-- PR links -->

[#2010]: https://github.com/munich-quantum-toolkit/core/pull/2010
[#2007]: https://github.com/munich-quantum-toolkit/core/pull/2007
[#2006]: https://github.com/munich-quantum-toolkit/core/pull/2006
[#2005]: https://github.com/munich-quantum-toolkit/core/pull/2005
Expand Down
3 changes: 3 additions & 0 deletions bindings/fomac/fomac.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,9 @@ when the custom slot is unsupported.)pb");
device.def("needs_calibration", &fomac::Device::getNeedsCalibration,
"Returns whether the device needs calibration.");

device.def("queue_depth", &fomac::Device::getQueueDepth,
"Returns the current queue depth, or None if unavailable.");

device.def("length_unit", &fomac::Device::getLengthUnit,
"Returns the unit of length used by the device.");

Expand Down
6 changes: 3 additions & 3 deletions cmake/ExternalDependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@ if(BUILD_MQT_CORE_TESTS)
endif()

# cmake-format: off
set(QDMI_MINIMUM_VERSION 1.3.2
set(QDMI_MINIMUM_VERSION 1.3.3
CACHE STRING "Minimum QDMI version")
set(QDMI_VERSION 1.3.2
set(QDMI_VERSION 1.3.3
CACHE STRING "QDMI version")
set(QDMI_REV "d05a0b418f42e54e9585d2e00af8ce23e745fd83" # v1.3.2
set(QDMI_REV "684aae5a959d63e3affb9428df2c4a0187bdb624" # QDMI PR #486
CACHE STRING "QDMI identifier (tag, branch or commit hash)")
set(QDMI_REPO_OWNER "Munich-Quantum-Software-Stack"
CACHE STRING "QDMI repository owner (change when using a fork)")
Expand Down
3 changes: 3 additions & 0 deletions include/mqt-core/fomac/FoMaC.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,9 @@ class Device {
/// @see QDMI_DEVICE_PROPERTY_NEEDSCALIBRATION
[[nodiscard]] std::optional<size_t> getNeedsCalibration() const;

/// @see QDMI_DEVICE_PROPERTY_QUEUEDEPTH
[[nodiscard]] std::optional<size_t> getQueueDepth() const;

/// @see QDMI_DEVICE_PROPERTY_LENGTHUNIT
[[nodiscard]] std::optional<std::string> getLengthUnit() const;

Expand Down
2 changes: 2 additions & 0 deletions include/mqt-core/qdmi/common/Common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,8 @@ constexpr auto toString(const QDMI_Device_Property prop) -> const char* {
return "SUPPORTED PROGRAM FORMATS";
case QDMI_DEVICE_PROPERTY_CHILDDEVICES:
return "CHILD DEVICES";
case QDMI_DEVICE_PROPERTY_QUEUEDEPTH:
return "QUEUE DEPTH";
case QDMI_DEVICE_PROPERTY_MAX:
return "MAX";
case QDMI_DEVICE_PROPERTY_CUSTOM1:
Expand Down
3 changes: 3 additions & 0 deletions python/mqt/core/fomac.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,9 @@ class Device:
def needs_calibration(self) -> int | None:
"""Returns whether the device needs calibration."""

def queue_depth(self) -> int | None:
"""Returns the current queue depth, or None if unavailable."""

def length_unit(self) -> str | None:
"""Returns the unit of length used by the device."""

Expand Down
4 changes: 4 additions & 0 deletions src/fomac/FoMaC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,10 @@ std::optional<size_t> Device::getNeedsCalibration() const {
QDMI_DEVICE_PROPERTY_NEEDSCALIBRATION);
}

std::optional<size_t> Device::getQueueDepth() const {
return queryProperty<std::optional<size_t>>(QDMI_DEVICE_PROPERTY_QUEUEDEPTH);
}

std::optional<std::string> Device::getLengthUnit() const {
return queryProperty<std::optional<std::string>>(
QDMI_DEVICE_PROPERTY_LENGTHUNIT);
Expand Down
5 changes: 5 additions & 0 deletions test/fomac/test_fomac.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,7 @@ TEST(FoMaCTest, DevicePropertyToString) {
"SUPPORTED PROGRAM FORMATS");
EXPECT_STREQ(qdmi::toString(QDMI_DEVICE_PROPERTY_CHILDDEVICES),
"CHILD DEVICES");
EXPECT_STREQ(qdmi::toString(QDMI_DEVICE_PROPERTY_QUEUEDEPTH), "QUEUE DEPTH");
EXPECT_STREQ(qdmi::toString(QDMI_DEVICE_PROPERTY_MAX), "MAX");
EXPECT_STREQ(qdmi::toString(QDMI_DEVICE_PROPERTY_CUSTOM1), "CUSTOM1");
EXPECT_STREQ(qdmi::toString(QDMI_DEVICE_PROPERTY_CUSTOM2), "CUSTOM2");
Expand Down Expand Up @@ -423,6 +424,10 @@ TEST_P(DeviceTest, NeedsCalibration) {
EXPECT_NO_THROW(std::ignore = device.getNeedsCalibration());
}

TEST_F(DDSimulatorDeviceTest, QueueDepthIsUnavailable) {
EXPECT_EQ(device.getQueueDepth(), std::nullopt);
}

TEST_P(DeviceTest, LengthUnit) {
EXPECT_NO_THROW(std::ignore = device.getLengthUnit());
}
Expand Down
8 changes: 8 additions & 0 deletions test/python/fomac/test_fomac.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,14 @@ def test_device_needs_calibration(device: Device) -> None:
assert isinstance(needs_cal, int)


def test_device_queue_depth(device: Device) -> None:
"""Test that the optional device queue depth is a non-negative integer."""
queue_depth = device.queue_depth()
if queue_depth is not None:
assert isinstance(queue_depth, int)
assert queue_depth >= 0


def test_device_length_unit(device: Device) -> None:
"""Test that the device length unit is a non-empty string."""
lu = device.length_unit()
Expand Down
Loading