Implement two-mode summing unitary#52
Conversation
Codecov ReportAttention: Patch coverage is
|
|
Hi, Andrew! This paper provides (equation 14) the symplectic matrix of SUM gate https://arxiv.org/pdf/2502.07670 which in The symplectic matrix of the SUM gate in the quadrature basis The aforementioned paper cited this paper when providing the symplectic representation in quadrature basis. |
apkille
left a comment
There was a problem hiding this comment.
Hi Feroz, thanks for this addition! I put some comments about docstrings and making sure there's support for arbitrary systems. Also, could you increase the codecov and have tests for each method implemented here?
| # predefined Gaussian channels | ||
| displace, squeeze, twosqueeze, phaseshift, beamsplitter, | ||
| attenuator, amplifier, | ||
| attenuator, amplifier, sum_gate, |
There was a problem hiding this comment.
Can you change it to twosum rather than sum_gate? It can then follow similar naming conventions to twosqueeze.
| end | ||
|
|
||
| """ | ||
| Constructs the two-mode SUM gate as a Gaussian unitary operator. |
There was a problem hiding this comment.
Can you describe mathematically what it does? Similar to this docstring: https://github.com/apkille/Gabs.jl/blob/fe7180a1de0f276f6bc4f5bb5ddeff3e4beb6b13/src/unitaries.jl#L5-L33
| disp, symplectic = _sum_gate(basis) | ||
| return GaussianUnitary(basis, disp, symplectic; ħ = ħ) | ||
| end | ||
| function _sum_gate(basis::QuadBlockBasis{N}) where {N<:Int} |
There was a problem hiding this comment.
Can you make it so that the sum gate supports arbitrary 2n-mode systems, rather than only 2-mode systems? This is done similarly in the twosqueeze function: https://github.com/apkille/Gabs.jl/blob/fe7180a1de0f276f6bc4f5bb5ddeff3e4beb6b13/src/unitaries.jl#L211-L323
This section of the docs might be helpful.
This PR aims to fix #38 by implementing two-mode summing unitary.
Hi, Andrew! Thank you for your help and guidance! I am not sure why I landed to page 123 😅 of https://journals.aps.org/prl/pdf/10.1103/PhysRevLett.88.09790. As you suggestion, I need to follow the information given much earlier in the paper!
The SUM gate can be realized using beamsplitter and squeeze, following the Bloch-Messiah decomposition:
Therefore, we can use the already implemented operators$-\pi/2$
squeezeandbeamsplitterand use them to implement thetwosumgate. The name follows the convention of similar totwosqueeze. I hope that this attempt is better than the previous attempt at least 😅beamsplitterappears to not have the parameter to extra phase shift to I have excludedEdit:
I was wondering whether the following can be implemented as a test to check whether the correctness of approach. It seems that excluding extra phase$\phi$ of $\pi$ in $BS(\theta, \phi)$ changes the symplectic matrix 😅. According to 199, the two mode squeeze can be written after Bloch- Messiah decomposition as
which can be written as excluding extra phase$\phi$ of $\pi$ in $BS(\theta, \phi)$ :
The current approach appears to be incorrect. I initially thought we could use the Bloch-Messiah decomposition for the two-sum gate and then leverage it to implement the gate. 😅