I may be confused, but...

29 views
Skip to first unread message

Justin C. Walker

unread,
Oct 8, 2025, 7:17:54 PM (6 days ago) Oct 8
to SAGE Support
Using sage 9.7 and 10.3 (on an oldish iMac), I ran into some puzzling results, of which the following are minimal examples:

#1:
sage: 4.is_square()
True
sage: 4.is_squarefree()
False

#2:
sage: f=x^2-3
sage: K.<a>=NumberField(f)
sage: OK=K.maximal_order()
sage: v=OK.random_element()
sage: v
2*a + 1
sage: v==v.conjugate()
True

#1 I don’t get (and it seems to contradict the “?” doc); while #2 may be a misunderstanding on my part.

Thoughts?  Pointers?

Thanks, for any help.

Justin

--
Justin C. Walker, Curmudgeon at Large
Institute for the Absorption of Federal Funds
-----------
I want to die, peacefully in my sleep, like my grandfather;
not screaming in terror, like his passengers.




John Cremona

unread,
Oct 9, 2025, 4:54:29 AM (5 days ago) Oct 9
to sage-support
As for #1, 4 is certainly a square, and is also not square-free (begin divisible by a square >1) so I don't see any problem.

For #2, K is a real quadratic field, and the conjugate method is *not* Galois conjugation, but complex conjugation (with respect to either of the embeddings of K into CC); for that, use v.galois_conjugate().

John Cremona

Justin C. Walker

unread,
Oct 9, 2025, 12:39:57 PM (5 days ago) Oct 9
to SAGE Support
Thanks for that lesson in the English language, John.  I obviously needed it :-}

As for #2, that’s something I did not know!

Justin

-- 
You received this message because you are subscribed to the Google Groups "sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sage-support...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/sage-support/a67a94d8-8e79-4cc4-8974-1c3b6a0c9c22n%40googlegroups.com.

--
Justin C. Walker, Curmudgeon at Large
Director
Institute for the Enhancement of the Director's income
-----------
Question 43:
What if the hokey pokey
really *is* what it’s all about?
--

Nils Bruin

unread,
Oct 9, 2025, 4:28:10 PM (5 days ago) Oct 9
to sage-support
Note that

4.is_square?

and

a=4
a.is_square?

give different documentation strings. I don't know where the first is coming from. That looks like a strange glitch. It gives the documentation of the function is_square, which is not what the method on integers is.
Reply all
Reply to author
Forward
0 new messages