Skip to content
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

Change ring to QQbar fails for subschemes #20067

Closed
bhutz opened this issue Feb 16, 2016 · 41 comments
Closed

Change ring to QQbar fails for subschemes #20067

bhutz opened this issue Feb 16, 2016 · 41 comments

Comments

@bhutz
Copy link
Contributor

bhutz commented Feb 16, 2016

Change ring for subschemes does not let the user specify an embedding and so fails for QQbar

K.<w>=QuadraticField(2)
P.<x,y> = ProjectiveSpace(K,1)
X = P.subscheme(x-y)
X.change_ring(QQbar)
K.<w>=QuadraticField(2)
P.<x,y> = ProjectiveSpace(K,1)
X = P.subscheme(x-y)
H = End(X)
f = H([6*x^2+2*x*y+16*y^2,-3*x^2-4*x*y-4*y^2])
f.change_ring(QQbar)

Component: algebraic geometry

Author: Ben Hutz

Branch: e73cd1f

Reviewer: Rebecca Lauren Miller, Joseph Eisner

Issue created by migration from https://trac.sagemath.org/ticket/20067

@bhutz bhutz added this to the sage-7.1 milestone Feb 16, 2016
@bhutz bhutz self-assigned this Feb 16, 2016
@bhutz
Copy link
Contributor Author

bhutz commented Feb 16, 2016

Branch: u/bhutz/ticket/20067

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Feb 16, 2016

Branch pushed to git repo; I updated commit sha1. New commits:

276ff7120067: improve change_ring() for subschemes

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Feb 16, 2016

Commit: 276ff71

@bhutz
Copy link
Contributor Author

bhutz commented Feb 16, 2016

comment:3

I added the embedding option for subschemes and made some other improvements to change_ring() in general to make it a little more robust.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Feb 18, 2016

Branch pushed to git repo; I updated commit sha1. New commits:

6a3922320067: try coercion first for change_ring

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Feb 18, 2016

Changed commit from 276ff71 to 6a39223

@sagetrac-rlmiller
Copy link
Mannequin

sagetrac-rlmiller mannequin commented Feb 18, 2016

Reviewer: Rebecca Miller, Joseph Eisner

@sagetrac-rlmiller
Copy link
Mannequin

sagetrac-rlmiller mannequin commented Feb 18, 2016

Changed reviewer from Rebecca Miller, Joseph Eisner to Rebecca Lauren Miller, Joseph Eisner

@sagetrac-rlmiller
Copy link
Mannequin

sagetrac-rlmiller mannequin commented Feb 18, 2016

comment:7
  1. Has coerce map from instead of try accept
  2. raise warning if embedding not specified and no coerce map

Still doing functionality testing.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Feb 25, 2016

Changed commit from 6a39223 to 05e47bb

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Feb 25, 2016

Branch pushed to git repo; I updated commit sha1. New commits:

05e47bb20067: add warning when choosing embedding

@bhutz
Copy link
Contributor Author

bhutz commented Feb 25, 2016

comment:9

changing the try/except to has_coerce_map_from reduced the functionality. For example QQ to GF(3) does not have a coerce map from, but can be done.

Consequently, I only added the warning.

@nbruin
Copy link
Contributor

nbruin commented Feb 25, 2016

comment:10

Can't we just make sure that base_change or change_ring can also be given a ring homomorphism from the base ring, to base extend to the codomain of the homomorphism? Then

X=Scheme(Q,...)
k=GF(3)
Xk=X.base_change(k.convert_map_from(QQ))

