ITADN

Conversion from symbolic object to numeric objects from the QuantumToolbox.jl library (by implementing a backend for the `express` API)

#116OpenKrastanov 创建于 2025-05-18
enhancement
K
Krastanovcommented
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 withe 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 introducing symbolic-to-numeric conversion capabilities for the `QuantumToolbox.jl` library About `QuantumToolbox.jl`: `QuantumToolbox.jl` is a recent alternative to `QuantumOptics.jl` with very similar capabilities. It would be useful for crosschecks and overall ecosystem health to support that library as well. A big difference between the two libraries is that `QuantumOptics.jl` enforces a notion of a semantic basis (e.g., a Fock basis is different from a spin basis of the same number of dimmensions), while `QuantumToolbox.jl` has a much flatter inner structure for its states and operators. Nonetheless, given the significant similarities, one can structure the implementation very similarly to the one for `QuantumOptics`. The most useful references would be: - [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/) - [conditionally loaded package extensions in julia](https://pkgdocs.julialang.org/v1/creating-packages/#Conditional-loading-of-code-in-packages-(Extensions)) which is how we have structured the dependencies on various external libraries in QuantumSymbolics For this bounty to be completed, one would need: - matching the `express` capabilities that exist for `QuantumOptics.jl` - preparing the implementation in the form of a package extension (as is done for QuantumOptics) - adding tests for correctness, potentially comparing numerical representations between the existing QuantumOptics and the new backend for QuantumToolbox - a brief mention of the new backend in the documentation, e.g. towards the bottom of the front page of the docs 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 for good IDE support
0 条评论