sage
b166754b - Fix construction functor for p-adic relaxed types.

Commit
2 years ago
Fix construction functor for p-adic relaxed types. The precision for relaxed p-adics has 3 components: `(default_prec, halting_prec, secure)` where the last one `secure` is a boolean defaulting to `False`. However, the `construction()` method doesn't know about it: ``` sage: K = QpER(5, secure=True) sage: K.construction(forbid_frac_field=True) (Completion[5, prec=(20, 40)], Rational Field) sage: R = ZpER(5, secure=True) sage: R.construction() (Completion[5, prec=(20, 40)], Integer Ring) ``` This has two undesired consequences for the `change()` method: a. The `secure` attribute is not copied: ``` sage: K.is_secure() True sage: K.change().is_secure() False sage: R.is_secure() True sage: R.change().is_secure() False ``` b. The `check=False` option is broken: ``` sage: K.change(check=False) ... ValueError: not enough values to unpack (expected 3, got 2) sage: R.change(check=False) ... ValueError: not enough values to unpack (expected 3, got 2) ``` Fixing the `construction()` method solves both issues. After this commit: ``` sage: K = QpER(5, secure=True) sage: K.construction(forbid_frac_field=True) (Completion[5, prec=(20, 40, True)], Rational Field) sage: K.change().is_secure() True sage: K.change(check=False) 5-adic Field handled with relaxed arithmetics sage: K.change(check=False).is_secure() True sage: R = ZpER(5, secure=True) sage: R.construction() (Completion[5, prec=(20, 40, True)], Integer Ring) sage: R.change().is_secure() True sage: R.change(check=False) 5-adic Ring handled with relaxed arithmetics sage: R.change(check=False).is_secure() True ```
Author
Committer
Parents
Loading