fn

conj

Tensor
conj(input: Tensor)
source

Element-wise complex conjugate.

Negates the imaginary part of each entry. For real inputs it is a no-op (returns the input).

Parameters

inputTensor
Input tensor.

Returns

Tensor

Element-wise result with the same shape as input.

Notes

Mathematical definition:

outi=inputi=Re(xi)iIm(xi)\text{out}_i = \overline{\text{input}_i} = \mathrm{Re}(x_i) - i\,\mathrm{Im}(x_i)

Involution: conj(conj(x)) == x. Used in inner products on complex vector spaces.

Examples

>>> import lucid
>>> x = lucid.tensor([1.0, 2.0, 3.0])
>>> lucid.conj(x)
Tensor([...])