Skip to content

Diffvar type check introduced in v9.63 causes error with complex diffvars #3406

@david-pl

Description

@david-pl

The recently introduced type check here

!(symtype(diffvar) === Real || eltype(symtype(diffvar)) === Real) &&
throws an error for previously working examples / tests in QuantumCumulants.jl.

Tests error with, e.g.

  ArgumentError: Differential variable var"⟨a′*a⟩"(t) has type Complex. Differential variables should not be concretely typed.

The check is too restrictive IMHO, since it's not strictly necessary for things to be <: Real here. Would it be possible to loosen the constraints? Would it be enough to check whether the type is abstract and <: Number?

Also, if you want to be picky: the check doesn't actually do what the error message says. Checking for symtype(x) === Real isn't actually checking for concretely typed variables.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions