qml.is_hermitian

is_hermitian(op)[source]

Check if the operation is hermitian.

A hermitian matrix is a complex square matrix that is equal to its own adjoint

\[O^\dagger = O\]
Parameters

op (Operator) – the operator to check against

Returns

True if the operation is hermitian, False otherwise

Return type

bool

Note

This check might be expensive for large operators.

Example

>>> op = qml.X(0)
>>> qml.is_hermitian(op)
True
>>> op2 = qml.RX(0.54, wires=0)
>>> qml.is_hermitian(op2)
False

Contents

Using PennyLane

Development

API

Internals