feat: add QuantumOpticsRepr(lazy=true) support for LazyOperator output - #197
Open
ibishal wants to merge 1 commit into
Open
feat: add QuantumOpticsRepr(lazy=true) support for LazyOperator output#197ibishal wants to merge 1 commit into
ibishal wants to merge 1 commit into
Conversation
Author
|
the changelog i have pasted here to avoid merge conflicts
|
Krastanov
self-requested a review
June 4, 2026 13:58
Author
|
@Krastanov can i get a review on this ? |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
adds express_nolookup methods for
SAdd,SMulOperator, andSTensorthat returnLazySum,LazyProduct, andLazyTensorwhenr.lazyis true. when its false, falls back to the existing eager path. includes tests and a short docs example. depends on qojulia/QuantumInterface.jl#80before this,
express(op, QuantumOpticsRepr())would produce an eagerOperator. now it produces lazy types:it produces
lazy_op type: LazySum{CompositeBasis{Vector{Int64}, Tuple{SpinBasis{1//2, Int64}, SpinBasis{1//2, Int64}}}, CompositeBasis{Vector{Int64}, Tuple{SpinBasis{1//2, Int64}, SpinBasis{1//2, Int64}}}, Vector{Any}, Tuple{LazyTensor{CompositeBasis{Vector{Int64}, Tuple{SpinBasis{1//2, Int64}, SpinBasis{1//2, Int64}}}, CompositeBasis{Vector{Int64}, Tuple{SpinBasis{1//2, Int64}, SpinBasis{1//2, Int64}}}, ComplexF64, Vector{Int64}, Tuple{Operator{SpinBasis{1//2, Int64}, SpinBasis{1//2, Int64}, LinearAlgebra.Diagonal{ComplexF64, FillArrays.Ones{ComplexF64, 1, Tuple{Base.OneTo{Int64}}}}}, Operator{SpinBasis{1//2, Int64}, SpinBasis{1//2, Int64}, SparseArrays.SparseMatrixCSC{ComplexF64, Int64}}}}, LazyTensor{CompositeBasis{Vector{Int64}, Tuple{SpinBasis{1//2, Int64}, SpinBasis{1//2, Int64}}}, CompositeBasis{Vector{Int64}, Tuple{SpinBasis{1//2, Int64}, SpinBasis{1//2, Int64}}}, ComplexF64, Vector{Int64}, Tuple{Operator{SpinBasis{1//2, Int64}, SpinBasis{1//2, Int64}, SparseArrays.SparseMatrixCSC{ComplexF64, Int64}}, Operator{SpinBasis{1//2, Int64}, SpinBasis{1//2, Int64}, LinearAlgebra.Diagonal{ComplexF64, FillArrays.Ones{ComplexF64, 1, Tuple{Base.OneTo{Int64}}}}}}}}} sum tests passed lazy_prod type: LazyProduct{CompositeBasis{Vector{Int64}, Tuple{SpinBasis{1//2, Int64}, SpinBasis{1//2, Int64}}}, CompositeBasis{Vector{Int64}, Tuple{SpinBasis{1//2, Int64}, SpinBasis{1//2, Int64}}}, Int64, Tuple{LazyTensor{CompositeBasis{Vector{Int64}, Tuple{SpinBasis{1//2, Int64}, SpinBasis{1//2, Int64}}}, CompositeBasis{Vector{Int64}, Tuple{SpinBasis{1//2, Int64}, SpinBasis{1//2, Int64}}}, ComplexF64, Vector{Int64}, Tuple{Operator{SpinBasis{1//2, Int64}, SpinBasis{1//2, Int64}, SparseArrays.SparseMatrixCSC{ComplexF64, Int64}}, Operator{SpinBasis{1//2, Int64}, SpinBasis{1//2, Int64}, LinearAlgebra.Diagonal{ComplexF64, FillArrays.Ones{ComplexF64, 1, Tuple{Base.OneTo{Int64}}}}}}}, LazyTensor{CompositeBasis{Vector{Int64}, Tuple{SpinBasis{1//2, Int64}, SpinBasis{1//2, Int64}}}, CompositeBasis{Vector{Int64}, Tuple{SpinBasis{1//2, Int64}, SpinBasis{1//2, Int64}}}, ComplexF64, Vector{Int64}, Tuple{Operator{SpinBasis{1//2, Int64}, SpinBasis{1//2, Int64}, LinearAlgebra.Diagonal{ComplexF64, FillArrays.Ones{ComplexF64, 1, Tuple{Base.OneTo{Int64}}}}}, Operator{SpinBasis{1//2, Int64}, SpinBasis{1//2, Int64}, SparseArrays.SparseMatrixCSC{ComplexF64, Int64}}}}}, Tuple{Ket{CompositeBasis{Vector{Int64}, Tuple{SpinBasis{1//2, Int64}, SpinBasis{1//2, Int64}}}, Vector{ComplexF64}}}, Tuple{Bra{CompositeBasis{Vector{Int64}, Tuple{SpinBasis{1//2, Int64}, SpinBasis{1//2, Int64}}}, Vector{ComplexF64}}}} product tests passedBefore considering your pull request ready for review and merging, make sure that all of the following are completed (please keep the clecklist as part of your PR):
If you are submitting for a bug bounty:
Part of qojulia/QuantumOptics.jl#521