-
Notifications
You must be signed in to change notification settings - Fork 1
Change labels
for the conj
of a Tensor
#13
Comments
I don't agree with this. You should call Tenet.contract(A, replace(conj(A), labels(A)[2] => :new_ind_name), (labels(A)[1], labels(A)[3])) |
In all tensor contraction functions I used, if you don't specify that the index is being contracted, it is taken as two different indexes. That's the whole purpose of specifying the labels to contract.
Okay, this can work. Nevertheless, I still think it is not a good idea since we will have to use this always that we specify a set of |
That's because what you usually pass are arrays but in our case, we already have arrays asociated to a set of indices.
We can discuss this after holidays, but the way other libraries follow does not convince me. |
Continuing with the discussion, I believe that the line: julia> Tenet.contract(A, conj(A), (labels(A)[1], labels(A)[3])) where |
Summary
The conjugate of a
Tensor
returns the conjugateddata
but thelabels
are not changed.This can be a problem if we want to partially contract a
Tensor
with its conjugate along a set of indices, since it will assume that the not-contracted indices are the same. Instead, I would suggest that a conjugate of aTensor
should have differentlabels
for the indices, and we could specify how to do the contraction incontract
(similar likeOMEinsum
does).Example
I would expect here that the contraction using
ein
fromOMEinsum
andcontract
are equivalent and return aMatrix
. Instead,contract
returns a one-dimensionalTensor
:The text was updated successfully, but these errors were encountered: