Skip to content

Move to BasicSymbolic #60

@david-pl

Description

@david-pl

The update to MTK v9 qojulia/QuantumCumulants.jl#197 required an overload of concrete_symtype to work:

MTK.concrete_symtype(::Symbolics.BasicSymbolic{T}) where T <: CNumber = ComplexF64

That isn't exactly great but should work for most use cases.

However, this now enables us to actually change the implementation of Parameter such that we can represent actual types. The whole parallel implementation for RealParameter could go and we can represent also e.g. 32-bit floats.

We'd just need to add another type parameter, something like

struct Parameter{T<:Number} <: CNumber
...
end

Then, changing the overload to something like

MTK.concrete_symtype(::Symbolics.BasicSymbolic{T}) where {S<:Number, T <: Parameter{S}} = S

could work.

This could be complemented by some syntactic sugar for the @cnumbers macro, basically just stealing the syntax from Symbolics, @cnumbers p::Float32...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions