QuEraComputing / Bloqade.jl

Package for the quantum computation and quantum simulation based on the neutral-atom architecture.
https://queracomputing.github.io/Bloqade.jl/dev/
Other
181 stars 35 forks source link

[BUG] Insane scaling on Bloqade.plot(atoms) #556

Open jon-wurtz opened 1 year ago

jon-wurtz commented 1 year ago

Describe the bug The visual called for Bloqade.plot(AtomList(**)) is insanely large when adding an intermediate number of atoms-- on my laptop, about 100,000 times larger than my screen-- zooming to 1% does not even see the dots.

To Reproduce atom_positions = [Random.rand(2) for x in 1:500] atoms1 = AtomList([tuple(x...) for x in atom_positions])

Expected behavior An insanely large svg output

Screenshots image

Version Info

Additional context Add any other context about the problem here.

Roger-luo commented 1 year ago

seems due to this https://github.com/QuEraComputing/Bloqade.jl/blob/master/lib/BloqadeLattices/src/visualize.jl#LL137C1-L139C54 the size of the figure is calculated based on the number of atoms instead of a fixed size. I think a more robust implementation that I used in Python is to rescale the atom circle radius based on the number of atoms with a fixed figure size.

cc: @weinbe58, @johnzl-777 should be an easy fix if any of you want to spend some time on this.