@@ -1331,62 +1331,6 @@ static int test_qasm3_dumps_invalid_parameter_names(void) {
13311331 return RuntimeError;
13321332 }
13331333
1334- QuantumCircuit duplicate_symbols (2 , 0 );
1335- Parameter a0 (" a" );
1336- Parameter a1 (" a" );
1337- threw = false ;
1338- try {
1339- duplicate_symbols.ry (a0, 0 );
1340- duplicate_symbols.ry (a1, 1 );
1341- } catch (const std::invalid_argument &) {
1342- threw = true ;
1343- }
1344- if (!threw) {
1345- std::cerr << " qasm3_dumps_invalid_parameter_names test : duplicate circuit parameter symbols did not throw" << std::endl;
1346- return RuntimeError;
1347- }
1348- if (duplicate_symbols.num_instructions () != 1 ) {
1349- std::cerr << " qasm3_dumps_invalid_parameter_names test : duplicate circuit symbol rejection mutated the circuit incorrectly" << std::endl;
1350- return RuntimeError;
1351- }
1352-
1353- QuantumCircuit duplicate_gate_symbols (1 , 0 );
1354- Parameter gate_a0 (" a" );
1355- Parameter gate_a1 (" a" );
1356- Parameter gate_b (" b" );
1357- threw = false ;
1358- try {
1359- duplicate_gate_symbols.u (gate_a0, gate_a1, gate_b, 0 );
1360- } catch (const std::invalid_argument &) {
1361- threw = true ;
1362- }
1363- if (!threw) {
1364- std::cerr << " qasm3_dumps_invalid_parameter_names test : duplicate symbols in one gate did not throw" << std::endl;
1365- return RuntimeError;
1366- }
1367- if (duplicate_gate_symbols.num_instructions () != 0 ) {
1368- std::cerr << " qasm3_dumps_invalid_parameter_names test : duplicate gate symbol rejection mutated the circuit" << std::endl;
1369- return RuntimeError;
1370- }
1371-
1372- QuantumCircuit duplicate_expression_symbols (1 , 0 );
1373- Parameter expr_a0 (" a" );
1374- Parameter expr_a1 (" a" );
1375- threw = false ;
1376- try {
1377- duplicate_expression_symbols.rz (expr_a0 + expr_a1, 0 );
1378- } catch (const std::invalid_argument &) {
1379- threw = true ;
1380- }
1381- if (!threw) {
1382- std::cerr << " qasm3_dumps_invalid_parameter_names test : duplicate symbols in one expression did not throw" << std::endl;
1383- return RuntimeError;
1384- }
1385- if (duplicate_expression_symbols.num_instructions () != 0 ) {
1386- std::cerr << " qasm3_dumps_invalid_parameter_names test : duplicate expression symbol rejection mutated the circuit" << std::endl;
1387- return RuntimeError;
1388- }
1389-
13901334 return Ok;
13911335}
13921336
0 commit comments