def sqrt5_ideal(X): """ Return ideal in ring of integers of Q(sqrt(5)) defined by X. INPUT: - `X` -- ideal or list or element of F OUTPUT: - ideal EXAMPLES:: sage: from sage.modular.hilbert.sqrt5_tables import F, sqrt5_ideal sage: sqrt5_ideal(7) Fractional ideal (7) sage: sqrt5_ideal(F.0) Fractional ideal (a) sage: sqrt5_ideal([F.0, 2]) Fractional ideal (1) """ if not is_Ideal(X) or X.ring() != F: return O_F.ideal(X) return X
def ideal(X): if not is_Ideal(X): return O_F.ideal(X) return X