-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix inconsistent canonical form labelling (#177)
# Description - I recently noticed that the code to apply two-qubit gates on non-adjacent qubits was using the wrong convention for what `DirMPS` refers to when describing the canonical form of a tensor. I believe in edge cases this could cause "incorrect" truncations, in the sense that the MPS would not be properly canonicalised, and hence we would lose the guarantees of optimality of singular value truncation. In practice, I have not encountered such a situation. Another point where it affects (and I think would be more common) is that tensor are unnecessarily re-canonicalised, because they were labelled with the wrong canonical form. This PR solves that issue. - Additionally, I included a small change to apply_unitary so that it can accept `np.ndarray` as well. # Checklist - [x] I have performed a self-review of my code. - [x] I have commented hard-to-understand parts of my code. - [x] I have made corresponding changes to the public API documentation. - [ ] I have added tests that prove my fix is effective or that my feature works. - [ ] I have updated the changelog with any user-facing changes.
- Loading branch information
1 parent
1e12786
commit 092816b
Showing
4 changed files
with
30 additions
and
19 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
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