Skip to content
This repository was archived by the owner on May 10, 2025. It is now read-only.

BUG with put function. #13

Description

@frankwswang

MWE:

julia> using CuYao

julia> c1 = put(10, (7,8,9)=>chain(3, chain(3, chain(3, chain(3, put(3, 1=>Ry(pi)), put(3, 2=>Ry(pi)))))))
nqubits: 10
put on (7, 8, 9)
└─ chain
   └─ chain
      └─ chain
         └─ chain
            ├─ put on (1)
            │  └─ rot(Y gate, 3.141592653589793)
            └─ put on (2)
               └─ rot(Y gate, 3.141592653589793)


julia> rand_state(10, nbatch = 1000) |> cu |> c1
ArrayReg{1000, Complex{Float64}, CuArray...}
    active qubits: 10/10

julia> c2 = put(11, (7,8,9,10)=>chain(4, chain(4, chain(4, chain(4, put(4, 1=>Ry(pi)), put(4, 2=>Ry(pi)))))))
nqubits: 11
put on (7, 8, 9, 10)
└─ chain
   └─ chain
      └─ chain
         └─ chain
            ├─ put on (1)
            │  └─ rot(Y gate, 3.141592653589793)
            └─ put on (2)
               └─ rot(Y gate, 3.141592653589793)


julia> rand_state(11, nbatch = 1000) |> cu |> c2
ERROR: CUDA error: device kernel image is invalid (code #200, ERROR_INVALID_IMAGE)

julia> c3 = put(11, (7,8,9)=>chain(3, chain(3, chain(3, chain(3, put(3, 1=>Ry(pi)), put(3, 2=>Ry(pi)))))))
nqubits: 11
put on (7, 8, 9)
└─ chain
   └─ chain
      └─ chain
         └─ chain
            ├─ put on (1)
            │  └─ rot(Y gate, 3.141592653589793)
            └─ put on (2)
               └─ rot(Y gate, 3.141592653589793)


julia> rand_state(11, nbatch = 1000) |> cu |> c3
ArrayReg{1000, Complex{Float64}, CuArray...}
    active qubits: 11/11

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions