C: Modelling errors in a measurement

AI Thread Summary
The discussion focuses on simulating a continuous variable quantum key distribution protocol by modeling measurement errors in Gaussian-distributed random numbers. The user is attempting to create a program that simulates how Bob receives a signal from Alice, factoring in Gaussian noise that introduces measurement errors. They express uncertainty about their current implementation, which adds a uniform random error to Alice's values, questioning whether a 50% spread represents a relative or absolute error. Suggestions indicate that to achieve a Gaussian distribution, the user should explore specific algorithms rather than relying on uniform random values. The conversation emphasizes the need for accurate modeling of measurement errors in quantum communication protocols.
six7th
Messages
14
Reaction score
0

Homework Statement


I'm currently writing a program that will read in a list of gaussian distributed random numbers as an array and will make a 'measurement', that is they will be assigned to another array with an associated error. This is to try and simulate the communication of Alice to Bob in a continuous variable quantum key distribution protocol.

In such a protocol there will be gaussian noise and therefore Bob will not receive the exact signal that was sent. For example, if there was a 50% spread around Alice's value that Bob could measure, how would I go about doing this?

2. The attempt at a solution

for(i=0;i<=size;i++)
{

double a = (rand() % 100) - 50; //Produces a random number between -50 and 50
bob = alice + (a/10); //Bob makes a measurement with a random error between -0.5 and 0.5

fprintf(gaussBob, "%.4lg %.4lg\n",alice,bob);
}

To me what I've done doesn't seem correct as there is just an addition of a random value between the specified range. Any help is appreciated.
 
Physics news on Phys.org
50% spread is a relative error? Or something absolute?
bob = alice + (a/10); //Bob makes a measurement with a random error between -0.5 and 0.5
I guess this should be a/100.
This gives a uniform distribution, To get a Gaussian there are many algorithms.
 
Back
Top