I've provided some more information to this post. Could someone please let 
me know whether this behavior is intended, or a bug?

I believe the different q-expansions are equivalent - they seem to just be 
generated by equivalent number fields with different defining polynomials. 
I confirmed this by running pari's polredabs function. I still find it 
quite odd that different polynomials would be used when run multiple times 
- is this intended? I tried poking through the library code, but couldn't 
find a cause.

*Example:*

sage: eps = kronecker_character(364)

....: M = ModularForms(eps)

....: S = M.cuspidal_subspace()

....: New = S.newforms('a')

....: 

sage: New[0]

q + (-1/7*a0^3 - 5/7*a0)*q^2 + 2*q^4 + O(q^6)

sage: New[0].hecke_eigenvalue_field()

Number Field in a0 with defining polynomial x^4 + 12*x^2 + 49

*Running in a different session:*

sage: eps = kronecker_character(364)

....: M = ModularForms(eps)

....: S = M.cuspidal_subspace()

....: New = S.newforms('a')

....: 
sage: New[0]

q + (-1/33*a0^3 + 7/33*a0)*q^2 + 2*q^4 + O(q^6)

sage: New[0].hecke_eigenvalue_field()

Number Field in a0 with defining polynomial x^4 + 4*x^2 + 121

sage: pari(New[0].hecke_eigenvalue_field().polynomial()).polredabs()

x^4 + 12*x^2 + 49




On Friday, August 30, 2019 at 10:44:11 PM UTC-7 ethanyi...@gmail.com wrote:

> Calculating newforms of a cuspidal subspace gives different answers on 
> different runs. 
>
> I did not (and don't know how to) check whether the newforms are 
> equivalent (and if they aren't, this would be a much more serious bug), 
> but, regardless, this type of calculation should definitely be 
> deterministic.
>
> *Steps to reproduce:*
>
> eps = kronecker_character(105)
>
> M2 = ModularForms(eps)
>
> S2 = M2.cuspidal_subspace()
>
> print(S2.newforms('a'))
>
>
> Running it multiple times, one gets a variety of q-expansions for the 
> newforms. Here I have listed 4 that I have received in output.
>
>
> [q + (-1/10*a0^3 + 3/10*a0^2 + 2/5*a0 - 3/5)*q^2 + (-1/10*a0^3 + 3/10*a0^2 
> - 3/5*a0 - 3/5)*q^3 + q^4 + (a0 - 1)*q^5 + O(q^6),
>
>  q - 1/2*a1*q^3 - 2*q^4 + (-1/24*a1^3 - 1/3*a1)*q^5 + O(q^6),
>
>  q + (-1/10*a2^3 + 3/10*a2^2 + 2/5*a2 - 3/5)*q^2 + (1/10*a2^3 - 3/10*a2^2 
> + 3/5*a2 + 3/5)*q^3 + q^4 + (-a2 + 1)*q^5 + O(q^6)]
>
>
> [q + (-1/22*a0^3 - 3/11*a0^2 - 1/2*a0 - 3/11)*q^2 + (1/44*a0^3 + 3/22*a0^2 
> + 3/4*a0 + 3/22)*q^3 + q^4 + (-3/44*a0^3 - 9/22*a0^2 - 5/4*a0 - 31/22)*q^5 
> + O(q^6), 
>
> q - 1/2*a1*q^3 - 2*q^4 + (-1/24*a1^3 - 1/3*a1)*q^5 + O(q^6), 
>
> q + (-1/22*a2^3 - 3/11*a2^2 - 1/2*a2 - 3/11)*q^2 + (-1/44*a2^3 - 3/22*a2^2 
> - 3/4*a2 - 3/22)*q^3 + q^4 + (3/44*a2^3 + 9/22*a2^2 + 5/4*a2 + 31/22)*q^5 + 
> O(q^6)]
>
>
> [q + (-1/10*a0^3 - 3/10*a0^2 + 2/5*a0 + 3/5)*q^2 + (1/10*a0^3 + 3/10*a0^2 
> + 3/5*a0 - 3/5)*q^3 + q^4 + (-1/5*a0^3 - 3/5*a0^2 - 1/5*a0 + 1/5)*q^5 + 
> O(q^6), 
>
> q - 1/2*a1*q^3 - 2*q^4 + (-1/24*a1^3 - 1/3*a1)*q^5 + O(q^6), 
>
> q + (-1/22*a2^3 - 3/11*a2^2 - 1/2*a2 - 3/11)*q^2 + (-1/44*a2^3 - 3/22*a2^2 
> - 3/4*a2 - 3/22)*q^3 + q^4 + (3/44*a2^3 + 9/22*a2^2 + 5/4*a2 + 31/22)*q^5 + 
> O(q^6)]
>
>
> [q + (-1/22*a0^3 + 3/11*a0^2 - 1/2*a0 + 3/11)*q^2 + (-1/44*a0^3 + 
> 3/22*a0^2 - 3/4*a0 + 3/22)*q^3 + q^4 + (-1/44*a0^3 + 3/22*a0^2 + 1/4*a0 - 
> 19/22)*q^5 + O(q^6), 
>
> q - a1*q^3 - 2*q^4 + (-1/3*a1^3 - 2/3*a1)*q^5 + O(q^6), 
>
> q + (-1/10*a2^3 - 3/10*a2^2 + 2/5*a2 + 3/5)*q^2 + (-1/10*a2^3 - 3/10*a2^2 
> - 3/5*a2 + 3/5)*q^3 + q^4 + (1/5*a2^3 + 3/5*a2^2 + 1/5*a2 - 1/5)*q^5 + 
> O(q^6)]
>
>
> Version: 8.7
> OS: macOS High Sierra 10.13.6, 64 Bit
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/ce116caa-d33a-4b6a-b275-b9a47681ba86n%40googlegroups.com.

Reply via email to