How can I search for a certain object in Sage?

53 Views Asked by At

If I’m reading a paper and I want to try to rewrite the content in a math programming language like Sage, I’d like to search from within Sage for objects they have corresponding to a certain name, like “homological invariant”. It would be cool if objects were like Python libraries - they had internal functions and attributes, but also a natural language help doc explaining what they were.

Is there any way to search inside Sage for a certain object they might have?

1

There are 1 best solutions below

0
On

The functions search_src, search_def, search_doc, browse_sage_doc might help.

Getting the Sage sources and using git grep is another way one can explore the code base.

Examples of using Sage functions:

sage: search_def('homological')
sage: search_def('invariant')
sage: search_doc('homological')
sage: search_src('homological')
sage: browse_sage_doc(j_invariant_qexp)

Examples of using git grep (in a terminal, from the Sage root directory):

$ git grep 'homological'
$ git grep 'homological' src/sage/schemes

(the first one searches everywhere, the second one only in src/sage/schemes).