Opened 4 years ago

Closed 3 years ago

#25023 closed enhancement (fixed)

Adds function to compute quadratic defect

Reported by: annahaensch Owned by:
Priority: major Milestone: sage-8.2
Component: number fields Keywords:
Cc: Merged in:
Authors: Anna Haensch Reviewers: Simon Brandhorst
Report Upstream: N/A Work issues:
Branch: 56283fe (Commits, GitHub, GitLab) Commit: 56283fe849868db720531ad45364aa247050247a
Dependencies: Stopgaps:

Status badges

Description

Computes the quadratic defect (see O'Meara Section 63A) of a number field element locally at a prime p. This is an implementation of Algorithm 3.1.3 from Kirschmer's "Definite quadratic and hermitian forms with small class number."

The function returns the valuation of the quadratic defect (rather than the fractional ideal itself) since this is the more relevant (and computationally useful) piece of information.

Change History (15)

comment:1 Changed 4 years ago by annahaensch

  • Branch set to u/annahaensch/adds_function_to_compute_quadratic_defect

comment:2 Changed 4 years ago by annahaensch

  • Commit set to a140e55ed69a77b79bacdc0a1f68a316868f561d
  • Status changed from new to needs_review

New commits:

2e4fc4fadds imports to number_field.py
a140e55adds quadratic_defect

comment:3 Changed 4 years ago by sbrandhorst

  • Status changed from needs_review to needs_work

Some quick comments:

over QQ: do not use quadratic_residues as that forms a list of size (p-1)/2 this is not necessary. You can use legendre_symbol or reduce mod p and then use is_square (like over numberfields)

Your method quadratic_defect sits in the wrong class. (NumberField_quadratic) so it is not accessible in general. For example we can move it to NumberField_generic.

+                    if w < u and w % 2 ==1:
+                        d = v+w
+                    if w == u and (f+F((a-1)/4)).is_irreducible():
+                        d = v+w

You sure this is correct ?(I did not fully check).

  • the reference to kirschmers work should be a proper citation in src/doc/en/reference/references

Could you explain why you consider the valuation more useful than the quadratic_defect itself?

comment:4 Changed 4 years ago by sbrandhorst

  • Reviewers set to Simon Brandhorst

comment:5 Changed 4 years ago by git

  • Commit changed from a140e55ed69a77b79bacdc0a1f68a316868f561d to e419b36841853392158db03d38ba6e006ea5d4d7

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

e419b36Changes to quadrati_defect()

comment:6 Changed 4 years ago by annahaensch

Thanks for the helpful comments! I've done the following:

  • Updated the function in rational_field to use legendre_symbol() instead of quadratic_residue().
  • I added Kirschmer's item to the reference list, and added a reference line to the documentation. I've never done this before, perhaps up can see if I did it correctly?
  • I moved the number field version of the function to be in the class number_field_generic...I think. Is this accomplished by just moving the function to where that class is defined? Maybe you can check to see if I did that correctly.
  • The item you point out should be correct, this should be 63:3 and 63:5 from O'meara's book on quadratic forms.

I am choosing to return a valuation since this is an easier object to deal with. Moreover, this is also what is returned by the analogous function "QuadraticDefect?" in magma (which I believe was implimented by Kirschmer).


New commits:

e419b36Changes to quadrati_defect()

comment:7 Changed 4 years ago by annahaensch

  • Status changed from needs_work to needs_review

comment:8 Changed 4 years ago by sbrandhorst

  • Branch changed from u/annahaensch/adds_function_to_compute_quadratic_defect to u/sbrandhorst/adds_function_to_compute_quadratic_defect

comment:9 Changed 4 years ago by sbrandhorst

  • Branch changed from u/sbrandhorst/adds_function_to_compute_quadratic_defect to u/annahaensch/adds_function_to_compute_quadratic_defect

I did some cosmetic changes. Positive review if you are happy with what I have done.

comment:10 Changed 4 years ago by git

  • Commit changed from e419b36841853392158db03d38ba6e006ea5d4d7 to 086cde098120cf2313030c28ac33e2d80cc4a579

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

086cde0Add reference to rational_field

comment:11 Changed 4 years ago by annahaensch

I just added the official reference to the rational_field version of the function. Now I am happy with it, and would be most pleased with a positive review. Thanks!

comment:12 Changed 4 years ago by sbrandhorst

  • Status changed from needs_review to positive_review

comment:13 Changed 3 years ago by sbrandhorst

  • Branch changed from u/annahaensch/adds_function_to_compute_quadratic_defect to u/sbrandhorst/adds_function_to_compute_quadratic_defect

comment:14 Changed 3 years ago by sbrandhorst

  • Commit changed from 086cde098120cf2313030c28ac33e2d80cc4a579 to 56283fe849868db720531ad45364aa247050247a

a trivial addition REFERENCES:: --> REFERENCES:


New commits:

e5f4670Allowed prime ideals as input for quadratic_defect.
b5fd719Merge branch 'u/annahaensch/adds_function_to_compute_quadratic_defect' of git://trac.sagemath.org/sage into t/25023/adds_function_to_compute_quadratic_defect
56283feDoc syntax

comment:15 Changed 3 years ago by vbraun

  • Branch changed from u/sbrandhorst/adds_function_to_compute_quadratic_defect to 56283fe849868db720531ad45364aa247050247a
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.