DiscretizedSpaceElement.conj¶
- DiscretizedSpaceElement.conj(out=None)[source]¶
Complex conjugate of this element.
- Parameters:
- out
DiscretizedSpaceElement
, optional Element to which the complex conjugate is written. Must be an element of this element's space.
- out
- Returns:
- out
DiscretizedSpaceElement
The complex conjugate element. If
out
is provided, the returned object is a reference to it.
- out
Examples
>>> discr = uniform_discr(0, 1, 4, dtype=complex) >>> x = discr.element([5+1j, 3, 2-2j, 1j]) >>> y = x.conj() >>> print(y) [ 5.-1.j, 3.-0.j, 2.+2.j, 0.-1.j]
The out parameter allows you to avoid a copy:
>>> z = discr.element() >>> z_out = x.conj(out=z) >>> print(z) [ 5.-1.j, 3.-0.j, 2.+2.j, 0.-1.j] >>> z_out is z True
It can also be used for in-place conjugation:
>>> x_out = x.conj(out=x) >>> print(x) [ 5.-1.j, 3.-0.j, 2.+2.j, 0.-1.j] >>> x_out is x True