Skip to content

Commit 3ea95de

Browse files
committed
Add back validation of parameters on gate methods
In the previous commit a side effect of the accidental eager operation creation was that the parameter input for gates were being validated by that. By fixing that in the previous commit the validation of input parameters on the circuit methods was broken. This commit fixes that oversight and adds back the validation.
1 parent b35bdbd commit 3ea95de

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

crates/circuit/src/operations.rs

+5
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,11 @@ impl StandardGate {
237237
pub fn get_num_clbits(&self) -> u32 {
238238
self.num_clbits()
239239
}
240+
241+
#[getter]
242+
pub fn get_name(&self) -> &str {
243+
self.name()
244+
}
240245
}
241246

242247
// This must be kept up-to-date with `StandardGate` when adding or removing

qiskit/circuit/quantumcircuit.py

+3
Original file line numberDiff line numberDiff line change
@@ -2315,6 +2315,9 @@ def _append_standard_gate(
23152315

23162316
expanded_qargs = [self.qbit_argument_conversion(qarg) for qarg in qargs or []]
23172317
expanded_cargs = [self.cbit_argument_conversion(carg) for carg in cargs or []]
2318+
if params is not None:
2319+
for param in params:
2320+
Gate.validate_parameter(op, param)
23182321

23192322
instructions = InstructionSet(resource_requester=circuit_scope.resolve_classical_resource)
23202323
broadcast_iter = Gate.broadcast_arguments(op, expanded_qargs, expanded_cargs)

0 commit comments

Comments
 (0)