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

Fix migration guide and code msgs for aqua_globals #1566

Merged
merged 3 commits into from
Apr 4, 2021
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 README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Aqua has been deprecated:
| qiskit.aqua.algorithms.factorizers | qiskit.algorithms.factorizers | qiskit-terra |
| qiskit.aqua.algorithms.minimum_eigen_solvers | qiskit.algorithms.minimum_eigen_solvers | qiskit-terra|
| qiskit.aqua.algorithms.VQAlgorithm | qiskit.algorithms.VariationalAlgorithm | qiskit-terra |
| qiskit.aqua.aqua_globals | qiskit.utils.aqua_globals | qiskit-terra|
| qiskit.aqua.aqua_globals | qiskit.utils.algorithm_globals | qiskit-terra|
| qiskit.aqua.components.multiclass_extensions | | |
| qiskit.aqua.components.neural_networks | qiskit_machine_learning.algorithms.distribution_learners.qgan | qiskit-machine-learning |
| qiskit.aqua.components.optimizers | qiskit.algorithms.optimizers | qiskit-terra |
Expand Down
14 changes: 7 additions & 7 deletions qiskit/aqua/aqua_globals.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ def __init__(self) -> None:
def random_seed(self) -> Optional[int]:
"""Return random seed."""
warn_variable('aqua.aqua_globals',
'qiskit.utils.aqua_globals',
'qiskit.utils.algorithm_globals',
'qiskit-terra', 3)
return self._random_seed

@random_seed.setter
def random_seed(self, seed: Optional[int]) -> None:
"""Set random seed."""
warn_variable('aqua.aqua_globals',
'qiskit.utils.aqua_globals',
'qiskit.utils.algorithm_globals',
'qiskit-terra', 3)
self._random_seed = seed
self._random = None
Expand All @@ -57,7 +57,7 @@ def random_seed(self, seed: Optional[int]) -> None:
def num_processes(self) -> int:
"""Return num processes."""
warn_variable('aqua.aqua_globals',
'qiskit.utils.aqua_globals',
'qiskit.utils.algorithm_globals',
'qiskit-terra', 3)
return self._num_processes

Expand All @@ -67,7 +67,7 @@ def num_processes(self, num_processes: Optional[int]) -> None:
If 'None' is passed, it resets to QiskitAquaGlobals.CPU_COUNT
"""
warn_variable('aqua.aqua_globals',
'qiskit.utils.aqua_globals',
'qiskit.utils.algorithm_globals',
'qiskit-terra', 3)
if num_processes is None:
num_processes = QiskitAquaGlobals.CPU_COUNT
Expand All @@ -89,7 +89,7 @@ def num_processes(self, num_processes: Optional[int]) -> None:
def random(self) -> np.random.Generator:
"""Return a numpy np.random.Generator (default_rng)."""
warn_variable('aqua.aqua_globals',
'qiskit.utils.aqua_globals',
'qiskit.utils.algorithm_globals',
'qiskit-terra', 3)
if self._random is None:
self._random = np.random.default_rng(self._random_seed)
Expand All @@ -99,15 +99,15 @@ def random(self) -> np.random.Generator:
def massive(self) -> bool:
"""Return massive to allow processing of large matrices or vectors."""
warn_variable('aqua.aqua_globals',
'qiskit.utils.aqua_globals',
'qiskit.utils.algorithm_globals',
'qiskit-terra', 3)
return self._massive

@massive.setter
def massive(self, massive: bool) -> None:
"""Set massive to allow processing of large matrices or vectors."""
warn_variable('aqua.aqua_globals',
'qiskit.utils.aqua_globals',
'qiskit.utils.algorithm_globals',
'qiskit-terra', 3)
self._massive = massive

Expand Down