Skip to content

Commit

Permalink
Merge pull request #40 from qojulia/time-dependent-operators
Browse files Browse the repository at this point in the history
Added compatibility with TimeDependentOperators
  • Loading branch information
mabuni1998 authored Dec 15, 2023
2 parents 7369405 + f6a0023 commit 575ff88
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 7 deletions.
8 changes: 4 additions & 4 deletions Manifest.toml
Original file line number Diff line number Diff line change
@@ -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"

Expand Down Expand Up @@ -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"]
Expand Down Expand Up @@ -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"]
Expand Down Expand Up @@ -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"]
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "WaveguideQED"
uuid = "c4555495-0e8d-488d-8e6a-965ecefe9055"
authors = ["Matias Bundgaard-Nielsen <[email protected]>, Mikkel Heuck <[email protected]>, and Stefan Krastanov <[email protected]>"]
version = "0.2.1"
version = "0.2.2"

[deps]
FFTW = "7a1cc6ca-52ef-59f5-83cd-3a7055c09341"
Expand Down
4 changes: 4 additions & 0 deletions src/CavityWaveguideOperator.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 6 additions & 0 deletions src/WaveguideInteraction.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 4 additions & 0 deletions src/WaveguideOperator.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
4 changes: 2 additions & 2 deletions src/WaveguideQED.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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")
Expand Down
3 changes: 3 additions & 0 deletions test/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

2 comments on commit 575ff88

@mabuni1998
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register

Release notes:

added compatibility with TimeDependentOperators in QuantumOptics.jl (see: qojulia/QuantumOpticsBase.jl#104)

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/97178

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.2.2 -m "<description of version>" 575ff880a9cda86dac9c36e1b347dfb3f50c4adf
git push origin v0.2.2

Please sign in to comment.