Closed fishgoesbloop closed 1 year ago
The legacy tutorials are so named because they have yet to be updated to the latest version of Qiskit. Perhaps @stefan-woerner or @levbishop has thoughts on when or if this will be done?
The problem is that due to sampling noise (you are using qasm_simulator
) the estimated kernel matrix might not be positive semi definite. In this case the used solver cannot handle the resulting problem and fails.
If you'd test the statevector_simulator
you shouldn't see this problem.
But also for the qasm_simulator
the problem is fixed by now in the master branch of qiskit-aqua. In the updated implementation (see PR Qiskit/qiskit-aqua#1190) we approximate the kernel matrix with the closest PSD matrix (essentially trimming negative eigenvalues to 0).
This tutorial will be adjusted and moved out of legacy_tutorials
latest with the next qiskit-aqua release in a few weeks.
Thanks, I no longer get the error after installing aqua 0.8.0. However, I realised I got vastly different accuracy scores(0.9 and 0.5), when i ran the same experiment(with same seed values) on aqua 0.7.5 and 0.8.0. One was on ibmq-vigo, the other on ibmq-valencia.
Apologies as I'm still quite new to Quantum machine learning, is this behaviour expected? Possibly due to noise factor?
It might be due to noise. You could validate your results using simulation (statevector and qasm) and maybe increase the number of shots used?
@fishgoesbloop Would you please tell me how to install aqua 0.8.0?
I tried this command
pip install --upgrade qiskit.aqua==0.8.0
but it returned an error saying
ERROR: Could not find a version that satisfies the requirement qiskit.aqua==0.8.0 (from versions: 0.2.0, 0.3.0, 0.3.1, 0.4.0, 0.4.1, 0.5.0, 0.5.1, 0.5.2, 0.5.3, 0.5.4, 0.5.5, 0.6.0, 0.6.1, 0.6.2, 0.6.3, 0.6.4, 0.6.5, 0.6.6, 0.7.0, 0.7.1, 0.7.2, 0.7.3, 0.7.4, 0.7.5) ERROR: No matching distribution found for qiskit.aqua==0.8.0
It might be due to noise. You could validate your results using simulation (statevector and qasm) and maybe increase the number of shots used?
Thank you, I will try that.
@fishgoesbloop Would you please tell me how to install aqua 0.8.0? I tried this command
pip install --upgrade qiskit.aqua==0.8.0
but it returned an error sayingERROR: Could not find a version that satisfies the requirement qiskit.aqua==0.8.0 (from versions: 0.2.0, 0.3.0, 0.3.1, 0.4.0, 0.4.1, 0.5.0, 0.5.1, 0.5.2, 0.5.3, 0.5.4, 0.5.5, 0.6.0, 0.6.1, 0.6.2, 0.6.3, 0.6.4, 0.6.5, 0.6.6, 0.7.0, 0.7.1, 0.7.2, 0.7.3, 0.7.4, 0.7.5) ERROR: No matching distribution found for qiskit.aqua==0.8.0
I followed this documentation. https://qiskit.org/documentation/contributing_to_qiskit.html "Installing Aqua from Source"
@fishgoesbloop Would you please tell me how to install aqua 0.8.0? I tried this command
pip install --upgrade qiskit.aqua==0.8.0
but it returned an error sayingERROR: Could not find a version that satisfies the requirement qiskit.aqua==0.8.0 (from versions: 0.2.0, 0.3.0, 0.3.1, 0.4.0, 0.4.1, 0.5.0, 0.5.1, 0.5.2, 0.5.3, 0.5.4, 0.5.5, 0.6.0, 0.6.1, 0.6.2, 0.6.3, 0.6.4, 0.6.5, 0.6.6, 0.7.0, 0.7.1, 0.7.2, 0.7.3, 0.7.4, 0.7.5) ERROR: No matching distribution found for qiskit.aqua==0.8.0
I followed this documentation. https://qiskit.org/documentation/contributing_to_qiskit.html "Installing Aqua from Source"
Thank you so much for sharing the link! That is so helpful!
Closing as OP seems to have found a solution to their problem 😄
Informations
What is the current behavior?
1)I'm trying to run the qsvm legacy tutorial (url) but am encountering a SolverError.
2)I've also tried out different training_size and test_size to test it out. When I use training_size=5, test_size=1 I get a different error "DQCPError: The problem is not DQCP". Which is related to issue #932 I believe.
3)When I use feature_dim =5, the code is able to run. Any idea why?
Thanks for helping and looking into this.
Steps to reproduce the problem
What is the expected behavior?
No errors
Suggested solutions