You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
It seems that there is a bug while saving a list of tuples of matrices. In fact, it seems that saving or loading assumes wrong size of matrices which makes data unable to be loaded.
To Reproduce
using Oscar
julia> m = (matrix(QQ, 1, 1, [2]), matrix(QQ, 2, 2, [1//2 0; 0 1//2]))
([2], [1//2 0; 0 1//2])
julia> mm = [m, reverse(m)]
2-element Vector{Tuple{QQMatrix, QQMatrix}}:
([2], [1//2 0; 0 1//2])
([1//2 0; 0 1//2], [2])
julia> save("Schreibtisch/tmp.mrdi", mm)
julia> load("Schreibtisch/tmp.mrdi")
┌ Warning: Attempted loading file stored using a DEV version with commit 8fc7969f373c61cb9bab612fe608e89c9d2d7d0c
└ @ Oscar ~/.julia/dev/Oscar/src/Serialization/main.jl:712
ERROR: Expected dimension 1 x 1, got 2 x 2
Stacktrace:
[1] _check_dim
@ ~/.julia/packages/AbstractAlgebra/bL4Gd/src/Matrix.jl:46 [inlined]
[2] _check_dim
@ ~/.julia/packages/AbstractAlgebra/bL4Gd/src/Matrix.jl:44 [inlined]
[3] (::MatSpace{QQFieldElem})(arr::Matrix{QQFieldElem})
@ Nemo ~/.julia/packages/Nemo/E8ekQ/src/flint/fmpq_mat.jl:718
[4] load_object(s::Oscar.DeserializerState{Oscar.JSONSerializer}, ::Type{MatElem}, parents::Vector{Union{Ring, FreeAssociativeAlgebra, MatSpace, SMatSpace}})
@ Oscar ~/.julia/dev/Oscar/src/Serialization/Rings.jl:417
[...]
[31] load(filename::String)
@ Oscar ~/.julia/dev/Oscar/src/Serialization/main.jl:718
[32] top-level scope
@ REPL[13]:1
Some type information was truncated. Use `show(err)` to see complete types.
Expected behavior
Since we know how to serialize lists, tuples and matrices, I would expect to be able to serialize a list of tuples of matrices of various sizes.
System (please complete the following information):
Please paste the output of Oscar.versioninfo(full=true) below. If this does
not work, please paste the output of Julia's versioninfo() and your Oscar
version.
julia> Oscar.versioninfo(full=true)
OSCAR version 1.3.0-DEV - #main, 8fc7969f37 -- 2025-02-08 18:29:40 +0000
combining:
AbstractAlgebra.jl v0.44.5
GAP.jl v0.13.1
Hecke.jl v0.35.9
Nemo.jl v0.48.2
Polymake.jl v0.11.25
Singular.jl v0.24.1
building on:
FLINT_jll v300.100.301+0
GAP_jll v400.1400.3+0
Singular_jll v404.1.700+0
libpolymake_julia_jll v0.13.1+0
libsingular_julia_jll v0.46.1+0
polymake_jll v400.1300.2+0
See `]st -m` for a full list of dependencies.
Julia Version 1.10.1
Commit 7790d6f0641 (2024-02-13 20:41 UTC)
Build Info:
Official https://julialang.org/ release
Platform Info:
OS: Linux (x86_64-linux-gnu)
CPU: 8 × Intel(R) Core(TM) i7-10510U CPU @ 1.80GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-15.0.7 (ORCJIT, skylake)
Threads: 1 default, 0 interactive, 1 GC (on 8 virtual cores)
Official https://julialang.org/ release
...
The text was updated successfully, but these errors were encountered:
IIrc from personal communication with @antonydellavecchia, the serialization in Oscar only supports "homogeneous" lists, aka all its elements need to have the same "serialization params" (usually parents, coefficient rings, etc.). I don't know how this extends to lists of tuples, but I would assume this to be somehow similar.
Unfortunately, I couldn't find anything about this in the "Serialization" chapter of the documentation.
Maybe @antonydellavecchia could have a look at this particular problem, and also add the answer to the docs?
The expected behaviour should actually be that there is an error on save.
In the current master however this check isn't sufficient because it can only check if parent is the same for each entry of the vector and the way parent works on tuples isn't sufficient enough to throw the error.
This is fixed in #4162 .
The reason this should throw an error is because each entry of the vector should be a type that is parametrized in the same way for each entry.
In this example each entry in the vector is a tuple, but they are different tuples since for example each first entry has a different parent.
If you use a tuple instead of a list this should work, this is what the error that wasn't thrown would print.
Describe the bug
It seems that there is a bug while saving a list of tuples of matrices. In fact, it seems that saving or loading assumes wrong size of matrices which makes data unable to be loaded.
To Reproduce
Expected behavior
Since we know how to serialize lists, tuples and matrices, I would expect to be able to serialize a list of tuples of matrices of various sizes.
System (please complete the following information):
Please paste the output of
Oscar.versioninfo(full=true)
below. If this doesnot work, please paste the output of Julia's
versioninfo()
and your Oscarversion.
The text was updated successfully, but these errors were encountered: