-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Symbolic Objects for Local and Remote entanglement generation process…
…es (#45)
- Loading branch information
Showing
23 changed files
with
3,379 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
module StatesZoo | ||
|
||
using QuantumSymbolics, QuantumOpticsBase | ||
using QuantumSymbolics: withmetadata, @withmetadata, Metadata | ||
import QuantumSymbolics: express_nolookup | ||
|
||
export SingleRailMidSwapBell, DualRailMidSwapBell, ZALMSpinPair | ||
|
||
abstract type AbstractTwoQubitState <: QuantumSymbolics.AbstractTwoQubitOp end #For representing density matrices | ||
Base.show(io::IO, x::AbstractTwoQubitState) = print(io, "$(symbollabel(x))") | ||
|
||
_bspin = SpinBasis(1//2) | ||
|
||
const cascaded_source_basis = [0 0 0 0; | ||
0 0 0 1; | ||
0 0 0 2; | ||
0 0 1 0; | ||
0 0 1 1; | ||
0 0 2 0; | ||
0 1 0 0; | ||
0 1 0 1; | ||
0 1 0 2; | ||
0 1 1 0; | ||
0 1 1 1; | ||
0 1 2 0; | ||
0 2 0 0; | ||
0 2 0 1; | ||
0 2 0 2; | ||
0 2 1 0; | ||
0 2 1 1; | ||
0 2 2 0; | ||
1 0 0 0; | ||
1 0 0 1; | ||
1 0 0 2; | ||
1 0 1 0; | ||
1 0 1 1; | ||
1 0 2 0; | ||
1 1 0 0; | ||
1 1 0 1; | ||
1 1 0 2; | ||
1 1 1 0; | ||
1 1 1 1; | ||
1 1 2 0; | ||
2 0 0 0; | ||
2 0 0 1; | ||
2 0 0 2; | ||
2 0 1 0; | ||
2 0 1 1; | ||
2 0 2 0] | ||
|
||
|
||
include("zalm_pair/zalm_pair.jl") | ||
include("zalm_pair/ret_cxy.jl") | ||
include("single_dual_rail_midswap/single_dual_rail_midswap.jl") | ||
|
||
end # module |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
## Quick Start | ||
|
||
Shown below are the typical values for the parameters and how to call the functions: | ||
|
||
``` | ||
using QuantumSavory.StatesZoo: cascaded_source_photonic, cascaded_source_spin, midswap_dual_rail, midswap_single_rail | ||
``` | ||
|
||
#### `cascaded_source_photonic()` | ||
|
||
``` | ||
Ns = 1e-3 | ||
eAs = 1 | ||
eBs = 1 | ||
eD = 0.9 | ||
Pd = 1e-8 | ||
VisF = 0.99 | ||
cascaded_source_photonic(Ns,eAs,eBs,eD,Pd,VisF) | ||
``` | ||
|
||
#### `cascaded_source_spin()` | ||
|
||
``` | ||
Ns = 1e-3 | ||
gA = 0.5 | ||
gB = 0.5 | ||
eAm = 1 | ||
eBm = 1 | ||
eAs = 1 | ||
eBs = 1 | ||
eD = 0.9 | ||
Pd = 1e-8 | ||
Pdo1 = 1e-8 | ||
Pdo2 = 1e-8 | ||
VisF = 0.99 | ||
cascaded_source_spin(Ns,gA,gB,eAm,eBm,eAs,eBs,eD,Pd,Pdo1,Pdo2,VisF) | ||
``` | ||
|
||
#### `midswap_single_rail` | ||
|
||
``` | ||
eA = 0.9 | ||
eB = 0.9 | ||
gA = 0.5 | ||
gB = 0.5 | ||
Pd = 1e-8 | ||
Vis = 0.99 | ||
midswap_single_rail(eA,eB,gA,gB,Pd,Vis) | ||
``` | ||
|
||
#### `midswap_dual_rail` | ||
|
||
``` | ||
eA = 0.9 | ||
eB = 0.9 | ||
gA = 0.5 | ||
gB = 0.5 | ||
Pd = 1e-8 | ||
Vis = 0.99 | ||
midswap_dual_rail(eA,eB,gA,gB,Pd,Vis) | ||
``` | ||
|
||
Note: Details and references in the respective readme.md files in the matlab folder |
46 changes: 46 additions & 0 deletions
46
...Zoo/single_dual_rail_midswap/entanglement_swap_with_emissive_memories/midswap_dual_rail.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
function Mv=midswap_dual_rail(eA,eB,gA,gB,Pd,Vis) | ||
% Author: Prajit Dhara | ||
% Function to calculate the spin-spin density matrix for midpoint swap | ||
% using memories emitting dual rail photonic qubits | ||
% Inputs: | ||
% eA, eB: Link efficiencies for memories A and B upto the swap (include link loss, detector efficiency, etc.) | ||
% Range: [0,1]; Typical value: 1-1e-4 | ||
% gA, gB: Memory initialization parameter for memories A and B | ||
% Range: [0,1]; Typical value: 0.5 | ||
% Memory emission model: \sqrt{1-g} |0>_M\otimes |0,1>_P + \sqrt{g} |1>_M\otimes |1,0>_P | ||
% Pd: Detector dark count probability per photonic mode (assumed to be the same for both detectors) | ||
% Range: [0,1]; Typical value: 1e-8 | ||
% Vis: Interferometer visibility for the midpoint swap () | ||
% Range:[0,1]; Typical value: 0.9-1 | ||
% Output: | ||
% Mv: Spin-spin density matrix for the two memories after the midpoint swap | ||
% Basis: |00>, |01>, |10>, |11> | ||
|
||
m11=((1/2).*eA.*(1+(-1).*eB).*gA.*gB+(1/2).*(1+(-1).*eA).*eB.* ... | ||
gA.*gB).*(1+(-1).*Pd).^3.*Pd+(1+(-1).*eA).*(1+(-1).*eB).* ... | ||
gA.*gB.*(1+(-1).*Pd).^2.*Pd.^2; | ||
|
||
m22=(1/4).*eA.*eB.*gA.*(1+(-1).*gB).*(1+(-1).*Pd).^4+(1/2).*eA.* ... | ||
(1+(-1).*eB).*gA.*(1+(-1).*gB).*(1+(-1).*Pd).^3.*Pd+(1/2).*( ... | ||
1+(-1).*eA).*eB.*gA.*(1+(-1).*gB).*(1+(-1).*Pd).^3.*Pd+(1+( ... | ||
-1).*eA).*(1+(-1).*eB).*gA.*(1+(-1).*gB).*(1+(-1).*Pd).^2.* ... | ||
Pd.^2; | ||
|
||
m33=(1/4).*eA.*eB.*(1+(-1).*gA).*gB.*(1+(-1).*Pd).^4+(1/2).*eA.* ... | ||
(1+(-1).*eB).*(1+(-1).*gA).*gB.*(1+(-1).*Pd).^3.*Pd+(1/2).*( ... | ||
1+(-1).*eA).*eB.*(1+(-1).*gA).*gB.*(1+(-1).*Pd).^3.*Pd+(1+( ... | ||
-1).*eA).*(1+(-1).*eB).*(1+(-1).*gA).*gB.*(1+(-1).*Pd).^2.* ... | ||
Pd.^2; | ||
|
||
m44=((1/2).*eA.*(1+(-1).*eB).*(1+(-1).*gA).*(1+(-1).*gB)+(1/2).* ... | ||
(1+(-1).*eA).*eB.*(1+(-1).*gA).*(1+(-1).*gB)).*(1+(-1).*Pd) ... | ||
.^3.*Pd+(1+(-1).*eA).*(1+(-1).*eB).*(1+(-1).*gA).*(1+(-1).* ... | ||
gB).*(1+(-1).*Pd).^2.*Pd.^2; | ||
|
||
m23=(Vis.^2).*(1/4).*eA.*eB.*(1+(-1).*gA).^(1/2).*gA.^(1/2).*(1+(-1).*gB) ... | ||
.^(1/2).*gB.^(1/2).*(1+(-1).*Pd).^4; | ||
|
||
m32=conj(m23); | ||
Mv=[m11, 0, 0, 0 ; 0, m22, m23, 0 ; 0, m32, m33, 0 ; 0, 0, 0, m44]; | ||
|
||
end |
35 changes: 35 additions & 0 deletions
35
...o/single_dual_rail_midswap/entanglement_swap_with_emissive_memories/midswap_single_rail.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
function Mv=midswap_single_rail(eA,eB,gA,gB,Pd,Vis) | ||
% Author: Prajit Dhara | ||
% Function to calculate the spin-spin density matrix for midpoint swap | ||
% using memories emitting single rail photonic qubits | ||
% Inputs: | ||
% eA, eB: Link efficiencies for memories A and B upto the swap (include link loss, detector efficiency, etc.) | ||
% Range: [0,1]; Typical value: 1-1e-4 | ||
% gA, gB: Memory initialization parameter for memories A and B | ||
% Range: [0,1]; Typical value: 0.5 (set to achieve maximum hashing bound or reach target fidelity) | ||
% Memory emission model: \sqrt{1-g} |0>_M\otimes |1>_P + \sqrt{g} |1>_M\otimes |0>_P | ||
% Pd: Detector dark count probability per photonic mode (assumed to be the same for both detectors) | ||
% Range: [0,1]; Typical value: 1e-8 | ||
% Vis: Interferometer visibility for the midpoint swap; can be a complex number to account for phase mismatch | ||
% Range (absolute value):[0,1]; Typical value: 0.9-1 | ||
% Output: | ||
% Mv: Spin-spin density matrix for the two memories after the midpoint swap | ||
% Basis: |00>, |01>, |10>, |11> | ||
m11=gA.*gB.*(1-Pd).*Pd; | ||
m22=(1/2).*eB.*gA.*(1-gB).*(1-Pd).^2 ... | ||
+(1-eB).*gA.*(1-gB).*(1-Pd).*Pd; | ||
|
||
m33=(1/2).*eA.*(1-gA).*gB.*(1-Pd).^2 ... | ||
+(1-eA).*(1-gA).*gB.*(1-Pd).*Pd; | ||
|
||
m23=(Vis).*(1/2).*((eA.*eB.*(1-gA).*gA.*(1-gB).*gB).^(1/2)).*(1-Pd).^2; | ||
|
||
m32=(Vis).*(1/2).*((eA.*eB.*(1-gA).*gA.*(1-gB).*gB).^(1/2)).*(1-Pd).^2; | ||
% | ||
m44=((1/2).*eB.*(1-eA).*(1-gA).*(1-gB)... | ||
+(1/2).*eA.*(1-eB).*(1-gA).*(1-gB)).*(1-Pd).^2 ... | ||
+(1-eA).*(1-eB).*(1-gA).*(1-gB).*(1-Pd).*Pd; | ||
% | ||
Mv=[m11, 0, 0, 0 ; 0, m22, m23, 0 ; 0, m32, m33, 0 ; 0, 0, 0, m44]; | ||
|
||
end |
78 changes: 78 additions & 0 deletions
78
...Zoo/single_dual_rail_midswap/entanglement_swap_with_emissive_memories/readme.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
# Entanglement Swap with Emissive Memories | ||
## Overview | ||
This folder contains the functions required to generate the spin-spin density matrix generated by linear photonic entanglement swap with emissive memories. The functions are written in MATLAB. The functions are: | ||
- midswap_dual_rail.m: Generates the spin-spin density matrix for linear photonic entanglement swap with emissive memories emitting dual rail photonic qubits from the papers Ref. 1. | ||
- midswap_single_rail.m: Generates the spin-spin density matrix for linear photonic entanglement swap with emissive memories emitting single rail photonic qubits from the papers Ref. 1. | ||
|
||
## Detailed Descriptions | ||
### midswap_dual_rail.m | ||
This function generates the spin-spin density matrix for linear photonic entanglement swap with emissive memories emitting dual rail photonic qubits | ||
|
||
**Inputs:** | ||
- eA, eB: Link efficiencies for memories A and B upto the swap (include link loss, detector efficiency, etc.) | ||
- Range: $[0,1]$ | ||
- Typical value: $1\leftrightarrow10^{-4}$ | ||
- gA, gB: Memory initialization parameter for memories A and B | ||
- Range: $[0,1]$ | ||
- Typical value: $0.5$ | ||
- Memory emission model: $\sqrt{1-g_k} \ket{0} _M\otimes \ket{0,1}_P + \sqrt{g_k} \ket{1}_M\otimes \ket{1,0}_P$ | ||
- Pd: Detector dark count probability per photonic mode (assumed to be the same for both detectors) | ||
- Range: $[0,1)$ | ||
- Typical value: $10^{-8}$ | ||
- Vis: Interferometer visibility for the midpoint swap () | ||
- Range: $[0,1]$ | ||
- Typical value: $0.99$ | ||
|
||
**Output:** | ||
- Mv: Spin-spin density matrix for the two memories after the midpoint swap | ||
- Basis order: $\ket{0,0}, \ket{0,1}, \ket{1,0}, \ket{1,1}$ | ||
|
||
### midswap_single_rail.m | ||
This function generates the spin-spin density matrix for linear photonic entanglement swap with emissive memories emitting single rail photonic qubits | ||
|
||
**Inputs:** | ||
- eA, eB: Link efficiencies for memories A and B upto the swap (include link loss, detector efficiency, etc.) | ||
- Range: $[0,1]$ | ||
- Typical value: $1\leftrightarrow10^{-4}$ | ||
- gA, gB: Memory initialization parameter for memories A and B | ||
- Range: $[0,1]$ | ||
- Typical value: $0.5$ | ||
- Memory emission model: $\sqrt{1-g_k} \ket{0} _M\otimes \ket{1}_P + \sqrt{g_k} \ket{1}_M\otimes \ket{0}_P$ | ||
- Pd: Detector dark count probability per photonic mode (assumed to be the same for both detectors) | ||
- Range: $[0,1)$ | ||
- Typical value: $10^{-8}$ | ||
- Vis: Interferometer visibility for the midpoint swap' can be complex to account for phase instability | ||
- Range (absolute value): $[0,1]$ | ||
- Typical value: $0.99$ | ||
|
||
**Output:** | ||
- Mv: Spin-spin density matrix for the two memories after the midpoint swap | ||
- Basis order: $\ket{0,0}, \ket{0,1}, \ket{1,0}, \ket{1,1}$ | ||
|
||
## Usage | ||
The functions can be used as follows: | ||
```matlab | ||
% Parameters | ||
eA = 0.9; % Link efficiency for memory A | ||
eB = 0.9; % Link efficiency for memory B | ||
gA = 0.5; % Initialization parameter for memory A | ||
gB = 0.5; % Initialization parameter for memory B | ||
Pd = 1e-8; % Dark count probability per photonic mode | ||
Vis = 0.99; % Interferometer visibility | ||
%% Generate the spin-spin density matrix | ||
M_dual= midswap_dual_rail(eA,eB,gA,gB,Pd,Vis); % For dual rail photonic qubits | ||
M_single = midswap_single_rail(eA,eB,gA,gB,Pd,Vis); % For single rail photonic qubits | ||
%% Calculate the probability of success | ||
P_succ_dual = trace(M_dual)*4; % Multiply by 4 to account for all click patterns | ||
P_succ_single = trace(M_single)*2; % Multiply by 2 to account for all click patterns | ||
%% Calculate the fidelity | ||
F_dual = 0.5*(M_dual(2,2)+M_dual(3,3)+M_dual(2,3)+M_dual(3,2)); | ||
F_single = 0.5*(M_single(2,2)+M_single(3,3)+M_single(2,3)+M_single(3,2)); | ||
``` | ||
|
||
|
||
## Reference | ||
1. [P. Dhara, D. Englund, S. Guha, Entangling quantum memories via heralded photonic Bell measurement. Phys. Rev. Res. 5, 033149 (2023).](https://journals.aps.org/prresearch/abstract/10.1103/PhysRevResearch.5.033149) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
The above code was translated from the code in the matlab files in the adjoining folder. The process for converting to julia involved: | ||
- Removing the broadcasting operator `.`, because the calculation is being performed on scalars. | ||
- Some spots needed the addition of brackets to clarify the ambiguity caused by the priority of operations. | ||
- Some spots needed `\` merging with previous line to avoid to ambiguity about end of expression. | ||
|
||
Then the output of the functions were linked to their corresponding symboic object which can be expressed as a density matrix in QuantumOptics representation. |
Oops, something went wrong.