-
Notifications
You must be signed in to change notification settings - Fork 66
setup SolveCtx for number fields #2149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2149 +/- ##
==========================================
- Coverage 88.14% 88.14% -0.01%
==========================================
Files 99 99
Lines 37054 37059 +5
==========================================
+ Hits 32663 32664 +1
- Misses 4391 4395 +4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Unfortunately, the magic does not seem to work:
Weirdly enough
works. |
The matrices are actually made integral in AbstractAlgebra: https://github.com/Nemocas/AbstractAlgebra.jl/blob/96790541de6f246c39f848a7c941f74413d673bb/src/Solve.jl#L1139 . So for this to work, the
Then at least my small example works. |
On Wed, Oct 01, 2025 at 06:10:42AM -0700, Johannes Schmitt wrote:
joschmitt left a comment (Nemocas/Nemo.jl#2149)
Unfortunately, the magic does not seem to work:
```
julia> K, a = cyclotomic_field(3, :a);
julia> A = K[1;;];
julia> B = K[1//2;;];
julia> can_solve_with_solution(A, B)
(true, [1])
To hazard a guess: the 3rd return value (the denominator) is ignored
… ```
Weirdly enough
```
julia> Nemo.AbstractAlgebra._can_solve_with_solution_fflu(A, B)
(true, [1//2], 1)
```
works.
--
Reply to this email directly or view it on GitHub:
#2149 (comment)
You are receiving this because you authored the thread.
Message ID: ***@***.***>
|
On Wed, Oct 01, 2025 at 06:17:50AM -0700, Johannes Schmitt wrote:
joschmitt left a comment (Nemocas/Nemo.jl#2149)
The matrices are actually made integral in AbstractAlgebra: https://github.com/Nemocas/AbstractAlgebra.jl/blob/96790541de6f246c39f848a7c941f74413d673bb/src/Solve.jl#L1139 . So for this to work, the `_common_denominator` would need to be
```
function AbstractAlgebra.Solve._common_denominator(A::MatElem{AbsSimpleNumFieldElem})
d = ZZ(1)
@inbounds for j in 1:ncols(A)
for i in 1:nrows(A)
d = lcm(d, denominator(A[i, j]))
end
end
return d
end
```
Then at least my small example works.
Try `can_solve_with_solution(4*A, B)`
the dens are handled badly. somewhere. In fields having a den of 1
always should maybe affect performance, but not correctness...
…
--
Reply to this email directly or view it on GitHub:
#2149 (comment)
You are receiving this because you authored the thread.
Message ID: ***@***.***>
|
Seems to be fine? I would say the problem is that https://github.com/Nemocas/AbstractAlgebra.jl/blob/96790541de6f246c39f848a7c941f74413d673bb/src/Solve.jl#L1139 calls a |
On Wed, Oct 01, 2025 at 06:34:45AM -0700, Johannes Schmitt wrote:
joschmitt left a comment (Nemocas/Nemo.jl#2149)
> On Wed, Oct 01, 2025 at 06:17:50AM -0700, Johannes Schmitt wrote: joschmitt left a comment ([Nemocas/Nemo.jl#2149](#2149)) The matrices are actually made integral in AbstractAlgebra: https://github.com/Nemocas/AbstractAlgebra.jl/blob/96790541de6f246c39f848a7c941f74413d673bb/src/Solve.jl#L1139 . So for this to work, the `_common_denominator` would need to be ``` function AbstractAlgebra.Solve._common_denominator(A::MatElem{AbsSimpleNumFieldElem}) d = ZZ(1) @inbounds for j in 1:ncols(A) for i in 1:nrows(A) d = lcm(d, denominator(A[i, j])) end end return d end ``` Then at least my small example works.
> Try `can_solve_with_solution(4*A, B)` the dens are handled badly. somewhere. In fields having a den of 1 always should maybe affect performance, but not correctness...
> […](#)
> -- Reply to this email directly or view it on GitHub: [#2149 (comment)](#2149 (comment)) You are receiving this because you authored the thread. Message ID: ***@***.***>
```
julia> can_solve_with_solution(4*A, B)
(true, [1//8])
```
Seems to be fine?
I got a 1//4...
…
I would say the problem is that https://github.com/Nemocas/AbstractAlgebra.jl/blob/96790541de6f246c39f848a7c941f74413d673bb/src/Solve.jl#L1139 calls a `numerator` function that is not compatible with the constant denominator 1.
--
Reply to this email directly or view it on GitHub:
#2149 (comment)
You are receiving this because you authored the thread.
Message ID: ***@***.***>
|
there are 2 things: common_den(matrix) needs to match den(elem) since we scale by matrix(den) to obtain elem == numerator |
to see a difference in
inv
it needs AA #2177. Solve should improve immedaitely, the rest I don't know