Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve GridQubit dictionary lookup performance 3x (quantumlib#3375)
According to the following profiling code, this change decreases the dictionary lookup time from 2100ns to 600ns on my machine. ``` import time import cirq d = {q: 5 for q in cirq.GridQubit.rect(3, 3)} q = cirq.GridQubit(0, 0) total = 0 t0 = time.monotonic() n = 100000 for _ in range(n): total += d[q] t1 = time.monotonic() print(total) print((t1 - t0) / n * 10**9, "nanoseconds per hash") ```
- Loading branch information