 CoCalc Public FilesSaad Main / Saad Khalid 2 / testing_gammas.sagews
Views : 52
Compute Environment: Ubuntu 18.04 (Deprecated)
Program for $\gamma_{0,0}$
a = [2,3,5]
aprod = 1
asum = 0
for i in (0..len(a)-1):
for j in (0..len(a)-1):
if i == j:
pass
else:
aprod = aprod * (a[i]/(a[i]-a[j]))*(a[i]/a[j])
aprod = aprod*(1/a[i])
asum = asum + aprod
aprod = 1
asum

23/10
%html
Program for $\gamma_{1,0}$

Program for $\gamma_{1,0}$
c = [2,3,5]
sum((1/abs(c[i]))*sum(((-c[i]^2)/(2*c[j]*(c[i]-c[j])))*prod(c[i]^2/(c[k]*(c[i]-c[k])) for k in (0..len(c)-1) if k != j and k != i) for j in (0..len(c)-1) if j != i) for i in (0..len(c)-1))

-23/10


Program for $\gamma_{0,1}$
c = [1,2,3]
sum((1/abs(c[i]))*sum( ( (1/((c[i]-c[j])/c[i]))*(-1/(c[j]/c[i])^2) + (1/(c[j]/c[i])^2)*( ( ((c[i]-c[j])/c[i]) - 1)/(2*((c[i]-c[j])/c[i])) ) )*prod( (1/(c[k]/c[i]))*(1/((c[i]-c[k])/c[i])) for k in (0..len(c)-1) if k != j and k != i) + ( 1/(c[j]/c[i])^2 ) * (1/((c[i]-c[j])/c[i])) *sum( (((((c[i]-c[m])/c[i]) - 1)/(2*((c[i]-c[m])/c[i])))*(1/(c[m]/c[i])) + ((c[m]/c[i] - 1)/(2*(c[m]/c[i])))*(1/((c[i]-c[m])/c[i])) )*prod( (1/(c[p]/c[i]))*(1/((c[i]-c[p])/c[i])) for p in (0..len(c)-1) if p != j and p != i and p != m) for m in (0..len(c)-1) if m != j and m != i ) for j in (0..len(c)-1) if j != i) for i in (0..len(c)-1))

-235/6
c = [1,2,3]
sum((1/abs(c[i]))*sum( ( (1/((c[i]-c[j])/c[i]))*(1/(c[j]/c[i])^2) + (-1/(c[j]/c[i])^2)*( ( ((c[i]-c[j])/c[i]) - 1)/(2*((c[i]-c[j])/c[i])) ) )*prod( (1/(c[k]/c[i]))*(1/((c[i]-c[k])/c[i])) for k in (0..len(c)-1) if k != j and k != i) + ( -1/(c[j]/c[i])^2 ) * (1/((c[i]-c[j])/c[i])) *sum( (((((c[i]-c[m])/c[i]) - 1)/(2*((c[i]-c[m])/c[i])))*(1/(c[m]/c[i])) + ((c[m]/c[i] - 1)/(2*(c[m]/c[i])))*(1/((c[i]-c[m])/c[i])) )*prod( (1/(c[p]/c[i]))*(1/((c[i]-c[p])/c[i])) for p in (0..len(c)-1) if p != j and p != i and p != m) for m in (0..len(c)-1) if m != j and m != i ) for j in (0..len(c)-1) if j != i) for i in (0..len(c)-1))

235/6
c = [-1,-2,-3]
sum((1/abs(c[i]))*sum( ( (c[i]^2*(2*c[i]+c[j])/(2*c[j]^2*(-c[j]+c[i])) ) )*prod( (c[i]^2/(c[k]*(c[i]-c[k]))) for k in (0..len(c)-1) if k != j and k != i) - ( c[i]^3/(c[j]^2*(c[i]-c[j]))) *sum( (-c[i]^2/(2*c[m]*(c[i]-c[m])))*prod( (1/(c[p]/c[i]))*(1/((c[i]-c[p])/c[i])) for p in (0..len(c)-1) if p != j and p != i and p != m) for m in (0..len(c)-1) if m != j and m != i ) for j in (0..len(c)-1) if j != i) for i in (0..len(c)-1))

