Skip to content
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

Fix output of DensityMatrix.partial_transpose to match input dimensions #10163

Merged
merged 5 commits into from
Jun 6, 2023

Conversation

diemilio
Copy link
Contributor

Summary

Add dimensions to the DensityMatrix returned by partial_transpose so its dimensions match those of the input density matrix.

Details and comments

Fix #10155

@diemilio diemilio requested review from a team and ikkoham as code owners May 25, 2023 12:33
@qiskit-bot qiskit-bot added the Community PR PRs from contributors that are not 'members' of the Qiskit repo label May 25, 2023
@qiskit-bot
Copy link
Collaborator

Thank you for opening a new pull request.

Before your PR can be merged it will first need to pass continuous integration tests and be reviewed. Sometimes the review process can be slow, so please be patient.

While you're waiting, please feel free to review other open PRs. While only a subset of people are authorized to approve pull requests for merging, everyone is encouraged to review open pull requests. Doing reviews helps reduce the burden on the core team and helps make the project's code better for everyone.

One or more of the the following people are requested to review this:

  • @Qiskit/terra-core
  • @ikkoham

@diemilio
Copy link
Contributor Author

lmk if tests to check for dims are needed.

@jakelishman
Copy link
Member

Yeah, a short test and a bugfix release note would be great, please!

@jakelishman jakelishman added Changelog: Bugfix Include in the "Fixed" section of the changelog mod: quantum info Related to the Quantum Info module (States & Operators) labels May 25, 2023
@coveralls
Copy link

coveralls commented May 25, 2023

Pull Request Test Coverage Report for Build 5188549547

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • 187 unchanged lines in 18 files lost coverage.
  • Overall coverage increased (+0.001%) to 85.94%

Files with Coverage Reduction New Missed Lines %
crates/accelerate/src/error_map.rs 1 81.63%
crates/accelerate/src/sabre_swap/neighbor_table.rs 1 87.18%
crates/accelerate/src/sabre_swap/sabre_dag.rs 1 97.14%
crates/qasm2/src/expr.rs 1 93.76%
crates/qasm2/src/lib.rs 1 92.21%
qiskit/circuit/instruction.py 1 95.69%
qiskit/transpiler/passmanager_config.py 1 97.26%
crates/accelerate/src/edge_collections.rs 2 54.55%
qiskit/dagcircuit/collect_blocks.py 2 98.6%
qiskit/extensions/hamiltonian_gate.py 2 89.39%
Totals Coverage Status
Change from base Build 5073178665: 0.001%
Covered Lines: 71370
Relevant Lines: 83046

💛 - Coveralls

ikkoham
ikkoham previously approved these changes Jun 6, 2023
Copy link
Contributor

@ikkoham ikkoham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for finding and fixing the bug. Great!

Copy link
Member

@jakelishman jakelishman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@jakelishman jakelishman added the stable backport potential The bug might be minimal and/or import enough to be port to stable label Jun 6, 2023
@jakelishman jakelishman added this to the 0.24.2 milestone Jun 6, 2023
@jakelishman jakelishman added this pull request to the merge queue Jun 6, 2023
Merged via the queue into Qiskit:main with commit 6f29d7b Jun 6, 2023
mergify bot pushed a commit that referenced this pull request Jun 6, 2023
…ions (#10163)

* (fix) change output of partial_transpose to return DensityMatrix matching input dimensions

* (test) check output dims match input dims when using DensityMatrix.partial_transpose

* (docs) add bugfix reno

* lint changes

* Fix up release note

---------

Co-authored-by: Jake Lishman <[email protected]>
(cherry picked from commit 6f29d7b)
jakelishman pushed a commit that referenced this pull request Jun 6, 2023
…ions (#10163) (#10215)

* (fix) change output of partial_transpose to return DensityMatrix matching input dimensions

* (test) check output dims match input dims when using DensityMatrix.partial_transpose

* (docs) add bugfix reno

* lint changes

* Fix up release note

---------

Co-authored-by: Jake Lishman <[email protected]>
(cherry picked from commit 6f29d7b)

Co-authored-by: Diego Emilio Serrano <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: Bugfix Include in the "Fixed" section of the changelog Community PR PRs from contributors that are not 'members' of the Qiskit repo mod: quantum info Related to the Quantum Info module (States & Operators) stable backport potential The bug might be minimal and/or import enough to be port to stable
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

DensityMatrix.partial_transpose does not preserve input dimensions
5 participants