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

Issue handling multiple measurements #15

Open
rahula06 opened this issue Mar 13, 2024 · 2 comments
Open

Issue handling multiple measurements #15

rahula06 opened this issue Mar 13, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@rahula06
Copy link

Hi, there seems to be an issue running jobs with multiple measurement gates in them. For instance the circuit in the following code runs well

from qibo_cloud_backends.qiskit_client import QiskitClientBackend
from qibo.models import Circuit 
from qibo import gates

qisk_backend = QiskitClientBackend(token = 'my_token')

d = Circuit(2)
d.add(gates.H(0))
d.add(gates.M(1))

print(qisk_backend.execute_circuit(d).probabilities())

but the circuit in the following code does not

from qibo_cloud_backends.qiskit_client import QiskitClientBackend
from qibo.models import Circuit 
from qibo import gates

qisk_backend = QiskitClientBackend(token = 'my_token')

d = Circuit(2)
d.add(gates.H(0))
d.add(gates.M(1))
d.add(gates.M(0))

print(qisk_backend.execute_circuit(d).probabilities())

yielding the error

 File "/home/q1/.conda/envs/RQibo/lib/python3.11/site-packages/qibo_cloud_backends/qiskit_client.py", line 55, in execute_circuit
    sample = [int(bit) for bit in reversed(state)]
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/q1/.conda/envs/RQibo/lib/python3.11/site-packages/qibo_cloud_backends/qiskit_client.py", line 55, in <listcomp>
    sample = [int(bit) for bit in reversed(state)]
              ^^^^^^^^
ValueError: invalid literal for int() with base 10: ' '

It seems to me that there's no issue with running the circuit, the processing of the result seems to be broken in this case.

@jykhoo1987

@rahula06 rahula06 added the bug Something isn't working label Mar 13, 2024
@rahula06
Copy link
Author

Using gates.M(0,1) instead of adding two measurement gates seems to be a good workaround, as suggested in the weekly meeting. Thanks a lot!

@BrunoLiegiBastonLiegi
Copy link
Contributor

Glad the workaround works, I'll fix this asap thanks for reporting!

@BrunoLiegiBastonLiegi BrunoLiegiBastonLiegi self-assigned this Mar 20, 2024
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