-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make qubits a memoized property of Moment (#6894)
Moment already has a _qubit_to_op dict. Maintaining a separate _qubits frozenset is inefficient when constructing circuits, as it needs copied each time an op is added to a moment. In particular, for wide moments, this change seems to result in about a 3x speedup. On my laptop, creating a moment with X gates on 10_000 qubits takes 4s before this change, and 1.3s after.
- Loading branch information
Showing
1 changed file
with
11 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters