Package sage :: Package calculus :: Module calculus :: Class SymbolicConstant
[hide private]
[frames] | no frames]

Class SymbolicConstant

source code

                      object --+                        
                               |                        
structure.sage_object.SageObject --+                    
                                   |                    
           structure.element.Element --+                
                                       |                
         structure.element.ModuleElement --+            
                                           |            
               structure.element.RingElement --+        
                                               |        
                              SymbolicExpression --+    
                                                   |    
                                     Symbolic_object --+
                                                       |
                                                      SymbolicConstant

Instance Methods [hide private]
 
__init__(self, x) source code
 
_is_atomic(self)
File: sage/structure/element.pyx (starting at line 497) Return True if and only if parenthesis are not required when *printing* out any of $x - s$, $x + s$, $x^s$ and $x/s$.
source code
 
_fast_float_(self, *vars) source code
 
_recursive_sub(self, kwds)
EXAMPLES:...
source code
 
_recursive_sub_over_ring(self, kwds, ring) source code
 
_algebraic_(self, field)
EXAMPLES: sage: a = SR(5/6) sage: AA(a) 5/6 sage: type(AA(a)) <class 'sage.rings.qqbar.AlgebraicReal'> sage: QQbar(a) 5/6 sage: type(QQbar(a)) <class 'sage.rings.qqbar.AlgebraicNumber'> sage: from sage.calculus.calculus import SymbolicConstant sage: i = SymbolicConstant(I) sage: AA(i) Traceback (most recent call last): ...
source code
 
_add_(self, right)
EXAMPLES:...
source code
 
_sub_(self, right)
EXAMPLES:...
source code
 
_mul_(self, right)
EXAMPLES:...
source code
 
_div_(self, right)
EXAMPLES:...
source code
 
__neg__(self)
File: sage/structure/element.pyx (starting at line 845) Top-level negation operator for ModuleElements.
source code
 
__pow__(self, right)
EXAMPLES:...
source code

Inherited from Symbolic_object: __complex__, __float__, __hash__, _complex_double_, _complex_mpfr_field_, _latex_, _maxima_init_, _mpfr_, _real_double_, _real_rqdf_, _repr_, _sys_init_, number_of_arguments, obj, str

Inherited from SymbolicExpression: __abs__, __call__, __cmp__, __eq__, __ge__, __gt__, __int__, __le__, __long__, __lt__, __ne__, __nonzero__, __str__, _axiom_init_, _gap_init_, _gp_init_, _integer_, _kash_init_, _macaulay2_init_, _magma_init_, _maple_init_, _mathematica_init_, _maxima_, _neg_, _octave_init_, _pari_init_, _polynomial_, _rational_, _richcmp_, _singular_init_, arguments, coeff, coefficient, coefficients, coeffs, combine, conjugate, default_variable, denominator, derivative, diff, differentiate, display2d, exp_simplify, expand, expand_rational, expand_trig, factor, factor_list, find_maximum_on_interval, find_minimum_on_interval, find_root, full_simplify, function, gradient, hessian, imag, integral, integrate, inverse_laplace, laplace, limit, log_simplify, minpoly, n, nintegral, nintegrate, norm, numerator, numerical_approx, partial_fraction, plot, poly, polynomial, power_series, radical_simplify, rational_expand, rational_simplify, real, roots, show, simplify, simplify_exp, simplify_full, simplify_log, simplify_radical, simplify_rational, simplify_trig, solve, subs, subs_expr, substitute, substitute_over_ring, taylor, trig_expand, trig_simplify, variables

Inherited from structure.element.RingElement: __div__, __idiv__, __imul__, __invert__, __mul__, __new__, __pos__, __rdiv__, __rmul__, __rpow__, __rtruediv__, __truediv__, _idiv_, _imul_, abs, additive_order, is_nilpotent, is_one, is_unit, multiplicative_order, order

Inherited from structure.element.ModuleElement: __add__, __iadd__, __isub__, __radd__, __rsub__, __sub__, _iadd_, _ilmul_, _isub_, _lmul_, _rmul_

Inherited from structure.element.Element: __reduce__, __rxor__, __xor__, _cmp_, _im_gens_, base_base_extend, base_base_extend_canonical_sym, base_extend, base_extend_canonical, base_extend_canonical_sym, base_extend_recursive, base_ring, category, is_zero, parent

Inherited from structure.sage_object.SageObject: __repr__, _axiom_, _gap_, _gp_, _interface_, _interface_init_, _interface_is_cached_, _kash_, _macaulay2_, _magma_, _maple_, _mathematica_, _octave_, _pari_, _r_init_, _sage_, _singular_, db, dump, dumps, rename, reset_name, save, version

