Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@ JuliaLocalPreferences.toml
docs/src/examples/jupyter_notebooks/.ipynb_checkpoints
docs/Manifest.toml
benchmarks_output.json
.codex
16 changes: 9 additions & 7 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,21 @@ Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7"
SymbolicUtils = "d1185830-fcd6-423d-90d6-eec64667417b"

[compat]
# Aqua = "0.8"
# CheckConcreteStructs = "0.1"
Aqua = "0.8"
CheckConcreteStructs = "0.1"
DataInterpolations = "8"
FunctionWrappers = "1"
DiffEqNoiseProcess = "5.27.0"
# ExplicitImports = "1.12"
ExplicitImports = "1.11"
JET = "0.9.18, 0.10, 0.11"
LinearAlgebra = "1.10"
ModelingToolkit = "10"
NumericalIntegration = "0.3"
OrdinaryDiffEq = "6"
QuantumCumulants = "0.4"
QuantumOptics = "1"
QuantumOpticsBase = "0.4, 0.5"
SecondQuantizedAlgebra = "0.4.4"
SecondQuantizedAlgebra = "0.4.5"
SpecialFunctions = "2"
StaticArrays = "1"
Symbolics = "6"
Expand All @@ -41,11 +42,12 @@ julia = "1.10"

[extras]
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
# CheckConcreteStructs = "73c92db5-9da6-4938-911a-6443a7e94a58"
# ExplicitImports = "7d51a73a-1435-4ff3-83d9-f097790105c7"
CheckConcreteStructs = "73c92db5-9da6-4938-911a-6443a7e94a58"
ExplicitImports = "7d51a73a-1435-4ff3-83d9-f097790105c7"
JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b"
ModelingToolkit = "961ee093-0014-501f-94e3-6117800e7a78"
QuantumCumulants = "35bcea6d-e19f-57db-af74-8011de6c7255"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test"] #, "QuantumCumulants", "Aqua", "ExplicitImports", "CheckConcreteStructs"]
test = ["Test", "Aqua", "ExplicitImports", "JET", "CheckConcreteStructs"] #, "QuantumCumulants"
40 changes: 18 additions & 22 deletions TODOs.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
# MAIN TODO - LIST:

- [ ] clean up
- [x] rm QC.jl
- [ ] types
- [ ] rename translate_qo (to to_numerics ?)
- [ ] speed up derivation

- [ ] examples
- [ ] Multi-mode Dicke state superradiance (https://journals.aps.org/pra/abstract/10.1103/PhysRevA.103.033713)
- [ ] SUPER example (Johannes)
- [ ] pulse delay advanced example (Victor paper)
- [ ] SUPER example
- [ ] pulse delay advanced example
- [x] feedback reduction (see SLH paper)
- [ ] cumulants correlation matrix modes
- [ ] H_loop in example 09-1 is not simplified correctly on the docu (locally it is fine; pkg versions)
Expand All @@ -25,30 +19,24 @@
- [ ] u_Gaussian, v_Gaussian; slower?

- [ ] more functionalities
- [x] feedback reduction
- [ ] pulse delay
- [ ] better method for u_eff and v_eff (Victor)
- [ ] interaction picture (Victor paper)
- [ ] general expression for A(t)
- [ ] pulse delay (Victor paper)
- [x] two_time_corr_matrix for Ls const (see example 02-2)

- [x] Formatter/SpellCheck

- [ ] JET

- [ ] Aqua

- [] docu
- u_eff and v_eff theory
- development status

## Additional TODOs

- [ ] SLH more specific types
- [ ] AbstractVector{<:QTerm}
- [ ] directly use gu(t) without substitution? (think about iscall)
- [ ] u_eff and v_eff equation (PRA 2020, appendix) theory, API, implementation
- [ ] rename translate_qo (to to_numerics ?)



## DONE
- [x] rm QC.jl
- [x] types
- [x] speed up derivation

- [x] Translate function:
- [x] Try TimeDependentSums again (after solving the gu(t) mistake/problem) [~factor 2 slower!]
Expand Down Expand Up @@ -95,3 +83,11 @@
- [x] arg u not needed?!
- [x] analytic expression for u=v
- [x] kwarg for adjoint replacement in substitute_operators
- [x] feedback reduction
- [x] interaction picture
- [x] general expression for A(t)
- [x] two_time_corr_matrix for Ls const (see example 02-2)

- [x] Formatter/SpellCheck
- [x] JET
- [x] Aqua
19 changes: 8 additions & 11 deletions src/QuantumInputOutput.jl
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
module QuantumInputOutput

using SecondQuantizedAlgebra
using QuantumOpticsBase
using QuantumOptics
using SymbolicUtils:
SymbolicUtils, substitute, BasicSymbolic, operation, arguments, iscall, simplify, expand
using Symbolics
using SecondQuantizedAlgebra: SecondQuantizedAlgebra, QSym, to_numeric
using QuantumOpticsBase: QuantumOpticsBase, expect, basis, dagger, sparse
using QuantumOptics: QuantumOptics, timeevolution
using SymbolicUtils: SymbolicUtils, substitute, BasicSymbolic, arguments, simplify, expand
using Symbolics: Symbolics, build_function
using SpecialFunctions: erf
using DataInterpolations: LinearInterpolation, ExtrapolationType
using NumericalIntegration: cumul_integrate
using LinearAlgebra: LinearAlgebra, I, mul!
using OrdinaryDiffEq
using StaticArrays
using FunctionWrappers
using OrdinaryDiffEq: OrdinaryDiffEq, ODEProblem, Tsit5, solve
using StaticArrays: StaticArrays, SMatrix, SVector
using FunctionWrappers: FunctionWrappers, FunctionWrapper

import QuantumOpticsBase: expect
import SecondQuantizedAlgebra: numeric_average
const SQA = SecondQuantizedAlgebra

export SLH,
Expand Down
5 changes: 1 addition & 4 deletions src/SLH.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using StaticArrays
using StaticArrays: StaticArrays, SMatrix, SVector
using FunctionWrappers: FunctionWrapper

# NOTE: FunctionWrapper is callable but NOT <: Function.
Expand Down Expand Up @@ -451,6 +451,3 @@ function _feedback_maps(n::Int, connections)
end
return mapped
end

Base.length(h::SecondQuantizedAlgebra.ConcreteHilbertSpace) = 1
Base.length(h::ProductSpace) = length(h.spaces)
15 changes: 1 addition & 14 deletions src/utils.jl
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
# move to SQA
function numeric_average(op::SQA.QNumber, state::Vector; kwargs...)
op_num = sparse(to_numeric(op, state[1]; kwargs...))
return QuantumOpticsBase.expect(op_num, state)
end
function numeric_average(avg::Average, state::Vector; kwargs...)
op = undo_average(avg)
return numeric_average(op, state; kwargs...)
end

expect(avg::Average, state; kwargs...) = numeric_average(avg, state; kwargs...)
expect(op::SQA.QNumber, state; kwargs...) = numeric_average(op, state; kwargs...)

"""
substitute_operators(op, dict::Dict; replace_adjoint=true)

Expand Down Expand Up @@ -38,6 +25,6 @@ end

function _extend_with_adjoint(dict::Dict)
pairs_ = collect(dict)
adj_pairs = [SQA.adjoint(k) => SQA.adjoint(v) for (k, v) in pairs_]
adj_pairs = [Base.adjoint(k) => Base.adjoint(v) for (k, v) in pairs_]
return Dict(vcat(pairs_, adj_pairs))
end
1 change: 1 addition & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
names = [
"test_code_quality.jl",
"test_SLH.jl",
"test_feedback.jl",
"test_translate.jl",
Expand Down
37 changes: 37 additions & 0 deletions test/test_code_quality.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
using QuantumInputOutput, Test

@testset "best practices" begin
using Aqua

Aqua.test_ambiguities([QuantumInputOutput]; broken = false)
Aqua.test_piracies(QuantumInputOutput; broken = false)
Aqua.test_all(QuantumInputOutput; ambiguities = false, piracies = false)
end

@testset "ExplicitImports" begin
using ExplicitImports

@test check_no_implicit_imports(QuantumInputOutput) == nothing
@test check_all_explicit_imports_via_owners(QuantumInputOutput) == nothing
@test check_no_stale_explicit_imports(QuantumInputOutput) == nothing
@test check_all_qualified_accesses_via_owners(QuantumInputOutput) == nothing
@test check_no_self_qualified_accesses(QuantumInputOutput) == nothing
end

if isempty(VERSION.prerelease)
@testset "Code linting" begin
using JET

rep = report_package(QuantumInputOutput)
@show rep
@test length(JET.get_reports(rep)) < 74 # TODO
end
end

@testset "Concretely typed" begin
import QuantumInputOutput as QIO
using CheckConcreteStructs

all_concrete(typeof(QIO.SLH(1, 0, 0))) # TODO
all_concrete(QIO.Gaussian)
end
Loading