You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I run the automated script with each of the three cases in #78 (comment), etc, I get the following error:
File "/Users/mistywahl/Documents/GitHub/aquapointer/aquapointer/analog/qubo_solution.py", line 117, in run_qubo
detunings = canvas.calculate_detunings()
File "/Users/mistywahl/Documents/GitHub/aquapointer/aquapointer/density_canvas/DensityCanvas.py", line 701, in calculate_detunings
if d10 < threshold_distances[i]:
KeyError: 0
Originally I'd thought this was related to the force_lattice_size error, but it seems different. From what I can tell, the update to calculate_detunings in #81 didn't account for the possibility that threshold_distances could be empty at line 701. I could just fix it as suggested below but wanted to check first if there's a reason threshold_distances should not be empty by line 701, which would indicate another problem.
Suggested solution:
Replace threshold_distances = {} with
from collections import defaultdict
threshold_distances = defaultdict(float)
The text was updated successfully, but these errors were encountered:
The function of the variable threshold_distance is to set a distance such that the interaction between a qubit and its neighbours that are closer than that distance is ignored. Sometimes, however, no interaction has to be ignored, and in this case threshold_distance should be the smallest possible distance.
The issue was solved in #84 by initializing threshold_distance with the smallest distance with:
threshold_distances[i] = distances[i][-1][1]
The remaining code will modify this value if a different threshold is needed, otherwise it will leave it unchanged.
When I run the automated script with each of the three cases in #78 (comment), etc, I get the following error:
Originally I'd thought this was related to the
force_lattice_size
error, but it seems different. From what I can tell, the update tocalculate_detunings
in #81 didn't account for the possibility thatthreshold_distances
could be empty at line 701. I could just fix it as suggested below but wanted to check first if there's a reasonthreshold_distances
should not be empty by line 701, which would indicate another problem.Suggested solution:
Replace
threshold_distances = {}
withThe text was updated successfully, but these errors were encountered: