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

should fix isse #82 and #83 #84

Merged
merged 4 commits into from
Jul 16, 2024
Merged

should fix isse #82 and #83 #84

merged 4 commits into from
Jul 16, 2024

Conversation

darcangelomauro
Copy link
Collaborator

No description provided.

@darcangelomauro
Copy link
Collaborator Author

More details in issue #82 and #83. @Misty-W could you check if it works this way?

@Misty-W
Copy link
Contributor

Misty-W commented Jul 16, 2024

More details in issue #82 and #83. @Misty-W could you check if it works this way?

Thanks @darcangelomauro! I tested this on Daniele's three test cases he posted in the comments on #78. There is a bit more troubleshooting to do, since none of them work as specified just yet. If I remove the cropping line on the first and third I get the final result w/o error messages. If I keep the cropping in, for the first and third cases I get

File "/Users/mistywahl/Documents/GitHub/aquapointer/aquapointer/density_canvas/DensityCanvas.py", line 678, in calculate_detunings
threshold_distances[i] = distances[i][-1][1] #initialize as smallest distance
IndexError: list index out of range

For the second case, both with and without cropping, I get

File "/Users/mistywahl/Documents/GitHub/aquapointer/aquapointer/density_canvas/Lattice.py", line 142, in poisson_disk
ref_radius = radius_density[_index_from_position(ref_point)]
IndexError: index 706 is out of bounds for axis 0 with size 79

The index that is reported out of bounds varies (I assume because of the random selection of points), but the rest of the error remains the same.

@darcangelomauro
Copy link
Collaborator Author

Added a function DensityCanvas.get_lattice() with an optional argument minimal_spacing, which defaults to None. If minimal_spacing is a number x, the function returns the lattice coordinates scaled by a factor such that the minimal distance in the coordinates is x.
The function DensityCanvas.calculate_detunings() now also takes the optional argument minimal_spacing, so that the user can make sure that the qubits will be at a reasonable distance from each other

Copy link
Contributor

@Misty-W Misty-W left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Modified test cases 1 and 3 work with the latest fix.

@Misty-W Misty-W merged commit 6552b90 into main Jul 16, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants