Subsections

7 More operators and functions

Unless noted, all functions return either true or false.

7.1 Predicate functions -- testing for properties

7.1.1 identitymatrixp

identitymatrixp($e$) returns true if e is the $n\times n$ identity matrix for any $n$.

7.1.2 ketp, brap, braketp

ketp($e$) returns true if the expression e is a ket (column vector). brap($e$) returns true if the expression e is a bra (row vector). braketp($e$) returns (ketp(e) or brap(e)), ie returns true if e is either a ket or a bra.

7.1.3 square_matp

square_matp($e$) returns true if e is a square matrix.

7.2 Miscellaneous

7.2.1 normalize_vector

normalize_vector($v$) returns $v/{\langle v\vert v\rangle}$.

7.2.2 normalize_matrix

normalize_matrix($m$) returns $m/\mbox{Tr}(m)$.





John Lapeyre 2008-09-02