-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Closed
Labels
mod: quantum infoRelated to the Quantum Info module (States & Operators)Related to the Quantum Info module (States & Operators)performancetype: feature requestNew feature or requestNew feature or request
Description
What should we add?
Currently the hashing of a Pauli operator is computed as hash(self.to_label())
. It is basically asking for the label of the Pauli operator which is an expensive computation to run. Instead building it directly from self.x
, self.z
,self.phase
seems more reasonable.
I did a quick test where I do the hashing with int.from_bytes(np.packbits([self.x, self.z]+[self.phase]))
and it was about 50 times faster.
Metadata
Metadata
Assignees
Labels
mod: quantum infoRelated to the Quantum Info module (States & Operators)Related to the Quantum Info module (States & Operators)performancetype: feature requestNew feature or requestNew feature or request