import sage.interfaces.gap sage.interfaces.gap.gap_cmd = "/usr/local/bin/gap"
Author Log:
Module-level Functions
[use_workspace_cache=True], [local=True]) |
[use_workspace_cache=True]) |
[max_workspace_size=None], [verbose=False]) |
Call this to completely reset the GAP workspace, which is used by default when SAGE first starts GAP.
The first time you start GAP from SAGE, it saves the startup state of GAP in the file
$HOME/.sage/gap-workspace
The packages sonata, guava, factint, gapdoc, grape, design, toric, and laguna are loaded in all cases before the workspace is saved, if they are available.
) |
x, F) |
Input:
sage: x = gap('Z(13)') sage: F = GF(13, 'a') sage: F(x) 2 sage: F(gap('0*Z(13)')) 0 sage: F = GF(13^2, 'a') sage: x = gap('Z(13)') sage: F(x) 2 sage: x = gap('Z(13^2)^3') sage: F(x) 12*a + 11 sage: F.multiplicative_generator()^3 12*a + 11
Author: David Joyner and William Stein
x) |
) |
) |
Class: Gap
Author: William Stein and David Joyner
self, [max_workspace_size=None], [maxread=100000], [script_subdirectory=None], [use_workspace_cache=True], [server=None], [server_tmpdir=None], [logfile=None]) |
Functions: console,
cputime,
eval,
get,
help,
load_package,
save_workspace,
set,
trait_names,
version
self, x, [newlines=False], [strip=True]) |
Send the code in the string s to the GAP interpreter and return the output as a string.
Input:
self, var, [use_file=False]) |
Get the string representation of the variable var.
self, s, [pager=True]) |
Print help on a given topic.
self, pkg, [verbose=False]) |
Load the Gap package with the given name.
If loading fails, raise a RuntimeError exception.
self, var, value) |
Set the variable var to the given value.
Special Functions: __init__,
__reduce__,
_contains,
_continuation_prompt,
_equality_symbol,
_eval_line,
_eval_line_using_file,
_execute_line,
_false_symbol,
_is_true_string,
_keyboard_interrupt,
_next_var_name,
_object_class,
_post_interact,
_pre_interact,
_quit_string,
_read_in_file_command,
_start,
_true_symbol
Class: GapElement
Functions: str,
trait_names
Special Functions: __getitem__,
__len__,
__reduce__,
__repr__,
_latex_,
_matrix_
self) |
sage: v = gap('[1,2,3]'); v [ 1, 2, 3 ] sage: len(v) 3
len is also called implicitly by if:
sage: if gap('1+1 = 2'): ... print "1 plus 1 does equal 2" 1 plus 1 does equal 2
sage: if gap('1+1 = 3'): ... print "it is true" ... else: ... print "it is false" it is false
self, R) |
Return matrix over the (Sage) ring R determined by self, where self should be a Gap matrix.
sage: s = gap("(Z(7)^0)*[[1,2,3],[4,5,6]]"); s [ [ Z(7)^0, Z(7)^2, Z(7) ], [ Z(7)^4, Z(7)^5, Z(7)^3 ] ] sage: s._matrix_(GF(7)) [1 2 3] [4 5 6]
sage: s = gap("[[1,2], [3/4, 5/6]]"); s [ [ 1, 2 ], [ 3/4, 5/6 ] ] sage: m = s._matrix_(QQ); m [ 1 2] [3/4 5/6] sage: parent(m) Full MatrixSpace of 2 by 2 dense matrices over Rational Field
sage: s = gap('[[Z(16),Z(16)^2],[Z(16)^3,Z(16)]]') sage: s._matrix_(GF(16,'a')) [ a a^2] [a^3 a]
Class: GapFunction
Special Functions: _sage_doc_
Class: GapFunctionElement
Special Functions: _sage_doc_
See About this document... for information on suggesting changes.