-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add partial transpose function in quantum_info #9566
Merged
Merged
Changes from 26 commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
5ba4856
partial_transpose included
PayalSolanki2906 a93623a
included partial_transpose
PayalSolanki2906 1a162dd
included partial_transpose
PayalSolanki2906 a7cbffe
included partial_transpose
PayalSolanki2906 95d99a5
included partial_transpose
PayalSolanki2906 ea9f8f0
included partial_transpose
PayalSolanki2906 2ff5294
included partial_transpose
PayalSolanki2906 ae400f1
included partial_transpose
PayalSolanki2906 28ba225
included partial_transpose
PayalSolanki2906 91cc3c1
included partial_transpose
PayalSolanki2906 d03e70e
included partial_transpose
PayalSolanki2906 fc1d655
included partial_transpose
PayalSolanki2906 a2c8a05
included test for partial transpose
PayalSolanki2906 35882a4
included test for partial transpose
PayalSolanki2906 3934c8c
included test for partial transpose
PayalSolanki2906 2a22078
added docstring
PayalSolanki2906 788f960
included DensityMatrix(rho1)
PayalSolanki2906 a3a16fb
changed rho1
PayalSolanki2906 c498c77
addition of release note
PayalSolanki2906 68f1ef6
Merge branch 'main' into pp-parttr
PayalSolanki2906 8e2684a
Merge branch 'main' into pp-parttr
PayalSolanki2906 934941f
Merge branch 'pp-parttr' of https://github.com/PayalSolanki2906/qiski…
PayalSolanki2906 3832e74
fix
PayalSolanki2906 11d5adc
fix
PayalSolanki2906 0ab74ea
fir partial_transpose
PayalSolanki2906 d944e23
Update utils.py
PayalSolanki2906 4f0a8c8
Merge branch 'main' into pp-parttr
ikkoham 84bd450
refactor and add tests
ikkoham e7c53ee
Merge pull request #1 from ikkoham/pp-parttr
PayalSolanki2906 5edcf20
Merge branch 'main' into pp-parttr
PayalSolanki2906 1b92492
Merge branch 'main' into pp-parttr
PayalSolanki2906 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
5 changes: 5 additions & 0 deletions
5
releasenotes/notes/adding-partial-transpose-040a6ff00228841b.yaml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
|
||
features: | ||
- | | ||
The partial transpose operation has been integrated into the quantum_info module, allowing for partial transposition of matrices. | ||
This operation is key in detecting entanglement between bipartite quantum system. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1202,6 +1202,17 @@ def test_drawings(self): | |
with self.subTest(msg=f"draw('{drawtype}')"): | ||
dm.draw(drawtype) | ||
|
||
def test_density_matrix_partial_transpose(self): | ||
"""Test partial_transpose function on density matrices""" | ||
rho = DensityMatrix.from_label("10+") | ||
rho1 = np.zeros((8, 8), complex) | ||
rho1[4, 4] = 0.5 | ||
rho1[4, 5] = 0.5 | ||
rho1[5, 4] = 0.5 | ||
rho1[5, 5] = 0.5 | ||
self.assertEqual(DensityMatrix.partial_transpose(rho, [0, 1]), DensityMatrix(rho1)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
self.assertEqual(DensityMatrix.partial_transpose(rho, [0, 2]), DensityMatrix(rho1)) | ||
|
||
|
||
if __name__ == "__main__": | ||
unittest.main() |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you need
_format_state
andreshape
?self
isDensityMatrix
by definition.