Quantum Computing Asked on June 18, 2021
I would like to try and ADMM optimizer as shown in Qiskit Tutorial in Quantum Lab. Firstly, I imported necessary libraries (copy/paste from the Tutorial):
import time
from typing import List, Optional, Any
import numpy as np
import matplotlib.pyplot as plt
from docplex.mp.model import Model
from qiskit import BasicAer
from qiskit.aqua.algorithms import QAOA, NumPyMinimumEigensolver
from qiskit.optimization.algorithms import CobylaOptimizer, MinimumEigenOptimizer
from qiskit.optimization.problems import QuadraticProgram
from qiskit.optimization.algorithms.admm_optimizer import ADMMParameters, ADMMOptimizer
When I started the import this error appeared:
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-32-c32e151d13df> in <module>
11
12 from qiskit import BasicAer
---> 13 from qiskit.aqua.algorithms import QAOA, NumPyMinimumEigensolver
14 from qiskit.optimization.algorithms import CobylaOptimizer, MinimumEigenOptimizer
15 from qiskit.optimization.problems import QuadraticProgram
/opt/conda/lib/python3.7/site-packages/qiskit/aqua/__init__.py in <module>
75 from .aqua_globals import aqua_globals
76 from .quantum_instance import QuantumInstance
---> 77 from .algorithms import QuantumAlgorithm
78 from ._logging import (QiskitLogDomains,
79 get_logging_level,
/opt/conda/lib/python3.7/site-packages/qiskit/aqua/algorithms/__init__.py in <module>
190 from .eigen_solvers import NumPyEigensolver, ExactEigensolver, EigensolverResult
191 from .factorizers import Shor
--> 192 from .linear_solvers import HHL, NumPyLSsolver, ExactLSsolver
193 from .minimum_eigen_solvers import (VQE, VQEResult, QAOA, IQPE, IQPEResult, QPE, QPEResult,
194 ClassicalCPLEX, CPLEX_Ising, NumPyMinimumEigensolver,
/opt/conda/lib/python3.7/site-packages/qiskit/aqua/algorithms/linear_solvers/__init__.py in <module>
15 """ Linear Solvers Package """
16
---> 17 from .hhl import HHL
18 from .numpy_ls_solver import NumPyLSsolver, ExactLSsolver
19
/opt/conda/lib/python3.7/site-packages/qiskit/aqua/algorithms/linear_solvers/hhl.py in <module>
24 from qiskit.aqua import QuantumInstance
25 from qiskit.aqua.algorithms import QuantumAlgorithm
---> 26 from qiskit.ignis.verification.tomography import state_tomography_circuits,
27 StateTomographyFitter
28 from qiskit.converters import circuit_to_dag
/opt/conda/lib/python3.7/site-packages/qiskit/ignis/verification/__init__.py in <module>
98 """
99 from .quantum_volume import qv_circuits, QVFitter
--> 100 from .randomized_benchmarking import (CNOTDihedral,
101 randomized_benchmarking_seq,
102 RBFitter, InterleavedRBFitter,
/opt/conda/lib/python3.7/site-packages/qiskit/ignis/verification/randomized_benchmarking/__init__.py in <module>
19
20 # Randomized Benchmarking functions
---> 21 from .circuits import randomized_benchmarking_seq
22 from .dihedral import (CNOTDihedral, decompose_cnotdihedral, random_cnotdihedral)
23 from .fitters import (RBFitter, InterleavedRBFitter, PurityRBFitter,
/opt/conda/lib/python3.7/site-packages/qiskit/ignis/verification/randomized_benchmarking/circuits.py in <module>
204 is_purity: bool = False,
205 group_gates: Optional[str] = None,
--> 206 rand_seed: Optional[Union[int, RandomState]] = None) ->
207 (List[List[qiskit.QuantumCircuit]], List[List[int]],
208 Optional[List[List[qiskit.QuantumCircuit]]],
AttributeError: module 'qiskit' has no attribute 'quantum_info'
Since I only copied the code, it seems there is some bug. Does anybody know how to solve this?
Note: I work in Quantum Lab in IBM Q Experience interface
Looks like a glitch. It is not reproducible under my account. I've seen similar errors when there's mismatch in versions between Qiskit Aqua and Terra installed locally, but I don't think it is the case in Quantum Lab. Try to restart the kernel or create a new notebook and run the same imports.
Correct answer by Mega Name on June 18, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP