I'm not familiar with the formula, but I can try to explain what I understand from it.
A sequence is a set of numbers that follow a rule. (Think of it as an array.)
S
i ϵ {+1, -1} means that the i
th number in the sequence S can either be + or -1. This is our rule.
(I think, I've only read about sets on YouTube because I was bored one day.)
Σ is called sigma and is used as a shorthand of writing sum of.
This means the sum of the elements i, starting at 1 and going up to and including 10. In other words, it is the shorthand of writing
1 + 2 + 3 + 4 + ... + 9 + 10
.
Similarly, E(S) is what we want to calculate. It is the energy of sequence S. But to calculate E(S), we need to calculate C
k(S).
To calculate C
k(S), we need L, the length of our sequence/array and k, which is a counter/iterator when we calculate E(S).
Suppose we had the sequence
1 2
|
const int L{ 5 };
int S[L]{ -1, -1, 1, -1, 1 };
|
then
1 2 3 4 5 6 7 8 9 10 11 12 13 14
|
pretend arrays are 1-indexed
when k == 1
C(S) == S[1]*S[1+1] + S[2]*S[2+1] + S[3]*S[3+1] + S[4]*S[4+1]
== -1*-1 + -1*1 + 1*-1 + -1*1
== 1 - 1 - 1 - 1
== -2
stop at 4, as L-k == 4
when k == 2
C(S) == S[1]*S[1+2] + S[2]*S[2+2] + S[3]*S[3+2]
== -1*1 + -1*-1 + 1*1
== -1 + 1 + 1
== 1
stop at 3
etc..
|
Now to get E(S), you do the above up to and including k == 4, square
(?) each C(S) and add them together.
I'm not sure if C(S) meant to be squared, but I don't know what else it could be.
1 2 3 4 5 6 7 8 9
|
when k == 3
C(S) == S[1]*S[1+3] + S[2]*S[2+3]
== -1*-1 + -1*1
== 1 - 1
== 0
when k == 4
C(S) == S[1]*S[1+4]
== -1*1
== -1
|
1 2 3
|
E(S) == (-2)2 + (1)2 + (0)2 + (-1)2
== 4 + 1 + 0 + 1
== 6
|
Thus, the energy of sequence S{ -1, -1, 1, -1, 1 } is 6.