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

Error when calculating samples with clifford backend #1453

Closed
AlejandroSopena opened this issue Sep 18, 2024 · 1 comment · Fixed by #1457
Closed

Error when calculating samples with clifford backend #1453

AlejandroSopena opened this issue Sep 18, 2024 · 1 comment · Fixed by #1457
Assignees
Labels
bug Something isn't working

Comments

@AlejandroSopena
Copy link
Contributor

When calculating the samples of an 8-qubit Clifford circuit with the clifford backend, I get the error:

IndexError: index 9 is out of bounds for axis 1 with size 9

I have confirmed that this also happens when generating a random Clifford circuit with a number of qubits proportional to 8. In other cases, it works fine.

The error can be reproduced using:

import qibo
from qibo import gates
from qibo.quantum_info import random_clifford

qibo.set_backend('numpy')

nshots = 10
circ = random_clifford(8)
circ.add(gates.M(0,1))
backend = qibo.backends.CliffordBackend()
result = backend.execute_circuit(circ,nshots=nshots)
result.samples()
@AlejandroSopena AlejandroSopena added the bug Something isn't working label Sep 18, 2024
@BrunoLiegiBastonLiegi
Copy link
Contributor

Thanks for reporting this, indeed there is a bug in the unpacking process of the symplectic matrix. I will open a PR with the fix soon.

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