Comments (2)
Comment by franciumxzf
Monday Feb 20, 2023 at 10:08 GMT
Originally commented as franciumxzf/fpfind#11 (comment)
Using dataset27 as an example, compare the results from method 1 and method 2:
print((1/(1+bob_freq)-1)) # 1.408126167778967e-05
print((-bob_freq)/(1 + bob_freq)) # 1.4081261677757226e-05
print(alice_freq) # 1.4081094847240294e-05
Notice that results from two expressions in method 1 are quite near, but much different from method 2. This is because the frequency convergency test in our pfind doesn't go to exact 1 but a float number very near to 1. In this dataset:
print((1 + alice_freq) * (1 + bob_freq)) # 0.9999999998331718
If we correct for this in method 1, compare the results:
print((0.9999999998331718/(1+bob_freq)-1)) # 1.4081094847240294e-05
print((0.9999999998331718-1-bob_freq)/(1 + bob_freq)) # 1.4081094847190168e-05
print(alice_freq) # 1.4081094847240294e-05
Now the first expression in method 1 gives the same value as method 2, while the second method lost some accuracy (but very small).
In summary, the major accuracy loss is from the near-1 result in the frequency convergency test. The loss from the calculation (multiplication /division of float number) is much less compare with it.
from fpfind.
Comment by franciumxzf
Monday Feb 20, 2023 at 10:16 GMT
Originally commented as franciumxzf/fpfind#11 (comment)
To illustrate more on the comparasion of accuracy loss between the two expressions in method 1, we can perform the following calculation:
import numpy as np
for bob_freq in np.geomspace(1e-5, 1e-10, 6):
print((1/(1+bob_freq)-1))
print((-bob_freq)/(1 + bob_freq))
print()
# -9.999900001056439e-06
# -9.99990000099999e-06
# -9.99998999939855e-07
# -9.99999000001e-07
# -9.99999900663795e-08
# -9.999999000000099e-08
# -9.999999828202988e-09
# -9.999999900000002e-09
# -1.000000082740371e-09
# -9.99999999e-10
# -1.000000082740371e-10
# -9.999999999e-11
Up to around 1e-14, we still hold the accuracy. In this way, we can say that the calculation does not remove a lot of accuracy.
from fpfind.
Related Issues (15)
- Standardize external interface for `pfind` function HOT 1
- Potential desynchronization of epochs with large frequency detuning HOT 2
- Port individual test cases from Jupyter notebook into the `pytest` framework
- Align `pfind` with arguments currently used by `pfind.c` in qcrypto stack HOT 2
- Check if pfind works with absolute time difference larger than half second HOT 5
- Frequency correction of timestamp events HOT 5
- Check if pfind can work with a thermal source HOT 1
- Add missing sigma calculation for pfind output HOT 1
- Create an MVP frequency correction script in C HOT 1
- Integrate into QKD Server HOT 2
- Integrate the conversion of timestamp to epoch into test HOT 1
- Implement per-epoch timing correction for qcrypto HOT 1
- fpfind fails for low FFT buffer order when time difference is too negative
- freqcd overflow logic is wrong HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fpfind.