Operators

class sage.symbolic.operators.FDerivativeOperator(function, parameter_set)

Bases: object

EXAMPLES:

sage: from sage.symbolic.operators import FDerivativeOperator
sage: f = function('foo')
sage: op = FDerivativeOperator(f, [0,1])
sage: loads(dumps(op))
D[0, 1](foo)
change_function(new)

Returns a new FDerivativeOperator with the same parameter set for a new function.

sage: from sage.symbolic.operators import FDerivativeOperator sage: f = function(‘foo’) sage: b = function(‘bar’) sage: op = FDerivativeOperator(f, [0,1]) sage: op.change_function(bar) D[0, 1](bar)
function()

EXAMPLES:

sage: from sage.symbolic.operators import FDerivativeOperator
sage: f = function('foo')
sage: op = FDerivativeOperator(f, [0,1])
sage: op.function()
foo
parameter_set()

EXAMPLES:

sage: from sage.symbolic.operators import FDerivativeOperator
sage: f = function('foo')
sage: op = FDerivativeOperator(f, [0,1])
sage: op.parameter_set()
[0, 1]
sage.symbolic.operators.add_vararg(first, *rest)

Addition of a variable number of arguments.

INPUT:

  • first, rest - arguments to add

OUTPUT: sum of arguments

EXAMPLES:

sage: from sage.symbolic.operators import add_vararg
sage: add_vararg(1,2,3,4,5,6,7)
28
sage: F=(1+x+x^2)
sage: bool(F.operator()(*F.operands()) == F)
True
sage.symbolic.operators.mul_vararg(first, *rest)

Multiplication of a variable number of arguments.

INPUT:

  • args - arguments to multiply

OUTPUT: product of arguments

EXAMPLES:

sage: from sage.symbolic.operators import mul_vararg
sage: mul_vararg(9,8,7,6,5,4)
60480
sage: G=x*cos(x)*sin(x)
sage: bool(G.operator()(*G.operands())==G)
True