!subroutine measure_ft is where we do some tests to see if the matrix is sensible subroutine measure_ft(M, det, tune) use bmad implicit none real(rp), allocatable:: M(:,:) real(rp) tune(3) real(rp) det real(rp) half_trace integer n,i integer j n=size(M,1) print * print *,' n= ', n print *,'M' do i=1,n print '(6es12.4)',(M(i,j),j=1,n) end do tune = 0. do i = 1,n/2 half_trace = (M(2*i-1,2*i-1)+M(2*i,2*i))/2 if(abs(half_trace) <= 1. )tune(i) = acos(half_trace)/twopi if(abs(half_trace) > 1. )tune(i) = -acosh(half_trace)/twopi end do det = determinant(M(1:n,1:n)) tune(1:2) = 1.-tune(1:2) print '(a,es12.4)',' determinant = ',det print '(a,3es12.4)','tune = ',tune print '(a,3es12.4)','1-tune = ',1-tune return end