torch.conj_physical
function conj_physical(input: unknown, options: unknown): TensorReturns the element-wise complex conjugate of the input tensor.
Computes z* = conj(z) for each complex element z = a + bi, where conj(a + bi) = a - bi. For real-valued tensors, returns a clone (real numbers are self-conjugate). Essential for:
- Signal processing (matched filtering, correlation computation)
- Quantum mechanics (bra-ket notation, Hermitian operators)
- Matrix operations (Hermitian transpose, adjoints)
Properties:
- Conjugate of conjugate: (z*)* = z
- Magnitude: |z*| = |z|
- Phase: arg(z*) = -arg(z)
Parameters
inputunknown- Complex or real-valued tensor of any shape
optionsunknown- Optional settings including
outparameter
Returns
Tensor– Conjugate tensor with same shape and dtype as inputExamples
// Complex conjugate: 3 + 4i → 3 - 4i
const z = torch.complex(torch.tensor([3.0]), torch.tensor([4.0]));
const z_conj = torch.conj_physical(z);
torch.imag(z_conj); // [-4]
// Real numbers are self-conjugate
const x = torch.tensor([1.0, 2.0]);
torch.conj_physical(x); // [1, 2] (unchanged)See Also
- PyTorch torch.conj_physical()
- real - Extract real component (unchanged by conjugation)
- imag - Extract imaginary component (negated by conjugation)
- angle - Extract phase angle (negated by conjugation)