QuantumSymbolics.jl icon indicating copy to clipboard operation
QuantumSymbolics.jl copied to clipboard

Conversion of symbolic objects to "lazy" QuantumOptics.jl numerical objects

Open Krastanov opened this issue 6 months ago • 3 comments

This is one of 3 independent bounties which share the type of work that needs to be done:

  • #116 on interfacing with QuantumToolbox.jl
  • #117 on improving the interface that already exists for QuantumOptics.jl
  • #118 on using the already existing QuantumOptics.jl interface to provide an interface for unstructured "naked" state vectors and operators

One of the main value-adds of QuantumSymbolics.jl is to enable converting symbolic expressions into the appropriate numerical representation for use with a variety of simulators. We have such capabilities with respect to a few simulators now, e.g. converting the symbolic Z1 into either a Ket (from QuantumOptics.jl) or a Stabilizer tableau (from QuantumClifford.jl). Here is an example:

julia> using QuantumSavory, QuantumOpticsBase, QuantumClifford

julia> express(X1, QuantumOpticsRepr())
Ket(dim=2)
  basis: Spin(1/2)
 0.7071067811865475 + 0.0im
 0.7071067811865475 + 0.0im

julia> express(X1, CliffordRepr())
𝒟ℯ𝓈𝓉𝒶𝒷
+ Z
𝒮𝓉𝒶𝒷
+ X

This bounty is on improving the conversion to QuantumOptics.jl objects to support "lazy" numerical computation

QuantumOptics.jl is a library providing the standard exponentially-expensive "state vector" modeling tools for quantum mechanics. In has kets, bras, operators, etc. Importantly, it also provides "lazy" operators for delayed computation. These semi-symbolic semi-numeric objects are particularly convenient for avoiding redundant computation or the creation of particularly large objects. Currently, conversion to these operators is not supported by QuantumSymbolics.jl.

This bounty requires the addition of a new configuration option to QuantumOpticsRepr, namely QuantumOpticsRepr(lazy=true). When that option is selected, the conversion (as done by the express API) should preferentially create LazyTensor, LazySum, and LazyProduct objects.

The most useful references would be:

For this bounty to be completed, one would need:

  • enabling express with QuantumOpticsRepr(lazy=true) to return "lazy" numerical objects
  • adding tests for correctness, potentially comparing lazy and non-lazy representations
  • a brief mention of the new capability in the documentation, e.g. in the docstring of QuantumOpticsRepr

If you are new to julia, make sure to:

Krastanov avatar May 19 '25 02:05 Krastanov