![]() |
Conjugates the given tensor about the target tensor.
cirq.linalg.targeted_conjugate_about(
tensor: np.ndarray,
target: np.ndarray,
indices: Sequence[int],
conj_indices: Sequence[int] = None,
buffer: Optional[np.ndarray] = None,
out: Optional[np.ndarray] = None
) -> np.ndarray
This method computes a target tensor conjugated by another tensor. Here conjugate is used in the sense of conjugating by a matrix, i.a. A conjugated about B is \(A B A^\dagger\) where \(\dagger\) represents the conjugate transpose.
Abstractly this compute \(A \cdot B \cdot A^\dagger\) where A and B are multi-dimensional arrays, and instead of matrix multiplication \(\cdot\) is a contraction between the given indices (indices for first \(\cdot\), conj_indices for second \(\cdot\)).
More specifically this computes $\sum tensor_{i0,...,i{r-1},j0,...,j{r-1} } * target_{k0,...,k{r-1},l0,...,l{r-1} } * tensor_{m0,...,m{r-1},n0,...,n{r-1} }^*$
where the sum is over indices where \(j_s\) = \(k_s\) and \(s\) is in indices
and \(l_s\) = \(m_s\) and s is in conj_indices
.
Args | |
---|---|
tensor
|
The tensor that will be conjugated about the target tensor. |
target
|
The tensor that will receive the conjugation. |
indices
|
The indices which will be contracted between the tensor and target. |
conj_indices
|
The indices which will be contracted between the
complex conjugate of the tensor and the target. If this is None,
then these will be the values in indices plus half the number
of dimensions of the target (ndim ). This is the most common case
and corresponds to the case where the target is an operator on
a n-dimensional tensor product space (here n would be ndim ).
|
buffer
|
A buffer to store partial results in. If not specified or None, a new buffer is used. |
out
|
The buffer to store the results in. If not specified or None, a new buffer is used. Must have the same shape as target. |
Returns | |
---|---|
The result the conjugation. |