JuliaAttic / QuBase.jl

A foundational library for quantum mechanics in Julia
Other
43 stars 6 forks source link

Attempt at warnings. #43

Closed amitjamadagni closed 9 years ago

amitjamadagni commented 9 years ago

Attempt at fixing some of the warnings.

acroy commented 9 years ago

This looks good to me. Could you try to address also the "Union" warning (probably using Compat)?

amitjamadagni commented 9 years ago

@acroy there seems to be a problem with methods of the formfunction(arg::@compat Union{arg_1...}...) leading to seg fault on the nightly release.

acroy commented 9 years ago

To get rid of the last warning, it might be sufficient to move the conflicting line 177 before line 175 in quarray.jl?

acroy commented 9 years ago

Looks good to me. @jrevels : Any idea regarding the last warning?

jrevels commented 9 years ago

You mean:

julia> using QuBase
WARNING: New definition
    convert(Type{#QV<:QuBase.AbstractQuArray{B<:QuBase.AbstractBasis, T<:Any, 1}}, #DV<:QuBase.CTranspose{B<:QuBase.AbstractBasis, T<:Any, 1, Q<:Any}) at /Users/jarrettrevels/.julia/QuBase/src/arrays/quarray.jl:175
is ambiguous with:
    convert(Type{#T<:Any}, #T<:Any) at essentials.jl:59.
To fix, define
    convert(Type{_<:QuBase.CTranspose{B<:QuBase.AbstractBasis, T<:Any, 1, Q<:Any}}, _<:QuBase.CTranspose{B<:QuBase.AbstractBasis, T<:Any, 1, Q<:Any})
before the new definition.

I'd just remove line 175. It's not really doing much anyway. The conversion zoo can likely be made simpler if we make the move to using traits instead of type aliases for identifying states/operators/etc.

acroy commented 9 years ago

@jrevels : Ok, you are probably right. It is not worth to fight for this error message. @amitjamadagni : Could you remove the offending line?

amitjamadagni commented 9 years ago

@acroy this is also ready !

acroy commented 9 years ago

Nice!