diff --git a/src/StatesZoo/StatesZoo.jl b/src/StatesZoo/StatesZoo.jl index 8c5f100e..7d32a35f 100644 --- a/src/StatesZoo/StatesZoo.jl +++ b/src/StatesZoo/StatesZoo.jl @@ -8,7 +8,7 @@ import QuantumSymbolics: express_nolookup using LinearAlgebra import LinearAlgebra: tr -export SingleRailMidSwapBellU, SingleRailMidSwapBellN, DualRailMidSwapBellU, DualRailMidSwapBellN, ZALMSpinPairU, ZALMSpinPairN, tr +export SingleRailMidSwapBellW, SingleRailMidSwapBell, DualRailMidSwapBellW, DualRailMidSwapBell, ZALMSpinPairW, ZALMSpinPair, tr abstract type AbstractTwoQubitState <: QuantumSymbolics.AbstractTwoQubitOp end #For representing density matrices Base.show(io::IO, x::AbstractTwoQubitState) = print(io, "$(symbollabel(x))") diff --git a/src/StatesZoo/single_dual_rail_midswap/single_dual_rail_midswap.jl b/src/StatesZoo/single_dual_rail_midswap/single_dual_rail_midswap.jl index d922d881..10e5e1ac 100644 --- a/src/StatesZoo/single_dual_rail_midswap/single_dual_rail_midswap.jl +++ b/src/StatesZoo/single_dual_rail_midswap/single_dual_rail_midswap.jl @@ -35,7 +35,9 @@ Fields: $FIELDS Generates the unnormalized spin-spin density matrix for linear photonic entanglement swap -with emissive memories emitting single rail photonic qubits from the paper [prajit2023entangling](@cite) +with emissive memories emitting single rail photonic qubits from the paper [prajit2023entangling](@cite). +Since the matrix is 'weighted' by the probability for success, it is suffixed with a W to distinguish it +from the normalized object `SingleRailMidSwapBell`. It takes the following parameters: - eA, eB: Link efficiencies for memories A and B upto the swap (include link loss, detector efficiency, etc.) - gA, gB: Memory initialization parameter for memories A and B @@ -45,12 +47,12 @@ It takes the following parameters: ```jldoctest julia> r = Register(2) -julia> initialize!(r[1:2], SingleRailMidSwapBellU(0.9, 0.9, 0.5, 0.5, 1e-8, 0.99)) +julia> initialize!(r[1:2], SingleRailMidSwapBellW(0.9, 0.9, 0.5, 0.5, 1e-8, 0.99)) julia> observable(r[1:2], Z⊗Z) ``` """ -@withmetadata struct SingleRailMidSwapBellU <: AbstractTwoQubitState +@withmetadata struct SingleRailMidSwapBellW <: AbstractTwoQubitState eA::Float64 eB::Float64 gA::Float64 @@ -59,7 +61,7 @@ julia> observable(r[1:2], Z⊗Z) Vis::Float64 end -symbollabel(x::SingleRailMidSwapBellU) = "ρˢʳᵐˢᵁ" +symbollabel(x::SingleRailMidSwapBellW) = "ρˢʳᵐˢᵂ" """ @@ -80,12 +82,12 @@ It takes the following parameters: ```jldoctest julia> r = Register(2) -julia> initialize!(r[1:2], SingleRailMidSwapBellN(0.9, 0.9, 0.5, 0.5, 1e-8, 0.99)) +julia> initialize!(r[1:2], SingleRailMidSwapBell(0.9, 0.9, 0.5, 0.5, 1e-8, 0.99)) julia> observable(r[1:2], Z⊗Z) ``` """ -@withmetadata struct SingleRailMidSwapBellN <: AbstractTwoQubitState +@withmetadata struct SingleRailMidSwapBell <: AbstractTwoQubitState eA::Float64 eB::Float64 gA::Float64 @@ -94,7 +96,7 @@ julia> observable(r[1:2], Z⊗Z) Vis::Float64 end -symbollabel(x::SingleRailMidSwapBellN) = "ρˢʳᵐˢᴺ" +symbollabel(x::SingleRailMidSwapBell) = "ρˢʳᵐˢ" """ @@ -105,7 +107,9 @@ Fields: $FIELDS Generates the unnormalized spin-spin density matrix for linear photonic entanglement swap with emissive - memories emitting dual rail photonic qubits from the paper [prajit2023entangling](@cite). + memories emitting dual rail photonic qubits from the paper [prajit2023entangling](@cite). + Since the matrix is 'weighted' by the probability for success, it is suffixed with a W to distinguish it +from the normalized object `DualRailMidSwapBell`. It takes the following parameters: - eA, eB: Link efficiencies for memories A and B upto the swap (include link loss, detector efficiency, etc.) - gA, gB: Memory initialization parameter for memories A and B @@ -115,12 +119,12 @@ Generates the unnormalized spin-spin density matrix for linear photonic entangle ```jldoctest julia> r = Register(2) -julia> initialize!(r[1:2], DualRailMidSwapBellU(0.9, 0.9, 0.5, 0.5, 1e-8, 0.99)) +julia> initialize!(r[1:2], DualRailMidSwapBellW(0.9, 0.9, 0.5, 0.5, 1e-8, 0.99)) julia> observable(r[1:2], Z⊗Z) ``` """ -@withmetadata struct DualRailMidSwapBellU <: AbstractTwoQubitState +@withmetadata struct DualRailMidSwapBellW <: AbstractTwoQubitState eA::Float64 eB::Float64 gA::Float64 @@ -129,7 +133,7 @@ julia> observable(r[1:2], Z⊗Z) Vis::Float64 end -symbollabel(x::DualRailMidSwapBellU) = "ρᵈʳᵐˢᵁ" +symbollabel(x::DualRailMidSwapBellW) = "ρᵈʳᵐˢᵂ" """ @@ -150,12 +154,12 @@ Generates the normalized spin-spin density matrix for linear photonic entangleme ```jldoctest julia> r = Register(2) -julia> initialize!(r[1:2], DualRailMidSwapBellN(0.9, 0.9, 0.5, 0.5, 1e-8, 0.99)) +julia> initialize!(r[1:2], DualRailMidSwapBell(0.9, 0.9, 0.5, 0.5, 1e-8, 0.99)) julia> observable(r[1:2], Z⊗Z) ``` """ -@withmetadata struct DualRailMidSwapBellN <: AbstractTwoQubitState +@withmetadata struct DualRailMidSwapBell <: AbstractTwoQubitState eA::Float64 eB::Float64 gA::Float64 @@ -164,32 +168,32 @@ julia> observable(r[1:2], Z⊗Z) Vis::Float64 end -symbollabel(x::DualRailMidSwapBellN) = "ρᵈʳᵐˢᴺ" +symbollabel(x::DualRailMidSwapBell) = "ρᵈʳᵐˢ" ## express -function express_nolookup(x::SingleRailMidSwapBellU, ::QuantumOpticsRepr) +function express_nolookup(x::SingleRailMidSwapBellW, ::QuantumOpticsRepr) data = midswap_single_rail(x.eA, x.eB, x.gA, x.gB, x.Pd, x.Vis) return SparseOperator(_bspin⊗_bspin, Complex.(data)) end -function express_nolookup(x::SingleRailMidSwapBellN, ::QuantumOpticsRepr) +function express_nolookup(x::SingleRailMidSwapBell, ::QuantumOpticsRepr) data = midswap_single_rail(x.eA, x.eB, x.gA, x.gB, x.Pd, x.Vis) return SparseOperator(_bspin⊗_bspin, Complex.(data/tr(data))) end -function express_nolookup(x::DualRailMidSwapBellU, ::QuantumOpticsRepr) +function express_nolookup(x::DualRailMidSwapBellW, ::QuantumOpticsRepr) data = midswap_dual_rail(x.eA, x.eB, x.gA, x.gB, x.Pd, x.Vis) return SparseOperator(_bspin⊗_bspin, Complex.(data)) end -function express_nolookup(x::DualRailMidSwapBellN, ::QuantumOpticsRepr) +function express_nolookup(x::DualRailMidSwapBell, ::QuantumOpticsRepr) data = midswap_dual_rail(x.eA, x.eB, x.gA, x.gB, x.Pd, x.Vis) return SparseOperator(_bspin⊗_bspin, Complex.(data/tr(data))) end # Symbolic trace -tr(::SingleRailMidSwapBellN) = 1 -tr(::DualRailMidSwapBellN) = 1 \ No newline at end of file +tr(::SingleRailMidSwapBell) = 1 +tr(::DualRailMidSwapBell) = 1 \ No newline at end of file diff --git a/src/StatesZoo/zalm_pair/zalm_pair.jl b/src/StatesZoo/zalm_pair/zalm_pair.jl index b6727ca7..261b2553 100644 --- a/src/StatesZoo/zalm_pair/zalm_pair.jl +++ b/src/StatesZoo/zalm_pair/zalm_pair.jl @@ -569,7 +569,8 @@ Fields: $FIELDS Generate symbolic object for the unnormalized spin-spin density matrix for a -cascaded source swapped with emissive spin memories. The cascaded +cascaded source swapped with emissive spin memories. Since the matrix is 'weighted' by the probability for +success, it is suffixed with a W to distinguish it from the normalized object `ZALMSpinPair`. The cascaded source from papers [prajit2022heralded](@cite) and [kevin2023zero](@cite) is stored in spin memories as discussed in [prajit2023entangling](@cite). It takes the following parameters: @@ -589,12 +590,12 @@ It takes the following parameters: ```jldoctest julia> r = Register(2) -julia> initialize!(r[1:2], ZALMSpinPairU(1e-3, 0.5, 0.5, 1, 1, 1, 1, 0.9, 1e-8, 1e-8, 1e-8, 0.99)) +julia> initialize!(r[1:2], ZALMSpinPairW(1e-3, 0.5, 0.5, 1, 1, 1, 1, 0.9, 1e-8, 1e-8, 1e-8, 0.99)) juilia> observable(r[1:2], Z⊗Z) ``` """ -@withmetadata struct ZALMSpinPairU <: AbstractTwoQubitState +@withmetadata struct ZALMSpinPairW <: AbstractTwoQubitState Ns::Float64 gA::Float64 gB::Float64 @@ -609,7 +610,7 @@ juilia> observable(r[1:2], Z⊗Z) VisF::Float64 end -symbollabel(x::ZALMSpinPairU) = "ρᶻᵃˡᵐᵁ" +symbollabel(x::ZALMSpinPairW) = "ρᶻᵃˡᵐᵂ" """ @@ -640,12 +641,12 @@ It takes the following parameters: ```jldoctest julia> r = Register(2) -julia> initialize!(r[1:2], ZALMSpinPairN(1e-3, 0.5, 0.5, 1, 1, 1, 1, 0.9, 1e-8, 1e-8, 1e-8, 0.99)) +julia> initialize!(r[1:2], ZALMSpinPair(1e-3, 0.5, 0.5, 1, 1, 1, 1, 0.9, 1e-8, 1e-8, 1e-8, 0.99)) juilia> observable(r[1:2], Z⊗Z) ``` """ -@withmetadata struct ZALMSpinPairN <: AbstractTwoQubitState +@withmetadata struct ZALMSpinPair <: AbstractTwoQubitState Ns::Float64 gA::Float64 gB::Float64 @@ -660,19 +661,19 @@ juilia> observable(r[1:2], Z⊗Z) VisF::Float64 end -symbollabel(x::ZALMSpinPairN) = "ρᶻᵃˡᵐᴺ" +symbollabel(x::ZALMSpinPair) = "ρᶻᵃˡᵐ" ## express -function express_nolookup(x::ZALMSpinPairU, ::QuantumOpticsRepr) +function express_nolookup(x::ZALMSpinPairW, ::QuantumOpticsRepr) data = cascaded_source_spin(x.Ns, x.gA, x.gB, x.eAm, x.eBm, x.eAs, x.eBs, x.eD, x.Pd, x.Pdo1, x.Pdo2, x.VisF) return SparseOperator(_bspin⊗_bspin, Complex.(data)) end -function express_nolookup(x::ZALMSpinPairN, ::QuantumOpticsRepr) +function express_nolookup(x::ZALMSpinPair, ::QuantumOpticsRepr) data = cascaded_source_spin(x.Ns, x.gA, x.gB, x.eAm, x.eBm, x.eAs, x.eBs, x.eD, x.Pd, x.Pdo1, x.Pdo2, x.VisF) return SparseOperator(_bspin⊗_bspin, Complex.(data/tr(data))) end ## Symbolic trace -tr(::ZALMSpinPairN) = 1 \ No newline at end of file +tr(::ZALMSpinPair) = 1 \ No newline at end of file