235/6
a = [1,-2]
sum((1/a[i])*sum(  for j in (0..len(a)-1) if j != i) for i in (0..len(a)-1))


sum for j neq i:
term1: -(a[i]/a[j])^2 * prod((a[i]/a[m]) for m in (0..len(a)-1) if m != i and m != j) * prod(-a[i]/(a[k]-a[i]) for k in (0..len(a)-1) if k != i)
term2: (a[i]/a[j])^2*sum( (a[m]-a[i])/(2*a[m])*prod( (a[i]/a[k]) for k in (0..len(a)-1) if k != i and k != j and k != m) for m in (0..len(a)-1) if m != i and m != j) * prod(-a[i]/(a[n] - a[i]) for n in (0..len(a)-1) if n!=i)
term3: (a[i]/a[j])^2 * prod( (a[i]/a[m]) for m in (0..len(a)-1) if m!= i and m!= j) * sum( (a[k]/(2*(a[k]-a[i]))) * prod(-a[i]/(a[n]-a[i]) for n in (0..len(a)-1) if n != i and n != k) for k in (0..len(a)-1) if k != i )

a = [-1,-2,-3]

sum( (1/abs(a[i]))*sum( (a[i]/a[j])^2 * prod((a[i]/a[m]) for m in (0..len(a)-1) if m != i and m != j) * prod(-a[i]/(a[k]-a[i]) for k in (0..len(a)-1) if k != i) + -(a[i]/a[j])^2*sum( (a[m]-a[i])/(2*a[m])*prod( (a[i]/a[k]) for k in (0..len(a)-1) if k != i and k != j and k != m) for m in (0..len(a)-1) if m != i and m != j) * prod(-a[i]/(a[n] - a[i]) for n in (0..len(a)-1) if n!=i) + -(a[i]/a[j])^2 * prod( (a[i]/a[m]) for m in (0..len(a)-1) if m!= i and m!= j) * sum( (a[k]/(2*(a[k]-a[i]))) * prod(-a[i]/(a[n]-a[i]) for n in (0..len(a)-1) if n != i and n != k) for k in (0..len(a)-1) if k != i ) for j in (0..len(a)-1) if j != i) for i in (0..len(a)-1))

235/6
%html
$\gamma_{-1,1}$

$\gamma_{-1,1}$
a = [1,2,3]
sum(1/(abs(a[i]))*sum(-(a[i]/a[j])^2*prod(a[i]/a[m] for m in (0..len(a)-1) if m != i and m!= j)*prod(-a[i]/(a[k]-a[i]) for k in (0..len(a)-1) if k != i) for j in (0..len(a)-1) if j != i) for i in (0..len(a)-1))

-70/3
Program for $\gamma_{-2,-2}$ with mixed weights
c = [-1,2,3]
k = 1 #k is numneg
sum( (1/abs(c[i]))*prod(1/((c[i]-c[j])/c[i]) for j in (0..len(c)-1) if j != i) for i in (k..len(c)-1))

1/12
%html
Program for $\gamma_{-3,-1}$ with mixed weights.

Program for $\gamma_{-3,-1}$ with mixed weights.
sum( (1/(abs(c[i])))*sum( (c[j]/(c[j] - c[i]))*prod(1/((c[i]-c[k])/c[i]) for k in (0..len(c)-1) if k != i and k != j) for j in (0..len(c)-1) if j != i) for i in (k..len(c)-1))

5/12
var('aj,ai')
show(((aj^2/ai^2 - 1)/(12*(aj/ai)^2)).full_simplify())

(aj, ai)
$\displaystyle -\frac{\mathit{ai}^{2} - \mathit{aj}^{2}}{12 \, \mathit{aj}^{2}}$
var('aj,ai')
t = aj/ai
show(((t-1)/(2*t)).full_simplify())

(aj, ai)
$\displaystyle -\frac{\mathit{ai} - \mathit{aj}}{2 \, \mathit{aj}}$
var('aj,ai')
t = (ai-aj)/ai
show(((t-1)/(2*t)).full_simplify())

