Closed HereAround closed 8 months ago
All of this seems right to me.
polynomial_ring(QQ, "x" => (1:2, 1:3), "y" => 1:2, "z" => (1:1, 1:1, 1:1))
returns 4 things: the ring, the x vars, the y vars, the z vars. Due to how julia handles tuple unpacking, you ask it only for two things, where the first one gets saved in R
and the second one gets further unpacked and the first three things get saved in s
, t
, u
. julia
considers it a feature instead of a bug to discard excess objects in tuple unpacking.
the first three indices of the x
matrix are indeed (1,1)
, (2,1)
and (1,2)
(it would continue with (2,2)
, (1,3)
, (2,3)
). After all, this is a julia matrix which has column-major indexing.
Ah! One does need time to get used to certain "features" of Julia ;-) Thanks for the clarification.
When we have time, we'll revise the tutorial about creating polynomial rings. The behaviour of the function polynomial_ring
can be confusing.
Describe the bug
The following ring constructor should maybe not work, because the variables defined as return values (here "s", "t" and "u") cannot match the number of generators of the created ring R (6 indeterminates).
(Aside: The output looks weird and includes a triple semicolon. Of course, we should of course not fumble around with the printing at this point in time. Still, maybe at a future stage, it could be checked if this is truly necessary? Julia weirdness?)
It is surprising that this input is accepted, since there are 9 variables in R but I only provide 3 julia names. So should have expected an error or a warning. But still... since this seems to work, I should expect that
s
is related to the first,t
to the second andu
to the third variable ofR
. Yet, here is whatjulia
tells me:Is this desired?
@JohnAAbbott suggested the following constructor instead:
Then we find the following:
(
u
is a 1 by 1 by 1 array???).This looks better and is sort-of what one can expect.
To Reproduce Steps to reproduce the behavior, please provide a code snippet that triggers the bug.
Expected behavior
R
andR2
above) should yield the same output.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'sversioninfo()
and your Oscar version.(@JohnAAbbott also tried with OSCAR
0.15.0
).Additional context
Appeared (or currently still does) in one tutorial.