@@ -580,21 +580,21 @@ TEST_F(NADeviceTest, QuerySiteData) {
580
580
}
581
581
582
582
TEST_F (NADeviceTest, QueryOperationData) {
583
- uint64_t duration = 0 ;
584
- bool isDurationSupported = false ;
585
- uint64_t meanShuttlingSpeed = 0 ;
586
- bool isMeanShuttlingSpeedSupported = false ;
587
- double fidelity = 0 ;
588
- bool isFidelitySupported = false ;
589
- size_t numQubits = 0 ;
590
- bool isNumQubitsSupported = false ;
591
- size_t numParameters = 0 ;
592
- bool isZoned = false ;
593
583
std::vector<MQT_NA_QDMI_Site> sites;
594
584
EXPECT_NO_THROW (sites = querySites (session));
595
585
std::vector<MQT_NA_QDMI_Operation> operations;
596
586
EXPECT_NO_THROW (operations = queryOperations (session));
597
587
for (auto * operation : operations) {
588
+ uint64_t duration = 0 ;
589
+ bool isDurationSupported = false ;
590
+ uint64_t meanShuttlingSpeed = 0 ;
591
+ bool isMeanShuttlingSpeedSupported = false ;
592
+ double fidelity = 0 ;
593
+ bool isFidelitySupported = false ;
594
+ size_t numQubits = 0 ;
595
+ bool isNumQubitsSupported = false ;
596
+ size_t numParameters = 0 ;
597
+ bool isZoned = false ;
598
598
size_t nameSize = 0 ;
599
599
ASSERT_EQ (MQT_NA_QDMI_device_session_query_operation_property (
600
600
session, operation, 0 , nullptr , 0 , nullptr ,
@@ -640,32 +640,37 @@ TEST_F(NADeviceTest, QueryOperationData) {
640
640
isNumQubitsSupported = true ;
641
641
EXPECT_GT (numQubits, 0 );
642
642
}
643
+ EXPECT_EQ (MQT_NA_QDMI_device_session_query_operation_property (
644
+ session, operation, 0 , nullptr , 0 , nullptr ,
645
+ QDMI_OPERATION_PROPERTY_ISZONED, sizeof (bool ), &isZoned,
646
+ nullptr ),
647
+ QDMI_SUCCESS);
648
+ EXPECT_EQ (MQT_NA_QDMI_device_session_query_operation_property (
649
+ session, operation, 0 , nullptr , 0 , nullptr ,
650
+ QDMI_OPERATION_PROPERTY_PARAMETERSNUM, sizeof (size_t ),
651
+ &numParameters, nullptr ),
652
+ QDMI_SUCCESS);
643
653
// isDurationSupported <==> isFidelitySupported
644
654
EXPECT_EQ (isDurationSupported, isFidelitySupported);
645
655
// isMeanShuttlingSpeedSupported <==> not isDurationSupported
646
656
EXPECT_EQ (isMeanShuttlingSpeedSupported, !isDurationSupported);
647
657
// isMeanShuttlingSpeedSupported ==> not isNumQubitsSupported
648
- EXPECT_TRUE (!isMeanShuttlingSpeedSupported || isNumQubitsSupported);
658
+ EXPECT_TRUE (!isMeanShuttlingSpeedSupported || ! isNumQubitsSupported);
649
659
// isMeanShuttlingSpeedSupported ==> isZoned
650
660
EXPECT_TRUE (!isMeanShuttlingSpeedSupported || isZoned);
651
661
// not isZoned ==> isNumQubitsSupported
652
- EXPECT_TRUE (! isZoned || isNumQubitsSupported);
662
+ EXPECT_TRUE (isZoned || isNumQubitsSupported);
653
663
EXPECT_EQ (MQT_NA_QDMI_device_session_query_operation_property (
654
664
session, operation, 0 , nullptr , 0 , nullptr ,
655
665
QDMI_OPERATION_PROPERTY_PARAMETERSNUM, sizeof (size_t ),
656
666
&numParameters, nullptr ),
657
667
QDMI_SUCCESS);
658
- EXPECT_EQ (MQT_NA_QDMI_device_session_query_operation_property (
659
- session, operation, 0 , nullptr , 0 , nullptr ,
660
- QDMI_OPERATION_PROPERTY_ISZONED, sizeof (bool ), &isZoned,
661
- nullptr ),
662
- QDMI_SUCCESS);
663
668
size_t sitesSize = 0 ;
664
669
EXPECT_EQ (MQT_NA_QDMI_device_session_query_operation_property (
665
670
session, operation, 0 , nullptr , 0 , nullptr ,
666
671
QDMI_OPERATION_PROPERTY_SITES, 0 , nullptr , &sitesSize),
667
672
QDMI_SUCCESS);
668
- if (numQubits == 1 ) {
673
+ if (isNumQubitsSupported && numQubits == 1 ) {
669
674
std::unordered_set<MQT_NA_QDMI_Site> supportedSites;
670
675
for (const auto & site : sites) {
671
676
result = MQT_NA_QDMI_device_session_query_operation_property (
@@ -746,18 +751,18 @@ TEST_F(NADeviceTest, QueryOperationData) {
746
751
const std::unordered_set queriedSupportedSitesSet (
747
752
queriedSupportedSitesVec.cbegin (), queriedSupportedSitesVec.cend ());
748
753
EXPECT_EQ (queriedSupportedSitesSet, supportedSites);
749
- } else if (numQubits == 2 ) {
754
+ } else if (isNumQubitsSupported && numQubits == 2 ) {
750
755
if (!isZoned) {
751
756
EXPECT_EQ (MQT_NA_QDMI_device_session_query_operation_property (
752
757
session, operation, 0 , nullptr , 0 , nullptr ,
753
758
QDMI_OPERATION_PROPERTY_INTERACTIONRADIUS, 0 , nullptr ,
754
759
nullptr ),
755
- QDMI_ERROR_NOTSUPPORTED );
760
+ QDMI_SUCCESS );
756
761
EXPECT_EQ (MQT_NA_QDMI_device_session_query_operation_property (
757
762
session, operation, 0 , nullptr , 0 , nullptr ,
758
763
QDMI_OPERATION_PROPERTY_BLOCKINGRADIUS, 0 , nullptr ,
759
764
nullptr ),
760
- QDMI_ERROR_NOTSUPPORTED );
765
+ QDMI_SUCCESS );
761
766
EXPECT_EQ (MQT_NA_QDMI_device_session_query_operation_property (
762
767
session, operation, 0 , nullptr , 0 , nullptr ,
763
768
QDMI_OPERATION_PROPERTY_IDLINGFIDELITY, 0 , nullptr ,
0 commit comments