Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
21808: some more .python() -> .sage() conversions
Browse files Browse the repository at this point in the history
  • Loading branch information
videlec committed Jan 10, 2017
1 parent 01ad2d8 commit 79397fb
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/sage/modules/free_module_integer.py
Expand Up @@ -625,7 +625,7 @@ def shortest_vector(self, update_reduced_basis=True, algorithm="fplll", *args, *
qf = B*B.transpose()

count, length, vectors = qf._pari_().qfminim()
v = vectors.python().columns()[0]
v = vectors.sage().columns()[0]
w = v*B
elif algorithm == "fplll":
from fpylll import IntegerMatrix, SVP
Expand Down
2 changes: 1 addition & 1 deletion src/sage/rings/number_field/bdd_height.py
Expand Up @@ -508,7 +508,7 @@ def packet_height(n, pair, u):
if LLL:
cut_fund_unit_logs = column_matrix(fund_unit_logs).delete_rows([r])
lll_fund_units = []
for c in pari(cut_fund_unit_logs).qflll().python().columns():
for c in pari(cut_fund_unit_logs).qflll().sage().columns():
new_unit = 1
for i in range(r):
new_unit *= fund_units[i]**c[i]
Expand Down
2 changes: 1 addition & 1 deletion src/sage/rings/number_field/number_field.py
Expand Up @@ -5266,7 +5266,7 @@ def reduced_basis(self, prec=None):
for i in range(d)]
else:
M = self.Minkowski_embedding(self.integral_basis(), prec=prec)
T = pari(M).qflll().python()
T = pari(M).qflll().sage()
self.__reduced_basis = [ self(v.list()) for v in T.columns() ]
if prec is None:
## this is the default choice for Minkowski_embedding
Expand Down
2 changes: 1 addition & 1 deletion src/sage/rings/number_field/unit_group.py
Expand Up @@ -359,7 +359,7 @@ def _element_constructor_(self, u):
m = pK.bnfisunit(pari(u)).mattranspose()

# convert column matrix to a list:
m = [ZZ(m[0,i].python()) for i in range(m.ncols())]
m = [ZZ(m[0,i].sage()) for i in range(m.ncols())]

# NB pari puts the torsion after the fundamental units, before
# the extra S-units but we have the torsion first:
Expand Down
6 changes: 3 additions & 3 deletions src/sage/schemes/elliptic_curves/ell_local_data.py
Expand Up @@ -269,9 +269,9 @@ def __init__(self, E, P, proof=None, algorithm="pari", globally=False):
if algorithm=="pari" and K is QQ:
Eint = E.integral_model()
data = Eint.pari_curve().elllocalred(p)
self._fp = data[0].python()
self._KS = KodairaSymbol(data[1].python())
self._cp = data[3].python()
self._fp = data[0].sage()
self._KS = KodairaSymbol(data[1].sage())
self._cp = data[3].sage()
# We use a global minimal model since we can:
self._Emin_reduced = Eint.minimal_model()
self._val_disc = self._Emin_reduced.discriminant().valuation(p)
Expand Down
2 changes: 1 addition & 1 deletion src/sage/schemes/elliptic_curves/ell_number_field.py
Expand Up @@ -3333,7 +3333,7 @@ def lll_reduce(self, points, height_matrix=None, precision=None):
r = len(points)
if height_matrix is None:
height_matrix = self.height_pairing_matrix(points, precision)
U = height_matrix._pari_().lllgram().python()
U = height_matrix._pari_().lllgram().sage()
new_points = [sum([U[j, i]*points[j] for j in range(r)])
for i in range(r)]
return new_points, U
Expand Down
6 changes: 3 additions & 3 deletions src/sage/schemes/elliptic_curves/ell_rational_field.py
Expand Up @@ -1490,7 +1490,7 @@ def analytic_rank(self, algorithm="pari", leading_coefficient=False):
if algorithm == 'pari':
rank_lead = self.pari_curve().ellanalyticrank()
if leading_coefficient:
return (rings.Integer(rank_lead[0]), rank_lead[1].python())
return (rings.Integer(rank_lead[0]), rank_lead[1].sage())
else:
return rings.Integer(self.pari_curve().ellanalyticrank()[0])
elif algorithm == 'rubinstein':
Expand Down Expand Up @@ -3194,7 +3194,7 @@ def tamagawa_product(self):
try:
return self.__tamagawa_product
except AttributeError:
self.__tamagawa_product = Integer(self.pari_mincurve().ellglobalred()[2].python())
self.__tamagawa_product = Integer(self.pari_mincurve().ellglobalred()[2].sage())
return self.__tamagawa_product

def real_components(self):
Expand Down Expand Up @@ -5559,7 +5559,7 @@ def eval_modular_form(self, points, prec):
for n in range(1, prec):
s += an[n-1]*r
r *= r0
ans.append(s.python())
ans.append(s.sage())
return ans


Expand Down
6 changes: 3 additions & 3 deletions src/sage/schemes/elliptic_curves/ell_torsion.py
Expand Up @@ -160,9 +160,9 @@ def __init__(self, E, algorithm=None):

if self.__K is RationalField():
G = self.__E.pari_curve().elltors()
order = G[0].python()
structure = G[1].python()
gens = G[2].python()
order = G[0].sage()
structure = G[1].sage()
gens = G[2].sage()

self.__torsion_gens = [ self.__E(P) for P in gens ]
from sage.groups.additive_abelian.additive_abelian_group import cover_and_relations_from_invariants
Expand Down
4 changes: 2 additions & 2 deletions src/sage/schemes/elliptic_curves/period_lattice.py
Expand Up @@ -592,12 +592,12 @@ def _compute_periods_real(self, prec=None, algorithm='sage'):

if algorithm=='pari':
if self.E.base_field() is QQ:
periods = self.E.pari_curve().omega(prec).python()
periods = self.E.pari_curve().omega(prec).sage()
return (R(periods[0]), C(periods[1]))

from sage.libs.pari.all import pari
E_pari = pari([R(self.embedding(ai).real()) for ai in self.E.a_invariants()]).ellinit()
periods = E_pari.omega(prec).python()
periods = E_pari.omega(prec).sage()
return (R(periods[0]), C(periods[1]))

if algorithm!='sage':
Expand Down

0 comments on commit 79397fb

Please sign in to comment.