Closed jofrevalles closed 1 year ago
Merging #78 (18b9620) into master (9e5349d) will decrease coverage by
0.45%
. The diff coverage is100.00%
.
@@ Coverage Diff @@
## master #78 +/- ##
==========================================
- Coverage 78.27% 77.82% -0.45%
==========================================
Files 9 9
Lines 695 699 +4
==========================================
Hits 544 544
- Misses 151 155 +4
Files Changed | Coverage Δ | |
---|---|---|
src/Quantum/Quantum.jl | 73.73% <100.00%> (-2.31%) |
:arrow_down: |
There is a reason why tensors
is only defined for State
s and not Operator
s, being that it is not as easy for Operator
s when the input and output sites do not match. This is the case of the Spaced Matrix Product Operator, for example.
I'm closing this PR without merging because I don't think this should be the solution, but thanks for reminding that I have yet to fix this.
@jofrevalles do you mind opening an issue?
If you need a quick fix, you can use the interlayer
property of Quantum
TNs along with the select
function. Also comment it with a # TODO refactor this when tensors is implemented for Operators
please.
Okay. Since right now MPO
and PEPO
do only support the same amount of inputs/outputs I thought that was a good idea to implement that. Nevertheless, let's discuss that in an issue.
Summary
This PR addresses a bug in the
tensors
function which caused aMethodError
when called with aTensorNetwork
ofOperator
type. The root cause was that the function signature was designed exclusively for theState
type. The solution was to extend the function signature to handle bothOperator
andState
types.In addition to the fix, this PR introduces new tests designed to cover this scenario and prevent regressions.
Example
Here we can see an example of the previous error: