Simulating quantum coefficients

AI Thread Summary
The discussion revolves around generating eight random variables that represent four complex numbers, constrained such that the sum of their squares equals one. This is intended for a quantum simulation of four qubits. The initial approach suggested using Mathematica's RandomVariate with a normal distribution, but the user is unsure how to implement the constraint effectively. A participant introduces the concept of using spherical coordinates to generate points uniformly on a sphere, explaining that directly sampling from a cube is inefficient. They suggest using the cosine of the angle in spherical coordinates to achieve a more even distribution over the sphere's surface. Another contributor proposes a practical method: generating eight random variables within the interval [-1,1], then normalizing them to ensure the sum of their squares equals one. This method simplifies the process while adhering to the required constraint. The discussion highlights the importance of understanding the distribution of points in higher dimensions and the potential challenges in achieving uniformity in random sampling.
Alex Cros
Messages
28
Reaction score
1
Hi everyone,

I want to generate 8 random variables (in reality to form 4 complex numbers) such that the sum of the 8 variables squared is equal to unity. The aim of generating such numbers is to perform a quantum simulation of 4 qubits (thus the 8 parameters). I've been trying to use RandomVariate[NormalDistribution[]] in Mathematica (since the rest of the calculations are there) but I'm not quite sure how to satisfy the constraint described before. I'm not familiar with Monte-Carlo simulations.

Thanks in advance!
 
Technology news on Phys.org
Alex Cros said:
I'm not familiar with Monte-Carlo simulations.
You will have to do something about that ...

8D is too complicated for me.

In a 3D equivalent: suppose you generate sets of 3 uniformly distributed random numbers -- i.e. a cube, uniformly filled with points. If you want the sphere ##r^2 = 1## then picking only the points that satisfy that constraint is totally inefficient. Switch to spherical coordinates and pick ##\phi## and ##\theta##: all points are on the sphere.

Alas, now they are unevenly distributed over the surface of the sphere. Easily fixed by not distributing ##\theta## itself evenly, but ##\cos\theta## instead (Something to do with ##dA = r \sin\theta \,d\theta d\phi \ ## -- check this because I quote from long term-memory that may have suffered from radiation damage :smile:).​

And this concludes your first MC101 lesson :rolleyes: . Homework: extrapolate to 8D :wink: .

By the way: is ##r^2 = 1## the only constraint ? And is it right to assume you want the points evenly distributed over the 7D 'sphere' ? Why do you have 'NormalDistribution' in there ?
 
Last edited:
  • Like
Likes Alex Cros
Alex Cros said:
I want to generate 8 random variables (in reality to form 4 complex numbers) such that the sum of the 8 variables squared is equal to unity. The aim of generating such numbers is to perform a quantum simulation of 4 qubits (thus the 8 parameters).
I don't understand what you want. Do you need to determine the state of 4 qubits, independent of each other? If that is the case, then you can use @BvU's advice and generate 4 locations on the Bloch sphere.
 
  • Like
Likes Alex Cros
How about creating 8 random variables on the interval [-1,1] and then normalizing them?
##X_{i}=random(-1,1), i=1,8##
##A=\sqrt{X{_1}^2+X_{2}^2+...X_{8}^2}##
##Y_{i}=X_{i}/A##
 
  • Like
Likes Alex Cros
Gene Naden said:
How about creating 8 random variables on the interval [-1,1] and then normalizing them?
##X_{i}=random(-1,1), i=1,8##
##A=\sqrt{X{_1}^2+X_{2}^2+...X_{8}^2}##
##Y_{i}=X_{i}/A##
In 3D that would be projecting the 'cube' on the 'sphere' -- unevenly distributed, which may or may not be ok, depending on what it is that you do want evenly distributed...
 
  • Like
Likes Alex Cros
Thread 'Is this public key encryption?'
I've tried to intuit public key encryption but never quite managed. But this seems to wrap it up in a bow. This seems to be a very elegant way of transmitting a message publicly that only the sender and receiver can decipher. Is this how PKE works? No, it cant be. In the above case, the requester knows the target's "secret" key - because they have his ID, and therefore knows his birthdate.
I tried a web search "the loss of programming ", and found an article saying that all aspects of writing, developing, and testing software programs will one day all be handled through artificial intelligence. One must wonder then, who is responsible. WHO is responsible for any problems, bugs, deficiencies, or whatever malfunctions which the programs make their users endure? Things may work wrong however the "wrong" happens. AI needs to fix the problems for the users. Any way to...
Back
Top