@@ -68,6 +68,20 @@ class QASM3TranslationTest
6868
6969} // namespace
7070
71+ static void singleNegControlledX (qc::QCProgramBuilder& b) {
72+ auto q = b.allocQubitRegister (2 );
73+ b.x (q[0 ]);
74+ b.cx (q[0 ], q[1 ]);
75+ b.x (q[0 ]);
76+ }
77+
78+ static void mixedControlledX (qc::QCProgramBuilder& b) {
79+ auto q = b.allocQubitRegister (3 );
80+ b.x (q[1 ]);
81+ b.mcx ({q[0 ], q[1 ]}, q[2 ]);
82+ b.x (q[1 ]);
83+ }
84+
7185TEST_P (QASM3TranslationTest, ProgramEquivalence) {
7286 const auto name = " (" + GetParam ().name + " )" ;
7387 const auto & source = GetParam ().source ;
@@ -148,6 +162,11 @@ INSTANTIATE_TEST_SUITE_P(
148162 QASM3TranslationTestCase{" X" , qasm::x, MQT_NAMED_BUILDER (qc::x)},
149163 QASM3TranslationTestCase{" SingleControlledX" , qasm::singleControlledX,
150164 MQT_NAMED_BUILDER (qc::singleControlledX)},
165+ QASM3TranslationTestCase{" SingleNegControlledX" ,
166+ qasm::singleNegControlledX,
167+ MQT_NAMED_BUILDER (singleNegControlledX)},
168+ QASM3TranslationTestCase{" MixedControlledX" , qasm::mixedControlledX,
169+ MQT_NAMED_BUILDER (mixedControlledX)},
151170 QASM3TranslationTestCase{" MultipleControlledX" ,
152171 qasm::multipleControlledX,
153172 MQT_NAMED_BUILDER (qc::multipleControlledX)},
@@ -341,12 +360,12 @@ INSTANTIATE_TEST_SUITE_P(
341360 qasm::barrierMultipleQubits,
342361 MQT_NAMED_BUILDER (qc::barrierMultipleQubits)},
343362 QASM3TranslationTestCase{" CtrlTwo" , qasm::ctrlTwo,
344- MQT_NAMED_BUILDER (mlir:: qc::ctrlTwo)},
363+ MQT_NAMED_BUILDER (qc::ctrlTwo)},
345364 QASM3TranslationTestCase{" CtrlTwoMixed" , qasm::ctrlTwoMixed,
346- MQT_NAMED_BUILDER (mlir:: qc::ctrlTwoMixed)},
365+ MQT_NAMED_BUILDER (qc::ctrlTwoMixed)},
347366 QASM3TranslationTestCase{" SimpleIf" , qasm::simpleIf,
348- MQT_NAMED_BUILDER (mlir:: qc::simpleIf)},
367+ MQT_NAMED_BUILDER (qc::simpleIf)},
349368 QASM3TranslationTestCase{" IfTwoQubits" , qasm::ifTwoQubits,
350- MQT_NAMED_BUILDER (mlir:: qc::ifTwoQubits)},
369+ MQT_NAMED_BUILDER (qc::ifTwoQubits)},
351370 QASM3TranslationTestCase{" IfElse" , qasm::ifElse,
352- MQT_NAMED_BUILDER (mlir:: qc::ifElse)}));
371+ MQT_NAMED_BUILDER (qc::ifElse)}));
0 commit comments