Inherited from object: __delattr__, __getattribute__, __reduce_ex__, __setattr__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, x)
(Constructor)

source code 
Overrides: Symbolic_object.__init__

_is_atomic(self)

source code 
File: sage/structure/element.pyx (starting at line 497)

Return True if and only if parenthesis are not required when
*printing* out any of $x - s$, $x + s$, $x^s$ and $x/s$.

EXAMPLES:
    sage: n = 5; n._is_atomic()
    True
    sage: n = x+1; n._is_atomic()
    False

Overrides: structure.element.Element._is_atomic
(inherited documentation)

_fast_float_(self, *vars)

source code 
Overrides: Symbolic_object._fast_float_

_recursive_sub(self, kwds)

source code 

EXAMPLES:
    sage: a = SR(5/6)
    sage: type(a)
    <class 'sage.calculus.calculus.SymbolicConstant'>
    sage: a(x=3)
    5/6

Overrides: SymbolicExpression._recursive_sub

_recursive_sub_over_ring(self, kwds, ring)

source code 
Overrides: SymbolicExpression._recursive_sub_over_ring

_algebraic_(self, field)

source code 

EXAMPLES:
    sage: a = SR(5/6)
    sage: AA(a)
    5/6
    sage: type(AA(a))
    <class 'sage.rings.qqbar.AlgebraicReal'>
    sage: QQbar(a)
    5/6
    sage: type(QQbar(a))
    <class 'sage.rings.qqbar.AlgebraicNumber'>
    sage: from sage.calculus.calculus import SymbolicConstant
    sage: i = SymbolicConstant(I)
    sage: AA(i)
    Traceback (most recent call last):
    ...    
    TypeError: Cannot coerce algebraic number with non-zero imaginary part to algebraic real
    sage: QQbar(i)
    1*I
    sage: phi = SymbolicConstant(golden_ratio)
    sage: AA(phi)
    [1.6180339887498946 .. 1.6180339887498950]
    sage: QQbar(phi)
    [1.6180339887498946 .. 1.6180339887498950]

_add_(self, right)

source code 

EXAMPLES:
    sage: SR = SymbolicExpressionRing()
    sage: a = SR(2)
    sage: b = a+2; b
    4
    sage: type(b)
    <class 'sage.calculus.calculus.SymbolicConstant'>
    sage: b = sum([a for i in range(1000)]); b
    2000
    sage: type(_)
    <class 'sage.calculus.calculus.SymbolicConstant'>

Overrides: SymbolicExpression._add_

_sub_(self, right)

source code 

EXAMPLES:
    sage: SR = SymbolicExpressionRing()
    sage: a = SR(2)
    sage: b = a-2; b
    0
    sage: type(b)
    <class 'sage.calculus.calculus.SymbolicConstant'>
    sage: b = SR(2000)
    sage: for i in range(1000): b -= a;
    sage: b
    0
    sage: type(b)
    <class 'sage.calculus.calculus.SymbolicConstant'>

Overrides: SymbolicExpression._sub_

_mul_(self, right)

source code 

EXAMPLES:
    sage: SR = SymbolicExpressionRing()
    sage: a = SR(2)
    sage: b = a*2; b
    4
    sage: type(b)
    <class 'sage.calculus.calculus.SymbolicConstant'>
    sage: prod([a for i in range(1000)])
    10715086071862673209484250490600018105614048117055336074437503883703510511249361224931983788156958581275946729175531468251871452856923140435984577574698574803934567774824230985421074605062371141877954182153046474983581941267398767559165543946077062914571196477686542167660429831652624386837205668069376
    sage: type(_)
    <class 'sage.calculus.calculus.SymbolicConstant'>

Overrides: SymbolicExpression._mul_

_div_(self, right)

source code 

EXAMPLES:
    sage: SR = SymbolicExpressionRing()
    sage: a = SR(2)
    sage: b = a/2; b
    1
    sage: type(b)
    <class 'sage.calculus.calculus.SymbolicConstant'>
    sage: b = SR(2^1000)
    sage: for i in range(1000): b /= a;
    sage: b
    1
    sage: type(b)
    <class 'sage.calculus.calculus.SymbolicConstant'>

Overrides: SymbolicExpression._div_

__neg__(self)

source code 
File: sage/structure/element.pyx (starting at line 845)

Top-level negation operator for ModuleElements.
See extensive documentation at the top of element.pyx.

Overrides: structure.element.ModuleElement.__neg__
(inherited documentation)

__pow__(self, right)

source code 

EXAMPLES:
    sage: SR = SymbolicExpressionRing()
    sage: a = SR(2)
    sage: b = a^2; b
    4
    sage: type(b)
    <class 'sage.calculus.calculus.SymbolicArithmetic'>        

Overrides: SymbolicExpression.__pow__