-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmultiloop_sunset_generic_masses.sage
More file actions
65 lines (53 loc) · 1.88 KB
/
multiloop_sunset_generic_masses.sage
File metadata and controls
65 lines (53 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# Sagemath code for computing the holomorphic period for all the sunset and it Frobenius deformation
# here t=p2
from sage.all import *
from itertools import product, combinations
var('t x n N rho')
R.<x> = PowerSeriesRing(ZZ)
def initialize_sunset_variables(looporder, coPFoperator,params, values, Nmax):
"""
Initialize sunset diagram variables for perturbative calculations.
Parameters:
-----------
looporder : int
The loop order for the calculation
Nmax : int
Maximum number of terms
max_log_power : int
Maximum logarithmic power for symbolic variables
coPFOperator : list coefficients differential operator
params : parameters (the masses)
values : the values of the parameters
Returns:
--------
dict : Dictionary containing all initialized variables
"""
# Initialize main sunset variables
if len(params) != len(values):
raise ValueError("Parameter list and value list must have same length")
subs_dict = dict(zip(params, values))
Lsunset=sum(
OA(coPFoperator[k].subs(subs_dict)) * Dt^k
for k in sorted(coPFoperator)
)
max_log_power=looporder
Persunset = Period(values, Nmax)
Qsunset = Q(values, Nmax)
Rsunset = R(values, Nmax)
# Create symbolic variables for each log power
var_groups = {}
for log_pow in range(max_log_power):
var_name = chr(65 + log_pow) # A, B, C, D, ...
var_groups[log_pow] = [SR.var(f'{var_name}_{n}') for n in range(1, Nmax)]
# Return all variables in a dictionary
return {
'Lsunset': Lsunset,
'Persunset': Persunset,
'Qsunset': Qsunset,
'Rsunset': Rsunset,
'var_groups': var_groups
}
# Example usage:
# sunset_vars = initialize_sunset_variables(looporder=2, Nmax=10)
# Lsunset = sunset_vars['Lsunset']
# var_groups = sunset_vars['var_groups']