qml.is_hermitian

is_hermitian(op: pennylane.operation.Operator)[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.PauliX(wires=0)
>>> qml.is_hermitian(op)
True
>>> op2 = qml.RX(0.54, wires=0)
>>> qml.is_hermitian(op2)
False

Contents

Using PennyLane

Development

API