Another simulation for QM Local functions

Foundations of physics and/or philosophy of physics, and in particular, posts on unresolved or controversial issues

Re: Another simulation for QM Local functions

Postby FrediFizzx » Tue Aug 20, 2019 9:40 am

gill1109 wrote:I have no idea at all what

n = {0, 2 w*y + 2 x*z, 2 y*z - 2 w*x, w^2 + z^2 - x^2 - y^2}

means. I have no idea what lots of the assignments mean.

What does this mean: Qcoordinates;
n1[[j]] = {n[[2]], n[[3]], n[[4]]}, {j, trials}]

I have commented the code in this new pdf.

EPRsims/nilesj2.pdf

As you can see the quaternions were not necessary for this particular demonstration.
.
FrediFizzx
Independent Physics Researcher
 
Posts: 2905
Joined: Tue Mar 19, 2013 7:12 pm
Location: N. California, USA

Re: Another simulation for QM Local functions

Postby gill1109 » Tue Aug 20, 2019 10:04 am

FrediFizzx wrote:
gill1109 wrote:I have no idea at all what

n = {0, 2 w*y + 2 x*z, 2 y*z - 2 w*x, w^2 + z^2 - x^2 - y^2}

means. I have no idea what lots of the assignments mean.

What does this mean: Qcoordinates;
n1[[j]] = {n[[2]], n[[3]], n[[4]]}, {j, trials}]

I have commented the code in this new pdf.

EPRsims/nilesj2.pdf

As you can see the quaternions were not necessary for this particular demonstration.
.

Thanks! So there was no need to have the first of four coordinates of n equal to zero, since, to get n1, you just extract the second, third and fourth coordinates.
We can think of n1 as a matrix with # trials rows and 3 columns.
n is a vector of length 4. But the first element is identically zero. And you put the other three elements into the j'th row of n1.

Am I right?

Niles Johnson's maths is still beyond me. I hope I will be able to figure it out. But I repeat: all this doesn't change the fact that the uniform distribution on parallelized S^3 is the uniform distribution on the old-fashioned unparallelized S^3. I don't yet see a clever way to use the parallelization in order to come up with better simulations. If you use Niles Johnson's formulas to create a uniform sample on S^2, how do you go *back* from his parametrization to the old-fashioned (x, y, z, t) of S^4?

I suppose that if we solve the equations a = 2 w*y + 2 x*z, b = 2 y*z - 2 w*x, c = w^2 + z^2 - x^2 - y^2 for a given (a, b, c) in S^2, unknowns x, y, z, w, we can find a whole curve of points (x, y, z, w) in S^3. Three equations in four unknowns. In what sense is this a "projection" of S^4?
gill1109
Mathematical Statistician
 
Posts: 2812
Joined: Tue Feb 04, 2014 10:39 pm
Location: Leiden

Re: Another simulation for QM Local functions

Postby FrediFizzx » Tue Aug 20, 2019 11:13 am

gill1109 wrote:
FrediFizzx wrote:I have commented the code in this new pdf.

EPRsims/nilesj2.pdf

As you can see the quaternions were not necessary for this particular demonstration.
.

Thanks! So there was no need to have the first of four coordinates of n equal to zero, since, to get n1, you just extract the second, third and fourth coordinates.
We can think of n1 as a matrix with # trials rows and 3 columns.
n is a vector of length 4. But the first element is identically zero. And you put the other three elements into the j'th row of n1.

Am I right?


Yes, that is correct. I was just following Johnson's math for the zero in the first coordinate.

gill1109 wrote:Niles Johnson's maths is still beyond me. I hope I will be able to figure it out. But I repeat: all this doesn't change the fact that the uniform distribution on parallelized S^3 is the uniform distribution on the old-fashioned unparallelized S^3. I don't yet see a clever way to use the parallelization in order to come up with better simulations. If you use Niles Johnson's formulas to create a uniform sample on S^2, how do you go *back* from his parametrization to the old-fashioned (x, y, z, t) of S^4?


What is S^4? Do you mean R^4? For Johnson's math, you have to use quaternions to get the translation from his very first formula for eta(q) = q.k.q^{-1}.

But we are dealing with the action of a parallelized 3-sphere for a spin 1/2 vector. It's not trivial.

gill1109 wrote:I suppose that if we solve the equations a = 2 w*y + 2 x*z, b = 2 y*z - 2 w*x, c = w^2 + z^2 - x^2 - y^2 for a given (a, b, c) in S^2, unknowns x, y, z, w, we can find a whole curve of points (x, y, z, w) in S^3. Three equations in four unknowns. In what sense is this a "projection" of S^4?


Again, I don't know what S^4 is. To me, that would be a 4-sphere not a 3-sphere.
.
FrediFizzx
Independent Physics Researcher
 
Posts: 2905
Joined: Tue Mar 19, 2013 7:12 pm
Location: N. California, USA

Re: Another simulation for QM Local functions

Postby Joy Christian » Tue Aug 20, 2019 8:10 pm

FrediFizzx wrote:
Again, I don't know what S^4 is. To me, that would be a 4-sphere not a 3-sphere.

He means S^3, not S^4. S^3 in R^4 requires four coordinates, just as S^2 in R^3 requires three coordinates. S^4, which is a 4-sphere, is not relevant here. To put it charitably, S^4 is a typo.

***
Joy Christian
Research Physicist
 
Posts: 2793
Joined: Wed Feb 05, 2014 4:49 am
Location: Oxford, United Kingdom

Re: Another simulation for QM Local functions

Postby FrediFizzx » Tue Aug 20, 2019 8:25 pm

Joy Christian wrote:
FrediFizzx wrote:
Again, I don't know what S^4 is. To me, that would be a 4-sphere not a 3-sphere.

He means S^3, not S^4. S^3 in R^4 requires four coordinates, just as S^2 in R^3 requires three coordinates. S^4, which is a 4-sphere, is not relevant here. To put it charitably, S^4 is a typo.

***

I was thinking he meant R^4 since he had 4 coordinates.
.
FrediFizzx
Independent Physics Researcher
 
Posts: 2905
Joined: Tue Mar 19, 2013 7:12 pm
Location: N. California, USA

Re: Another simulation for QM Local functions

Postby FrediFizzx » Tue Aug 20, 2019 8:28 pm

Does anyone know what base_point[0],etc. means in this Sage/Cython code?

Code: Select all
"""
Fiber parametrization function improved to Cython by Jason Grout.
"""

from libc.math cimport sin, cos, atan2, acos, sqrt, M_1_PI
cdef class fib_param2(object):
    cdef float a,b,c,al,be
    def __init__(self, base_point):
        self.a=base_point[0]
        self.b=base_point[1]
        self.c=base_point[2]
        self.al=sqrt(.5*(1 + self.c))
        self.be=sqrt(.5*(1 - self.c))
       
    def __call__(self, float ph):
        cdef float th = atan2(-self.a,self.b)-ph
        cdef float w,x,y,z
        (w,x,y,z) = (self.al*cos(th), -1*self.be*cos(ph), -1*self.be*sin(ph), self.al*sin(th))
        cdef float rr = acos(w)*M_1_PI*(1.0/sqrt(1-w**2))
        return (x*rr, y*rr, z*rr)


Or take a wild guess. :D I searched all over the Inet with no luck.
.
FrediFizzx
Independent Physics Researcher
 
Posts: 2905
Joined: Tue Mar 19, 2013 7:12 pm
Location: N. California, USA

Re: Another simulation for QM Local functions

Postby gill1109 » Wed Aug 21, 2019 1:00 am

FrediFizzx wrote:Does anyone know what base_point[0],etc. means in this Sage/Cython code?

Code: Select all
"""
Fibre parametrization function improved to Cython by Jason Grout.
"""

from libc.math cimport sin, cos, atan2, acos, sqrt, M_1_PI
cdef class fib_param2(object):
    cdef float a,b,c,al,be
    def __init__(self, base_point):
        self.a=base_point[0]
        self.b=base_point[1]
        self.c=base_point[2]
        self.al=sqrt(.5*(1 + self.c))
        self.be=sqrt(.5*(1 - self.c))
       
    def __call__(self, float ph):
        cdef float th = atan2(-self.a,self.b)-ph
        cdef float w,x,y,z
        (w,x,y,z) = (self.al*cos(th), -1*self.be*cos(ph), -1*self.be*sin(ph), self.al*sin(th))
        cdef float rr = acos(w)*M_1_PI*(1.0/sqrt(1-w**2))
        return (x*rr, y*rr, z*rr)


Or take a wild guess. :D I searched all over the Inet with no luck.
.

You can see what it means, from this description of the function "Quaternion.exp_map(q, eta)" in https://kieranwynn.github.io/pyquaternion/. This "pyquaternion" is based on the same mathematics. (I see that "cython" is a kind of translation of python into C).

The terminology "base point" comes from the general mathematical theory of quaternions.

Quaternion exponential map.

Find the exponential map on the Riemannian manifold described by the quaternion space.

Params:

q - the base point of the exponential map, i.e. a Quaternion object
eta - the argument of the exponential map, a tangent vector, i.e. a Quaternion object
Returns: A quaternion p such that p is the endpoint of the geodesic starting at q in the direction of eta, having the length equal to the magnitude of eta.

Note: The exponential map plays an important role in integrating orientation variations (e.g. angular velocities). This is done by projecting quaternion tangent vectors onto the quaternion manifold.


And sorry, my S^4 was indeed a typo. Sorry, I make a lot of typos. I was referring to coordinates in R^4.

Another useful resource is:

http://csunix1.lvc.edu/~lyons/pubs/hopf_paper_preprint.pdf
An Elementary Introduction to the Hopf Fibration
David W. Lyons

The Hopf fibration, named after Heinz Hopf who studied it in a 1931 paper [8], is an important object in mathematics and physics. It was a landmark discovery in topology and is a fundamental object in the theory of Lie groups. The Hopf fibration has a wide variety of physical applications including magnetic monopoles [13], rigid body mechanics [10] and quantum information theory [12]. Unfortunately, the Hopf fibration is little known in the undergraduate curriculum, in part because presentations usually assume a background in abstract algebra or manifolds. However, this is not a necessary restriction. We present in this article an introduction to the Hopf fibration that requires only linear algebra and analytic geometry. In particular, no vector calculus, abstract algebra or topology is needed. Our approach uses the algebra of quaternions and illustrates some of the algebraic and geometric properties of the Hopf fibration. We explain the intimate connection of the Hopf fibration with rotations of 3-space that is the basis for its natural applications to physics. We deliberately leave some of the development as exercises, called “Investigations,” for the reader. The Investigations contain key ideas and are meant to be fun to think about. The reader may also take them as statements of facts that we wish to assume without interrupting the narrative.

[12] R. Mosseri and R. Dandoloff, Geometry of entangled states, Bloch spheres and Hopf fibrations, J. Phys. A 34 (2001), 10243–10252 https://arxiv.org/pdf/quant-ph/0108137.pdf
gill1109
Mathematical Statistician
 
Posts: 2812
Joined: Tue Feb 04, 2014 10:39 pm
Location: Leiden

Re: Another simulation for QM Local functions

Postby gill1109 » Wed Aug 21, 2019 4:35 am

Here is R-code which very creates a uniform sample of size 100000 on S^3 and then plots two thin "t-slices" of the resulting (x, y, z, t) points. The blue (x,y,z) points have t approximately equal to 0.2 and the red points have t approximately equal to 0.8. They all lie within the ball of radius 1, of course. If you run this yourself you can hand-rotate the cloud of points and the annotated box [-1, 1]^3 they lie in.

Code: Select all
N <- 100000
set.seed(11091951)

f <- function(u) uniroot(function(x) x - sin(2 * x)/2 - u, interval = c(0, pi))$root
unirootVec <- Vectorize(f)

U <- runif(N, 0, pi)
Phi1 <- unirootVec(U)

V <- runif(N, -1, 1)
Phi2 <- acos(V)

Phi3 <- runif(N, 0, 2 * pi)

S1 <- sin(Phi1)
S2 <- sin(Phi2)
S3 <- sin(Phi3)

C1 <- cos(Phi1)
C2 <- V
C3 <- cos(Phi3)

X <- C1
Y <- S1 * C2
S12 <- S1 * S2
Z <- S12 * C3
T <- S12 * S3

library(rgl)

slice <- (1:N)[T > 0.2 & T < 0.21]
spheres3d(X[slice], Y[slice], Z[slice], col = "blue", radius = 0.02)
slice <- (1:N)[T > 0.8 & T < 0.81]
spheres3d(X[slice], Y[slice], Z[slice], col = "red", radius = 0.02)
decorate3d()


Image
gill1109
Mathematical Statistician
 
Posts: 2812
Joined: Tue Feb 04, 2014 10:39 pm
Location: Leiden

Re: Another simulation for QM Local functions

Postby gill1109 » Wed Aug 21, 2019 6:34 am

Here is the marginal distribution of T. It turns out to have the semicircle distribution! Its probability density is easily computed to be 2 sqrt(1 - t^2) / pi. (In fact, I computed the marginal probability density of X. They are all the same!). I have graphed the empirical histogram of those 100 000 realisations, together with the theoretical density. Axes scaled so that the theoretical density is indeed a perfect semicircle.

Image
gill1109
Mathematical Statistician
 
Posts: 2812
Joined: Tue Feb 04, 2014 10:39 pm
Location: Leiden

Re: Another simulation for QM Local functions

Postby FrediFizzx » Wed Aug 21, 2019 10:15 am

gill1109 wrote:You can see what it means, from this description of the function "Quaternion.exp_map(q, eta)" in https://kieranwynn.github.io/pyquaternion/. This "pyquaternion" is based on the same mathematics. (I see that "cython" is a kind of translation of python into C).

The terminology "base point" comes from the general mathematical theory of quaternions.

Quaternion exponential map.

Find the exponential map on the Riemannian manifold described by the quaternion space.

Params:

q - the base point of the exponential map, i.e. a Quaternion object
eta - the argument of the exponential map, a tangent vector, i.e. a Quaternion object
Returns: A quaternion p such that p is the endpoint of the geodesic starting at q in the direction of eta, having the length equal to the magnitude of eta.

Note: The exponential map plays an important role in integrating orientation variations (e.g. angular velocities). This is done by projecting quaternion tangent vectors onto the quaternion manifold.


Sorry, but that is not helpful. I still can't figure out how to program base_point[0] in Mathematica.
.
FrediFizzx
Independent Physics Researcher
 
Posts: 2905
Joined: Tue Mar 19, 2013 7:12 pm
Location: N. California, USA

Re: Another simulation for QM Local functions

Postby FrediFizzx » Wed Aug 21, 2019 10:17 am

gill1109 wrote:Another useful resource is:

http://csunix1.lvc.edu/~lyons/pubs/hopf_paper_preprint.pdf
An Elementary Introduction to the Hopf Fibration
David W. Lyons

Yes, you can see Johnson's formula in his eq. (1).
.
FrediFizzx
Independent Physics Researcher
 
Posts: 2905
Joined: Tue Mar 19, 2013 7:12 pm
Location: N. California, USA

Re: Another simulation for QM Local functions

Postby gill1109 » Wed Aug 21, 2019 10:20 am

https://gill1109.files.wordpress.com/2019/08/3sphere-better.png?w=800
Code getting better and better. And it spins like a dream!
“t-slices” of a uniform random sample (x, y, z, t) from S^3. N = 100 000. Delta t = 0.01. Red, radius 0.3. Blue, radius 0.8
gill1109
Mathematical Statistician
 
Posts: 2812
Joined: Tue Feb 04, 2014 10:39 pm
Location: Leiden

Re: Another simulation for QM Local functions

Postby minkwe » Wed Aug 21, 2019 2:34 pm

FrediFizzx wrote:Does anyone know what base_point[0],etc. means in this Sage/Cython code?

Code: Select all
"""
Fiber parametrization function improved to Cython by Jason Grout.
"""

from libc.math cimport sin, cos, atan2, acos, sqrt, M_1_PI
cdef class fib_param2(object):
    cdef float a,b,c,al,be
    def __init__(self, base_point):
        self.a=base_point[0]
        self.b=base_point[1]
        self.c=base_point[2]
        self.al=sqrt(.5*(1 + self.c))
        self.be=sqrt(.5*(1 - self.c))
       
    def __call__(self, float ph):
        cdef float th = atan2(-self.a,self.b)-ph
        cdef float w,x,y,z
        (w,x,y,z) = (self.al*cos(th), -1*self.be*cos(ph), -1*self.be*sin(ph), self.al*sin(th))
        cdef float rr = acos(w)*M_1_PI*(1.0/sqrt(1-w**2))
        return (x*rr, y*rr, z*rr)


Or take a wild guess. :D I searched all over the Inet with no luck.
.


base_point is an array and base_point[0] is referencing the first element of the array. fib_param2 is a functor which is instantiated with an array 'base_point' of length 3. Once instantiated, it acts like a function which takes a single parameter 'ph', and returns a 3-tuple.
minkwe
 
Posts: 1441
Joined: Sat Feb 08, 2014 10:22 am

Re: Another simulation for QM Local functions

Postby FrediFizzx » Wed Aug 21, 2019 2:54 pm

minkwe wrote:
FrediFizzx wrote:Does anyone know what base_point[0],etc. means in this Sage/Cython code?

Code: Select all
"""
Fiber parametrization function improved to Cython by Jason Grout.
"""

from libc.math cimport sin, cos, atan2, acos, sqrt, M_1_PI
cdef class fib_param2(object):
    cdef float a,b,c,al,be
    def __init__(self, base_point):
        self.a=base_point[0]
        self.b=base_point[1]
        self.c=base_point[2]
        self.al=sqrt(.5*(1 + self.c))
        self.be=sqrt(.5*(1 - self.c))
       
    def __call__(self, float ph):
        cdef float th = atan2(-self.a,self.b)-ph
        cdef float w,x,y,z
        (w,x,y,z) = (self.al*cos(th), -1*self.be*cos(ph), -1*self.be*sin(ph), self.al*sin(th))
        cdef float rr = acos(w)*M_1_PI*(1.0/sqrt(1-w**2))
        return (x*rr, y*rr, z*rr)


Or take a wild guess. :D I searched all over the Inet with no luck.
.


base_point is an array and base_point[0] is referencing the first element of the array. fib_param2 is a functor which is instantiated with an array 'base_point' of length 3. Once instantiated, it acts like a function which takes a single parameter 'ph', and returns a 3-tuple.

Thanks very much. I took a wild guess at how to program this in Mathematica and ended up with this,

Image

It is giving points in a ball with a radius of about 0.54 with a lot of points concentrated in the center so definitely not correct. Here is the Mathematica code,

Code: Select all
trials = 2000;
x1 = ConstantArray[0, trials];
y1 = ConstantArray[0, trials];
z1 = ConstantArray[0, trials];
n1 = ConstantArray[0, trials];
Do[a = RandomReal[{-1, 1}];
 b = RandomReal[{-1, 1}];
 c = RandomReal[{-1, 1}];
 al = Sqrt[0.5 (1 + c)];
 be = Sqrt[0.5 (1 - c)];
 ph = RandomReal[{0, 2 \[Pi]}];
 th = ArcTan[a, b] - ph;
 w = al*Cos[th];
 x = -be*Cos[ph];
 y = -be*Sin[ph];
 z = al*Sin[th];
 rr = ArcCos[w]/\[Pi] Sqrt[1 - w^2];
 x1[[j]] = x*rr;
 y1[[j]] = y*rr;
 z1[[j]] = z*rr;
 n1[[j]] = {x1[[j]], y1[[j]], z1[[j]]}, {j, trials}]
Graphics3D[Table[Point[{{0, 0, 0}, p}], {p, n1}], Axes -> True]

So what am I doing wrong?
.
FrediFizzx
Independent Physics Researcher
 
Posts: 2905
Joined: Tue Mar 19, 2013 7:12 pm
Location: N. California, USA

Re: Another simulation for QM Local functions

Postby Joy Christian » Wed Aug 21, 2019 3:10 pm

FrediFizzx wrote:
So what am I doing wrong?

From the 3-sphere perspective, it is unlikely to have a uniform distribution of points on any 2-sphere projection.

***
Joy Christian
Research Physicist
 
Posts: 2793
Joined: Wed Feb 05, 2014 4:49 am
Location: Oxford, United Kingdom

Re: Another simulation for QM Local functions

Postby minkwe » Wed Aug 21, 2019 6:44 pm

FrediFizzx wrote:Thanks very much. I took a wild guess at how to program this in Mathematica and ended up with this,

Image

It is giving points in a ball with a radius of about 0.54 with a lot of points concentrated in the center so definitely not correct. Here is the Mathematica code,

Code: Select all
trials = 2000;
x1 = ConstantArray[0, trials];
y1 = ConstantArray[0, trials];
z1 = ConstantArray[0, trials];
n1 = ConstantArray[0, trials];
Do[a = RandomReal[{-1, 1}];
 b = RandomReal[{-1, 1}];
 c = RandomReal[{-1, 1}];
 al = Sqrt[0.5 (1 + c)];
 be = Sqrt[0.5 (1 - c)];
 ph = RandomReal[{0, 2 \[Pi]}];
 th = ArcTan[a, b] - ph;
 w = al*Cos[th];
 x = -be*Cos[ph];
 y = -be*Sin[ph];
 z = al*Sin[th];
 rr = ArcCos[w]/\[Pi] Sqrt[1 - w^2];
 x1[[j]] = x*rr;
 y1[[j]] = y*rr;
 z1[[j]] = z*rr;
 n1[[j]] = {x1[[j]], y1[[j]], z1[[j]]}, {j, trials}]
Graphics3D[Table[Point[{{0, 0, 0}, p}], {p, n1}], Axes -> True]

So what am I doing wrong?
.

Hi Fred,
The Cython (Cython is Python compiler with an extension to the Python language) code you posted is a declaration. It doesn't actually show how the Function Object is instanciated and used. In code declares a template for generating functions based on the provided base_point array. So that slightly different functions can be generated by simply changing base_point when generating an instance of fib_param2.

In your translation to Mathematica, you are selecting the elements of base_point as three random real numbers between -1 and 1. Why?
Now I haven't been paying close attention to everything on this thread but note that the selected randomization scheme appears to be critical in the distribution of points you obtain. See https://en.wikipedia.org/wiki/Bertrand_ ... robability)#Jaynes's_solution_using_the_%22maximum_ignorance%22_principle.
minkwe
 
Posts: 1441
Joined: Sat Feb 08, 2014 10:22 am

Re: Another simulation for QM Local functions

Postby FrediFizzx » Wed Aug 21, 2019 7:07 pm

