by FrediFizzx » Tue Jan 03, 2017 1:08 pm
minkwe wrote:FrediFizzx wrote:How does this line of code for the fourth plot,
QM = matrix(nrow = K, ncol = K, data = sapply(Angles, function(t) -cos(t - Angles)), byrow = TRUE)
have (beta - alpha) in it?
Fred, for each angle in Angles, sapply constructs a new array of 51 differences between the angle and all the rest. Theta is not always zero. Theta is a 51 by 51 matrix with zero on the diagonal.
OK, I get it now. So say we have 5 degree increments instead of 7.2 then in the matrix the 9th column is 45 degrees and the 18th row is 90 degrees so the difference there is 45 degrees. So it is possible to extract (beta - alpha) from the matrix.
I am just still trying to figure out why sign(cos(angle*pol)) works in Mathematica with random angles but does not work in R. It is like cos(angle) is already in the R functions for the complete state and polarizer.
[quote="minkwe"][quote="FrediFizzx"]How does this line of code for the fourth plot,
QM = matrix(nrow = K, ncol = K, data = sapply(Angles, function(t) -cos(t - Angles)), byrow = TRUE)
have (beta - alpha) in it?[/quote]
Fred, for each angle in Angles, sapply constructs a new array of 51 differences between the angle and all the rest. Theta is not always zero. Theta is a 51 by 51 matrix with zero on the diagonal.[/quote]
OK, I get it now. So say we have 5 degree increments instead of 7.2 then in the matrix the 9th column is 45 degrees and the 18th row is 90 degrees so the difference there is 45 degrees. So it is possible to extract (beta - alpha) from the matrix.
I am just still trying to figure out why sign(cos(angle*pol)) works in Mathematica with random angles but does not work in R. It is like cos(angle) is already in the R functions for the complete state and polarizer.