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

Initial resets being removed by transpiler #5921

Closed
nonhermitian opened this issue Feb 27, 2021 · 2 comments · Fixed by #10591
Closed

Initial resets being removed by transpiler #5921

nonhermitian opened this issue Feb 27, 2021 · 2 comments · Fixed by #10591
Labels
bug Something isn't working

Comments

@nonhermitian
Copy link
Contributor

Information

  • Qiskit Terra version: latest
  • Python version:
  • Operating system:

What is the current behavior?

This circuit

image

has becomes

image

after transpilation (levels 1,2,3) on a backend with reset support.

print(backend.configuration().basis_gates)

['id', 'rz', 'sx', 'x', 'cx', 'ecr', 'reset']

This means that I do not get correct answers using init_qubits=False.

Steps to reproduce the problem

What is the expected behavior?

Suggested solutions

@nonhermitian nonhermitian added the bug Something isn't working label Feb 27, 2021
@1ucian0
Copy link
Member

1ucian0 commented Mar 5, 2021

Is there a backend property that indicates that the backend start in ground state? We could do the transpilation process depending on that.

@nonhermitian
Copy link
Contributor Author

If one sets init_qubits=False in execute then the backend does not initialize qubits. This is a Qobj thing not a transpile thing, so perhaps the correct thing to do is to remove reset only when they are not supported on the device. Indeed, a reset at the beginning will not do much to a state if initialized anyway.

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

Successfully merging a pull request may close this issue.

2 participants