minkwe wrote:Hi Fred,
The Cython (Cython is Python compiler with an extension to the Python language) code you posted is a declaration. It doesn't actually show how the Function Object is instanciated and used. In code declares a template for generating functions based on the provided base_point array. So that slightly different functions can be generated by simply changing base_point when generating an instance of fib_param2.

In your translation to Mathematica, you are selecting the elements of base_point as three random real numbers between -1 and 1. Why?
Now I haven't been paying close attention to everything on this thread but note that the selected randomization scheme appears to be critical in the distribution of points you obtain. See https://en.wikipedia.org/wiki/Bertrand_ ... robability)#Jaynes's_solution_using_the_%22maximum_ignorance%22_principle.

Yes, here is a link to a text file of the rest of the Sage code that uses that function. It is quite long.

www.sciphysicsforums.com/spfbb1/EPRsims ... imate.sage

Now that I understand what base_point is, I can maybe understand this code better. I just guessed at using random real numbers between -1 and 1 for a, b and c. It did give me some output. :D And I have ph random between 0 and 2pi. If I set it to pi, I get half a ball. To pi/2, a 1/4 ball. Pretty wild and crazy!

What I am trying to do is to see if there is another way of getting parallelized 3-sphere points to feed the other simulations.
.
FrediFizzx
Independent Physics Researcher
 
Posts: 2905
Joined: Tue Mar 19, 2013 7:12 pm
Location: N. California, USA

Re: Another simulation for QM Local functions

Postby minkwe » Wed Aug 21, 2019 7:53 pm

FrediFizzx wrote:Now that I understand what base_point is, I can maybe understand this code better. I just guessed at using random real numbers between -1 and 1 for a, b and c. It did give me some output. :D And I have ph random between 0 and 2pi. If I set it to pi, I get half a ball. To pi/2, a 1/4 ball. Pretty wild and crazy!

What I am trying to do is to see if there is another way of getting parallelized 3-sphere points to feed the other simulations.
.


Looking at that code, everything starts at "draw_frame" function, that takes in a list of points on S^2. This list is then passed to the "add_fibers" method of a HopfFibers instance as "fiber_coordinates", this is a list of 3-tuples [(a1,b1,c1), (a2, b2, c2), ...]. Again the code says these are points on S^2. I can see that the S^2 points are generated in the BaseSpiral object as listed right at the top of the file. The "add_fibers" method, iterates through these coordinates (a,b,c), modifies them a little using another functor RealField (I don't seen the declaration of this), verifies that they are on S^2 and then calculates a parametric representation of the fiber for plotting using the fib_param2 which takes the tuple (a,b,c) as input.

If you are interested in generation of coordinates, you may want to look at BaseSpiral instead of fib_param2 which is just converting cartesian to parametric representation of the fibers.
minkwe
 
Posts: 1441
Joined: Sat Feb 08, 2014 10:22 am

Re: Another simulation for QM Local functions

Postby FrediFizzx » Wed Aug 21, 2019 8:28 pm

minkwe wrote:
FrediFizzx wrote:Now that I understand what base_point is, I can maybe understand this code better. I just guessed at using random real numbers between -1 and 1 for a, b and c. It did give me some output. :D And I have ph random between 0 and 2pi. If I set it to pi, I get half a ball. To pi/2, a 1/4 ball. Pretty wild and crazy!

What I am trying to do is to see if there is another way of getting parallelized 3-sphere points to feed the other simulations.
.


Looking at that code, everything starts at "draw_frame" function, that takes in a list of points on S^2. This list is then passed to the "add_fibers" method of a HopfFibers instance as "fiber_coordinates", this is a list of 3-tuples [(a1,b1,c1), (a2, b2, c2), ...]. Again the code says these are points on S^2. I can see that the S^2 points are generated in the BaseSpiral object as listed right at the top of the file. The "add_fibers" method, iterates through these coordinates (a,b,c), modifies them a little using another functor RealField (I don't seen the declaration of this), verifies that they are on S^2 and then calculates a parametric representation of the fiber for plotting using the fib_param2 which takes the tuple (a,b,c) as input.

If you are interested in generation of coordinates, you may want to look at BaseSpiral instead of fib_param2 which is just converting cartesian to parametric representation of the fibers.

Ok, thanks. Got some studying to do now. :)
.
FrediFizzx
Independent Physics Researcher
 
Posts: 2905
Joined: Tue Mar 19, 2013 7:12 pm
Location: N. California, USA

Re: Another simulation for QM Local functions

Postby gill1109 » Thu Aug 22, 2019 4:38 am

FrediFizzx wrote:
minkwe wrote:Hi Fred,
The Cython (Cython is Python compiler with an extension to the Python language) code you posted is a declaration. It doesn't actually show how the Function Object is instanciated and used. In code declares a template for generating functions based on the provided base_point array. So that slightly different functions can be generated by simply changing base_point when generating an instance of fib_param2.

In your translation to Mathematica, you are selecting the elements of base_point as three random real numbers between -1 and 1. Why?
Now I haven't been paying close attention to everything on this thread but note that the selected randomization scheme appears to be critical in the distribution of points you obtain. See https://en.wikipedia.org/wiki/Bertrand_ ... robability)#Jaynes's_solution_using_the_%22maximum_ignorance%22_principle.

Yes, here is a link to a text file of the rest of the Sage code that uses that function. It is quite long.

EPRsims/hopf_animate.sage

Now that I understand what base_point is, I can maybe understand this code better. I just guessed at using random real numbers between -1 and 1 for a, b and c. It did give me some output. :D And I have ph random between 0 and 2pi. If I set it to pi, I get half a ball. To pi/2, a 1/4 ball. Pretty wild and crazy!

What I am trying to do is to see if there is another way of getting parallelized 3-sphere points to feed the other simulations.
.

Fred, another way of getting parallelized 3-sphere points to feed the other simulations: generate random unparallelized 3-sphere points in whatever way you like, and compute their coordinates wrt to a parallelization! (Note - there are many parallelizations, but all are isomorphic one another. Obtained from one another by rotations of the 3-sphere.

Regarding another question (about the picture of the cloud of points in the unit ball):

If you generate uniform random points (x, y, z, t) on the 3-sphere and make a 3d plot of the first 3 coordinates, the result will be hardly distinguishable, by eye, from uniform random points (x, y, z) in the 3-ball.
Image
Image
See a difference? Which is which?

However, if you just make a histogram of the x coordinate, you'll see a big difference. In the case of the 3-sphere, the *second* of the two 3-d plots, you'll see the semicircle law. In the case of the 3-ball you'll see something markedly different. It isn't difficult to figure out the probability density of x in that case (one needs a formula for the volume of the intersection of the ball and a half-space, and then differentiate with respect the distance of the hyperplane defining the half-space to the origin. The result is proportional, of course, to the area of the disk which is the intersection of ball and hyperplane!) The answer is 3/4 (1 - u^2), a parabola.

Image

Notice that the 3d points from the 3-sphere come up closer to the boundary of the ball. At the boundary, the density is zero, but the slope of the density there is infinite. 3d points from the 3-ball kind of stay away from the boundary: at the boundary, the density is zero too, but its slope at the boundary is finite.

Conversely, the density of points near the centre of the ball is smaller for the 3-sphere than for the 3-ball case.

Immediately, the mean values of the squares of the x co-ordinate in the two cases are 1/4 (3-sphere) and 1/3 (3-ball). This suggests that the 3-sphere points are closer to the origin than the 3-ball points. But that is a wrong suggestion. Curious.
gill1109
Mathematical Statistician
 
Posts: 2812
Joined: Tue Feb 04, 2014 10:39 pm
Location: Leiden

PreviousNext

Return to Sci.Physics.Foundations

Who is online

Users browsing this forum: No registered users and 68 guests

cron
CodeCogs - An Open Source Scientific Library