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

Aer update causing issues in backend execution #1863

Closed
Syed-Affan-Hussain opened this issue Jul 6, 2023 · 1 comment
Closed

Aer update causing issues in backend execution #1863

Syed-Affan-Hussain opened this issue Jul 6, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@Syed-Affan-Hussain
Copy link

Informations

  • Qiskit Aer version: 0.12.1
  • Python version: 3.10.7
  • Operating system: Microsoft Windows 11 Home
  • OS Version: 10.0.22621 N/A Build 22621

What is the current behavior?

The code was working perfectly a week ago. However, after the Aer update from version 12.0 to 12.1, it started causing a 'bind_parameter' error that did not exist before. Now, I believe we can pass the parameters through the execute function of Aer, whereas in my code, I bind the parameters within the circuit. How can I resolve this issue? Alternatively, is there any way to set a custom Aer version on IBM Quantum Lab?

Steps to reproduce the problem

code :
image

error :
image

What is the expected behavior?

I ran the same code a week ago. The code should run fine and it would return the optimized parameters.
image
here is the circuit function where parameters are bounded
image

Suggested solutions

The user should have the choice of whether to use the 'bind_parameter' parameter in the execute function or within the circuit. This flexibility is important because if the user has already set their own parameters within the circuit, it could potentially lead to errors when executing it in Aer

@Syed-Affan-Hussain Syed-Affan-Hussain added the bug Something isn't working label Jul 6, 2023
@hhorii
Copy link
Collaborator

hhorii commented Jul 7, 2023

I think 0.12.0 wrongly work due to #1773. Your code has a bug in gatckt. bind_parameters() returns a new circuit with bound parameters. https://qiskit.org/documentation/stubs/qiskit.circuit.QuantumCircuit.bind_parameters.html

Try

circuit = circuit.bind_parameters(bind_dict)

or

circuit.assign_parameters(bind_dict)

@hhorii hhorii closed this as completed Jul 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants