Skip to main content

is_unitary

Method of Operator.

is_unitary() -> bool​

Returns true if the operator is unitary. Conservative method: May return false for operators that are actually unitary. When true is returned, it is guaranteed to be correct.

Returns​

true if the operator is provably unitary, false otherwise (including cases where it may be unitary but cannot be verified).

Example​

var u1 = is_unitary(RotZ(1.0, 0)) // true (provably unitary)
var u2 = RotZ(0.5, 0).is_unitary() // true
var u3 = is_unitary(Proj0(0)) // false (provably not unitary)