% test deflate_dcnots()

global_defs;

example = 1;
switch example
	case (1)
		a0= get_unit_vec(randn(3,1));
		t0= get_unit_vec(randn(3,1));
		d0= get_unit_vec(randn(3,1));

		a1= get_unit_vec(randn(3,1));
		d1= get_unit_vec(randn(3,1));

	otherwise
		error("example number is out of range");
end
vecs_in=[d0,t0,t0,a0;d1,d1,a1,a1];
[vecs_out, U1, U0] = deflate_dcnots(vecs_in);
b0f=vecs_out(1:3,1); a0f=vecs_out(1:3,2);
b1f=vecs_out(4:6,1); a1f=vecs_out(4:6,2);

% d0    t0    t0    a0         b0f   a0f  [U0]
% |     |     |     |    -->   |     |    
% d1    d1    a1    a1         b1f   a1f  [U1]


error1 = norm(dr11(d1,d0)*dr11(d1,t0)*dr11(a1,t0)*dr11(a1,a0) -dr11(b1f,b0f)*dr11(a1f,a0f)*kron(U1,U0) )
