-
Notifications
You must be signed in to change notification settings - Fork 604
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
**Context:** It would be nice to have a function to calculate the expectation values of an operator $A$ given a state vector $\vert\psi\rangle$. This can be also used for computing the fidelity between a mixed and a pure state in simple way, avoiding eigendecomposition problems. **Description of the Change:** Added a overlap calculation between state vectors and density matrices **Benefits:** It is faster then computing $\text{Tr}(A \vert\psi\rangle\langle\psi\vert)$. No need for eigendecomposition, therefore, it is a way to avoid issues regarding differentiation as pointed on issue #4373. **Possible Drawbacks:** It does not work if the user pass as input two state vectors or two matrices. It is tailored to first input as (batched) matrices and the second one as (batched) state vectors. **Related GitHub Issues:** #4373 --------- Co-authored-by: Frederik Wilde <[email protected]> Co-authored-by: Christina Lee <[email protected]> Co-authored-by: Matthew Silverman <[email protected]> Co-authored-by: Romain Moyard <[email protected]> Co-authored-by: Mudit Pandey <[email protected]> Co-authored-by: Olivia Di Matteo <[email protected]> Co-authored-by: Olivia Di Matteo <[email protected]> Co-authored-by: Jay Soni <[email protected]> Co-authored-by: Christina Lee <[email protected]> Co-authored-by: Matthew Silverman <[email protected]> Co-authored-by: David Wierichs <[email protected]> Co-authored-by: Edward Jiang <[email protected]> Co-authored-by: Utkarsh <[email protected]> Co-authored-by: Korbinian Kottmann <[email protected]> Co-authored-by: Thomas R. Bromley <[email protected]> Co-authored-by: Astral Cai <[email protected]> Co-authored-by: Astral Cai <[email protected]>
- Loading branch information
1 parent
94adc17
commit fb06ce8
Showing
4 changed files
with
348 additions
and
9 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
Oops, something went wrong.