gusucode.com > qit_matlab_0.10.0工具箱源码程序 > qit/@state/var.m

    function x = var(s, A)
% VAR  Variance of an observable in the state.
%  x = var(s, A)
%
%  Returns the variance of observable A in the state s.
%  A has to be Hermitian.

% Ville Bergholm 2009


x = ev(s, A^2) - ev(s, A)^2;