Skip to content
This repository has been archived by the owner on Dec 7, 2021. It is now read-only.

Fix seed_simulator=0 in the quantum instance #1410

Merged
merged 6 commits into from
Nov 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion qiskit/aqua/quantum_instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def __init__(self,
'but you specified {}'.format(max_shots, shots))

run_config = RunConfig(shots=shots, max_credits=max_credits)
if seed_simulator:
if seed_simulator is not None:
run_config.seed_simulator = seed_simulator

self._run_config = run_config
Expand Down
5 changes: 5 additions & 0 deletions releasenotes/notes/qi-seed-simulator-757f88ec183082f7.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
fixes:
- |
Previously, setting `seed_simulator=0` in the `QuantumInstance` did not set
any seed. This was only affecting the value 0. This has been fixed.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class TestTPBGroupedWeightedPauliOperator(QiskitAquaTestCase):

def setUp(self):
super().setUp()
seed = 0
seed = 1
aqua_globals.random_seed = seed

self.num_qubits = 3
Expand Down
2 changes: 1 addition & 1 deletion test/aqua/operators/legacy/test_weighted_pauli_operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class TestWeightedPauliOperator(QiskitAquaTestCase):

def setUp(self):
super().setUp()
seed = 0
seed = 3
aqua_globals.random_seed = seed

self.num_qubits = 3
Expand Down