diff --git a/test/algorithms/test_qpe.cpp b/test/algorithms/test_qpe.cpp index 553f3dfac1..287b658b70 100644 --- a/test/algorithms/test_qpe.cpp +++ b/test/algorithms/test_qpe.cpp @@ -175,7 +175,7 @@ TEST_P(QPE, IQPETest) { auto qc = qc::createIterativeQPE(lambda, precision); ASSERT_EQ(qc.getNqubits(), 2U); - constexpr auto shots = 8192U; + constexpr auto shots = 16384U; const auto measurements = dd::sample(qc, shots); // sort the measurements diff --git a/test/qdmi/devices/dd/device_status_test.cpp b/test/qdmi/devices/dd/device_status_test.cpp index 67054e518a..2943ebf93c 100644 --- a/test/qdmi/devices/dd/device_status_test.cpp +++ b/test/qdmi/devices/dd/device_status_test.cpp @@ -39,9 +39,9 @@ TEST(DeviceStatus, TransitionsBusyThenIdleAfterJob) { // it. Submit a job to force BUSY then completion to IDLE. const qdmi_test::JobGuard j{s.session}; ASSERT_EQ(qdmi_test::setProgram(j.job, QDMI_PROGRAM_FORMAT_QASM3, - qdmi_test::QASM3_BELL_SAMPLING), + qdmi_test::QASM3_HEAVY_SAMPLING), QDMI_SUCCESS); - ASSERT_EQ(qdmi_test::setShots(j.job, 4096), QDMI_SUCCESS); + ASSERT_EQ(qdmi_test::setShots(j.job, 16384), QDMI_SUCCESS); ASSERT_EQ(MQT_DDSIM_QDMI_device_job_submit(j.job), QDMI_SUCCESS); // Poll while running to observe BUSY at least once. @@ -65,30 +65,3 @@ TEST(DeviceStatus, TransitionsBusyThenIdleAfterJob) { // After completion, the status should be IDLE. EXPECT_EQ(queryStatus(s.session), QDMI_DEVICE_STATUS_IDLE); } - -TEST(DeviceStatus, MultipleConcurrentJobsKeepBusyUntilLastFinishes) { - const qdmi_test::SessionGuard s{}; - - const qdmi_test::JobGuard j1{s.session}; - const qdmi_test::JobGuard j2{s.session}; - ASSERT_EQ(qdmi_test::setProgram(j1.job, QDMI_PROGRAM_FORMAT_QASM3, - qdmi_test::QASM3_BELL_SAMPLING), - QDMI_SUCCESS); - ASSERT_EQ(qdmi_test::setProgram(j2.job, QDMI_PROGRAM_FORMAT_QASM3, - qdmi_test::QASM3_HEAVY_SAMPLING5), - QDMI_SUCCESS); - ASSERT_EQ(qdmi_test::setShots(j1.job, 1024), QDMI_SUCCESS); - ASSERT_EQ(qdmi_test::setShots(j2.job, 16384), QDMI_SUCCESS); - - ASSERT_EQ(MQT_DDSIM_QDMI_device_job_submit(j1.job), QDMI_SUCCESS); - ASSERT_EQ(MQT_DDSIM_QDMI_device_job_submit(j2.job), QDMI_SUCCESS); - - // Wait for first to finish - ASSERT_EQ(MQT_DDSIM_QDMI_device_job_wait(j1.job, 0), QDMI_SUCCESS); - // Status should still be BUSY while the second runs - EXPECT_EQ(queryStatus(s.session), QDMI_DEVICE_STATUS_BUSY); - - // Wait for second, then status should go IDLE - ASSERT_EQ(MQT_DDSIM_QDMI_device_job_wait(j2.job, 0), QDMI_SUCCESS); - EXPECT_EQ(queryStatus(s.session), QDMI_DEVICE_STATUS_IDLE); -} diff --git a/test/qdmi/devices/dd/error_handling_test.cpp b/test/qdmi/devices/dd/error_handling_test.cpp index b2766c051a..c67f1ec19b 100644 --- a/test/qdmi/devices/dd/error_handling_test.cpp +++ b/test/qdmi/devices/dd/error_handling_test.cpp @@ -75,9 +75,9 @@ TEST_F(ErrorHandling, GetResultsBeforeDone) { const qdmi_test::SessionGuard s{}; const qdmi_test::JobGuard j{s.session}; ASSERT_EQ(qdmi_test::setProgram(j.job, QDMI_PROGRAM_FORMAT_QASM3, - qdmi_test::QASM3_BELL_SAMPLING), + qdmi_test::QASM3_HEAVY_SAMPLING), QDMI_SUCCESS); - ASSERT_EQ(qdmi_test::setShots(j.job, 64), QDMI_SUCCESS); + ASSERT_EQ(qdmi_test::setShots(j.job, 16384), QDMI_SUCCESS); // Before submit → invalid EXPECT_EQ(MQT_DDSIM_QDMI_device_job_get_results( j.job, QDMI_JOB_RESULT_HIST_KEYS, 0, nullptr, nullptr), diff --git a/test/qdmi/devices/dd/helpers/circuits.hpp b/test/qdmi/devices/dd/helpers/circuits.hpp index 156dd1de94..b6f7564ff1 100644 --- a/test/qdmi/devices/dd/helpers/circuits.hpp +++ b/test/qdmi/devices/dd/helpers/circuits.hpp @@ -32,9 +32,9 @@ cx q[0], q[1]; inline constexpr const char* QASM3_MALFORMED = "Definitely not OpenQASM"; -// A slightly heavier 5-qubit sampling circuit to prolong runtime slightly while +// A slightly heavier dynamic sampling circuit to prolong runtime slightly while // remaining fast -inline constexpr auto QASM3_HEAVY_SAMPLING5 = R"( +inline constexpr auto QASM3_HEAVY_SAMPLING = R"( OPENQASM 3; include "stdgates.inc"; qubit[5] q; @@ -58,6 +58,16 @@ cx q[1], q[2]; cx q[0], q[1]; // Measure all qubits c = measure q; +// Add dynamic component +if (c == 3) { + rx(0.7) q[0]; + ry(0.5) q[1]; + rz(1.1) q[2]; + ry(0.3) q[3]; + rx(0.9) q[4]; +} +// Measure all qubits again +c = measure q; )"; } // namespace qdmi_test diff --git a/test/qdmi/devices/dd/job_lifecycle_test.cpp b/test/qdmi/devices/dd/job_lifecycle_test.cpp index 267740641b..bf9be9282f 100644 --- a/test/qdmi/devices/dd/job_lifecycle_test.cpp +++ b/test/qdmi/devices/dd/job_lifecycle_test.cpp @@ -111,7 +111,7 @@ TEST(JobLifecycle, FreeWhileRunningWaitsForCompletion) { ASSERT_EQ(MQT_DDSIM_QDMI_device_session_create_device_job(s.session, &job), QDMI_SUCCESS); ASSERT_EQ(qdmi_test::setProgram(job, QDMI_PROGRAM_FORMAT_QASM3, - qdmi_test::QASM3_HEAVY_SAMPLING5), + qdmi_test::QASM3_HEAVY_SAMPLING), QDMI_SUCCESS); ASSERT_EQ(qdmi_test::setShots(job, 4096), QDMI_SUCCESS); ASSERT_EQ(MQT_DDSIM_QDMI_device_job_submit(job), QDMI_SUCCESS);