would work (provided we don't check if the map really is a homomorphism).
Then we can have that X.base_change(GF(3)) can still raise an error (because it's not well-defined), but we can still get an answer.

@bhutz
Copy link
Contributor Author

bhutz commented Feb 25, 2016

comment:11

Not sure exactly what you are suggesting here. If it is just the ability to supply the mapping, then that is actually the main change here. There is now an optional embedding parameter that can be specified

Xk=X_change_ring(embedding=k.convert_map_from(QQ))

The remaining issue was what to do if not specified. In this case, one is attempted to be constructed (the try/except parts...). When this is not unique, you seem to be suggesting raising an error and having the user construct the particular map they want. It seemed more user friendly to me to simply choose one and provide a warning that happened.

@nbruin
Copy link
Contributor

nbruin commented Feb 25, 2016

comment:12

Replying to @bhutz:

The remaining issue was what to do if not specified. In this case, one is attempted to be constructed (the try/except parts...). When this is not unique, you seem to be suggesting raising an error and having the user construct the particular map they want. It seemed more user friendly to me to simply choose one and provide a warning that happened.

The problem is that we don't have a channel to reliably report warnings through. If you print them in places where people aren't particularly looking for output, they are easily missed. In fact, STDOUT might be redirected to /dev/null, and messages on STDERR might be hard to match up with the rest of the data (if it gets read at all).

To quote the Zen of Python: "In the face of ambiguity, refuse the temptation to guess.". I'm not for following the Zen religiously, but I think it's a good principle. In this case, I think the error is a more honest and ultimately more reliable solution than making some non-canonical guess.

@bhutz
Copy link
Contributor Author

bhutz commented Feb 25, 2016

comment:13

I understand the concern and definitely didn't want to silently guess, hence the verbose warning. However, there was some precedent since

K.<w>=CyclotomicField(3)
CC(w)

just works and 'guesses' what embedding to use.

However, if just raising an error is more in-line with similar other functionality, I can do that instead.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Feb 26, 2016

Branch pushed to git repo; I updated commit sha1. New commits:

e28d8be20067: remove creation of embedding if not specified

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Feb 26, 2016

Changed commit from 05e47bb to e28d8be

@bhutz
Copy link
Contributor Author

bhutz commented Feb 26, 2016

comment:15

on further looking, that wasn't a precedent since cyclotomic fields create an embedding by default as part of their creation.

So here is a version where I've removed the 'guessing'

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Feb 26, 2016

Branch pushed to git repo; I updated commit sha1. New commits:

0882474Merge branch 'master' into ticket/20067

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Feb 26, 2016

Changed commit from e28d8be to 0882474

@bhutz
Copy link
Contributor Author

bhutz commented Feb 26, 2016

comment:17

I don't like the embedding keyword syntax. I'm going to check this to accept passing the ring in. This is more compatible with the other existing change_ring functions.

@vbraun
Copy link
Member

vbraun commented Feb 26, 2016

comment:21

Reviewer name is missing

@vbraun
Copy link
Member

vbraun commented Feb 26, 2016

comment:22

I mean, Author name

@bhutz
Copy link
Contributor Author

bhutz commented Feb 26, 2016

comment:23

I meant to set this to needs review. Added author.

@bhutz
Copy link
Contributor Author

bhutz commented Feb 26, 2016

Author: Ben Hutz

@sagetrac-rlmiller
Copy link
Mannequin

sagetrac-rlmiller mannequin commented Mar 3, 2016

comment:24

Looks good to me!

@vbraun
Copy link
Member

vbraun commented Mar 3, 2016

comment:25

Merge conflict, please merge in the latest beta...

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 4, 2016

Changed commit from 9001f02 to e73cd1f

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 4, 2016

Branch pushed to git repo; I updated commit sha1. New commits:

e73cd1fMerge branch '7.1.beta6' into ticket/20067

@sagetrac-rlmiller
Copy link
Mannequin

sagetrac-rlmiller mannequin commented Mar 5, 2016

comment:28

Looks good to me. No error with new commits in the latest beta.

@vbraun
Copy link
Member

vbraun commented Mar 5, 2016

Changed branch from u/bhutz/ticket/20067 to e73cd1f

@jdemeyer
Copy link

comment:30

What do you prefer: "Rebecca Lauren Miller" or "Rebecca Miller"?

@jdemeyer
Copy link

Changed commit from e73cd1f to none

@kcrisman
Copy link
Member

comment:31

Given that comment:6 was done by rlmiller, I would guess the "Lauren" version.

@sagetrac-rlmiller
Copy link
Mannequin

sagetrac-rlmiller mannequin commented Mar 22, 2016

comment:32

Yes, The Lauren Version. I will update all previous tickets.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants