0
$\begingroup$

I follow qiskit tutorial "Portfolio optimization". When I executed this cell, I encounter the attribute error as the title(picture showed below). enter image description here

Do anyone know how to fix this problem? It seems like the problem is inside the package, so I have no idea...

$\endgroup$
1
  • 4
    $\begingroup$ I’m voting to close this question because I think that technical Qiskit questions such as this should be issues on Qiskit's GitHub. $\endgroup$ – Cryoris Jun 28 at 14:47
1
$\begingroup$

As the error message stated, QuantumInstance has no attribute name.

What it has is backend and from backend you can retrieve name.

For example:

quantum_instance = QuantumInstance(backend=Aer.get_backend('statevector_simulator'))
quantum_instance.backend

will printout:

StatevectorSimulator('statevector_simulator')

and if you do

quantum_instance.backend.name() 

it will printout

'statevector_simulator'
$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.