Closed yu289333 closed 3 years ago
HI @yu289333 --- You are correct, P([l]) is the power set of the first l integers. Where it is not defined?
Then |S| is the number of elements in set S? Thank you so much for explaining.
Correct.
Sorry for asking all the questions. I'm on the physics side and am overwhelmed by all the math. For N=2, and vector_n = {1, 0}, O{n} should be a 2x2 matrix, it's not possible to go over S∈P([ℓ]), right? Where do I get wrong?
For a Two Mode Squeezed State (TMSS), the probability of the |0>0> Fock state is 1-[tanh(r)]^2. I'm having trouble verifying with the torontorian result for vector_n={0,0}
And for vector_n={0,1} and {1,0}, the probability is (x-1)/x.(x+ln(1-x)) where x=[tanh(r)]^2. I hope to compare with the torontorian result.
Hi --- The easiest way to calculate these probabilities is to use threshold_detection_prob
. For a two mode squeezed vacuum state you can do
import numpy as np
from thewalrus.symplectic import two_mode_squeezing
from thewalrus._torontonian import threshold_detection_prob
n_mean = np.arcsinh(1.0)
cov = two_mode_squeezing(2*n_mean, 0)
mean = np.zeros([4])
patterns = [[0,0], [0,1], [1,0], [1,1]]
probs = [threshold_detection_prob(mean, cov, pat) for pat in patterns]
for i, pat in enumerate(patterns):
print("The probability of the event "+str(pat)+" is "+str(probs[i]))
to get
The probability of the event [0, 0] is (0.4999999999999999+0j) The probability of the event [0, 1] is (1.1102230246251563e-16+0j) The probability of the event [1, 0] is (1.1102230246251563e-16+0j) The probability of the event [1, 1] is (0.5000000000000001+0j)
As for your question
Sorry for asking all the questions. I'm on the physics side and am overwhelmed by all the math. For N=2, and vector_n = {1, 0}, O{n} should be a 2x2 matrix, it's not possible to go over S∈P([ℓ]), right? Where do I get wrong?
in that case [ℓ] = [2] = [0,1]
and the P[ℓ] = [[], [0], [1], [0,1]]
Thanks. I forgot to mention that my trouble is to calculate the results of TMSS photons going through a symmetric beam splitter to compare with the original Hong-Ou-Mandel experiment.
You can generate the relevant covariance matrices either using the symplectic
module or Strawberry Fields. Once you have the covariance matrix you can pass them to threshold_detection_prob
as above.
Before posting an issue
Search existing GitHub issues to make sure the issue does not already exist: https://github.com/XanaduAI/thewalrus/issues
If posting a library issue, delete everything above the dashed line, and fill in the template.
If making a feature request, delete the following template and describe, in detail, the feature and why it is needed.
For general technical details check out our documentation: https://the-walrus.readthedocs.io
Issue description
Description of the issue - include code snippets and screenshots here if relevant. You may use the following template below
Expected behavior: (What you expect to happen)
Actual behavior: (What actually happens)
Reproduces how often: (What percentage of the time does it reproduce?)
System information: (include operating system version, Python version, how you installed The Walrus, and anything else that might be relevant)
Source code and tracebacks
Please include any additional code snippets and error tracebacks related to the issue here.
Additional information
Any additional information, configuration or data that might be necessary to reproduce the issue.