mirror of https://github.com/Qiskit/qiskit.git
Fix primitives metadata (#9285)
* Fix bug metadata Co-authored-by: Julian Schuhmacher <jsc@zurich.ibm.com> * Add reno * Re-trigger CI * Fix typo Co-authored-by: Ikko Hamamura <ikkoham@users.noreply.github.com> Co-authored-by: Julian Schuhmacher <jsc@zurich.ibm.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: Julien Gacon <gaconju@gmail.com> Co-authored-by: Ikko Hamamura <ikkoham@users.noreply.github.com>
This commit is contained in:
parent
9733fc0ca9
commit
1caf0306e7
|
@ -109,7 +109,7 @@ class Estimator(BaseEstimator):
|
|||
rng = np.random.default_rng(seed)
|
||||
|
||||
# Initialize metadata
|
||||
metadata: list[dict[str, Any]] = [{}] * len(circuits)
|
||||
metadata: list[dict[str, Any]] = [{} for _ in range(len(circuits))]
|
||||
|
||||
bound_circuits = []
|
||||
for i, value in zip(circuits, parameter_values):
|
||||
|
|
|
@ -101,7 +101,7 @@ class Sampler(BaseSampler):
|
|||
rng = np.random.default_rng(seed)
|
||||
|
||||
# Initialize metadata
|
||||
metadata: list[dict[str, Any]] = [{}] * len(circuits)
|
||||
metadata: list[dict[str, Any]] = [{} for _ in range(len(circuits))]
|
||||
|
||||
bound_circuits = []
|
||||
qargs_list = []
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
fixes:
|
||||
- |
|
||||
Fixed a bug in the primitives' metadata, where the list made copies by reference and
|
||||
all elements were updated with the same value at every iteration.
|
Loading…
Reference in New Issue