On Wed, Sep 28, 2022 at 6:49 AM Александр Каренин (alexKar)
<
tremel...@gmail.com> wrote:
> Having trouble with the matrix multiplication which I first explained in
https://ask.sagemath.org/question/64194/determinants-over-cyclotomic-fields-are-broken/
> If I define two matrices (L and U) over CyclotomicField and then multiply then like L*U and via the definition then the results are sometimes different. An example is:
>
> K.<z> = CyclotomicField(16)
> OK = K.ring_of_integers()
> L = [[-575*z^7 - 439*z^6 - 237*z^5 + 237*z^3 + 439*z^2 + 575*z + 623, 0],
> [0, -114*z^7 - 88*z^6 - 48*z^5 + 48*z^3 + 88*z^2 + 114*z + 123]]
> U = [[-1926*z^7 - 1474*z^6 - 798*z^5 + 798*z^3 + 1474*z^2 + 1926*z + 2085, 0],
> [0, -1014*z^7 - 777*z^6 - 421*z^5 + 421*z^3 + 777*z^2 + 1014*z + 1097]]
> L, U = matrix(K,L), matrix(K,U)
> LU = matrix( [ [L[i].inner_product(U.transpose()[j]) for j in range(2)] for i in range(2)] )
> assert LU == L*U
>
> Where the last assertion must clearly sucseed but it doesn't.
>
> Note: if I define L, U = matrix(K,L), matrix(K,U) then the matrices are no longer Matrix_cyclo_dense but Matrix_generic_dense and the last assertion sucseeds!
> You received this message because you are subscribed to the Google Groups "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to