-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use np.einsum for gate-state multiplication
Use np.einsum to apply the gate matrix directly on the state vector, instead of expanding it first to the full dimension. - The private member self._state will remain a numpy array during the sequential application of gates. - If a measurement occurs, the state has to be transformed to a Qobj. - Returning the state after each step is removed as it inevitably creates Qobj and creates a copy in v4.
- Loading branch information
Showing
3 changed files
with
94 additions
and
27 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
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
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