Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors in @trace for the qft example #5

Open
ChenZhao44 opened this issue Nov 17, 2020 · 0 comments
Open

Errors in @trace for the qft example #5

ChenZhao44 opened this issue Nov 17, 2020 · 0 comments

Comments

@ChenZhao44
Copy link
Member

julia> using YaoCompiler

julia> using YaoCompiler.Intrinsics

julia> @device function qft(n::Int)
           1 => H
           for k in 2:n
               @ctrl k 1 => shift(2π / 2^k)
           end

           if n > 1
               2:n => qft(n - 1)
           end
       end
qft (generic routine with 1 methods)

julia> YaoCompiler.@trace qft(5)
ERROR: MethodError: no method matching map_check_nothrow(::Locations{UnitRange{Int64}}, ::Locations{Int64})
Closest candidates are:
  map_check_nothrow(::Locations{Int64}, ::Locations{Int64}) at /Users/chenzhao/.julia/dev/YaoCompiler/src/runtime/locations.jl:88
  map_check_nothrow(::Locations{Tuple{Vararg{Int64, N}}}, ::Locations{Int64}) where N at /Users/chenzhao/.julia/dev/YaoCompiler/src/runtime/locations.jl:104
  map_check_nothrow(::Locations, ::CtrlLocations) at /Users/chenzhao/.julia/dev/YaoCompiler/src/runtime/locations.jl:270
Stacktrace:
 [1] map_check_nothrow(parent::Locations{UnitRange{Int64}}, sub::CtrlLocations{Int64, 1, 1})
   @ YaoCompiler ~/.julia/dev/YaoCompiler/src/runtime/locations.jl:270
 [2] map_check(parent::Locations{UnitRange{Int64}}, sub::CtrlLocations{Int64, 1, 1})
   @ YaoCompiler ~/.julia/dev/YaoCompiler/src/runtime/locations.jl:85
 [3] getindex
   @ ~/.julia/dev/YaoCompiler/src/runtime/locations.jl:277 [inlined]
 [4] execute
   @ ./REPL[5]:4 [inlined]
 [5] execute
   @ ./REPL[5]:8 [inlined]
 [6] execute(#unused#::typeof(YaoCompiler.Semantic.main), #unused#::YaoCompiler.TraceTape, spec::RoutineSpec{GenericRoutine{:qft}, Tuple{Int64}})
   @ YaoCompiler ~/.julia/dev/YaoCompiler/src/compiler/codegen/emulation.jl:0
 [7] top-level scope
   @ ~/.julia/dev/YaoCompiler/src/runtime/intrinsics.jl:129
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant