Skip to content

Commit 6d3e954

Browse files
committed
some details
1 parent 95a414e commit 6d3e954

File tree

1 file changed

+16
-38
lines changed

1 file changed

+16
-38
lines changed

src/sage/quadratic_forms/quadratic_form__local_density_congruence.py

Lines changed: 16 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,7 @@ def count_modp_solutions__by_Gauss_sum(self, p, m):
3636
3737
- `m` -- an integer
3838
39-
OUTPUT:
40-
41-
an integer >= 0
39+
OUTPUT: an integer >= 0
4240
4341
EXAMPLES::
4442
@@ -81,9 +79,7 @@ def local_good_density_congruence_odd(self, p, m, Zvec, NZvec):
8179
8280
- Zvec, NZvec -- non-repeating lists of integers in range(self.dim()) or None
8381
84-
OUTPUT:
85-
86-
a rational number
82+
OUTPUT: a rational number
8783
8884
EXAMPLES::
8985
@@ -123,19 +119,19 @@ def local_good_density_congruence_odd(self, p, m, Zvec, NZvec):
123119

124120
if NZvec is None:
125121
if m % p:
126-
total = Q_Unit_minus_Zvec.count_modp_solutions__by_Gauss_sum(p, m) * p**len(NonUnitVec_minus_Zvec) # m != 0 (mod p)
122+
total = Q_Unit_minus_Zvec.count_modp_solutions__by_Gauss_sum(p, m) * p**len(NonUnitVec_minus_Zvec)
127123
else:
128-
total = (Q_Unit_minus_Zvec.count_modp_solutions__by_Gauss_sum(p, m) - 1) * p**len(NonUnitVec_minus_Zvec) # m == 0 (mod p)
124+
total = (Q_Unit_minus_Zvec.count_modp_solutions__by_Gauss_sum(p, m) - 1) * p**len(NonUnitVec_minus_Zvec)
129125

130126
else:
131127
UnitVec_minus_ZNZvec = list(UnitVec - (Set(Zvec) + Set(NZvec)))
132128
NonUnitVec_minus_ZNZvec = list(NonUnitVec - (Set(Zvec) + Set(NZvec)))
133129
Q_Unit_minus_ZNZvec = self.extract_variables(UnitVec_minus_ZNZvec)
134130

135-
if m % p: # m != 0 (mod p)
131+
if m % p:
136132
total = Q_Unit_minus_Zvec.count_modp_solutions__by_Gauss_sum(p, m) * p**len(NonUnitVec_minus_Zvec) \
137133
- Q_Unit_minus_ZNZvec.count_modp_solutions__by_Gauss_sum(p, m) * p**len(NonUnitVec_minus_ZNZvec)
138-
else: # m == 0 (mod p)
134+
else:
139135
total = (Q_Unit_minus_Zvec.count_modp_solutions__by_Gauss_sum(p, m) - 1) * p**len(NonUnitVec_minus_Zvec) \
140136
- (Q_Unit_minus_ZNZvec.count_modp_solutions__by_Gauss_sum(p, m) - 1) * p**len(NonUnitVec_minus_ZNZvec)
141137

@@ -178,9 +174,7 @@ def local_good_density_congruence_even(self, m, Zvec, NZvec):
178174
179175
- Zvec, NZvec -- non-repeating lists of integers in range(self.dim()) or None
180176
181-
OUTPUT:
182-
183-
a rational number
177+
OUTPUT: a rational number
184178
185179
EXAMPLES::
186180
@@ -347,9 +341,7 @@ def local_good_density_congruence(self, p, m, Zvec=None, NZvec=None):
347341
348342
- Zvec, NZvec -- non-repeating lists of integers in range(self.dim()) or None
349343
350-
OUTPUT:
351-
352-
a rational number
344+
OUTPUT: a rational number
353345
354346
EXAMPLES::
355347
@@ -390,12 +382,10 @@ def local_good_density_congruence(self, p, m, Zvec=None, NZvec=None):
390382
if (NZvec is not None) and (len(Set(NZvec) + Sn) > n):
391383
raise RuntimeError("NZvec must be a subset of {0, ..., n-1}.")
392384

393-
# Check that Q is in local normal form -- should replace this with a diagonalization check?
385+
# There was here a commented-out check that Q is in local normal form
394386
# (it often may not be since the reduction procedure
395387
# often mixes up the order of the valuations...)
396-
#
397-
# if (self != self.local_normal_form(p))
398-
# print "Warning in local_good_density_congruence: Q is not in local normal form! \n";
388+
# This commented-out code was removed in ticket #32960
399389

400390
# Decide which routine to use to compute the Good-type density
401391
if p > 2:
@@ -422,9 +412,7 @@ def local_zero_density_congruence(self, p, m, Zvec=None, NZvec=None):
422412
423413
- Zvec, NZvec -- non-repeating lists of integers in range(self.dim()) or None
424414
425-
OUTPUT:
426-
427-
a rational number
415+
OUTPUT: a rational number
428416
429417
EXAMPLES::
430418
@@ -498,9 +486,7 @@ def local_badI_density_congruence(self, p, m, Zvec=None, NZvec=None):
498486
499487
- Zvec, NZvec -- non-repeating lists of integers in range(self.dim()) or None
500488
501-
OUTPUT:
502-
503-
a rational number
489+
OUTPUT: a rational number
504490
505491
EXAMPLES::
506492
@@ -665,9 +651,7 @@ def local_badII_density_congruence(self, p, m, Zvec=None, NZvec=None):
665651
666652
- Zvec, NZvec -- non-repeating lists of integers in range(self.dim()) or None
667653
668-
OUTPUT:
669-
670-
a rational number
654+
OUTPUT: a rational number
671655
672656
EXAMPLES::
673657
@@ -814,9 +798,7 @@ def local_bad_density_congruence(self, p, m, Zvec=None, NZvec=None):
814798
815799
- Zvec, NZvec -- non-repeating lists of integers in range(self.dim()) or None
816800
817-
OUTPUT:
818-
819-
a rational number
801+
OUTPUT: a rational number
820802
821803
EXAMPLES::
822804
@@ -875,9 +857,7 @@ def local_density_congruence(self, p, m, Zvec=None, NZvec=None):
875857
876858
- Zvec, NZvec -- non-repeating lists of integers in range(self.dim()) or None
877859
878-
OUTPUT:
879-
880-
a rational number
860+
OUTPUT: a rational number
881861
882862
EXAMPLES::
883863
@@ -949,9 +929,7 @@ def local_primitive_density_congruence(self, p, m, Zvec=None, NZvec=None):
949929
950930
- Zvec, NZvec -- non-repeating lists of integers in range(self.dim()) or None
951931
952-
OUTPUT:
953-
954-
a rational number
932+
OUTPUT: a rational number
955933
956934
EXAMPLES::
957935

0 commit comments

Comments
 (0)