Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QSVM+Image classification+ DCP errors #82

Open
ZainabASA opened this issue Jul 5, 2020 · 2 comments
Open

QSVM+Image classification+ DCP errors #82

ZainabASA opened this issue Jul 5, 2020 · 2 comments

Comments

@ZainabASA
Copy link

. I use QSVM to classify image dataset … I don't understand this error, How to fix it.
error display


DCPError Traceback (most recent call last)
in ()
5 svm.random_seed = 10598
6 quantum_instance = QuantumInstance(backend, shots=1024, seed_simulator=10598, seed_transpiler=10598)
----> 7 result = svm.run(quantum_instance)

9 frames
/usr/local/lib/python3.6/dist-packages/cvxpy/reductions/solvers/intermediate_chain.py in construct_intermediate_chain(problem, candidates, gp)
94 append += ("\nHowever, the problem does follow DQCP rules. "
95 "Consider calling solve() with qcp=True.")
---> 96 raise DCPError("Problem does not follow DCP rules. Specifically:\n" + append)
97
98 elif gp and not problem.is_dgp():

DCPError: Problem does not follow DCP rules. Specifically:

@ArthiBoss
Copy link

Have you tried using statevector_simulator, in most case qasm_simulator shows such error but satevector_simulator wont show DCP error and the prediction accuracy also good.

@praveentn
Copy link

@ArthiBoss thank you!

Changing the backend from

backend = BasicAer.get_backend('qasm_simulator')

to

backend = BasicAer.get_backend('statevector_simulator')

worked for me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants