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

SPAM errors introduce large simulation overhead #352

Closed
darcangelomauro opened this issue Mar 30, 2022 · 4 comments · Fixed by #529
Closed

SPAM errors introduce large simulation overhead #352

darcangelomauro opened this issue Mar 30, 2022 · 4 comments · Fixed by #529
Assignees
Labels
performance It works, but could work faster pulser-simulation

Comments

@darcangelomauro
Copy link
Collaborator

Doing simulations with SPAM errors introduces a significant time overhead dependent on the samples_per_run argument, which was intended to give extra statistics (almost) for free.

The reason is that detection errors (false positives and false negatives) cycle on the sampled bitstrings and randomly flip the bits. In the following simple example execution time increases tenfold when increasing samples_per_run from 10 to 1000:

reg = Register.square(side=2)
pulse = Pulse.ConstantDetuning(BlackmanWaveform(duration=1000, area=np.pi),0,0)
seq = Sequence(reg, MockDevice)
seq.declare_channel('ch', 'rydberg_global')
seq.add(pulse, 'ch')
sim = Simulation(seq)
noise_config = SimConfig(noise=('SPAM', 'doppler', 'amplitude'),
                             eta=0.005, epsilon=0.03, epsilon_prime=0.08,
                             temperature=30, laser_waist=148,
                             runs=10, samples_per_run=10)
sim.set_config(noise_config)
sim.show_config()
res = sim.run()

A first issue is that reducing the epsilon and epsilon_prime parameters to zero does not get rid of the overhead.
Secondly, the time overhead could probably be improved following a suggestion of @Louis-PaulHenry.

As @sebgrijalva pointed out, reducing the evaluation times helps dramatically, so it could be used as a workaround.

@Louis-PaulHenry
Copy link
Collaborator

@darcangelomauro When you're mentioning a suggestion from me, do you mean computing the "reweighting" matrix?

@darcangelomauro
Copy link
Collaborator Author

Yes @Louis-PaulHenry, that would eliminate the need to flip bit by bit in each string right?

@Louis-PaulHenry
Copy link
Collaborator

yes, I think so (we can discuss it further in private).

@HGSilveri HGSilveri added the performance It works, but could work faster label May 10, 2022
@dakk
Copy link
Contributor

dakk commented May 30, 2023

I'm trying to work on this issue, however I don't promising any result.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance It works, but could work faster pulser-simulation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants