Add lazy option to QuantumOpticsRepr#83
Open
DennisWayo wants to merge 3 commits into
Open
Conversation
This was referenced Jun 11, 2026
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.
This PR adds a small option to
QuantumOpticsReprso downstream packages can ask for a lazy QuantumOptics representation without changing the current default behavior.The main change is that
QuantumOpticsReprnow carries alazy::Boolfield:The default remains eager conversion (
lazy=false), and the existing positional cutoff form is preserved:This PR is intentionally only the interface piece. The actual lazy conversion behavior is implemented in the companion QuantumSymbolics PR:
QuantumSavory/QuantumSymbolics.jl#201
Why this is useful:
QuantumInterface.jl, whereQuantumOpticsRepris defined;QuantumSymbolics.jla clean way to opt intoLazySum,LazyProduct, andLazyTensorconstruction.Tests added:
QuantumOpticsRepr()keepscutoff == 2andlazy == false;QuantumOpticsRepr(4)still works as before;QuantumOpticsRepr(lazy=true)andQuantumOpticsRepr(cutoff=4, lazy=true)store the requested values.Local test command:
julia --project=. -e 'using Pkg; Pkg.test()'OSS Contributions
PennyLaneAI/pennylane#9566
PennyLaneAI/pennylane#9604
https://www.linkedin.com/posts/activity-7443523751436091392-depM?utm_source=share&utm_medium=member_desktop&rcm=ACoAABfS9T0BJJPP6KT13py3QtCdMEGtOb3Q3PE
AI Use Disclosure: Code syntax was assisted by Codex model. All handwritten code and accompanying text were thoroughly reviewed and verified by me prior to submission. I retain full responsibility for the final contribution.