Conversion of symbolic objects to "lazy" QuantumOptics.jl numerical objects
enhancement
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](https://docs.qojulia.org/quantumobjects/operators/#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:
- [the "lazy" objects of `QuantumOptics.jl`](https://docs.qojulia.org/quantumobjects/operators/#Lazy-operators)
- [what is the `express` API that is used for conversion from symbolics to numerics](https://doc.quantumsavory.org/QuantumSymbolics.jl/dev/express/)
- [how `express` is implemented for `QuantumOptics`](https://github.com/QuantumSavory/QuantumSymbolics.jl/tree/main/ext/QuantumOpticsExt)
- [the overall documentation of QuantumSymbolics](https://doc.quantumsavory.org/QuantumSymbolics.jl/dev/)
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:
- install julia using `juliaup` for version management
- look through the [julia manual](https://docs.julialang.org/en/v1/) and [modern workflows](https://modernjuliaworkflows.org/)
- try out VSCode with the [Julia plugin](https://www.julia-vscode.org/) for good IDE support
2 条评论