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 simulator (stabilizer) only reports results of first 64 qubits - unless you reset the qubits first #2104

Closed
rharper2 opened this issue Apr 22, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@rharper2
Copy link

Informations

  • Qiskit Aer version: 0.14.01
  • Python version: 3.12
  • Operating system: OSX 14.4.1

What is the current behavior?

If you measure, say, 127 qubits, only the results of 64 are returned.

Steps to reproduce the problem

import qiskit
import qiskit_aer as aer
c = qiskit.QuantumCircuit(127,127)
for i in range(127):
    c.x(i)
c.measure(range(127),range(127))
simulator = aer.AerSimulator(method="stabilizer")
print(simulator.num_qubits)

r = simulator.run(c,shots=2000).result()
print(r.get_counts(c))

Gives output:

10000
{'0000000000000000000000000000000000000000000000000000000000000001111111111111111111111111111111111111111111111111111111111111111': 2000}

What is the expected behavior?

Should give output:

10000
{'1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111': 2000}

Suggested solutions

Almost certainly some precision problem.

@rharper2 rharper2 added the bug Something isn't working label Apr 22, 2024
@rharper2 rharper2 changed the title Aer simulator (stabilizer) only reports results of first 64 qubits. Aer simulator (stabilizer) only reports results of first 64 qubits - unless you reset the qubits first Apr 22, 2024
@rharper2
Copy link
Author

I noticed that the following gives the desired output...

import qiskit
import qiskit_aer as aer
c = qiskit.QuantumCircuit(127,127)
for i in range(127):
    c.reset(i)
for i in range(127):
    c.x(i)
c.measure(range(127),range(127))
simulator = aer.AerSimulator(method="stabilizer")
print(simulator.num_qubits)

r = simulator.run(c,shots=2000).result()
print(r.get_counts(c))

Gives:

10000
{'1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111': 2000}

@doichanj
Copy link
Collaborator

This issue should be fixed by PR #2094

@doichanj
Copy link
Collaborator

doichanj commented May 1, 2024

This issue is fixed by Release 0.14.1

@doichanj doichanj closed this as completed May 1, 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