qml.math.angle

angle(tensor)[source]

Returns the element-wise angle of a complex tensor.

Parameters

tensor (tensor_like) – input tensor

Returns

Return type

tensor_like

Example

>>> a = torch.tensor([1.0, 1.0j, 1+1j], requires_grad=True)
>>> angle(a)
tensor([0.0000, 1.5708, 0.7854], grad_fn=<AngleBackward>)