    function T = transitionjeff(G1, G2)
    
    n = max(size(G1));
    [PDiag1 GDiag1] = eig(G1); 
    P2 = zeros(n);
    for i=1:n
        P2(:,i:i) = randsoln(GDiag1(i,i)*eye(n)-G2);
    end
    PDiag1; % GDiag and therefore PDiag may be imaginary
    P2; % GDiag and therefore PJeff may be imaginary
    GDiag1;
    inv(PDiag1)*G1*PDiag1; % Should be GDiag
    inv(P2)*G2*P2; % Should be GDiag
    T = P2*inv(PDiag1);
   