Closed ghost closed 2 years ago
How should I create a custom parameterised gate? I tried to copy the example in https://github.com/GTorlai/PastaQ.jl/blob/master/examples/01_quantumgates.jl, but this seems to be incorrect.
using ITensors using PastaQ import PastaQ: gate N = 2 hilbert = qubits(N) gate(::GateName"G"; θ::Number) = [ 1 0 0 0 0 cos(θ / 2) -sin(θ / 2) 0 0 sin(θ / 2) cos(θ / 2) 0 0 0 0 1 ] circuit = Tuple[("G", (1, 2), 0.1)] psi = runcircuit(hilbert, circuit)
Solved, found that I needed to change the rotation argument:
circuit = Tuple[("G", (1, 2), (θ = 0.1,))]
How should I create a custom parameterised gate? I tried to copy the example in https://github.com/GTorlai/PastaQ.jl/blob/master/examples/01_quantumgates.jl, but this seems to be incorrect.