USCqserver / OpenQuantumBase.jl

Abstract types and math operations for OpenQuantumTools.jl.
https://uscqserver.github.io/OpenQuantumTools.jl/stable/
MIT License
7 stars 2 forks source link

flexibilize types for partial_trace #109

Closed araujoms closed 10 months ago

araujoms commented 10 months ago

Currently partial_trace does not accept Hermitian or Symmetric matrices, and always returns a ComplexF64 result, independent of the type of the input. This PR fixes both issues. I'm also adding a convenience method to allow calling it with dim_2_keep being a integer instead of a vector.

I hope you find it useful.

codecov[bot] commented 10 months ago

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (fc2ec75) 80.40% compared to head (ea673d4) 80.36%.

Files Patch % Lines
src/math_util.jl 66.66% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #109 +/- ## ========================================== - Coverage 80.40% 80.36% -0.04% ========================================== Files 36 36 Lines 2281 2282 +1 ========================================== Hits 1834 1834 - Misses 447 448 +1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

neversakura commented 10 months ago

@araujoms Thanks!