Skip to content

Commit

Permalink
Migrate from bind_parameters to assign_parameters (#418)
Browse files Browse the repository at this point in the history
... as `bind_parameters` has been deprecated
(Qiskit/qiskit#10792)
  • Loading branch information
garrison authored Sep 13, 2023
1 parent 6bb6fec commit 1864583
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion circuit_knitting/forging/entanglement_forging_knitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ def __call__(
"ambiguous how to combine the options with the backends."
)
# For now, we only assign the parameters to a copy of the ansatz
circuit_u = self._ansatz.circuit_u.bind_parameters(ansatz_parameters)
circuit_u = self._ansatz.circuit_u.assign_parameters(ansatz_parameters)

# Create the tensor and superposition stateprep circuits
# tensor_ansatze = [U|bi⟩ for |bi⟩ in tensor_circuits]
Expand Down
2 changes: 1 addition & 1 deletion circuit_knitting/utils/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def _call(
) -> SamplerResult:
metadata: list[dict[str, Any]] = [{} for _ in range(len(circuits))]
bound_circuits = [
circuit if len(value) == 0 else circuit.bind_parameters(value)
circuit if len(value) == 0 else circuit.assign_parameters(value)
for circuit, value in strict_zip(circuits, parameter_values)
]
probabilities = [simulate_statevector_outcomes(qc) for qc in bound_circuits]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"circuit = circuit.decompose()\n",
"\n",
"params = [(np.pi * i) / 16 for i in range(len(circuit.parameters))]\n",
"circuit = circuit.bind_parameters(params)\n",
"circuit.assign_parameters(params, inplace=True)\n",
"circuit.draw(\"mpl\", fold=-1, scale=0.7)"
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"circuit = circuit.decompose()\n",
"\n",
"params = [(np.pi * i) / 16 for i in range(len(circuit.parameters))]\n",
"circuit = circuit.bind_parameters(params)\n",
"circuit.assign_parameters(params, inplace=True)\n",
"circuit.draw(\"mpl\", fold=-1, scale=0.7)"
]
},
Expand Down

0 comments on commit 1864583

Please sign in to comment.