Skip to content

Commit e66980a

Browse files
committed
Update QASM3 parameter export API
1 parent 0956a1d commit e66980a

2 files changed

Lines changed: 0 additions & 60 deletions

File tree

src/circuit/quantumcircuit_def.hpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,10 +185,6 @@ class QuantumCircuit
185185

186186
QkExitCode add_parameterized_gate(QkGate gate, const std::uint32_t *qubits, QkParam **params)
187187
{
188-
std::shared_ptr<rust_circuit> preflight(qk_circuit_copy(rust_circuit_.get()), qk_circuit_free);
189-
QkExitCode preflight_ret = qk_circuit_parameterized_gate(preflight.get(), gate, qubits, params);
190-
check_circuit_parameter_operation(preflight_ret);
191-
192188
QkExitCode ret = qk_circuit_parameterized_gate(rust_circuit_.get(), gate, qubits, params);
193189
check_circuit_parameter_operation(ret);
194190
return ret;

test/test_circuit.cpp

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)