Ticket #3946 (closed enhancement: fixed)

Opened 3 months ago

Last modified 3 months ago

[with patch; with positive review] Tidier BinaryQF reductions

Reported by: choldsworth Assigned to: was
Priority: minor Milestone: sage-3.1.2
Component: number theory Keywords:
Cc: cremona

Description

Cremona writes:

However, there are some things I really do not like about this implementation:

1. self.reduce() computes (if necessary) caches and returns the reduced form equivalent to self. I would expect it to change self into the reduced form, and have a different function self.reduced_form() to do what this function does.

2. The function is_reduced() actually reduces self and tests if the result is the same as self. This is potentially very expensive! To test is_reduced() you should just test that the usual inequalities are satisfied.

I have attached a patch which I believe fixes these issues. I have also altered the reduction methods to throw more enlightening exceptions when given negative definite forms and indefinite forms.

It would be nice to implement the the handling of indefinite and negative definite forms at some point in the future, however I don't think Pari can deal with negative definite forms currently.

Attachments

3946.patch (3.2 kB) - added by choldsworth on 08/24/2008 07:35:42 PM.

Change History

08/24/2008 07:35:42 PM changed by choldsworth

  • attachment 3946.patch added.

08/24/2008 07:36:29 PM changed by choldsworth

  • summary changed from Tidier BinaryQF reductions to [with patch; needs review] Tidier BinaryQF reductions.

08/25/2008 03:51:10 AM changed by cremona

  • summary changed from [with patch; needs review] Tidier BinaryQF reductions to [with patch; with positive review] Tidier BinaryQF reductions.

I am happy that this patch deals with the criticisms I had regarding #3857 (which did in fact have nothing to do with the bug which #3857 fixed, but rather were criticisms of some of the design of this class).

The patch applies fine after the patches for #3857 (and probably independently of those too), and all doctests in sage/quadratic_forms pass.

08/25/2008 01:17:28 PM changed by mabshoff

  • status changed from new to closed.
  • resolution set to fixed.

Merged in Sage 3.1.2.alpha1