diff options
Diffstat (limited to 'bloch_messiah.m')
-rw-r--r-- | bloch_messiah.m | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/bloch_messiah.m b/bloch_messiah.m index 4050102..19806db 100644 --- a/bloch_messiah.m +++ b/bloch_messiah.m @@ -79,3 +79,17 @@ function [ut1, st1, v1] = bloch_messiah(S, tol) v1 = real(v1); end +%!test +%! V = load('test_data/covmat0.csv'); +%! [Db, S] = williamson(V); +%! [ut1, st1, v1] = bloch_messiah(S); +%! st0 = load('test_data/bm_s0.csv'); +%! assert(st1,st0,1e-9) + +%!test +%! V = load('test_data/covmat15.csv'); +%! [Db, S] = williamson(V); +%! [ut1, st1, v1] = bloch_messiah(S); +%! st0 = load('test_data/bm_s15.csv'); +%! assert(st1,st0,1e-9) + |