C: Modelling errors in a measurement

Click For Summary
SUMMARY

The discussion focuses on simulating a continuous variable quantum key distribution protocol by modeling measurement errors in Gaussian distributed random numbers. The user attempts to implement a solution in C, where Bob's measurements are influenced by a random error derived from Alice's values. The proposed code snippet adds a uniformly distributed random error, but the user seeks clarification on how to correctly implement Gaussian noise to reflect a 50% spread around Alice's values. The conversation emphasizes the need for proper algorithms to achieve Gaussian distribution rather than uniform distribution.

PREREQUISITES
  • Understanding of Gaussian distribution and its properties
  • Proficiency in C programming language
  • Familiarity with random number generation techniques
  • Knowledge of quantum key distribution protocols
NEXT STEPS
  • Research algorithms for generating Gaussian distributed random numbers in C
  • Learn about the mathematical modeling of measurement errors in quantum communication
  • Explore the concept of relative vs. absolute error in data measurement
  • Investigate existing libraries for quantum key distribution simulations
USEFUL FOR

Quantum computing enthusiasts, C programmers, researchers in quantum key distribution, and anyone interested in modeling measurement errors in statistical simulations.

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.
 

Similar threads

  • · Replies 16 ·
Replies
16
Views
3K
  • · Replies 12 ·
Replies
12
Views
2K
Replies
5
Views
5K
  • · Replies 45 ·
2
Replies
45
Views
7K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 41 ·
2
Replies
41
Views
6K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 35 ·
2
Replies
35
Views
2K
  • · Replies 37 ·
2
Replies
37
Views
6K
  • · Replies 6 ·
Replies
6
Views
3K