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

add support for weight vectors to gran/groebner_fan #4352

Closed
sagetrac-mhampton mannequin opened this issue Oct 23, 2008 · 6 comments
Closed

add support for weight vectors to gran/groebner_fan #4352

sagetrac-mhampton mannequin opened this issue Oct 23, 2008 · 6 comments

Comments

@sagetrac-mhampton
Copy link
Mannequin

sagetrac-mhampton mannequin commented Oct 23, 2008

This should be pretty straightforward.

sage-support request from Ursula Whitcher:
I asked Anders Jensen, "I would like to compute the weight vectors
corresponding to each reduced Groebner basis in gfan's output. Is
there a way to tell gfan to do this?"

He replied:

"There is a command "weightvector" that does exactly this. The command
is hidden (does not show up in the manual or the file system). To run
it type "gfan weightvector" in your shell. MIND THE SPACE BEFORE ''.
According to the --help text the correct thing to do would be to run
"gfan _weightvector -m" with the gfan output as input.

For example
gfan | gfan _weightvector -m
Q[x,y]
{x-y}

will produce a list of two vectors.
I hope this works out for you.
Best regards,
Anders"

Is there a way to access the weightvector command from the Sage
implementation of gfan?

Thanks!
Ursula

Component: interfaces

Keywords: gfan, groebner_fan, weight vectors

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

@sagetrac-mhampton sagetrac-mhampton mannequin self-assigned this Oct 23, 2008
@sagetrac-mhampton
Copy link
Mannequin Author

sagetrac-mhampton mannequin commented Oct 24, 2008

Attachment: 4352_1.patch.gz

based on 3.1.4 but should be fine against 3.2-alpha0

@williamstein
Copy link
Contributor

comment:2

REVIEW:

patch applies and passes test. Code raises major red flag!!

	        ans = eval(ans.replace('{','').replace('}','').replace('\n','')) 

If the output -- which you make into vectors over QQ ever actually has any rational numbers, then eval will do very bad things to them, e.g.,

sage: eval('2/3')
0

Oops!

Use sage_eval instead:

sage: sage_eval('2/3')
2/3

@williamstein williamstein added this to the sage-3.2.2 milestone Nov 29, 2008
@sagetrac-mhampton
Copy link
Mannequin Author

sagetrac-mhampton mannequin commented Nov 29, 2008

Attachment: 4352_2.patch.gz

supercedes previous patch, addresses review

@sagetrac-mabshoff
Copy link
Mannequin

sagetrac-mabshoff mannequin commented Nov 30, 2008

comment:5

This patch no longer applies cleanly to my 3.2.1.rc1 merge tree:

sage-3.2.1.rc1/devel/sage$ patch -p1 --dry-run < trac_4352_2.patch 
patching file sage/rings/polynomial/groebner_fan.py
Hunk #2 FAILED at 76.
1 out of 3 hunks FAILED -- saving rejects to file sage/rings/polynomial/groebner_fan.py.rej

I gather from the patch description that only trac_4352_2.patch should be applied. So unless I am mistaken please rebase this. If there are unknown dependencies for this ticket please list them.

Cheers,

Michael

@sagetrac-mabshoff sagetrac-mabshoff mannequin changed the title add support for weight vectors to gran/groebner_fan [needs rebase] add support for weight vectors to gran/groebner_fan Nov 30, 2008
@sagetrac-mhampton
Copy link
Mannequin Author

sagetrac-mhampton mannequin commented Nov 30, 2008

Attachment: 4352_3.patch.gz

rebased against 3.2.1.rc0

@sagetrac-mhampton sagetrac-mhampton mannequin changed the title [needs rebase] add support for weight vectors to gran/groebner_fan [rebased] add support for weight vectors to gran/groebner_fan Nov 30, 2008
@sagetrac-mabshoff
Copy link
Mannequin

sagetrac-mabshoff mannequin commented Nov 30, 2008

comment:7

Merged 4352_3.patch in Sage 3.2.1.rc1

@sagetrac-mabshoff sagetrac-mabshoff mannequin changed the title [rebased] add support for weight vectors to gran/groebner_fan add support for weight vectors to gran/groebner_fan Nov 30, 2008
@sagetrac-mabshoff sagetrac-mabshoff mannequin closed this as completed Nov 30, 2008
@sagetrac-mabshoff sagetrac-mabshoff mannequin modified the milestones: sage-3.2.2, sage-3.2.1 Nov 30, 2008
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

1 participant