Simulating quantum coefficients

  • #1
28
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!
 

Answers and Replies

  • #2
BvU
Science Advisor
Homework Helper
14,119
3,540
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
  • #3
DrClaude
Mentor
7,554
3,894
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
  • #4
319
64
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
  • #5
BvU
Science Advisor
Homework Helper
14,119
3,540
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

Related Threads on Simulating quantum coefficients

Replies
0
Views
549
Replies
2
Views
3K
  • Last Post
Replies
5
Views
2K
Replies
2
Views
1K
Replies
3
Views
3K
Replies
7
Views
927
  • Last Post
Replies
1
Views
553
  • Last Post
Replies
5
Views
5K
  • Last Post
Replies
14
Views
2K
  • Last Post
Replies
1
Views
819
Top