Taylor expansions in independent variables (support AbstractGraph)
API
FeynmanDiagram.Taylor
— ModuleTaylorSeries
A Julia package for Taylor expansions in one or more independent variables.
The basic constructors is TaylorSeries
.
FeynmanDiagram.Taylor.ParamsTaylor
— TypeParamsTaylor
DataType holding the current parameters for `TaylorSeries`.
This part of code is adopted from TaylorSeries.jl (https://github.com/JuliaDiff/TaylorSeries.jl)
Fields:
orders :: Int
Orders (degree) of the polynomialsnum_vars :: Int
Number of variablesvariable_names :: Vector{String}
Names of the variablesvariable_symbols :: Vector{Symbol}
Symbols of the variables
These parameters can be changed using set_variables
FeynmanDiagram.Taylor.TaylorSeries
— Typemutable struct TaylorSeries{T}
A representation of a taylor series.
Members:
name::Symbol
name of the diagramcoeffs::Dict{Vector{Int},T}
The taylor expansion coefficients. The integer array define the order of corresponding coefficient.
FeynmanDiagram.Taylor.TaylorSeries
— Methodfunction TaylorSeries(::Type{T}, nv::Int) where {T}
Create a taylor series equal to variable with index nv. For example, if global variables are "x y", in put nv=2 generate series t=y.
Arguments:
::Type{T}
DataType of coefficients in taylor series.nv::Int
Index of variable.
Base.:*
— Methodfunction Base.:*(g1::TaylorSeries{T}, g2::TaylorSeries{T}) where {T}
Returns a taylor series `g1 * g2` representing the product of `g2` with `g1`.
Arguments:
g1
First taylor seriesg2
Second taylor series
Base.:*
— Methodfunction Base.:*(g1::TaylorSeries{T}, c2::Number) where {T}
Returns a TaylorSeries representing the scalar multiplication `g1*c2`.
Arguments:
g1
TaylorSeriesc2
scalar multiple
Base.:*
— Methodfunction Base.:*(c1::Number, g2::TaylorSeries{T}) where {T}
Returns a TaylorSeries representing the scalar multiplication `g2*c1`.
Arguments:
g2
TaylorSeriesc1
scalar multiple
Base.:+
— Methodfunction Base.:+(g1::TaylorSeries{T}, c::S) where {T,S<:Number}
Returns a taylor series `g1 + c` representing the addition of constant `c` with `g1`.
Arguments:
g1
Taylor seriesc
Constant
Base.:+
— Methodfunction Base.:+(g1::TaylorSeries{T}, g2::TaylorSeries{T}) where {T}
Returns a taylor series `g1 + g2` representing the addition of `g2` with `g1`.
Arguments:
g1
First taylor seriesg2
Second taylor series
Base.:+
— Methodfunction Base.:+(c::S, g1::TaylorSeries{T}) where {S<:Number,T}
Returns a taylor series `g1 + c` representing the addition of constant `c` with `g1`.
Arguments:
g1
Taylor seriesc
Constant
Base.:-
— Methodfunction Base.:-(g1::TaylorSeries{T,V}, g2::TaylorSeries{T,V}) where {T,V}
Returns a taylor series `g1 - g2` representing the difference of `g2` with `g1`.
Arguments:
g1
First taylor seriesg2
Second taylor series
Base.:^
— Methodfunction Base.:^(x::TaylorSeries, p::Integer)
Return the power of taylor series x^p, where p is an integer.
Arguments:
x
Taylor series- 'p' Power index
Base.one
— Methodfunction Base.one(g::TaylorSeries{T}) where {T}
Return a constant one for a given taylor series.
Arguments:
g
Taylor series
FeynmanDiagram.Taylor.displayBigO
— MethoddisplayBigO(d::Bool) --> nothing
Set/unset displaying of the big 𝒪 notation in the output of Taylor1
and TaylorN
polynomials. The initial value is true
.
FeynmanDiagram.Taylor.getcoeff
— Methodfunction getcoeff(g::TaylorSeries, order::Vector{Int})
Return the taylor coefficients with given order in taylor series g.
Arguments:
g
Taylor seriesorder
Order of target coefficients
FeynmanDiagram.Taylor.getderivative
— Methodfunction getderivative(g::TaylorSeries, order::Vector{Int})
Return the derivative with given order in taylor series g.
Arguments:
g
Taylor seriesorder
Order of derivative
FeynmanDiagram.Taylor.set_variables
— Methodset_variables([T::Type], names::String; [orders=get_orders(), numvars=-1])
Return a TaylorSeries{T}
vector with each entry representing an independent variable. names
defines the output for each variable (separated by a space). The default type T
is Float64
, and the default for orders
is the one defined globally.
If numvars
is not specified, it is inferred from names
. If only one variable name is defined and numvars>1
, it uses this name with subscripts for the different variables.
julia> set_variables(Int, "x y z", orders=[4,4,4])
3-element Array{TaylorSeries.Taylor{Int},1}:
1 x + 𝒪(x⁵y⁵z⁵)
1 y + 𝒪(x⁵y⁵z⁵)
1 z + 𝒪(x⁵y⁵z⁵)
FeynmanDiagram.Taylor.taylor_binomial
— Methodfunction taylor_binomial(o1::Vector{Int}, o2::Vector{Int})
Return the taylor binomial prefactor when product two high-order derivatives with order o1 and o2.
# Arguments:
- `o1` Order of first derivative
- `o2` Order of second derivative
FeynmanDiagram.Taylor.taylor_factorial
— Methodfunction taylor_factorial(o::Vector{Int})
Return the taylor factorial prefactor with order o.
# Arguments:
- `o` Order of the taylor coefficient
FeynmanDiagram.Taylor.use_show_default
— Methoduse_Base_show(d::Bool) --> nothing
Use Base.show_default
method (default show
method in Base), or a custom display. The initial value is false
, so customized display is used.