function check_dcnots(vecs) %Input is a matrix packed with 2 rows of unit 3d vectors. %Input specifies a string of dressed cnots. %This function checks that all the input vectors are unit vectors. cols = columns(vecs); if(rows(vecs)!=6) error("input doesn't have six rows."); end for c=1:cols r=1; while(r<5) if(abs(norm(vecs(r:r+2,c))-1)>1e-10) error("non-unit vector used to specify a dressed cnot"); end r=r+3; end end