diff --git a/Manifest.toml b/Manifest.toml index ba13cca..f2ca72d 100644 --- a/Manifest.toml +++ b/Manifest.toml @@ -1,6 +1,6 @@ # This file is machine-generated - editing it directly is not advised -julia_version = "1.9.0" +julia_version = "1.9.3" manifest_format = "2.0" project_hash = "1c494bef7d7f4b16e46d8f7d4eae31049f5ce1bf" @@ -139,7 +139,7 @@ weakdeps = ["Dates", "LinearAlgebra"] [[deps.CompilerSupportLibraries_jll]] deps = ["Artifacts", "Libdl"] uuid = "e66e0078-7015-5450-92f7-15fbd957f2ae" -version = "1.0.2+0" +version = "1.0.5+0" [[deps.ConstructionBase]] deps = ["LinearAlgebra"] @@ -722,7 +722,7 @@ version = "0.12.3" [[deps.Pkg]] deps = ["Artifacts", "Dates", "Downloads", "FileWatching", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "Serialization", "TOML", "Tar", "UUIDs", "p7zip_jll"] uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" -version = "1.9.0" +version = "1.9.2" [[deps.PoissonRandom]] deps = ["Random"] @@ -1217,7 +1217,7 @@ version = "0.2.3" [[deps.libblastrampoline_jll]] deps = ["Artifacts", "Libdl"] uuid = "8e850b90-86db-534c-a0d3-1478176c7d93" -version = "5.7.0+0" +version = "5.8.0+0" [[deps.nghttp2_jll]] deps = ["Artifacts", "Libdl"] diff --git a/Project.toml b/Project.toml index cb3c8d4..3599615 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "WaveguideQED" uuid = "c4555495-0e8d-488d-8e6a-965ecefe9055" authors = ["Matias Bundgaard-Nielsen , Mikkel Heuck , and Stefan Krastanov "] -version = "0.2.1" +version = "0.2.2" [deps] FFTW = "7a1cc6ca-52ef-59f5-83cd-3a7055c09341" diff --git a/src/CavityWaveguideOperator.jl b/src/CavityWaveguideOperator.jl index 470f084..16395a1 100644 --- a/src/CavityWaveguideOperator.jl +++ b/src/CavityWaveguideOperator.jl @@ -76,6 +76,10 @@ mutable struct CavityWaveguideEmission{B1,B2} <: CavityWaveguideOperator{B1,B2} end end +@inline function set_time!(o::CavityWaveguideOperator, t::Number) + set_time!(o.op,t) +end + function Base.:eltype(x::CavityWaveguideOperator) typeof(x.factor) end function Base.:copy(x::CavityWaveguideEmission) CavityWaveguideEmission(x.basis_l,x.basis_r,x.factor,x.op,x.loc) diff --git a/src/WaveguideInteraction.jl b/src/WaveguideInteraction.jl index 9c95a59..74b2a87 100644 --- a/src/WaveguideInteraction.jl +++ b/src/WaveguideInteraction.jl @@ -47,6 +47,12 @@ function Base.:copy(x::WaveguideInteraction) WaveguideInteraction(x.basis_l,x.basis_r,x.factor,x.op1,x.op2,x.loc) end +@inline function set_time!(o::WaveguideInteraction, t::Number) + set_time!(o.op1,t) + set_time!(o.op2,t) + return o +end + Base.:*(x::WaveguideInteraction{BL,BR},y::WaveguideInteraction{BL,BR}) where {BL,BR} = LazyProduct((x,y),x.factor*y.factor) identityoperator(x::WaveguideInteraction) = identityoperator(x.basis_l) diff --git a/src/WaveguideOperator.jl b/src/WaveguideOperator.jl index 1d7c1e1..e58ab48 100644 --- a/src/WaveguideOperator.jl +++ b/src/WaveguideOperator.jl @@ -37,6 +37,10 @@ function Base.:eltype(x::WaveguideOperator) typeof(x.factor) end #Base.:*(x::WaveguideOperator{B1,B2},y::WaveguideOperator{B1,B2}) where {B1,B2} = LazyProduct((x,y),x.factor*y.factor) +@inline function set_time!(o::WaveguideOperator, t::Number) + o.timeindex = min(round(Int,t/o.basis_l.dt,RoundDown) + 1,o.basis_l.nsteps) + return o +end #Methods for copying waveguide operators function Base.:copy(x::WaveguideDestroy{B,B,Np,idx}) where {B,Np,idx} diff --git a/src/WaveguideQED.jl b/src/WaveguideQED.jl index 5991a30..782a6aa 100644 --- a/src/WaveguideQED.jl +++ b/src/WaveguideQED.jl @@ -5,7 +5,7 @@ using Strided using UnsafeArrays using FFTW import LinearAlgebra: axpy!, dot, mul!, rmul!,I -import QuantumOpticsBase: create, dagger, destroy, expect, identityoperator, tensor +import QuantumOpticsBase: create, dagger, destroy, expect, identityoperator, tensor,set_time! export TwoPhotonTimestepView,TwoWaveguideTimestepView,OnePhotonView,TwoPhotonView,TwoWaveguideView, WaveguideBasis,zerophoton,onephoton,twophoton,view_waveguide,get_waveguidetimeindex,set_waveguidetimeindex!,get_dt,get_nsteps,get_waveguide_location,get_waveguide_basis,get_number_of_waveguides,get_waveguide_operators, @@ -17,7 +17,7 @@ export TwoPhotonTimestepView,TwoWaveguideTimestepView,OnePhotonView,TwoPhotonVie detect_single_click,detect_single_click!,LazyTensorKet,LazyTensorBra,LazySumKet,get_all_projectors,detect_double_click,detect_double_click!,Detector, plot_twophoton!, WaveguideTransform,effective_hamiltonian,fftket, - destroy,create,tensor,⊗,dagger,identityoperator,expect + destroy,create,tensor,⊗,dagger,identityoperator,expect,set_time! include("view.jl") include("basis.jl") diff --git a/test/Project.toml b/test/Project.toml index 812469e..cba4283 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -15,3 +15,6 @@ StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3" Strided = "5e0ebb24-38b0-5f93-81fe-25c709ecae67" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" UnsafeArrays = "c4a57d5a-5b31-53a6-b365-19f8c011fbd6" + +[compat] +Aqua = "0.6"