diff --git a/crates/circuit/src/operations.rs b/crates/circuit/src/operations.rs index 3bfef81d29ce..44ca85fb64e5 100644 --- a/crates/circuit/src/operations.rs +++ b/crates/circuit/src/operations.rs @@ -184,6 +184,17 @@ impl ToPyObject for Param { } } +impl PartialEq for Param { + fn eq(&self, other: &Self) -> bool { + match (self, other) { + (Param::Float(s), Param::Float(other)) => s == other, + (Param::ParameterExpression(one), Param::ParameterExpression(other)) => one.is(other), + (Param::Obj(one), Param::Obj(other)) => one.is(other), + _ => false, + } + } +} + #[derive(Clone, Debug, Copy, Eq, PartialEq, Hash)] #[pyclass(module = "qiskit._accelerate.circuit")] pub enum StandardGate {