-
Notifications
You must be signed in to change notification settings - Fork 20
Description
This is one of 3 independent bounties which share the type of work that needs to be done:
- Conversion from symbolic object to numeric objects from the QuantumToolbox.jl library (by implementing a backend for the
expressAPI)ย #116 on interfacing with QuantumToolbox.jl - Conversion of symbolic objects to "lazy" QuantumOptics.jl numerical objectsย #117 on improving the interface that already exists for QuantumOptics.jl
- Conversion of symbolic objects to base linear algebra objects (vectors, matrices, sparse matrices, etc)ย #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 providing even simpler conversion to "state vector" objects without having them wrapped in additional structure.
Libraries like QuantumOptics.jl, QuantumToolbox.jl, and qutip are "just" convenience wrappers around standard vectors and matrices as available in any linear algebra toolkit (julia's LinearAlgebra or python's numpy). Such libraries provide a lot of syntactic sugar and nice utilities, but occasionally one just needs the basic underlying vectors and matrices. Providing this capability is what this bounty is about.
This bounty requires the creation of a new representation type, StateVectorRepr under which symbolic objects will be converted to Vector{ComplexF64} and Matrix{ComplexF64} and comparable sparse matrices. The implementation of this capability can be extremely simple: just use express(symbolic_object, QuantumOpticsRepr()) and then take the .data field of the QuantumOptics.jl datastructure. As such, this capability would still depend on QuantumOptics internally, but the returned structure would be much simpler.
Basically we get express(symbolic_object, StateVectorRepr(config)) = express(symbolic_object, QuantumOpticsRepr(config)).data.
Nonetheless, this needs to be properly packaged and tested.
The most useful references would be:
- what is the
expressAPI that is used for conversion from symbolics to numerics - how
expressis implemented forQuantumOptics - the overall documentation of QuantumSymbolics
- conditionally loaded package extensions in julia 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
expresscapabilities that exist forQuantumOptics.jl, but now simply for conversion to vectors and matrices - preparing the implementation in the form of a package extension (as is done for QuantumOptics)
- adding tests for correctness, potentially comparing numerical representations against the existing QuantumOptics
- 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
juliaupfor version management - look through the julia manual and modern workflows
- try out VSCode with the Julia plugin for good IDE support