diff --git a/pyproject.toml b/pyproject.toml index f134da2d..2b52c6b2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -137,9 +137,9 @@ log_cli_level = "INFO" xfail_strict = true filterwarnings = [ "error", - 'ignore:.*`product` is deprecated.*:DeprecationWarning:qiskit:', 'ignore:.*qiskit.__qiskit_version__.*:DeprecationWarning:qiskit:', - 'ignore:.*encountered in det.*:RuntimeWarning:numpy.linalg:', + 'ignore:.*qiskit.utils.algorithm_globals.QiskitAlgorithmGlobals*:DeprecationWarning:qiskit', + 'ignore:.*Building a flow controller with keyword arguments is going to be deprecated*:PendingDeprecationWarning:qiskit', ] [tool.coverage] diff --git a/src/mqt/qcec/parameterized.py b/src/mqt/qcec/parameterized.py index ada47b23..213277e9 100644 --- a/src/mqt/qcec/parameterized.py +++ b/src/mqt/qcec/parameterized.py @@ -100,8 +100,8 @@ def check_instantiated_random( for p in params: param_map[p] = rng.random() * 2 * np.pi - circ1_inst = circ1.bind_parameters(param_map) - circ2_inst = circ2.bind_parameters(param_map) + circ1_inst = circ1.assign_parameters(param_map) + circ2_inst = circ2.assign_parameters(param_map) return check_instantiated(circ1_inst, circ2_inst, configuration) @@ -156,14 +156,15 @@ def instantiate_params( mat_pinv = np.linalg.pinv(mat) x = np.dot(mat_pinv, b) param_map = {param: x[i] for i, param in enumerate(parameters)} - qc1_bound = qc1.bind_parameters(param_map) - qc2_bound = qc2.bind_parameters(param_map) + qc1_bound = qc1.assign_parameters(param_map) + qc2_bound = qc2.assign_parameters(param_map) def round_zero_params(qc: QuantumCircuit) -> QuantumCircuit: for instr in qc.data: - params = instr[0].params - instr[0].params = [float(x) for x in params] - instr[0].params = [0 if np.abs(x) < tol else x for x in instr[0].params] + if not hasattr(instr[0], "mutable") or instr[0].mutable: + params = instr[0].params + instr[0].params = [float(x) for x in params] + instr[0].params = [0 if np.abs(x) < tol else x for x in instr[0].params] return qc qc1_bound = round_zero_params(qc1_bound)