From ba1aa48aa9f0a5daab3619812733e67c4babf9db Mon Sep 17 00:00:00 2001 From: "Eugeniy E. Mikhailov" Date: Wed, 20 Nov 2024 21:27:21 -0500 Subject: added test cases for bloch_messiah and williamson --- bloch_messiah.m | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'bloch_messiah.m') 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) + -- cgit v1.2.3