diff options
author | Eugeniy E. Mikhailov <evgmik@gmail.com> | 2024-11-20 21:27:21 -0500 |
---|---|---|
committer | Eugeniy E. Mikhailov <evgmik@gmail.com> | 2024-11-20 21:27:21 -0500 |
commit | ba1aa48aa9f0a5daab3619812733e67c4babf9db (patch) | |
tree | e4086a7d863d635c91c6bc4be89dd4edc7a85e46 /bloch_messiah.m | |
parent | fa3ed5eaf67bd54e8f1fa4a1bc2c7ffbd1898d6f (diff) | |
download | matlab_strawberryfields-ba1aa48aa9f0a5daab3619812733e67c4babf9db.tar.gz matlab_strawberryfields-ba1aa48aa9f0a5daab3619812733e67c4babf9db.zip |
added test cases for bloch_messiah and williamson
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) + |