Support lazy QuantumOptics conversion#201
Open
DennisWayo wants to merge 5 commits into
Open
Conversation
Contributor
Benchmark Results (Julia v1)Time benchmarks
Memory benchmarks
|
This was referenced Jun 11, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #201 +/- ##
==========================================
+ Coverage 68.53% 69.28% +0.75%
==========================================
Files 21 21
Lines 982 1006 +24
==========================================
+ Hits 673 697 +24
Misses 309 309 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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 the lazy QuantumOptics conversion side for
QuantumOpticsRepr(lazy=true).It depends on the small interface change in:
qojulia/QuantumInterface.jl#83
The goal is to keep the current eager conversion path unchanged, while allowing callers to preserve expression structure when they explicitly request the lazy representation.
Example:
Behavior added here:
LazySum;LazyProduct;LazyTensor;QuantumOpticsRepr()path still goes through the existing eager conversion behavior.One implementation detail worth calling out: for tensor products whose factors are themselves lazy composite operators, the factor is materialized before building the
LazyTensor. I did this becauseQuantumOpticsBaseexpects tensor factors that can be densified reliably. The result still gives aLazyTensorat the top level, while keepingdense(express(..., QuantumOpticsRepr(lazy=true)))consistent with the eager result.The tests cover the target expression shapes directly:
Docs were also updated with a short example showing how to request lazy conversion.
Local test command used with the companion interface branch checked out locally:
julia --project=. -e 'using Pkg; Pkg.develop(path="../QuantumInterface.jl"); Pkg.test(test_args=["general"])'Note: CI for this PR may need the companion
QuantumInterface.jlPR available, becauseQuantumOpticsRepr(lazy=true)is introduced there.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.