# PowerSeriesRing Not Accepting QuotientRing [closed]

Hi,

I'm simply trying to define a power series ring on a quotient ring in python as shown below

```
var('x w y z t')
P = PolynomialRing(CC,'x, w, y, z')
I = P.ideal(x*w-1, y*z-1)
R = P.quotient_ring(I)
S = PowerSeriesRing(R, 't')
```

All of it works up until initializing S, at which point I get the following (very long) error message (note: I changed the path address to the python file to "Path/to/test.py" in the error message below, but everything else is unchanged):

```
Traceback (most recent call last):
File "sage/misc/cachefunc.pyx", line 996, in sage.misc.cachefunc.CachedFunction.__call__ (build/cythonized/sage/misc/cachefunc.c:5974)
File "sage/misc/weak_dict.pyx", line 704, in sage.misc.weak_dict.WeakValueDictionary.__getitem__ (build/cythonized/sage/misc/weak_dict.c:3736)
KeyError: ((<class 'sage.rings.power_series_ring.PowerSeriesRing_generic'>, Quotient of Multivariate Polynomial Ring in x, w, y, z over Complex Field with 53 bits of precision by the ideal (x*w - 1.00000000000000, y*z - 1.00000000000000), 't', 20), (('implementation', None), ('sparse', False)))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "sage/misc/cachefunc.pyx", line 1943, in sage.misc.cachefunc.CachedMethodCaller.__call__ (build/cythonized/sage/misc/cachefunc.c:10303)
KeyError: ((False,), ())
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "sage/misc/cachefunc.pyx", line 1943, in sage.misc.cachefunc.CachedMethodCaller.__call__ (build/cythonized/sage/misc/cachefunc.c:10303)
KeyError: (('sy',), ())
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "Path/to/test.py", line 7, in <module>
S = PowerSeriesRing(R, 't')
File "/opt/sagemath-9.3/local/lib/python3.7/site-packages/sage/rings/power_series_ring.py", line 417, in PowerSeriesRing
sparse=sparse, implementation=implementation)
File "sage/misc/classcall_metaclass.pyx", line 322, in sage.misc.classcall_metaclass.ClasscallMetaclass.__call__ (build/cythonized/sage/misc/classcall_metaclass.c:1761)
File "sage/misc/cachefunc.pyx", line 1001, in sage.misc.cachefunc.CachedFunction.__call__ (build/cythonized/sage/misc/cachefunc.c:6100)
File "/opt/sagemath-9.3/local/lib/python3.7/site-packages/sage/structure/unique_representation.py", line 1007, in __classcall__
instance = typecall(cls, *args, **options)
File "sage/misc/classcall_metaclass.pyx", line 486, in sage.misc.classcall_metaclass.typecall (build/cythonized/sage/misc/classcall_metaclass.c:2223)
File "/opt/sagemath-9.3/local/lib/python3.7/site-packages/sage/rings/power_series_ring.py", line 546, in __init__
R = PolynomialRing(base_ring, name, sparse=sparse)
File "/opt/sagemath-9.3/local/lib/python3.7/site-packages/sage/rings/polynomial/polynomial_ring_constructor.py", line 649, in PolynomialRing
return _single_variate(base_ring, names, **kwds)
File "/opt/sagemath-9.3/local/lib/python3.7/site-packages/sage/rings/polynomial/polynomial_ring_constructor.py", line 731, in _single_variate
elif base_ring.is_integral_domain(proof=False):
File "sage/misc/cachefunc.pyx", line 1948, in sage.misc.cachefunc.CachedMethodCaller.__call__ (build/cythonized/sage/misc/cachefunc.c:10437)
File "sage/misc/cachefunc.pyx", line 1824, in sage.misc.cachefunc.CachedMethodCaller._instance_call (build/cythonized/sage/misc/cachefunc.c:9916)
File "/opt/sagemath-9.3/local/lib/python3.7/site-packages/sage/rings/quotient_ring.py", line 864, in is_integral_domain
return self.defining_ideal().is_prime()
File "/opt/sagemath-9.3/local/lib/python3.7/site-packages/sage/rings/polynomial/multi_polynomial_ideal.py", line 952, in is_prime
CPD = self.complete_primary_decomposition(**kwds)
File "sage/misc/cachefunc.pyx", line 1948, in sage.misc.cachefunc.CachedMethodCaller.__call__ (build/cythonized/sage/misc/cachefunc.c:10437)
File "sage/misc/cachefunc.pyx", line 1824, in sage.misc.cachefunc.CachedMethodCaller._instance_call (build/cythonized/sage/misc/cachefunc.c:9916)
File "/opt/sagemath-9.3/local/lib/python3.7/site-packages/sage/libs/singular/standard_options.py", line 141, in wrapper
return func(*args, **kwds)
File "/opt/sagemath-9.3/local/lib/python3.7/site-packages/sage/rings/polynomial/multi_polynomial_ideal.py", line 768, in complete_primary_decomposition
P = primdecSY(self)
File "sage/libs/singular/function.pyx", line 1333, in sage.libs.singular.function.SingularFunction.__call__ (build/cythonized/sage/libs/singular/function.cpp:15181)
TypeError: Cannot call Singular function 'primdecSY' with ring parameter of type '<class 'sage.rings.polynomial.multi_polynomial_ring.MPolynomialRing_polydict_domain_with_category'>'
```

I have no idea how to analyze this, the ring R is of course commutative, so in theory there should be no problems initizializing S. PowerSeriesRing works with easier rings like ZZ.quotient_ring(ZZ*5), so I'm guessing it has something to do with conflicting precisions between the PowerSeriesRing and the base_ring? But I don't know how to change that, I'd appreciate any help or direction on figuring out how I can get a power series ring from R.

Thanks in advance.

At very least you mix up symbolic and polynomial variables. Replace

`var('x w y z t')`

with`P.inject_variables()`

Thanks for the reply Max, I've fixed that but I still get the same exact error message.

It looks like a bug. The error is produced by the following

`if`

:You may try to comment it out to see if it's just a missing clause.

Hi Max, I've struggled for a long time to compile the modified function.pyx file to no avail; is there a way to use sage to compile it? I've tried using "sage -b function.pyx" in the sage shell but I get errors like "/opt/sagemath-9.3/build/pkgs/sagelib/spkg-install: line 5: cd: src: No such file or directory" In general, I'd much appreciate a link or some basic outline of how I should go about this. Many thanks.

Alright, so I've managed to circumvent this situation entirely by simply writing

I don't know what's wrong with the original code, but this works well enough.