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 --- williamson.m | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'williamson.m') diff --git a/williamson.m b/williamson.m index f969ab1..eaba514 100644 --- a/williamson.m +++ b/williamson.m @@ -57,7 +57,6 @@ function [Db, S] = williamson(V, tol) Kt = K * p; s1t = p * s1 * p; - s1t dd = xpxp_to_xxpp(s1t); perm_indices = xpxp_to_xxpp(1:2*n); @@ -70,4 +69,14 @@ function [Db, S] = williamson(V, tol) S = inv(S)'; end +%!test +%! V = load('test_data/covmat0.csv'); +%! [Db, S] = williamson(V); +%! assert(Db,eye(8), 1e-14) + +%!test +%! V = load('test_data/covmat15.csv'); +%! D0 = load('test_data/w_diag15.csv'); +%! [Db, S] = williamson(V); +%! assert(Db,D0, 1e-9) -- cgit v1.2.3