(aj, ai)
$\displaystyle -\frac{\mathit{aj}}{2 \, {\left(\mathit{ai} - \mathit{aj}\right)}}$
%html
$\delta_{0,0} $\delta_{0,0}
a = [1,2,3]
sum( (1/abs(a[i]))*prod((a[i]/(a[i]-a[j])) for j in (0..len(a)-1) if j != i) for i in (0..len(a)-1))

0
a = [1,2,3]
sum( (1/abs(a[i]))*sum( (a[j]/(2*(a[j]-a[i]))) * prod(a[i]/(a[i]-a[k]) for k in (0..len(a)-1) if k != i and k!= j) for j in (0..len(a)-1) if j != i) for i in (0..len(a)-1))

0
prod((a[j]/(2*(a[j]-a[i]))) for j in (0..len(a)-1) if j != i) +



B = matrix([[ -3, 2, 1 ],[  2,-4, 4 ],  [  1, 2,-5 ]])
B.rank()
show(.5*B)
(.5*B).parent()
(0.5*B).rank()
((QQ(2 * 0.5))*B).rank()
(QQ(2 * 0.5*B)) == B
(RR(.5)).parent()

2
$\displaystyle \left(\begin{array}{rrr} -1.50000000000000 & 1.00000000000000 & 0.500000000000000 \\ 1.00000000000000 & -2.00000000000000 & 2.00000000000000 \\ 0.500000000000000 & 1.00000000000000 & -2.50000000000000 \end{array}\right)$
Full MatrixSpace of 3 by 3 dense matrices over Real Field with 53 bits of precision 3 2
Error in lines 7-7 Traceback (most recent call last): File "/cocalc/lib/python2.7/site-packages/smc_sagews/sage_server.py", line 1013, in execute exec compile(block+'\n', '', 'single') in namespace, locals File "", line 1, in <module> File "sage/structure/parent.pyx", line 939, in sage.structure.parent.Parent.__call__ (build/cythonized/sage/structure/parent.c:9641) return mor._call_(x) File "sage/structure/coerce_maps.pyx", line 154, in sage.structure.coerce_maps.DefaultConvertMap_unique._call_ (build/cythonized/sage/structure/coerce_maps.c:4928) raise File "sage/structure/coerce_maps.pyx", line 149, in sage.structure.coerce_maps.DefaultConvertMap_unique._call_ (build/cythonized/sage/structure/coerce_maps.c:4790) return C._element_constructor(x) File "sage/rings/rational.pyx", line 474, in sage.rings.rational.Rational.__init__ (build/cythonized/sage/rings/rational.c:6081) self.__set_value(x, base) File "sage/rings/rational.pyx", line 640, in sage.rings.rational.Rational.__set_value (build/cythonized/sage/rings/rational.c:8228) raise TypeError("unable to convert {!r} to a rational".format(x)) TypeError: unable to convert [-3.00000000000000 2.00000000000000 1.00000000000000] [ 2.00000000000000 -4.00000000000000 4.00000000000000] [ 1.00000000000000 2.00000000000000 -5.00000000000000] to a rational
(ZZ(3/2)).parent()

Error in lines 1-1 Traceback (most recent call last): File "/cocalc/lib/python2.7/site-packages/smc_sagews/sage_server.py", line 1013, in execute exec compile(block+'\n', '', 'single') in namespace, locals File "", line 1, in <module> File "sage/structure/parent.pyx", line 939, in sage.structure.parent.Parent.__call__ (build/cythonized/sage/structure/parent.c:9641) return mor._call_(x) File "sage/rings/rational.pyx", line 4075, in sage.rings.rational.Q_to_Z._call_ (build/cythonized/sage/rings/rational.c:35152) raise TypeError("no conversion of this rational to integer") TypeError: no conversion of this rational to integer
(ZZ[I](2+I)).is_prime()

True
e^(i*pi)

-1
(2+I).parent()

Symbolic Ring
3 == ZZ(3/1)

True
a = [-1,-2,-3,-4]
sum( (1/a[i])*prod( (a[i]/(a[i]-a[j])) for j in (0..len(a)-1) if j != i ) for i in (0..len(a)-1))

0