Closed jofrevalles closed 1 year ago
Merging #39 (ca6a81e) into master (0bbd73d) will increase coverage by
0.00%
. The diff coverage is0.00%
.
@@ Coverage Diff @@
## master #39 +/- ##
======================================
Coverage 0.38% 0.39%
======================================
Files 13 13
Lines 772 769 -3
======================================
Hits 3 3
+ Misses 769 766 -3
Impacted Files | Coverage Δ | |
---|---|---|
src/Differentiation.jl | 0.00% <0.00%> (ø) |
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.
@mofeing I was thinking that here we can not do the adjoint of the tensors in the rrule
s, since this is not general for N>2-dimensional Tensor
s. Should this maybe be something else?
mmm adjoint
should only be applied to Tensor
s contained in a Quantum
TN. As such, there is a "directionality" sense in the TN. I see two solutions:
left_inds
in the Tensor
structure.Right now you can leave it like we talked so it works for Tensor
s with real numbers and we can continue discussing.
Okay, so right now it will work with rank-2 tensors. Still, we should consider adding the conjugate for larger dimensional tensors in the future (or maybe just raising an error), since the rrule
will not work for (N>2)-dimensional tensors.
If it's just for the rrule
, you can call conj
inside the rrule
instead of calling adjoint
.
Okay, good idea, let's do that.
Cool! Now our tests are not failing anymore. We will have to fix some that are currently commented out for the contraction of TensorNetwork
s, but the Tensor
type the chain rules are now working properly.
@mofeing, Can I close the issue #39 and start one for the contraction of TensorNetwork
s?
Summary
The previous code failed the
test_rrule
andtest_frule
for complex numbers (#38). In this PR we address this issue and fix the chainrrule
for contraction. We also addedrrule
andfrule
tests for the contraction of Tensors with complex values.Extra
The code now is not fully functional, and I believe that is because we have to somehow introduce the
ChainRulesCore.ProjectTo
for the adjointTensor
types. I think that is the reason whyȧ
orḃ
return aMatrix
instead of aTensor
sometimes: