def K3mat_old(E, L, K0, K1, K2, A, B, Ytype): nnk_list = list_nnk(E, L) N = len(nnk_list) K3_00 = np.zeros((N, N)) K3_02 = np.zeros((N, 5 * N)) K3_20 = np.zeros((5 * N, N)) K3_22 = np.zeros((5 * N, 5 * N)) for i in range(N): pvec = [npi * 2 * pi / L for npi in nnk_list[i]] for j in range(N): kvec = [nki * 2 * pi / L for nki in nnk_list[j]] K3_00[i][j] = K3quad(E, pvec, 0, 0, kvec, 0, 0, K0, K1, K2, A, B, Ytype) for mp in range(-2, 3): I = (mp + 2) * N + i K3_20[I][j] = K3quad(E, pvec, 2, mp, kvec, 0, 0, K0, K1, K2, A, B, Ytype) for m in range(-2, 3): J = (m + 2) * N + j K3_22[I][J] = K3quad(E, pvec, 2, mp, kvec, 2, m, K0, K1, K2, A, B, Ytype) if mp == 2: # only do this once (mp==2 is arbitrary) K3_02[i][J] = K3quad(E, pvec, 0, 0, kvec, 2, m, K0, K1, K2, A, B, Ytype) return full_matrix(K3_00, K3_20, K3_02, K3_22)
def Hmat_old(E,L,a0,r0,P0,a2): Hmat00 = K2i_mat.K2inv_mat0(E,L,a0,r0,P0) + F2_alt.full_F2_00_matrix(E,L) + Gmatrix.G00(E,L) Hmat20 = F2_alt.full_F2_20_matrix(E,L) + Gmatrix.G20(E,L) Hmat02 = F2_alt.full_F2_02_matrix(E,L) + Gmatrix.G02(E,L) Hmat22 = K2i_mat.K2inv_mat2(E,L,a2) + F2_alt.full_F2_22_matrix(E,L) + Gmatrix.G22(E,L) return full_matrix( Hmat00, Hmat20, Hmat02, Hmat22 )
def detF2_dwave(e, L, a, a2): XI = np.diag(np.concatenate((np.diag(Xi00(e, L)), np.diag(Xi22(e, L))))) RHO = np.diag(np.concatenate((np.diag(RHO00(e, L)), np.diag(RHO22(e, L))))) A = np.diag(np.concatenate((np.diag(A00(e, L, a)), np.diag(A22(e, L, a2))))) G = full_matrix(G00(e, L), G20(e, L), G02(e, L), G22(e, L)) f00 = F2.full_F2_00_matrix(e, L) f20 = F2.full_F2_20_matrix(e, L) f02 = F2.full_F2_02_matrix(e, L) f22 = F2.full_F2_22_matrix(e, L) F = full_matrix(f00, f20, f02, f22) matrix1 = np.dot(XI, F + G) matrix2 = RHO + np.dot(matrix1, XI) + A detres = np.linalg.det(matrix2) return detres
def Hmatinv_block(E,L,a0,r0,P0,a2): Ai = LA.inv( K2i_mat.K2inv_mat0(E,L,a0,r0,P0) + F2_alt.full_F2_00_matrix(E,L) + Gmatrix.G00(E,L) ) B = F2_alt.full_F2_02_matrix(E,L) + Gmatrix.G02(E,L) C = F2_alt.full_F2_20_matrix(E,L) + Gmatrix.G20(E,L) D = K2i_mat.K2inv_mat2(E,L,a2) + F2_alt.full_F2_22_matrix(E,L) + Gmatrix.G22(E,L) Ei = LA.inv( D-C*Ai*B ) out00 = Ai + Ai@B@Ei@C@Ai out20 = -Ei@C@Ai out02 = -Ai@B@Ei out22 = Ei return full_matrix( out00, out20, out02, out22 )
def Gmat_old(E, L): return full_matrix(G00(E, L), G20(E, L), G02(E, L), G22(E, L))
def Fmat_old(E, L): F00 = full_F2_00_matrix(E, L) F20 = full_F2_20_matrix(E, L) F02 = full_F2_02_matrix(E, L) F22 = full_F2_22_matrix(E, L) return full_matrix(F00, F20, F02, F22)